Hi all, after some trouble with InnoSetup I begin to fall in love with this tool… it is really handy!
However, I face the following problem: I have an app that writes data in its own app folder (eg. ./myapp/somefile.txt). The app is provided for download, so the well-known “security measurements” apply. App and installer are signed.
On macOS, this seems to be not an issue, even if the app resides within the application folder. I tried downloading my own app, installing it, starting - works.
On Windows, downloading and installing the app works. Launching not. It says that the app cannot be executed and fails. Anyway, as soon as I run the app as an administrator, anything is working as intended.
Now I read about giving admin rights to the app on execution automatically which involves a registry entry:
[quote]You can add Registry entry in [Registry] Section that will set to run as Administrator as default action for runnint this app. e.g. Root: “HKLM”; Subkey: “SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers”; ValueType: String; ValueName: “{app}\tomcat7w.exe”; ValueData: “RUNASADMIN”; Flags: uninsdeletekeyifempty uninsdeletevalue; MinVersion: 0,6.1
[/quote]
Guess tomcat7w.exe needs to be replaced with the app name… but I just fairly understand this code.
(I took this from here: http://stackoverflow.com/questions/16978917/how-to-set-run-as-administrator-on-a-file-using-inno-setup )
I wonder if there is an easier method? Maybe some kind of built-in feature of InnoSetup?
Another method I worked out is to change the InnoSetup script to choose a different software installation path:
[Setup]
;…
DefaultDirName={sd}\MyAppName
This suggests the user to install the app directly on the harddrive’s root folder. Well, not the most elegant solution but the app can later write its files without gaining admin privileges.
I’m looking forward any thoughts or help.
Thank you!