|
From: Justin D. <jus...@gm...> - 2014-12-31 02:04:00
|
I am completely new to wix, so bare with me here. I have followed a guide here http://nicholasarmstrong.com/2014/08/sideloading-windows-8-apps-with-wix/ to create an installer that sideloads a windows 8.1 application. I have that working after messing with it for a while. I also want my wix installer to install a service. My service has a number of dependency DLLs such as log4net, sqlite, etc. I tried following this guide http://www.talksharp.com/wix-toolset-install-windows-service to integrate what I saw there into my existing installer that does the sideloading. At first, the installer was place the service executable in the installation directory, but there would not be any of the included DLLs necessary for it to run. I am just lost at this point trying to take those two examples and merge them into what I want working. I have added the service project as a reference to my wix project. I have also added this to my wixproj file: <PropertyGroup> <!-- Service file harvesting --> <ServiceDir>..\PRISMContingencyService\bin\$(Configuration)\</ServiceDir> <DefineConstants>$(DefineConstants);ServiceDir=$(ServiceDir)</DefineConstants> </PropertyGroup> <ItemGroup> <!-- Harvest service --> <HarvestDirectory Include="$(ServiceDir)"> <InProject>false</InProject> <DirectoryRefId>INSTALLFOLDER</DirectoryRefId> <ComponentGroupName>ComponentGroup.Service</ComponentGroupName> <PreprocessorVariable>var.ServiceDir</PreprocessorVariable> <SuppressRootDirectory>true</SuppressRootDirectory> </HarvestDirectory> </ItemGroup> In the config.wxi file I have a number of lines including: <?define ServiceExeName = "PRISMContingencyService.exe" ?> And I think this is the relevant part in the Setup.wxs file that I can't figure out: <Feature Id="ProductFeature" Title="Sideload PRISM Contingency App" Level="1"> <ComponentGroupRef Id="ComponentGroup.App" /> <ComponentGroupRef Id="ComponentGroup.PowerShellScripts" /> <ComponentGroupRef Id="ComponentGroup.Service"/> <!--<ComponentRef Id="$(var.PRISMContingencyService.TargetFileName)"/>--> </Feature> <UIRef Id="WixUI_Minimal" /> </Product> <Fragment> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLFOLDER" Name="$(var.InstallFolderName)" /> </Directory> </Directory> <!-- New stuff here --> <DirectoryRef Id="INSTALLFOLDER"> <!-- Create a single component which is the TestService.exe file --> <Component Id="Component.ServiceComponent"> <!-- Copies the TestService.exe file using the project reference preprocessor variables --> <File Id="File.ServiceFile" Source="[INSTALLFOLDER]\$(var.ServiceExeName)" KeyPath="yes" /> <!-- Remove all files from the INSTALLFOLDER on uninstall --> <!--<RemoveFile Id="ALLFILES" Name="*.*" On="both" />--> <!-- Tell WiX to install the Service --> <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Name="PRISMContingencyService" DisplayName="PRISMContingencyService" Description="Service for the PRISM Contingency Windows Application." Start="auto" ErrorControl="normal" Account="localSystem" Vital="yes"/> <!-- Tell WiX to start the Service --> <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="PRISMContingencyService" Wait="yes" /> </Component> </DirectoryRef> </Fragment> |