3
我正在嘗試使用WiX爲我的Windows服務編寫安裝程序。我的可執行文件可以使用命令行參數--install
和--uninstall
將自己註冊/取消註冊爲Windows服務。這是我想出的:刪除文件之前提高的自定義操作
<CustomAction Id='InstallAsService' FileKey='CCWirelessServer.exe' ExeCommand='--install' Return='check' Impersonate='no' Execute='deferred' />
<CustomAction Id='InstallAsServiceRollback' FileKey='CCWirelessServer.exe' ExeCommand='--uninstall' Return='check' Impersonate='no' Execute='rollback' />
<CustomAction Id='UninstallAsService' FileKey='CCWirelessServer.exe' ExeCommand='--uninstall' Return='check' Impersonate='no' Execute='deferred' />
<InstallExecuteSequence>
<Custom Action='InstallAsService' After='InstallFiles' >NOT Installed</Custom>
<Custom Action='InstallAsServiceRollback' Before='InstallAsService' >NOT Installed</Custom>
<Custom Action='UninstallAsService' Before='RemoveFiles' >Installed</Custom>
</InstallExecuteSequence>
安裝和卸載都基本工作。但在卸載期間,我收到以下消息:
安裝程序必須更新系統運行時無法更新的文件或服務。如果您選擇繼續,則需要重新啓動以完成設置。
儘管出現此錯誤消息,該服務會取消註冊並且文件將被刪除而不重新啓動。對我來說,這看起來像安裝程序正在檢查CCWirelessServer.exe
是否打開之前它執行我的自定義操作。
所以我的問題是:我如何需要修改我的安裝執行順序,以便此錯誤消息不再出現?
謝謝您的回答,它的工作原理! (但是,我寧願選擇一個解決方案來修復安裝順序。全局禁用檢查看起來更像是一種解決方法。) –