Extract contents of Burn bootstrapper
Asked Answered
D

4

22

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

Darvon answered 5/11, 2014 at 3:28 Comment(0)
T
38

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

dark.exe -x temp <installer>
Tourney answered 5/11, 2014 at 4:2 Comment(0)
D
5

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

Deneb answered 5/11, 2014 at 4:20 Comment(0)
H
1

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
Hadria answered 26/8, 2020 at 19:29 Comment(0)
I
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.

Irritated answered 5/11, 2014 at 15:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.