_NN_
Posts: 2
Joined: Sat Sep 15, 2018 8:05 am

Custom action without elevation prompt

Hello,
I added a custom action and set installer to require administrator.
When installer is running it shows elevation prompt and continues successfully.
But my custom action which requires administrator too, shows a separate elevation prompt which is annoying.
Is it possible to run my custom action using the already elevated process so I will see the prompt only once ?
Thanks.
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom action without elevation prompt

Hello,

This may happen if you, for example, use our predefined support for the "Launch File" custom action and have the "Run as Administrator" option checked on the "Launch File" custom action. Please keep in mind that if you run the main package with Administrator privileges, you do not need to also check the "Run as Administrator" option on your custom action, since the elevation is inherited from the main package.

Please let me know if this helps! If no, please give me some more details about your scenario (e.g. what type of custom action you are using, etc.).

Kind regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
_NN_
Posts: 2
Joined: Sat Sep 15, 2018 8:05 am

Re: Custom action without elevation prompt

Hello,
Thank you.
I think it is confusing.
When my package is set as "Run As Administrator", I would expect that any other action with 'Run As Administrator' will run without elevation prompont.
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom action without elevation prompt

Hello,

You're welcome!

Indeed, this should be the expected behavior. In order for me to further investigate, could you please share with us a sample project which replicates the behavior? Or maybe if you could give me some more details about your scenario (e.g. what custom action you are using). I am asking for these because I have retested your scenario and I could not encounter the same behavior.

Here is what I have tested:

- Simple project with a "Launch File" custom action (I have tested this using "cmd.exe" and "notepad.exe" in the "Launch File" field).

- "Run as administrator" option checked from both "Install Parameters" and "Custom Actions" page.

- The results were: UAC prompt and the beginning of the installation, but not when the custom action was deployed.

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

Return to “Common Problems”