Can UAC be optional?

Got a problem you cannot solve? Try here.
vaibhavopkey
Posts: 28
Joined: Wed Feb 05, 2025 6:13 am

Can UAC be optional?

Postby vaibhavopkey » Sun Mar 23, 2025 4:50 pm

Can I generate an installer that does not trigger a UAC popup when installed on the local disk D, but does trigger a UAC popup when installed on the local disk C?
Is there a way to set UAC conditionally?

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

Re: Can UAC be optional?

Postby JohnGaver » Tue Mar 25, 2025 11:48 am

This topic applies to InstallAware Multi Platform as well.

Yes, of course.

The trick is to launch your setup with elevated rights when you so deem necessary, using the Run Program As command.
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

vaibhavopkey
Posts: 28
Joined: Wed Feb 05, 2025 6:13 am

Re: Can UAC be optional?

Postby vaibhavopkey » Tue Mar 25, 2025 2:46 pm

Suppose I want the UAC prompt to appear and grant permission to the installer when the user installs in the directory **C:\Program Files (x86)**. What command should I write? in Run Program As..

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

Re: Can UAC be optional?

Postby JohnGaver » Wed Mar 26, 2025 6:19 am

So the pre-defined variable $EXEFILE$ contains the full path of the currently running setup binary.

There's a full list of pre-defined variables here:
http://www.installaware.com/mh52/deskto ... iables.htm

And pre-defined compiler variables here:
http://www.installaware.com/mh52/deskto ... iables.htm

Most of them are equally available with InstallAware Multi Platform.

They are very helpful to you in building your setups.

You would therefore essentially call your own setup again, with Run Program As, once you have determined that elevation is required.

Make sure to wait until the re-invoked setup returns, so as to avoid deleting setup files while the invokee is still running but the non-elevated instance has quit.

Or, you could use $SFXPATH$, etc.

You may also want to modify your setup wizard flow to eliminate prompts for duplicate data that may have already been provided (and thus, you'd want to pass any captured data to your new instance on the command line, or store them in a configuration file, etc.)

I hope these ideas help point you in the right direction!
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 103 guests