问题
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