Command Line Build NOT Building with Elevated UAC (requireAdministrator)

Got a problem you cannot solve? Try here.
yol1ana
Posts: 3
Joined: Fri Dec 03, 2021 3:52 pm

Command Line Build NOT Building with Elevated UAC (requireAdministrator)

Postby yol1ana » Fri Dec 03, 2021 4:00 pm

ETAS uses InstallAware Studio Admin X13 to create custom packages of our software for special use cases for our customers. Our EXE''s need to be built with elevated UAC permissions (requireAdministrator) in order to work correctly on customer machines. We use miabuild.exe via command line to automatically create these builds and out of nowhere the elevated permission stopped working when calling miabuild.exe via command line but DOES work when built directly in the InstallAware IDE..

Has anyone else experienced this before? Calling miabuild.exe via command line with our project parameters worked for this up until yesterday is when I noticed the builds weren't being made with elevated UAC. As I said, I can click "Build" in the IDE with all project parameters remaining the same and it works as expected.

Any help on resolving this would be greatly appreciated!

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Command Line Build NOT Building with Elevated UAC (requireAdministrator)

Postby FrancescoT » Mon Dec 06, 2021 11:29 am

I suppose that by mistake, you are not invoking the same identical project file (*.mpr) when building from command line.

From Miabuild there is no way to override or to set the UAC settings for the generated package. The UAC settings are stored with the project file itself (*.mpr). Due of this, to produce from command line a setup package with different UAC settings, you forcebly need to invoke a specific project file where these have been already defined.

Hope this helps you.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

yol1ana
Posts: 3
Joined: Fri Dec 03, 2021 3:52 pm

Re: Command Line Build NOT Building with Elevated UAC (requireAdministrator)

Postby yol1ana » Wed Jul 06, 2022 8:33 am

Hi Francesco,

I did not see your reply to this until today and coincidentally I started experiencing these issues again over the past few days. I checked the output of the failing builds (not elevated UAC) compared to successful builds (requireAdmin) and the same project file (*.mpr) was called in both scenarios. The Project Settings for the *.mpr used is configured to "Always Elevate (requireAdministrator)".

Any other ideas?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Command Line Build NOT Building with Elevated UAC (requireAdministrator)

Postby FrancescoT » Wed Jul 13, 2022 10:19 am

As I said, from command line build utility there is no way to specify the UAC setting of the generated package. It's always used the UAC level as defined with the project.

For this reason, the behavior you reported sounds very very strange.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

yol1ana
Posts: 3
Joined: Fri Dec 03, 2021 3:52 pm

Re: Command Line Build NOT Building with Elevated UAC (requireAdministrator)

Postby yol1ana » Wed Jul 13, 2022 10:35 am

I understand that there is not a way to specify the UAC settings of the generated package from the command line utility, that is why I confirmed that the project being used holds the "Always Elevate" configuration. I also agree that it is strange behavior which is why I was posing the question here...

While watching the output directory of a build triggered using the command line utility, the icon of the build had the shield denoting it requires an administrator to run it (as expected) while the compression was still taking place; however, as soon as the build was complete and the only file left in the output folder was the executable, the shield icon was no longer present (UAC not elevated) which results in an executable that cannot be installed on any of our test machines. I can then manually open our InstallAware project (the same project file that was called with the command line utility), change nothing, and trigger the build in compressed mode - the result is an elevated UAC executable.

So I guess an additional question for you as I need to root cause this so the builds created with our automated process can be installed on our test machines for testing:

Q: Is there something in the compression process that could block the build from elevating the UAC?

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

Re: Command Line Build NOT Building with Elevated UAC (requireAdministrator)

Postby JohnGaver » Sat Feb 24, 2024 1:25 pm

This topic applies to InstallAware Multi Platform as well.

Interesting thread here.

The launch-time elevation setting of your setup is actually stored inside a compiler variable, aptly named #UAC#:

http://www.installaware.com/mh52/deskto ... iables.htm

While the variable doesn't seem to be documented there, you can inspect its three values (or two for InstallAware Multi Platform) by using the Project Options dialog's Project | Summary | UAC Elevation (or Project Options | Project | Elevation for InstallAware Multi Platform) combo box to select a desired elevation setting, and then inspecting the value of the #UAC# pre-defined compiler variable looking at Project | Compiler variables.

Then, just pass that value to mia(x)build(.exe) on the command line using the form:

Code: Select all

UAC=<value>

And see if this has the desired effect of changing your elevation setting, when building from the command line.

FWIW, it does sound like something on your device is interfering with the natural build flow; irrespective of the validity of the information I have provided above.
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: Google [Bot] and 32 guests