WiX ServiceInstall Service referencing a .EXE from wixlib?

 ̄綄美尐妖づ 提交于 2020-01-06 04:51:33

问题


I use WIX for the first time and I'm trying to create a MSI to install a service. I have one project that generates a myLib.wixlib that have :

<Component Id="TestExecutable" Directory="TESTAPIFOLDER" Guid="*" >
          <File Source="$(var.BasePath)/TEST.exe" Id="TESTAPIServiceEXE"></File>
</Component>

To generate the .wixlib, I use -bf flags to embed the files into the .wixlib.

How can I refer the TEST.exe file from the .wixlib in the code below? I have to set the source to use the file TEST.EXE which is included in the "myLib.wixlib". I tried multiple ways but the file can't be found.

<Component Id="ServiceEXE" Guid="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
  <File Id="ServiceEXE" Name="YourService.exe" DiskId="1"
        Source="path\to\TEST.exe" KeyPath="yes" />
  <ServiceInstall 
       Id="ServiceInstall" 
       Type="ownProcess" 
       Vital="yes"
       Name="YourService"
       DisplayName="Your Service" 
       Description="Your Service description"
       Start="auto" 
       Account="[SERVICECREDENTIALS_USERLOGIN]" 
       Password="[SERVICECREDENTIALS_PASSWORD]"
       ErrorControl="normal" 
       Interactive="no" />
</Component>

来源:https://stackoverflow.com/questions/59358963/wix-serviceinstall-service-referencing-a-exe-from-wixlib

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!