您是否支持Windows XP上的标准用户?

时间:2022-03-08 00:25:03

Update: Since development machine has moved to Vista, i now automatically test as a standard user. And with XP being phased out, this question isn't so relavent anymore.

更新:由于开发机器已移至Vista,我现在自动作为标准用户进行测试。随着XP逐步淘汰,这个问题不再那么相关了。


Since the Windows 2000 logo requirements, Microsoft has been requiring that applications run as standard user. Like everyone else i always ran my desktop as an administrative user. And like every developer: i log in, develop, run, and test as an administrative user.

由于Windows 2000徽标要求,Microsoft一直要求应用程序作为标准用户运行。像其他人一样,我总是以管理用户身份运行我的桌面。和每个开发人员一样:我以管理用户身份登录,开发,运行和测试。

Now with a new push to finally support standard users, i've been testing my applications by running them as a normal user - either through RunAs, or having my application relaunch itself with normal rights using [SaferCreateLevel][1]/[SaferComputeTokenFromLevel][2] if it detects it is running as an administrator. i quickly see how specacularly some of my apps fail under Windows XP as a standard user (due to my own stupidity). i also see how the same applications work fine under Vista (thanks to it's numerous shims to fix my bugs for me).

现在,随着最终支持标准用户的新推动,我一直在测试我的应用程序,通过以普通用户身份运行它们 - 或者通过RunAs,或者让我的应用程序使用[SaferCreateLevel] [1] / [SaferComputeTokenFromLevel]以正常权限重新启动自己[2]如果它检测到它以管理员身份运行。我很快就看到我的一些应用程序在Windows XP下作为标准用户失败的原因(由于我自己的愚蠢)。我也看到相同的应用程序如何在Vista下运行良好(感谢它为我修复我的错误的众多垫片)。

Aside: It's ironic that applications are more likely to run on Vista as a standard user than on XP.

旁白:具有讽刺意味的是,作为标准用户,应用程序更有可能在Vista上运行。

The question is do you test your applications for standard user compatiblity? Do you develop as a standard user on XP? Do you ignore standard user access and hope for the best?

问题是您是否测试应用程序的标准用户兼容性?您是否在XP上成为标准用户?您是否忽略标准用户访问并希望获得最佳?


i tried, as a bonus, to have my app relaunch itself as a limited user (rather than normal user). It doesn't even come up - Windows says it failed to initialize. So there an area of future research on my part: making the app even support limited user.

作为奖励,我尝试让我的应用程序重新启动为有限用户(而不是普通用户)。它甚至没有出现--Windows说它无法初始化。因此,我的未来研究领域:使应用程序甚至支持有限的用户。


i specifically referred to standard users on XP rather than Vista to enforce the truth that Vista is no different from XP as far as compatibility is concerned. And anyone who says their app fails on Vista must realize it also fails on XP.

我特别提到XP上的标准用户而不是Vista,以强制执行Vista与兼容性有关的事实。任何说他们的应用程序在Vista上失败的人都必须意识到它在XP上也失败了。

10 个解决方案

#1


5  

I run on XP as a limited user almost all of the time and as the default. (On Vista, I use an adminstrative account and rely on UAC.)

我几乎在所有时间都以限制用户身份运行XP并作为默认设置。 (在Vista上,我使用管理员帐户并依赖UAC。)

I develop as a limited user. There's very little in Java and Visual Studio development that requires any more privilege than that.

我是一个有限的用户。 Java和Visual Studio开发中几乎没有什么需要更多的权限。

If I need to run something under the limited account but with administrative privileges, I use a MakeMeAdmin (renamed and tuned as ConsoleMeAdmin) .bat script that creates an administrative console session.

如果我需要在有限帐户下运行但具有管理权限,我使用MakeMeAdmin(重命名并调整为ConsoleMeAdmin).bat脚本来创建管理控制台会话。

If I really need to be an administrator in order to do installs and do first-time-runs so my security software can condition itself to allow network access to the new code (or not), etc., I will elevate my Limited User Account to Administrator long enough to get all of that done, then restart the account as Limited User again. Other than for Windows Updates, I do all of my downloads as a limited user and then install off-line after elevation to Administrator.

