ChrisGue
Posts: 116
Joined: Tue Feb 03, 2009 7:26 pm

AI 19.9: custom action file lauch with admin privileges shown UAC dialog

I use Ai 19.9 enterprise.

I have added a custom action Lauch file:
with these options:
Image

The action is located in Add Ressoures

However during installation the UAC shows up for this custom action, although the UAC has show up when starting the installation.
Why again? The installation should have admin privileges at this stage.

I think with an older version of AI this was working fine.

How to solve this?

Thank you , Chris
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: AI 19.9: custom action file lauch with admin privileges shown UAC dialog

Hello Chris,

Indeed, the UAC appears twice if you use the "Run as administrator" option.

This is due to the custom action not inheriting the admin privileges from the parent process.

If you want the custom action to run elevated, we need to have it scheduled as "Deferred" and with the "Run under the LocalSystem account with full privileges (no impersonation)" option enabled.

This is something by deisgn in Windows Installer (and yes, I know, it's counterintuitive). Here is an example of another user that used another tool that is MSI based which stumbled accross the same issue:

CustomAction run as administrator
My installer does pop up and say that it needs admin rights to run. Which I grant it.
However when it runs the custom action it doesn't work because its not running as administrator.
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ChrisGue
Posts: 116
Joined: Tue Feb 03, 2009 7:26 pm

Re: AI 19.9: custom action file lauch with admin privileges shown UAC dialog

thanks for your answer.

"This is due to the custom action not inheriting the admin privileges from the parent process."
Why that? With this the user has to click Yes multiple times.
The custom action should inheriting the admin privileges when 'Run as administrator' is checked.

I am pretty sure this worked fine with older versions of AI.

"Run under the LocalSystem account with full privileges (no impersonation)"
With this my commend does not work, as it requires the user account.


So, any other suggestions?
Thank you.
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: AI 19.9: custom action file lauch with admin privileges shown UAC dialog

Hello Chris,
Why that? With this the user has to click Yes multiple times.
To be quite honest with you, I can't really tell why this is, becauase it is something we inherited from using the Windows Installer technology.

If you want to avoid double prompts, you can use the "Run as administrator" option from the "Install Parameters" page and that should get rid of the double prompts and only prompt the user once at the start of the installation.

Note: the option I mentioned requires an EXE setup package as output for your project, so if you need an MSI this does not help much. The reason for this is that the MSI does not have the "Run as admin" option in its' context menu. An MSI can only be run with admin rights via inheritance so, for example, if you run it from an admin command prompt.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ChrisGue
Posts: 116
Joined: Tue Feb 03, 2009 7:26 pm

Re: AI 19.9: custom action file lauch with admin privileges shown UAC dialog

thanks for your answer

"To be quite honest with you, I can't really tell why this is, becauase it is something we inherited from using the Windows Installer technology"
I tested an old installation created with an AI prior to 19, and with this it definetly works fine, no additional promt. So it seems sth in AI has been changed.

"Run as administrator" option from the "Install Parameters" page
thanks, with that it works fine.

I used a custom action to create a windows scheduler task without any trigger, as AI requires a trigger to create a trask (although in the windows schedduler a task without any trigger can be cretaed).
I now let AI create that task with a dummy trigger.

Thank you
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: AI 19.9: custom action file lauch with admin privileges shown UAC dialog

Hello Chris,
I tested an old installation created with an AI prior to 19, and with this it definetly works fine, no additional promt. So it seems sth in AI has been changed.
Most likely, that was the bug and we actually fixed it. :)
thanks, with that it works fine.
Glad to hear everything is working as expected now.
I used a custom action to create a windows scheduler task without any trigger, as AI requires a trigger to create a trask (although in the windows schedduler a task without any trigger can be cretaed).
I now let AI create that task with a dummy trigger.
Mhm, interesting. I will test this and open a ticket so that this can be fixed in a future version of Advanced Installer.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”