Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup : How to set installer "Run As Administrator"?

Tags:

inno-setup

In Inno Setup,

[Setup] 
PrivilegesRequired=admin 

is still can not Run the installer as Administrator, but I need to Launch my Program at last step of Inno Setup.

How can I do to set my Installer can Run as Administrator ?

like image 665
健榮 陳 Avatar asked Nov 09 '12 05:11

健榮 陳


1 Answers

I have been having this same problem as well, it took me quite a bit of time to figure out that after you have set the PrivilegesRequired=admin you also need to add runascurrentuser to all the [Run]Flags.

[Setup]
PrivilegesRequired=admin

[Run]
Filename: "{app}\MyApp.exe"; Description: "{cm:LaunchProgram,MyApp}"; Flags: runascurrentuser nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\MyApp.exe"; Flags: runascurrentuser; Parameters: "-install -svcName ""MyApp"" -svcDesc ""MyApp"" -mainExe ""MyApp.exe""  "; Check: returnFalse()

I know you have probably already figured out the issue considering this question was asked over two years ago but I thought I would answer it anyway for others like myself who found this unanswered question but would have really liked to have seen an answer.

like image 116
dwaddell Avatar answered Oct 15 '22 19:10

dwaddell