我正在使用 wix 構建一個安裝程式,該程式根據從命令列傳入的“CURRENCY”屬性安裝不同的功能。
msiexec /i install.msi CURRENCY="GBP"
這是 wix 檔案的特征元素:
<Feature Id="Complete" Level="1" Title="My Service" Display="expand" InstallDefault="local">
<Feature Id="MainProgram" Title="My Service" Display="expand" Level="1" Absent="allow">
<ComponentRef Id="MyCoordinator" />
<Feature Id="Foo" Title="Foo" Display="expand" InstallDefault="followParent" Level="1" Absent="disallow">
<Feature Id="UK" Title="UK Settings" Description="UK Plugin." Level="0" InstallDefault="followParent" Absent="disallow">
<Condition Level="1">CURRENCY = "GBP"</Condition> <<-- CONDITION
<ComponentRef Id="UK_Settings_Component" />
</Feature>
<Feature Id="US" Title="US Settings" Description="US Plugin." Level="0" InstallDefault="followParent" Absent="disallow">
<Condition Level="1">CURRENCY = "USD"</Condition> <<-- CONDITION
<ComponentRef Id="US_Settings_Component" />
</Feature>
</Feature>
</Feature>
</Feature>
安裝程序很好用。我傳入一種貨幣并安裝了相應國家/地區的設定組件。
但是當我嘗試通過“添加或洗掉程式”小程式卸載應用程式時,它要求用戶卸載應用程式兩次,然后再將其從已安裝程式串列中洗掉。因此,我使用詳細日志記錄從命令列運行卸載。
> msiexec /x {product-guid} /L*v "uninstall_1.txt"
> msiexec /x {product-guid} /L*v "uninstall_2.txt"
在深入了解詳細的卸載日志后,我相信這是因為安裝程式未能洗掉特定于貨幣的設定組件。
從第二次卸載后的卸載日志中,我可以看到它找到了:
Component: UK_Settings_Component; Installed: Local; Request: Null; Action: Local
如果我將貨幣傳遞給卸載命令,則只需卸載一次
> msiexec /x {product-guid} CURRENCY="GBP"
問題:如何告訴它在卸載應用程式時始終洗掉所有貨幣組件?
uj5u.com熱心網友回復:
確保功能始終處于啟用狀態,以便可以洗掉它們:
不過,解決方案很簡單:添加
OR REMOVE到啟用該功能的條件中。這可確保在整個產品卸載或嘗試洗掉該特定功能期間啟用該功能。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/370766.html
上一篇:捕獲c 訪問沖突例外
