19

I have an MSI package bundled in a WiX Burn bootstrapper. Can I extract this MSI from the bundle on the target machine?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Kunal
  • 227
  • 1
  • 3
  • 9

4 Answers4

35

You need to use the dark.exe utility that comes with WiX.

dark.exe -x temp <installer>
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Shaun Wilde
  • 8,228
  • 4
  • 36
  • 56
5

The bundle can't self-extract itself until someone implements this feature.

Sean Hall
  • 7,629
  • 2
  • 29
  • 44
0

You can extract an embedded .msi from your bundle while it's running if you're using a custom bootstrapper application, then extract the contents of that .msi by using the WiX SDK.

The short answer is that you can use the Unbinder class to extract the MSI files from your bundle:

unbinder = new Unbinder();
unbinder.Unbind(bundlePath, OutputType.Bundle, tmpFolder);
unbinder.DeleteTempFiles();

Then, use the InstallPackge class to extract the files:

using (var msiPackage = new InstallPackage(msiFilePath, DatabaseOpenMode.Transact) { WorkingDirectory = _targetFolder })
{
  using (var session = Microsoft.Deployment.WindowsInstaller.Installer.OpenPackage(msiPackage, ignoreMachineState: true))
  {
     msiPackage.ExtractFiles(fileKeysToInstall);
  }
  msiPackage.Close()
}

That's a very simplified version of what you need to do. I've written a blog post with much more details, which you can find here: http://www.wrightfully.com/extracting-msi-files-without-running-the-installer

Important Note: This does not run any of your custom actions, so makes sure to take that into account.

John M. Wright
  • 4,477
  • 1
  • 43
  • 61
0

Extracting a WiX Toolset installation .exe package is easy. Just use dark.exe from the WiX Toolset.

For example:

C:\Program Files (x86)\WiX Toolset v3.11\bin\dark.exe c:\temp\myInstaller.exe -x c:\temp\myInstallerFiles
arielhad
  • 1,753
  • 15
  • 12