Thursday, 1 November 2012

Install Windows Service using Wix Installer (msi)

Yet another change to the build was made today, which meant another change to the Wix installer. I had to install a windows service that is some sort of batch process, although the details are not important.

I have defined in my installer three public properties for user credentials, so I'm using those here, hopefully self explanatory.
<Component Id="cmpA16863CBS2F3E9E4186BECA95D8D652D" 
Directory="dirCFD54C07EFB094CBS317543172D62CC3" 
Guid="{65F83DA6-A1B4-46DD-944E-485314D1C774}">

 <File Id="fil30F24E5CD9B36161CAE8CB0E4BCE7AFD" KeyPath="yes" 
 Source="$(var.Processor.TargetDir)Processor.exe" />
 <File Id="fil31C22B1F09F16191CF5ECD1A1ACD2CBC" 
 Source="$(var.Processor.TargetDir)Processor.exe.config" />

 <ServiceInstall Id="ServiceInstaller" Vital="yes" Name="Processor"  
 Type="ownProcess"  DisplayName="Processor"
 Description="Process all data generated today" Start="auto" 
 Account="[DOMAIN]\[USER]" Password="[PASSWORD]" ErrorControl="normal"/>

 <ServiceControl Id="StartYourEngines" Start="install" Stop="both"  
 Remove="uninstall" Name="Processor" Wait="no" />

</Component> 

No comments:

Post a Comment