I am creating an installer for our NServiceBus-based solution using WiX, but I am having problems starting the host service after installation.
If I run the host installer from the command line using NServiceBus.Host.exe /install , it will set a penalty and even start successfully when I start the service.
However, when I create a service in WiX using the ServiceInstall element, it does not start the service. I tried to start the service in my installer using the ServiceControl element, and also after installation from the WIndows Services control panel.
The code I'm trying to use on WiX is:
<Component Id="NServiceBus.Host" Guid="PUT-GUID-HERE" Win64="yes"> <File Id="NServiceBus.Host" KeyPath="yes" Source="$(var.[Project].TargetDir)NServiceBus.Host.exe" Checksum="yes" /> <ServiceInstall Id="NServiceBus.Host.Install" Name="[Product].Host" DisplayName="[Product]" Type="ownProcess" Account="NT Authority\Network Service" Interactive="no" Start="auto" Vital="yes" ErrorControl="normal"> <ServiceDependency Id="MSMQ" /> <ServiceDependency Id="MSDTC" /> </ServiceInstall> <ServiceControl Id="NServiceBus.Host.Control" Name="[Product].Host" Start="install" Stop="both" Remove="uninstall" Wait="yes" /> </Component>
I used the same code in other projects to install and start services, so I'm sure the problem is with the NServiceBus node. The service here is also installed correctly, but just does not start.
Has anyone been able to install NServiceBus.Host.exe as a service using WiX? Or does anyone know if there are other steps that occur when starting NServiceBus.Host.exe /install , which I must follow in my WiX installer?
I know that I can create a CustomAction on WiX that launches NServiceBus.Host.exe /install , but I would rather avoid this if possible and install the service correctly (WiX). It also avoids the need for deletion of actions and deletion sequence.
Edit: For reference, this is how I create the queues using WiX MsmqExtension :
<Component Id="NServiceBus.Host.Queue" Guid="PUT-GUID-HERE" Win64="yes"> <msmq:MessageQueue Id="Queue1" Label="[Product] Host" PathName=".\private$\[Product].Host" Transactional="yes" PrivLevel="optional" /> <msmq:MessageQueue Id="Queue2" Label="[Product] Host Retries" PathName=".\private$\[Product].Host.Retries" Transactional="yes" PrivLevel="optional" /> <msmq:MessageQueue Id="Queue3" Label="[Product] Host Timeouts" PathName=".\private$\[Product].Host.Timeouts" Transactional="yes" PrivLevel="optional" /> <msmq:MessageQueue Id="Queue4" Label="[Product] Host Timeouts Dispatcher" PathName=".\private$\[Product].Host.TimeoutsDispatcher" Transactional="yes" PrivLevel="optional" /> </Component>