[wix-users] changing install location of MSI packages within Bundles

John Naylor mejohnnaylor at mac.com
Wed Jun 15 11:07:02 PDT 2016


I have a package that can be installed onto 2 types of machine:
1) ordinary windows PC
2) a turnkey that runs embedded windows

In the 2nd case I need to install a bundle of 3 MSI’s into a specific folder, while in the first, they should go to their default locations in %PROGRAMFILES% or %PROGRAMFILES(X86)% as appropriate.

It seems that the trick to this is to use an MsiProperty within each MsiPackage in the bundle to set the INSTALLLOCATION Property from a Burn Variable. Simple enough if I could get it to work. I can use a registry search to determine whether the install is on a regular machine or a turnkey, and set the variable appropriately. Unfortunately, it’s not working.

Here’s my test bundle code, the SampleFirst.msi package, when installed by itself, installs to %PROGRAMFILES(X86)%. Unfortunately, it installs to the same place when installed from the Bundle (FoobarBundle.exe). 

I’m testing this on a regular windows 10 machine. The aforementioned Turnkey system isn’t involved at this point.

<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi <http://schemas.microsoft.com/wix/2006/wi>"
		xmlns:bal="http://schemas.microsoft.com/wix/BalExtension <http://schemas.microsoft.com/wix/BalExtension>"
	>
 <Bundle Version='0.1.0' UpgradeCode=‘GUID HERE'>
   <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
   	<bal:WixStandardBootstrapperApplication
   		LicenseFile="License.rtf"
   	/>
   </BootstrapperApplicationRef>
		<Variable Name="MyInstallFolder" Type="string" Value="C:\Pretend\Plugins" bal:Overridable="yes"/>    		
   <Chain>
   	<MsiPackage Id="SampleFirst" SourceFile="SampleFirst.msi" Vital="yes" Visible="yes" >
   		<MsiProperty Name="INSTALLLOCATION" Value="[MyInstallFolder]" />
   	</MsiPackage >   		
   </Chain>
 </Bundle>
</Wix>

I’m building the Bundle using these commands:

> candle FoobarBundle.wxs -ext WixBalExtension
> light FoobarBundle.wixobj -ext WixBalExtension

This is with version 3.10.2.2516 of the toolset.

Thanks in advance for your help!

John


More information about the wix-users mailing list