Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix Burn Bundle - Must be Administrator

I've created a WIX Burn Bundle. In the Bundle I install .Net 4 (if its not installed) then 2 more .msi files. 1 is a third part msi the other a msi I created for my software using WIX. I need to be an Administrator on the machine to run these the .msi files.

I want the Burn bundle to not do anything if the user is not an administartor i.e. install nothing. In my product software I can easily do do using below - however I cant do this in the bundle. I've read lots of similar posts but just didnt find a working example for what I want to do.

<CustomAction Id="IsPrivileged" Error="You must be an Administrator to install [ProductName]." />
  <InstallExecuteSequence>
     <Custom Action='IsPrivileged' Before='LaunchConditions'>
        Not Privileged
     </Custom>
  </InstallExecuteSequence>
like image 457
gisWeeper Avatar asked Aug 21 '13 14:08

gisWeeper


1 Answers

You can use the bundle equivalent of launch conditions using Burn's built-in variables and WixBalExtension's Condition element:

<bal:Condition Message="You can't elevate.">
  <![CDATA[Privileged <> 0]]>
</bal:Condition>

<bal:Condition Message="You're not elevated.">
  WixBundleElevated = 1
</bal:Condition>
like image 71
Bob Arnson Avatar answered Dec 08 '22 14:12

Bob Arnson