Run Program and Shortcuts as administrator

Got a problem you cannot solve? Try here.
aleyna
Posts: 1
Joined: Fri Nov 01, 2024 5:16 am

Run Program and Shortcuts as administrator

Postby aleyna » Fri Nov 01, 2024 5:25 am

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?

JohnGaver
Posts: 240
Joined: Mon Feb 05, 2024 6:15 pm

Re: Run Program and Shortcuts as administrator

Postby JohnGaver » Sat Nov 02, 2024 8:24 am

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 20383 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 20383 times


Hoping one of these work out for you!
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 38 guests