Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch x86 or x64 MSI from MSBuild bootstrapper

So I have a WiX based MSI that installs a handful of device drivers and therefore I have an x64 and an x86 version. The package also has a .NET 3.5 dependency so I'm generating a bootstrapper to do this and then launch the MSI. My question is if anyone is aware of a way to create a bootstrapper that will detect the platform it is running on and launch the appropriate MSI. I've googled around for such a solution and have turned up nothing so far. Thanks!

like image 231
MattB Avatar asked Oct 02 '09 00:10

MattB


2 Answers

Unfortunately, the Windows Installer requires a separate MSI package for x86 and x64.

With WiX v3.6+ Burn provides the functionality to "bundle" the two packages together into a single install (driven by the Burn executable). You could do it with a .wxs file that would something a little like:

<Bundle ...>
  <BootstrapperApplicationRef Id='WixStandardBootstrapperApplication.RtfLicense' />

  <Chain>
    <MsiPackage InstallCondition='NOT VersionNT64' SourceFile='path\to\x86.msi' />
    <MsiPackage InstallCondition='VersionNT64' SourceFile='path\to\x64.msi' />
  </Chain>
</Bundle>

That's just beginning to scratch the surface of everything that Burn can do but it shows how to bundle the two architecture packages into a single installation experience.

like image 86
Rob Mensching Avatar answered Nov 02 '22 10:11

Rob Mensching


If you're installing .Net before launching your msi you could also include an exe written in c# that detects your platform and then passes the answer back to your bootstrapper.

I used an exe that detected the platform, created a reg key that I was verifying to decide what to launch.

C# example

like image 31
Gabriel Avatar answered Nov 02 '22 09:11

Gabriel