如果我真的需要成为管理员才能进行安装并进行首次运行,那么我的安全软件可以自行调整以允许网络访问新代码(或不运行)等,我将提升我的受限用户帐户管理员足够长时间完成所有这些操作,然后再次以受限用户身份重新启动帐户。除了Windows更新,我作为受限用户执行所有下载,然后在提升后离线安装到管理员。

Because I only have a small workgroup LAN with no Active Directory, the only useful account types are Administrator and Limited User on XP. (I tried power user when I first began using XP but found that I could do without it and I prefer what that teaches me about not depending on special privileges in code I build.)

因为我只有一个没有Active Directory的小型工作组LAN,所以唯一有用的帐户类型是XP上的Administrator和Limited User。 (当我第一次开始使用XP时,我尝试过高级用户,但发现我可以不使用它而且我更喜欢那些教我不依赖于我构建的代码中的特殊权限的内容。)

[PS: I also have Data Execution Protection (supported in hardware) active by default on my XP system, and you'd be surprised what that turns up.]

[PS:我的XP系统默认情况下我也有数据执行保护(硬件支持),你会感到惊讶。

#2


16  

I'm going to point you to Crispin Cowan's "Best Practices for Developing for Windows Standard User" talk. It's well worth watching.

我将向您介绍Crispin Cowan的“为Windows标准用户开发的最佳实践”演讲。这非常值得一看。

#3


11  

If you want to sell your application to businesses then yes, you must test your application running as a standard user. If your application can't run without administrative privelleges, that's going to doom any sale in to a business.

如果您想将应用程序出售给企业,那么您必须测试以标准用户身份运行的应用程序。如果您的应用程序无法在没有管理权限的情况下运行,那么这将导致任何销售业务失败。

Even in the home market, plenty of people can and do use limited users to go about their daily activities; I know I do.

即使在国内市场,也有很多人能够并且确实使用有限的用户来进行日常活动;我知道我这样做。

Even administrative applications that do legimately need administrative privelleges should behave sensibly when running as a limited user. They should popup up a dialog informing the user that administrative rights are required to complete whatever task it was that they were attempting.

即使是在需要管理权限时需要管理权限的管理应用程序,在以有限用户身份运行时也应该表现得很明智。他们应该弹出一个对话框,通知用户需要管理权限来完成他们正在尝试的任何任务。

The best way to build software that respects these limitations is to develop your software under a user that has limited privileges. That way, every time you develop a feature you're implicitly testing whether it will work in a limited environment.

构建尊重这些限制的软件的最佳方法是在具有有限权限的用户下开发您的软件。这样,每次开发功能时,您都会隐式测试它是否可以在有限的环境中运行。

None of this is hard, it just take a degree of discipline - just like all quality assurance procedures do. People have been developing as non-root users on *nix for decades. Windows development is behind the curve in this respect.

这些都不是很难,它只需要一定程度的纪律 - 就像所有质量保证程序一样。几十年来,人们一直在* nix上作为非root用户开发。 Windows开发在这方面落后于曲线。

#4


7  

Crispin, in his PDC talk, made a very good point, one that i had never considered before.

克里斯平在他的PDC谈话中提出了一个非常好的观点,一个我从未考虑过的观点。

Google Chrome installs as a standard user: it installs in the per-user folder, without needing a UAC or OTS prompt, and everything is user friendly because the install is so easy. Unfortunatly, it is installed in a per-user folder, where the user can modify it.

Google Chrome以标准用户身份安装:它安装在每个用户文件夹中,无需UAC或OTS提示,并且一切都是用户友好的,因为安装非常简单。不幸的是,它安装在每个用户的文件夹中,用户可以在其中修改它。

Put it another way: malware can modify the Chrome exe.

换句话说:恶意软件可以修改Chrome exe。

Chrome would now become the biggest target for any mal-ware. And if some malware does modify it, Chrome is now sending your usernames, passwords, and credit card info back to home base, because that's what the new Chrome exe does.

Chrome现在将成为任何恶意软件的最大目标。如果某些恶意软件确实对其进行了修改,那么Chrome现在会将您的用户名,密码和信用卡信息发送回家庭基础,因为这就是新Chrome操作系统所做的事情。

That is why you sometimes want applications installed to protected locations.

这就是您有时希望将应用程序安装到受保护位置的原因


Edit: The entire Microsoft "Click Once" deployment inititave suffers the danger.

编辑:整个Microsoft“Click Once”部署inititave遭受危险。

#5


5  

In the business environment most users are standard windows domain users. To ignore standard user compliance tests is a really bad move. And you will get each domain administrator that has to install your application very angry and they will go to your competition.

在商业环境中,大多数用户都是标准的Windows域用户。忽略标准用户合规性测试是一个非常糟糕的举措。并且您将让每个必须安装您的应用程序的域管理员非常生气,他们将参加您的竞争对手。

#6


3  

IMHO developing in an administrator account is not only unnecessary, but also highly dangerous! Suppose you check something on the internet while developing (* comes to mind) and you catch some malware - history shows that this is far easier than you might have thought, e.g. through banners. As an administrator this malware will infect your computer and you might never get rid of it. It can even be a danger to all your development work (think of industrial espionage)!

恕我直言在管理员帐户中开发不仅没有必要,而且非常危险!假设您在开发过程中检查互联网上的某些内容(想到*)并且您发现了一些恶意软件 - 历史记录表明这比您想象的要容易得多,例如:通过横幅。作为管理员,此恶意软件会感染您的计算机,您可能永远不会将其删除。它甚至可能对您的所有开发工作构成威胁(想想工业间谍活动)!

If you have to run/test anything as an administrator, use either runas or even better virtual machines - that way you can use separate systems with defined behaviour (lots of problems with Windows software come from libraries that are of course available on the developer's PC, but hardly anywhere else!). In times of Microsoft Virtual PC and VMWare Server (both free) there isn't even an excuse due to high prices for virtualization software.

如果您必须以管理员身份运行/测试任何内容,请使用runas或更好的虚拟机 - 这样您就可以使用具有已定义行为的单独系统(Windows软件的许多问题来自开发人员PC上当然可用的库) ,但几乎没有其他地方!)。在Microsoft Virtual PC和VMWare Server(都是免费的)时代,由于虚拟化软件的高价格,甚至没有任何借口。

I've developed some Windows apps some years ago and besides their installers NOTHING ever required administrative rights. The run-time settings always belong to the user, not to the machine.

几年前我开发了一些Windows应用程序,除了他们的安装程序之外,还没有需要管理权限。运行时设置始终属于用户,而不属于机器。

And yes, I run Windows XP as normal user at home too, as do my family members (parents etc.). Sometimes a crappy piece of software needs write access to their installation folder, but 95% of all installed apps run fine out-of-the-box by today.

是的,我也在家里以普通用户身份运行Windows XP,我的家人(父母等)也是如此。有时,一个蹩脚的软件需要对其安装文件夹进行写入访问,但是到目前为止,95%的已安装应用程序都可以开箱即用。

#7


2  

Yes, we test that.

是的,我们测试一下。

Probably the simplest, but most abused, rule is that you shouldn't do anything that requires write access to your program's install folder. Instead, there's a special folder called Application Data for that kind of thing.

可能最简单但最滥用的规则是,您不应该执行任何需要对程序的安装文件夹进行写访问的操作。相反,有一个名为Application Data的特殊文件夹用于此类事情。

#8


1  

Yes, and I took the general advice that its much easier to get your application to run on Vista if it runs ok on XP as limited user. To achieve that, and know if there were any problems running as limited user, I used LUABuglight.

是的,我采取了一般性的建议,如果它在XP上以有限的用户运行,那么在Vista上运行应用程序要容易得多。为了实现这一点,并且知道运行有限的用户是否存在任何问题,我使用了LUABuglight。

I generally don't develop as limited user but only log on as limited user for testing.

我通常不会以有限的用户身份开发,而只能以有限的用户身份登录进行测试。

The number of programs that require Admin rights and write to their own Program Files folder is amazing. To be honest, I've found very few programs that run correctly as limited user, from any software company, big or small.

需要管理员权限并写入自己的Program Files文件夹的程序数量是惊人的。说实话,我发现很少有程序可以作为有限的用户正确运行,来自任何软件公司,无论大小。

#9


0  

Anyone else find it funny that Windows developers think its normal to run as Admin (apparently), but Linux developers pretty much never run as root?

其他人发现Windows开发人员认为以管理员身份运行(显然)是正常的,但Linux开发人员几乎从不以root身份运行?

#10


0  

As an old-time BOFH I will rain fire and ugly words over anyone asking for elevated rights for their client-side applications to run properly. It's just out of the question, always was ever since around 2001-2002 when we switched from Win9x to XP (sic).

作为一个旧时的BOFH,我会对任何要求提升其客户端应用程序正常运行权限的人发出火灾和丑陋的话语。这是不可能的,从2001-2002左右开始,我们从Win9x切换到XP(原文如此)。

As a newly born developer in a place where everyone on XP is a local admin by a forced group policy and changing it seems to take time and noone is especially inclined to start either - I've installed the RunAsAdmin shim that lowers me down to a normal user for most tasks including developing - much like in Vista. Recommended if you're stuck as a local admin on XP ^^

作为一个新出生的开发人员,XP上的每个人都是强制组策略的本地管理员并且改变它似乎需要时间,没有人特别倾向于开始 - 我已经安装了RunAsAdmin垫片,这使我降低到大多数任务的普通用户,包括开发 - 很像Vista。如果您在XP ^ ^上被困为本地管理员,建议您使用

#1


5  

I run on XP as a limited user almost all of the time and as the default. (On Vista, I use an adminstrative account and rely on UAC.)

我几乎在所有时间都以限制用户身份运行XP并作为默认设置。 (在Vista上,我使用管理员帐户并依赖UAC。)

I develop as a limited user. There's very little in Java and Visual Studio development that requires any more privilege than that.

我是一个有限的用户。 Java和Visual Studio开发中几乎没有什么需要更多的权限。

If I need to run something under the limited account but with administrative privileges, I use a MakeMeAdmin (renamed and tuned as ConsoleMeAdmin) .bat script that creates an administrative console session.

如果我需要在有限帐户下运行但具有管理权限,我使用MakeMeAdmin(重命名并调整为ConsoleMeAdmin).bat脚本来创建管理控制台会话。

If I really need to be an administrator in order to do installs and do first-time-runs so my security software can condition itself to allow network access to the new code (or not), etc., I will elevate my Limited User Account to Administrator long enough to get all of that done, then restart the account as Limited User again. Other than for Windows Updates, I do all of my downloads as a limited user and then install off-line after elevation to Administrator.

如果我真的需要成为管理员才能进行安装并进行首次运行,那么我的安全软件可以自行调整以允许网络访问新代码(或不运行)等,我将提升我的受限用户帐户管理员足够长时间完成所有这些操作,然后再次以受限用户身份重新启动帐户。除了Windows更新,我作为受限用户执行所有下载,然后在提升后离线安装到管理员。

Because I only have a small workgroup LAN with no Active Directory, the only useful account types are Administrator and Limited User on XP. (I tried power user when I first began using XP but found that I could do without it and I prefer what that teaches me about not depending on special privileges in code I build.)

因为我只有一个没有Active Directory的小型工作组LAN,所以唯一有用的帐户类型是XP上的Administrator和Limited User。 (当我第一次开始使用XP时,我尝试过高级用户,但发现我可以不使用它而且我更喜欢那些教我不依赖于我构建的代码中的特殊权限的内容。)

[PS: I also have Data Execution Protection (supported in hardware) active by default on my XP system, and you'd be surprised what that turns up.]

[PS:我的XP系统默认情况下我也有数据执行保护(硬件支持),你会感到惊讶。

#2


16  

I'm going to point you to Crispin Cowan's "Best Practices for Developing for Windows Standard User" talk. It's well worth watching.

我将向您介绍Crispin Cowan的“为Windows标准用户开发的最佳实践”演讲。这非常值得一看。

#3


11  

If you want to sell your application to businesses then yes, you must test your application running as a standard user. If your application can't run without administrative privelleges, that's going to doom any sale in to a business.

如果您想将应用程序出售给企业,那么您必须测试以标准用户身份运行的应用程序。如果您的应用程序无法在没有管理权限的情况下运行,那么这将导致任何销售业务失败。

Even in the home market, plenty of people can and do use limited users to go about their daily activities; I know I do.

即使在国内市场,也有很多人能够并且确实使用有限的用户来进行日常活动;我知道我这样做。

Even administrative applications that do legimately need administrative privelleges should behave sensibly when running as a limited user. They should popup up a dialog informing the user that administrative rights are required to complete whatever task it was that they were attempting.

即使是在需要管理权限时需要管理权限的管理应用程序,在以有限用户身份运行时也应该表现得很明智。他们应该弹出一个对话框,通知用户需要管理权限来完成他们正在尝试的任何任务。

The best way to build software that respects these limitations is to develop your software under a user that has limited privileges. That way, every time you develop a feature you're implicitly testing whether it will work in a limited environment.

构建尊重这些限制的软件的最佳方法是在具有有限权限的用户下开发您的软件。这样,每次开发功能时,您都会隐式测试它是否可以在有限的环境中运行。

None of this is hard, it just take a degree of discipline - just like all quality assurance procedures do. People have been developing as non-root users on *nix for decades. Windows development is behind the curve in this respect.

这些都不是很难,它只需要一定程度的纪律 - 就像所有质量保证程序一样。几十年来,人们一直在* nix上作为非root用户开发。 Windows开发在这方面落后于曲线。

#4


7  

Crispin, in his PDC talk, made a very good point, one that i had never considered before.

克里斯平在他的PDC谈话中提出了一个非常好的观点,一个我从未考虑过的观点。

Google Chrome installs as a standard user: it installs in the per-user folder, without needing a UAC or OTS prompt, and everything is user friendly because the install is so easy. Unfortunatly, it is installed in a per-user folder, where the user can modify it.

Google Chrome以标准用户身份安装:它安装在每个用户文件夹中,无需UAC或OTS提示,并且一切都是用户友好的,因为安装非常简单。不幸的是,它安装在每个用户的文件夹中,用户可以在其中修改它。

Put it another way: malware can modify the Chrome exe.

换句话说:恶意软件可以修改Chrome exe。

Chrome would now become the biggest target for any mal-ware. And if some malware does modify it, Chrome is now sending your usernames, passwords, and credit card info back to home base, because that's what the new Chrome exe does.

Chrome现在将成为任何恶意软件的最大目标。如果某些恶意软件确实对其进行了修改,那么Chrome现在会将您的用户名,密码和信用卡信息发送回家庭基础,因为这就是新Chrome操作系统所做的事情。

That is why you sometimes want applications installed to protected locations.

这就是您有时希望将应用程序安装到受保护位置的原因


Edit: The entire Microsoft "Click Once" deployment inititave suffers the danger.

编辑:整个Microsoft“Click Once”部署inititave遭受危险。

#5


5  

In the business environment most users are standard windows domain users. To ignore standard user compliance tests is a really bad move. And you will get each domain administrator that has to install your application very angry and they will go to your competition.

在商业环境中,大多数用户都是标准的Windows域用户。忽略标准用户合规性测试是一个非常糟糕的举措。并且您将让每个必须安装您的应用程序的域管理员非常生气,他们将参加您的竞争对手。

#6


3  

IMHO developing in an administrator account is not only unnecessary, but also highly dangerous! Suppose you check something on the internet while developing (* comes to mind) and you catch some malware - history shows that this is far easier than you might have thought, e.g. through banners. As an administrator this malware will infect your computer and you might never get rid of it. It can even be a danger to all your development work (think of industrial espionage)!

恕我直言在管理员帐户中开发不仅没有必要,而且非常危险!假设您在开发过程中检查互联网上的某些内容(想到*)并且您发现了一些恶意软件 - 历史记录表明这比您想象的要容易得多,例如:通过横幅。作为管理员,此恶意软件会感染您的计算机,您可能永远不会将其删除。它甚至可能对您的所有开发工作构成威胁(想想工业间谍活动)!

If you have to run/test anything as an administrator, use either runas or even better virtual machines - that way you can use separate systems with defined behaviour (lots of problems with Windows software come from libraries that are of course available on the developer's PC, but hardly anywhere else!). In times of Microsoft Virtual PC and VMWare Server (both free) there isn't even an excuse due to high prices for virtualization software.

如果您必须以管理员身份运行/测试任何内容,请使用runas或更好的虚拟机 - 这样您就可以使用具有已定义行为的单独系统(Windows软件的许多问题来自开发人员PC上当然可用的库) ,但几乎没有其他地方!)。在Microsoft Virtual PC和VMWare Server(都是免费的)时代,由于虚拟化软件的高价格,甚至没有任何借口。

I've developed some Windows apps some years ago and besides their installers NOTHING ever required administrative rights. The run-time settings always belong to the user, not to the machine.

几年前我开发了一些Windows应用程序,除了他们的安装程序之外,还没有需要管理权限。运行时设置始终属于用户,而不属于机器。

And yes, I run Windows XP as normal user at home too, as do my family members (parents etc.). Sometimes a crappy piece of software needs write access to their installation folder, but 95% of all installed apps run fine out-of-the-box by today.

是的,我也在家里以普通用户身份运行Windows XP,我的家人(父母等)也是如此。有时,一个蹩脚的软件需要对其安装文件夹进行写入访问,但是到目前为止,95%的已安装应用程序都可以开箱即用。

#7


2  

Yes, we test that.

是的,我们测试一下。

Probably the simplest, but most abused, rule is that you shouldn't do anything that requires write access to your program's install folder. Instead, there's a special folder called Application Data for that kind of thing.

可能最简单但最滥用的规则是,您不应该执行任何需要对程序的安装文件夹进行写访问的操作。相反,有一个名为Application Data的特殊文件夹用于此类事情。

#8


1  

Yes, and I took the general advice that its much easier to get your application to run on Vista if it runs ok on XP as limited user. To achieve that, and know if there were any problems running as limited user, I used LUABuglight.

是的,我采取了一般性的建议,如果它在XP上以有限的用户运行,那么在Vista上运行应用程序要容易得多。为了实现这一点,并且知道运行有限的用户是否存在任何问题,我使用了LUABuglight。

I generally don't develop as limited user but only log on as limited user for testing.

我通常不会以有限的用户身份开发,而只能以有限的用户身份登录进行测试。

The number of programs that require Admin rights and write to their own Program Files folder is amazing. To be honest, I've found very few programs that run correctly as limited user, from any software company, big or small.

需要管理员权限并写入自己的Program Files文件夹的程序数量是惊人的。说实话,我发现很少有程序可以作为有限的用户正确运行,来自任何软件公司,无论大小。

#9


0  

Anyone else find it funny that Windows developers think its normal to run as Admin (apparently), but Linux developers pretty much never run as root?

其他人发现Windows开发人员认为以管理员身份运行(显然)是正常的,但Linux开发人员几乎从不以root身份运行?

#10


0  

As an old-time BOFH I will rain fire and ugly words over anyone asking for elevated rights for their client-side applications to run properly. It's just out of the question, always was ever since around 2001-2002 when we switched from Win9x to XP (sic).

作为一个旧时的BOFH,我会对任何要求提升其客户端应用程序正常运行权限的人发出火灾和丑陋的话语。这是不可能的,从2001-2002左右开始,我们从Win9x切换到XP(原文如此)。

As a newly born developer in a place where everyone on XP is a local admin by a forced group policy and changing it seems to take time and noone is especially inclined to start either - I've installed the RunAsAdmin shim that lowers me down to a normal user for most tasks including developing - much like in Vista. Recommended if you're stuck as a local admin on XP ^^

作为一个新出生的开发人员,XP上的每个人都是强制组策略的本地管理员并且改变它似乎需要时间,没有人特别倾向于开始 - 我已经安装了RunAsAdmin垫片,这使我降低到大多数任务的普通用户,包括开发 - 很像Vista。如果您在XP ^ ^上被困为本地管理员,建议您使用