1

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 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?

GoalMaker
  • 905
  • 3
  • 9
  • 22

1 Answers1

1

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?

Cosmin
  • 21,216
  • 5
  • 45
  • 60
  • _A per-user installation for a standard user needs to run without elevation_ - thanks letting me know. I'm not sure how to get the program to run without elevation. Is this possible for an executable file. – GoalMaker Jul 19 '11 at 10:19
  • The registry key is created in HKEY_LOCAL_MACHINE\Software\[Product Name]. Its a flag stating indicating that the program has been installed and is used by the bootstrapper. – GoalMaker Jul 19 '11 at 10:21
  • To run a per-user installation without elevation you need to make sure that it doesn't use per-machine locations like Program Files and HKEY_LOCAL_MACHINE. Is the registry entry created using Windows Installer support or through a custom action? Resources created by custom actions or by your application are not removed by an uninstall. – Cosmin Jul 19 '11 at 11:10
  • Thats good info. I'll see what I can do about putting the registry key in a different location and try to install the application to a different location. My registry entries are created by Windows Installer support. – GoalMaker Jul 19 '11 at 11:42