2016-12-26 26 views
0

我能夠使用System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;和Ubinder來提取自己。如何在實際運行安裝之前提取Wix啓動程序嵌入式msi?

但是在Wix 3.10.3穩定版中,BA只是將一個slim ba.exe提取到臨時文件夾,然後它將切換到運行沒有msi的slim ba.exe。提取本身不起作用。雖然我仍然無法完成第一次啓動,因爲ba.exe已經關閉。

如果有任何屬性,我可以從BootstrapperApplication類中得到以指出完整的ba.exe(它應該有一些跟蹤,因爲MSI應該在開始安裝時被解壓縮)或者我可以在開始安裝之前調用解壓縮微星?

回答

0

使用Unbinder類,可以將嵌入的MSI提取到工作文件夾中。請注意,這隻適用於如果您的軟件包使用嵌入式MSI。

我已經包含了下面的代碼,它需要你提供bundle可執行文件的路徑(與ba.exe不同)。我已經寫了我這究竟是怎麼在我的博客,你可以查看這裏: https://www.wrightfully.com/extracting-wix-bundled-msi-files-without-running-the-installer/

Unbinder unbinder = null; 

    try 
    { 
     unbinder = new Unbinder(); 
     //unbinder.Message += MessageEventHandlerMethod; 
     unbinder.Unbind(bundlePath, OutputType.Bundle, tmpFolder); 
    } 
    finally 
    { 
     if (null != unbinder) 
      unbinder.DeleteTempFiles(); 
    } 
+1

感謝約翰,鏈接解決了我的問題。其實我需要的行:_bundlePath = _bootstrapperApplication.Engine.StringVariables [「WixBundleOriginalSource」]; – txiangyang

相關問題