Visual Studio Setup Project - Install Current User with Windows Standard User Account
I tested my installer on netbook running Windows 7 Starter logged in using a Standard User Account and noticed some issues I had not encountered before.
Because the user is running as Standard User, they are prompted for Administrator account details. This is fine and allows the installer to start. Now when the user gets to choose whether they want to install the software for the Current User/All Users and they select Current开发者_StackOverflow User the following occurs:
The shortcuts (desktop and application menu) are not created for the Standard User, rather they are created for the Administrator account. I logged out of the Standard User Account and logged in as the Administrator Account and the shortcuts appeared correctly. This is not what I expected.
Uninstalling on this machine also left behind a registry key that was created by the installer. This behavior did not occur on the desktops that I tried out.
One thing to note (but should not really affect this scenario) is that I use dotNetInstaller to bootstrap some prerequisties that my application needs to run (Sql Compact DB 3.5) prior to the bootstrapper itself calling the Visual Studio 2010 Setup executable (my application).
If a Standard User is logged in and they try to install my product, enter the admin credentials and select a Current User install, how do I get it to install the shortcuts for the Standard User account rather than the Administrator Account?
Also why wouldn't a registry entry created as part of the setup project remove itself when the user removes the program (through add/remove programs) on this pc? Is the Windows installation on this netbook corrupted somehow?
If a Standard User is logged in and they try to install my product, enter the admin credentials and select a Current User install, how do I get it to install the shortcuts for the Standard User account rather than the Administrator Account?
You can't. A per-user installation for a standard user needs to run without elevation. This means that it can use only per-user locations like Application Data folder and HKEY_CURRENT_USER hive. If you elevate a per-user installation, it will be performed for the account on which you elevate.
Also why wouldn't a registry entry created as part of the setup project remove itself when the user removes the program (through add/remove programs) on this pc?
Where exactly is this registry entry? If it's in HKEY_CURRENT_USER, perhaps the uninstall process doesn't have access to it (for example it was installed for another user account). Did you try creating an uninstall log to see what happens?
精彩评论