Page 1 of 1

Can UAC be optional?

Posted: Sun Mar 23, 2025 4:50 pm
by vaibhavopkey
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?

Re: Can UAC be optional?

Posted: Tue Mar 25, 2025 11:48 am
by JohnGaver
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.

Re: Can UAC be optional?

Posted: Tue Mar 25, 2025 2:46 pm
by vaibhavopkey
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..

Re: Can UAC be optional?

Posted: Wed Mar 26, 2025 6:19 am
by JohnGaver
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!