【发布时间】:2017-04-27 23:47:16
【问题描述】:
我正在尝试使用 wix 安装 Windows 服务,但我似乎无法将服务文件指向用户选择的安装目录。
<Component Id="MyServiceInstaller_ServiceControl" Guid="B72CAA3F-F2DB-48D2-90DD-061209AB2CE5" Directory="INSTALLDIR">
<CreateFolder />
<File Id='MyServiceEXE' Name='MyService.exe' DiskId='1' Source='[INSTALLDIR]MyService.exe' KeyPath='yes'/>
<ServiceInstall Id="MyServiceInstaller_ServiceInstall"
Type="ownProcess"
Vital="yes"
Name="My Service"
DisplayName="My Service"
Description="This will make windows services great again!"
Start="auto"
Account="NT AUTHORITY\LocalService"
ErrorControl="ignore"
Interactive="no" />
<ServiceControl Id="MyServiceInstaller_ServiceInstall"
Name="My Service"
Stop="both"
Remove="uninstall"
Wait="yes" />
</Component>
问题似乎是当我使用任何 [PROPERTY] 目录时出现以下错误。
错误 LGHT0103 : 系统找不到文件 '[INSTALLDIR]MyService.exe'。
如何告诉 Wix 使用用户选择的安装文件夹作为服务的路径?
【问题讨论】:
标签: wix installation wix3