Passing command line args to MSI from WiX bundle

Your MSI needs to define a property like so:

<Property Id="SOMEPROPERTY" Value="Default"/>

You can then set this property from the bundle:

<MsiPackage SourceFile="<package>.msi" Id="SomeId">
    <MsiProperty Name="SOMEPROPERTY" Value="[SomeProperty]" />
</MsiPackage>

After this you can set the property in the Bootstrapper as described here: WiX Bootstrapper: How do I set burn variables from the command line?

Notice that SomeProperty is a Burn variable which you have to define:

<Variable Name="SomeProperty" Type="string" Value="DefaultValue" />

Update:

In the MSI you are then able to do a registry search based on this property:

<RegistrySearch Id="GetSomeValue" Root="HKLM" Key="SOFTWARE\<Manufacturer>\[SOMEPROPERTY]" Name="<ValueName>" Type="raw" />

Leave a Comment