rajat
rajat

Reputation: 3553

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.

Upvotes: 8

Views: 10404

Answers (1)

Anders
Anders

Reputation: 101606

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.

Upvotes: 7

Related Questions