Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute a Execwait in NSIS with administrative privileges

I want to execute ExecWait in NSIS with admin privileges, I was unable to find any documentation on this issue.

like image 252
rajat Avatar asked Jul 22 '12 18:07

rajat


1 Answers

Generally I would recommend that the whole installer should run elevated in a case like this, it makes it clear to the user up-front that elevation is required.

If you cannot do this then you should make sure that the program you want to run requests administrator rights. For this to work you need to launch the program with ExecShell.

If that program does not requests administrator rights you basically have two options:

  • Use ExecShell with the "runas" verb and hope for the best (Fails if the user is not a member of the administrators group, UAC is off or on < Vista)
  • Write a small launcher application that requests administrator rights and then launches the real program.
like image 186
Anders Avatar answered Oct 04 '22 09:10

Anders