WIX Burn Bootstrapper not asking for admin rights for my MSI
Asked Answered
D

1

13

I created an MSI with WIX that needs elevated permissions to work correctly. In the MSI Project, I specified this via

<Package [...] InstallPrivileges="elevated" />

Now I included this MSI in a custom bootsrapper project, based on WixWPF Bootstrapper. As I understand it, the bootstrapper itself should not alter the machine state and thus should not require elevated privileges.

I would now expect the Bootstrapper to automatically launch the integrated MSI with elevated priviliges, prompting the user with a UAC dialog, if necessary. But it does not. Instead, the installation just fails. It works however, when I run the bootstrapper executable explicitly as administrator.

How do I make the bootstrapper ask for elevated permissions when installing the MSI?

Druci answered 28/10, 2014 at 16:5 Comment(3)
Just to know, have you set this attribute for your MSI? InstallScope="perMachine"Sealer
@Sealer I did not have set that attribute; I will check tomorrow if that makes any difference, as I have no access to my project right now. Thanks!Druci
@Sealer Thanks, that was it! If you post this as an answer, I will be happy to accept it.Druci
S
19

Since the INSTALLSCOPE attribute for the MSI was not set, it defaulted to Per-User install and the bootstrapper application considered that it does not need any ADMIN/Elevated rights to run it.

Now in your case, you are the author of the MSI and it was easy enough for you to add the InstallScope to the package element.

InstallScope="perMachine" 

If you are not the author of the MSI, still bootstrapper provides a property which you can use to force the per-machine for the MSI/EXE.

  1. MSIPackage - ForcePerMachine
  2. EXEPackage - PerMachine

So why does Bootstrapper think that Per-Machine install needs elevated privileges and Per-User doesnt? Simple enough, per-user installation the registry value is written under HKEY_CURRENT_USER and for Per-machine installation the registry value is written under HKEY_LOCAL_MACHINE. Only Admin users can read/write to HKLM.

Sealer answered 29/10, 2014 at 15:46 Comment(1)
Thanks, I appreciate the additional background information!Druci

© 2022 - 2024 — McMap. All rights reserved.