Page 1 of 1

Run Program and Shortcuts as administrator

Posted: Fri Nov 01, 2024 5:25 am
by aleyna
Hello,
I’m experiencing an issue with a program I set up. I have set the setup options to "Always Elevate" and also checked the "Administrator Privileges" feature. While there are no issues running the program after installation, when I try to use the shortcut(Also I checked the all shortcuts run as administrator), I receive a warning saying "UNABLE TO WRITE C:\PROGRAM DATA APP.INI".

The program is able to create the ini file in Program Data after installation, but it cannot do so when launched from the shortcut. The problem is resolved when I run the shortcut as an administrator. How can I configure this through the setup?

Re: Run Program and Shortcuts as administrator

Posted: Sat Nov 02, 2024 8:24 am
by JohnGaver
This sounds like an issue with your product running originally with elevated rights, creating files using those higher privileges; and then being invoked with non-elevated rights, finally resulting in an inability to update the files it had created elevated.

There's a couple ways you can work around this issue without having to modify the code of your product:

1. Use the Run Program As command with a de-elevation request, so your product never launches elevated to begin with:
Screenshot 2024-11-02 at 16.22.10.png
Screenshot 2024-11-02 at 16.22.10.png (249.79 KiB) Viewed 20551 times


2. Use the Create Shortcut command with an elevation parameter, so your product always launches elevated from its shortcut:
Screenshot 2024-11-02 at 16.23.30.png
Screenshot 2024-11-02 at 16.23.30.png (426.22 KiB) Viewed 20551 times


Hoping one of these work out for you!