I have an MSI package bundled in a WiX Burn bootstrapper. Can I extract this MSI from the bundle on the target machine?
You need to use the dark.exe
utility that comes with WiX.
dark.exe -x temp <installer>
The bundle can't self-extract itself until someone implements this feature.
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
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.
© 2022 - 2024 — McMap. All rights reserved.