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" 

 <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" />


No comments:

Post a Comment