Windows 7 (UAC): Run Prerequisite setups as Admin, but normal Setup as User

Nov 26, 2010 at 8:38 AM

My dotNetInstaller setup contains the following:

  1. Windows Installer 3.1
  2. .NET Framework 2.0
  3. My acutal application setup (NSIS-based)

Since my setup (3.) launches the installed application at the end of the installation process, I must start this as the current user, not the elevated administration user that is being used during the installation.

I use the UAC plug-in for NSIS for that task, which required to be started as a normal UAC user first and then internally elevates to UAC administration user.

Everything works correctly if I  launch the NSIS setup directly, i.e. not from the dotNetInstaller.

When being launched at the end of the dotNetInstaller setup (as step three, as described above), the NSIS setup is being started as an elevated administration user, which results in a wrong startup user for the setup.

My question is:

Can I somehow tell dotNetInstaller to launch my actual application setup as the current user, not the elevated user which is used to install the prerequisites?

Thanks
Uwe 

Coordinator
Nov 27, 2010 at 12:02 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Nov 27, 2010 at 12:06 PM

I think that you need to have dotNetInstaller run in non-elevated mode, which can be done by embedding a proper non-UAC manifest (see doc on manifests). Then every component will require elevation and your NSIS-based install will run as if it wasn't elevated.

I don't think it's possible to un-elevate a spawned process after the parent process has been elevated, but I might be wrong. I think it would also be nice if DNI was the one doing elevation when component installs are spawed, so I created a feature request to capture that.

Nov 27, 2010 at 12:20 PM

Thank you very much, exactly what I am looking for :-)

You likely will be the first free installer that will do this right (if not the only one installer at all!). Only the long announced but not yet present WiX Burn is said to support this.

Until then, I am going to ship my application setup without the option to start at the end, as suggested by option 1 in this Stack Overflow reply.