簡體   English   中英

Wix:可以在InstallValidate之前執行自定義操作嗎?

[英]Wix: Can execute a custom action before InstallValidate?

在卸載過程中,安裝程序會顯示以下消息:

"The setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required to complete the setup."

我認為這是由安裝的服務在卸載時仍在運行造成的。 所以,我嘗試編寫一個自定義動作來阻止它。 但是,它似乎不起作用。

如果我將操作設置為Execute='deferred' Impersonate='no' ,它只允許我在InstallInitializeInstallFinalize之間執行操作,因此我必須將其設置為“立即”。

<CustomAction BinaryKey='CustomActions' Id='StopService' DllEntry='StopService' Execute='immediate' />

<Custom Action="StopService" Before="InstallValidate">REMOVE="ALL"</Custom>

另請注意,由於某些原因,我必須使用自定義操作手動安裝服務,而不是使用Wix。 這就是我試圖手動刪除它的原因。

您無法在InstallInitialize之前運行提升的自定義操作。 如果您要正常安裝該服務,MSI將負責為您停止服務,而不顯示正在使用的消息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM