No announcement yet.

Having my program set to Run as Admin on install

  • Filter
  • Time
  • Show
Clear All
new posts

  • Having my program set to Run as Admin on install

    On the previous version of our program, we have had to have our customer manually do to the Properties, Compatibility tab and check the Run as Admin. On this release we are wanting to have the Setup program do that automatically;y. First is there a simple way to accomplish this as I have not seemed to find it? Second, I did find the following as a way to accomplish it via the registry.

    reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Dillo\Billing.exe" /t REG_SZ /d RUNASADMIN

    However, when I attempt to add this to the Post Install, it does not like the format.

  • #2
    A proper way can be found here. The first code shown doesn't require a plugin, but works only on 32-bit Windows. The second sample code requires the Wow64 plugin, setting the application compatibility correctly on both 32 and 64-bit platforms.

    Last edited by Ulrich; 11-13-2014, 02:14 PM.


    • #3
      On your sample, where are those lines added? Post Install I assume.


      • #4
        As long as you execute the code after deploying the file, any location will do. You can use On Post Install (as mentioned in the thread), or On Shutdown, or place it in a script of a screen in the After Installing sequence (as long as you don't have the possibility of performing a silent install).