2014-11-05 19 views

回答

24

您需要使用WiX附帶的dark.exe實用程序。

dark.exe -x temp <installer> 
5

捆綁包不能自行提取自己,直到有人實現了this feature

0

如果您使用自定義引導程序應用程序,則可以在運行時從您的包中提取嵌入式.msi,然後使用WiX SDK提取該.msi的內容。

簡短的回答是,你可以使用Unbinder類從包中提取MSI文件:

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

然後,使用InstallPackge類提取文件:

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() 
} 

這一個你需要做的非常簡化的版本。我寫了一篇博客文章,其中包含更多詳細信息,您可以在這裏找到:http://www.wrightfully.com/extracting-msi-files-without-running-the-installer

重要說明:這不會運行任何自定義操作,因此請務必將其考慮在內。