Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch a program as as a normal user from a UAC elevated installer

I'm writing an NSIS installer and the setup program elevates "as administrator" as needed on Windows 7 / vista. I need to run the installed program at the end of the install and don't want to launch it with the same privileges as the installer.

The regular NSIS exec commands run the child process with the same permissions as the installer.

There is a UAC plugin for NSIS, but the documentation on it isn't great and it seems v. new; I'd prefer not to use that plugin.

Ideally, I'm looking for a small .exe I can include that'll launch the target program without UAC elevation. Does this exist?

Any other suggestions?

Thanks!

like image 694
KZ. Avatar asked Mar 10 '10 06:03

KZ.


1 Answers

You only have two options:

  • Uncheck and remove the run checkbox (When running on NT6+)
  • Use the UAC plugin (It is not that new, but it is a pain to use, so I would suggest you just go for the first option)

There is no external program you can use since it is impossible to get back to the original user from a elevated process (You can try, and get pretty close, but it will not get the correct user in every case)

like image 149
Anders Avatar answered Sep 19 '22 06:09

Anders