Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSI installation and UAC

We have our product installation built using WiX. It needs to be executed on servers and, because of its nature, needs to create user and assign this user specific rights (e.g. Execute as Service) For that we're using our own custom actions that are defined in C#-based custom actions library.

When we start installation by user who has administrative permissions, but is not administrator on Windows 2008 the system doesn't ask us to confirm that we want this application to be executed (UAC dialog is not shown). As result, all these action fails because the MSI seems to be run without Administrative permissions. We cannot make our action deferred because some of them need to be executed during UI sequence and need to be marked as "immediate".

How would we mark installer as one that needs Administrative permissions? We tried WiX attribute InstallPrivileges='elevated', but documentation says it is set by default and it didn't make any difference.

Thanks

like image 871
Denis Mazourick Avatar asked Dec 14 '25 09:12

Denis Mazourick


2 Answers

You cannot mark the MSI directly to request Administrator privileges. However, you can try using an EXE bootstrapper which requests elevation through its manifest: http://msdn.microsoft.com/en-us/library/bb756929.aspx

A better approach is to split your custom actions instead of a single action which does everything:

  • use Immediate custom action which collect data from UI
  • use Deferred with no impersonation custom action which use that data

The information collected by the UI custom actions can be stored in installer properties. These properties can be passed through Action Data (CustomActionData property) to the deferred actions.

like image 115
rmrrm Avatar answered Dec 16 '25 22:12

rmrrm


I use InstallPrivileges='elevated' in my install and it displays the UAC dialog on Windows 2008. Do you see the shield icon on the "Install" button?

like image 33
Neil Avatar answered Dec 16 '25 23:12

Neil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!