我有这个 mosquitto.exe,我需要使用 WiX 将其安装为 Windows 服务。当我创建一个 Windows 服务项目并通过其启动方法运行 EXE 时,一切正常。但是是否可以仅使用 ServiceControl 和 ServiceInstall 行并且没有单独的 Windows 服务项目来运行 mosquitto.exe?我试过这个,但服务无法启动,虽然它不是很好。
</Component>
<Component Id="cmp59455E1C37B7879C4BC250DE3D60A2AD" Directory="MyProgramDir" Guid="179B4F4C-912B-4CA1-8F08-5E1B4ADFFD8B" Win64="no">
<File Id="fil7D28AEF774656849395A2FA20A5C963D" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto.exe" />
<ServiceInstall Id="MosquittoSI" Type="ownProcess" Name="Mosquitto" DisplayName="Mosquitto" Description="Mosquitto broker service" Start="auto" Account="LocalSystem" ErrorControl="normal"/>
<ServiceControl Id="MosquittoSC" Start="install" Stop="both" Remove="uninstall" Name="Mosquitto" Wait="no" />
</Component>
我在这里做错了什么还是我真的需要通过使用 Windows 服务项目创建的另一个 exe 来启动这个 mosquitto.exe?任何帮助将非常感激。