Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set 'Run as administrator' on a file using Inno Setup

I'm creating an installer using Inno Setup. As part of the install process I'm installing Tomcat. On Windows 7 I suffer from the problem described here:

http://blog.paulbouwer.com/2010/10/23/the-case-of-the-annoying-tomcat-6-monitor/

I can fix it by manually setting the 'Run as administrator' on tomcat7w.exe (the issue and the root cause is the same for tomcat7 as well), but I don't know how to do it through Inno Setup.

I'm finding threads that explain running some_program.exe as administrator, but here the program is started when the Tomcat service starts (e.g. on machine start-up), so I need a way to flag it using Inno Setup to 'Run as administrator' rather than actually run it.

like image 433
learnAndImprove Avatar asked Jun 07 '13 07:06

learnAndImprove


1 Answers

Add the runascurrentuser flag attribute to the [Run] section

Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: runascurrentuser nowait postinstall skipifsilent; 
like image 58
Mehdi Benkirane Avatar answered Oct 12 '22 01:10

Mehdi Benkirane