[英]How to extract Wix bootstrapper embedded msi before actually run install?
我能夠使用System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
和Ubinder提取自身。
但是在Wix 3.10.3穩定版中,BA只是將一個苗條的ba.exe
提取到temp文件夾中,然后它將切換到運行其中沒有msi的苗條的ba.exe
。 提取本身將不起作用。 雖然我仍然無法獲得第一次啟動的完整ba.exe
因為它已經關閉。
如果可以從BootstrapperApplication
類獲取任何屬性以指出完整的ba.exe
(它應該具有一定的跟蹤能力,因為在開始安裝msi時應將其提取出來),或者我可以在開始安裝msi之前調用提取程序嗎?
使用Unbinder
類,您可以將嵌入式MSI提取到工作文件夾中。 請注意,這僅在捆綁包使用嵌入式MSI時有效。
我已包含以下代碼,這需要您提供捆綁可執行文件的路徑(與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();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.