"Run this program as administrator" flag gone after installi

Common questions about using Actual Installer.
Post Reply
Zanko
Posts: 1
Joined: Thu Jul 11, 2013 7:34 am

"Run this program as administrator" flag gone after installi

Post by Zanko »

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?
Leo
Site Admin
Posts: 455
Joined: Fri Jan 22, 2010 12:40 pm

Re: "Run this program as administrator" flag gone after inst

Post by Leo »

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):

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
Where <InstallDir>\file.exe is a required file.
Leo,
Actual Installer Team
https://www.actualinstaller.com
mucio77
Posts: 1
Joined: Mon Mar 03, 2014 10:06 pm

Re: "Run this program as administrator" flag gone after inst

Post by mucio77 »

Thanks for the add.
AndrevanHaren
Posts: 14
Joined: Mon Jul 15, 2019 6:01 am

Re: "Run this program as administrator" flag gone after inst

Post by AndrevanHaren »

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?
Leo
Site Admin
Posts: 455
Joined: Fri Jan 22, 2010 12:40 pm

Re: "Run this program as administrator" flag gone after inst

Post by Leo »

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
Leo,
Actual Installer Team
https://www.actualinstaller.com
Post Reply