2016-10-21 133 views
0

我正在使用包含MSI軟件包和幾個EXE軟件包的WiX軟件包安裝程序。對於EXE軟件包,似乎WiX軟件包安裝程序可以處理升級或卸載,但不能同時處理兩者。是否可以使用ExePackages創建一個WiX bundle安裝程序,以處理升級和卸載ExePackage?WiX Burn軟件包安裝程序 - 處理升級和卸載exe軟件包

我碰到的第一個問題是,當卸載我的軟件包時,它只會卸載MSI軟件包,並將EXE安裝的軟件包留在系統上。我發現解決方案是將一個DetectCondition放入ExePackage元素中。但是,DetectCondition似乎會干擾升級ExePackage。在那裏使用DetectCondition時,升級安裝日誌會顯示Exe包的「錯誤0x80070002:無法找到有效負載」。

例如,與DetectCondition的ExeBundle部分看起來是這樣的:

<ExePackage Id="BLAH_INSTALLER" 
       SourceFile="$(var.SolutionDir)\InputBin\SetupBlah.exe" 
       Compressed="yes" 
       InstallCommand="/install /norestart /quiet" 
       UninstallCommand="/uninstall /quiet" 
       RepairCommand="/repair /quiet" 
       DetectCondition="BlahPresent" 
       Cache="always" > 
    <dep:Provides Key="IntelISA" Version="5.1.10.160" /> 
    </ExePackage> 

而且BlahPresent邏輯:

<util:FileSearch 
    Id="Blah_Installed" 
    Path="[ProgramFiles64Folder]\Blah\blah.exe" 
    Variable="BlahPresent" 
    Result="exists" /> 

回答

0

我發現這DetectCondition在示例中,這似乎同時啓用升級和卸載軟件包中的ExePackage:

DetectCondition="WixBundleInstalled=1" 

這就是它將出現在ExePackage元素中的方式:

<ExePackage Id="BLAH_INSTALLER" 
       SourceFile="$(var.SolutionDir)\InputBin\SetupBlah.exe" 
       Compressed="yes" 
       InstallCommand="/install /norestart /quiet" 
       UninstallCommand="/uninstall /quiet" 
       RepairCommand="/repair /quiet" 
       DetectCondition="WixBundleInstalled=1" 
       Cache="always" > 
相關問題