tn8826
Posts: 7
Joined: Wed Jul 28, 2021 10:25 pm

Maintenance Repair/Remove doesn't run as admin while First-time-install does

Wed Jul 28, 2021 10:36 pm

Hello,
I have an msi that require Administrator privilege to install.
In the "Install Parameters", "Run as Administrator" is checked, and "Per-machine only (failed if user is not Administrator).
First time install runs ok (by double clicking on the msi) as the UAC is prompted.
Second time running the MSI, the maintenance wizard is showed but no UAC is prompted and the sequence is run as user level.
I have custom action that requires admin privileges to run and check a condition if it is met before the installation is run. So it needs to run before "Preparing" and can't be changed to "deferred" execution time and change to "Run under the LocalSystem account with full previledge (no-impersonate)"

Why doesn't maintenance started as admin like the first time install? Is this expected behavior? if So, is there a workaround?

Thanks,

Tuan

Liviu
Posts: 111
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Maintenance Repair/Remove doesn't run as admin while First-time-install does

Thu Jul 29, 2021 12:02 pm

Hello Tuan,

Yes, it is an expected behavior. This is a limitation of Advanced Installer.

As you can read in our documentation, "Run as administrator" option does not work for MSI packages launched in maintenance mode.
More information on Install Parameters article.

The only workaround is to use an .exe. To do that you can go to the “Builds” page, and from Configuration Settings tab select “EXE Setup” on “Package type” section.


Hope this helps! If you have any other questions, please don't hesitate to contact us.

Best regards,
Liviu
_______________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

tn8826
Posts: 7
Joined: Wed Jul 28, 2021 10:25 pm

Re: Maintenance Repair/Remove doesn't run as admin while First-time-install does

Thu Jul 29, 2021 7:58 pm

Hi Liviu,

Thanks for responding.

I tried to get around this limitation by start a custom action when clicking on "Repair" on the confirm dialog.
The custom action will run "launch file " with paramter "msiexec /f {productcode}" and run as Administrator.

It works fine except that the "Reinstalling" of the maintenance mode still runs and result in a "End Prematurely" dialog.
I tried to disable the Repair button's "Published Event" "Reinstall one or more features" but seems like it still runs.

Is there another flag somewhere that trigger the reinstall after Repair button is clicked?

Thanks.

Tuan

Liviu
Posts: 111
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Maintenance Repair/Remove doesn't run as admin while First-time-install does

Fri Jul 30, 2021 9:22 am

Hi Tuan,

I'm afraid the workaround you are trying to implement is not suitable, nor a recommended one. Once again, the only workaround solution for you in this case is to build an EXE setup package instead of an MSI one. This is the only solution we have for your requirement.

Thank you for your understanding.

Best regards,
Liviu
_______________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

tn8826
Posts: 7
Joined: Wed Jul 28, 2021 10:25 pm

Re: Maintenance Repair/Remove doesn't run as admin while First-time-install does

Mon Aug 16, 2021 9:01 pm

Hi Liviu,

Thanks for replying. I guess I will have to try the exe format.

Tuan

Liviu
Posts: 111
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Maintenance Repair/Remove doesn't run as admin while First-time-install does

Tue Aug 17, 2021 8:49 am

You are always welcome!

Best regards,
Liviu
_______________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”