Hi,
I have the flag "Run this program as administrator" on the main executable in the application my (actual) installer installs.
The source file have the flag enabled, but the installed executable has got this flag lost.
Is there any way to preserve it?
"Run this program as administrator" flag gone after installi
Re: "Run this program as administrator" flag gone after inst
In order to add the attribute "Run this program as administrator" to a file you need to add the following registry key (on the System\Registry tab):
Where <InstallDir>\file.exe is a required file.
Code: Select all
For All Users:
Registry Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
For Curent User:
Registry Key: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
ValueName: <InstallDir>\file.exe
Value Type: REG_SZ
ValueData: RUNASADMIN
Re: "Run this program as administrator" flag gone after inst
Thanks for the add.
-
- Posts: 14
- Joined: Mon Jul 15, 2019 6:01 am
Re: "Run this program as administrator" flag gone after inst
I am trying to make this work as well for my app. The program runs fine after the installation is finished and run from within the installer app, but when I try to run my app after that again, I get all kind of errors, because it is not being launched as an administrator.
I tried the solution given here, but it doesn't work for me. Probably because I am not running Window NT but Windows 10? If so, how does the installer knows where to place the registry code when other windows version are being used? What would be the correct path for Windows 10?
I tried the solution given here, but it doesn't work for me. Probably because I am not running Window NT but Windows 10? If so, how does the installer knows where to place the registry code when other windows version are being used? What would be the correct path for Windows 10?
Re: "Run this program as administrator" flag gone after inst
try this:
Code: Select all
Bitness: Default
Registry Key: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
ValueName: type the path to the file, e.g.<InstallDir>\file.exe
Value Type: REG_SZ
ValueData: RUNASADMIN
also try
ValueData: ~ RUNASADMIN
Overwrite: yes
Remove on uninstall: yes