我們爲我們的應用程序創建了WIX安裝程序。我們面臨的問題是: 我們已經定義了兩種不同的自定義操作(比如ActionForInstall和ActionForUninstall),我們希望在以下情況下執行: ActionForInstall:應該在安裝,產品升級,維護模式(用於修復和修改)時運行 ActionForUninstall :只能運行卸載。基於模式執行自定義操作 - WIX
但我們無法設置適當的條件。您可以參考代碼:
<Custom Action=ActionForInstall After='InstallFinalize' >
(NOT Installed) OR (Installed AND ((MaintenanceMode = "Modify") OR (MaintenanceMode = "Repair")) AND (NOT (MaintenanceMode = "Remove"))) OR ((UPGRADINGPRODUCTCODE) AND NOT(REMOVE ~= "ALL"))
</Custom>
<Custom Action=ActionForUninstall Before='InstallFinalize'>
Installed AND NOT UPGRADINGPRODUCTCODE
</Custom>
請讓我們知道我們做錯了什麼。上面的代碼甚至調用InstallFinalize進行卸載。
有用速查表:http://www.flexerasoftware.com/webdocuments/PDF/IS-CHS-Common-MSI-Conditions.pdf。我喜歡通過將NOT PATCH添加到現有條件列表以及禁用UPGRADINGPRODUCTCODE來禁用它們以進行主要升級,從而禁用MSI修補程序運行的自定義操作。 – 2014-05-28 00:37:01