[英]Service not being installed properly using WIX installer
正如標題所說,我有以下代碼片段,它使用 wix 安裝服務
<Directory Id="Test" Name="Test">
<Component Id="ConnectorMainService" Guid="{SOME-ID}">
<CreateFolder/>
<ServiceInstall Id="ServiceInstaller" Type="ownProcess" Name="$(var.PRODUCT_NAME)" DisplayName="$(var.PRODUCT_NAME)" Description="$(var.DESCRIPTION)" Start="auto" Account="NT AUTHORITY\LocalService" ErrorControl="normal" Interactive="no" Vital="yes"/>
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="$(var.PRODUCT_NAME)" Wait="yes"/>
</Component>
</Directory>
我必須在其中放一個 <CreateFolder> ,否則我會遇到與此問題中描述的相同的問題( 為什么我的 WiX 安裝程序需要一個空的 CreateFolder 來有條件地更新 Xml 文件? )。
我所擁有的不同之處甚至是 <CreateFolder> 在那里,安裝程序退出而不創建服務,它只是創建文件夾。
將CreateFolder
元素替換為服務可執行文件本身的File
元素。 Windows 安裝程序要求服務的可執行File
和ServiceInstall
元素位於同一個Component
中(具體來說,服務可執行文件必須是Component
的KeyPath
,但 WiX 會為您處理,如果您將可執行File
元素放在Component
中的第一位)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.