SEBWIN-300: Added service to installer.

This commit is contained in:
dbuechel 2019-07-31 09:51:06 +02:00
parent ff0f85d9f9
commit 68f3f352fe
4 changed files with 32 additions and 4 deletions

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="wix:File[substring(@Source, string-length(@Source) - string-length('Service.exe') + 1) = 'Service.exe']">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
<wix:ServiceInstall DisplayName="Safe Exam Browser Service" Name="SafeExamBrowser" Account="LocalSystem" ErrorControl="normal" Start="auto"
Type="ownProcess" Vital="yes" Interactive="no" Description="Performs operations which require elevated privileges." />
<wix:ServiceControl Id="ServiceControl" Name="SafeExamBrowser" Start="install" Stop="uninstall" Remove="uninstall" Wait="yes" />
</xsl:template>
</xsl:stylesheet>

View file

@ -6,7 +6,7 @@
<Directory Id="InstallFolder" Name="SafeExamBrowser"> <Directory Id="InstallFolder" Name="SafeExamBrowser">
<Directory Id="ApplicationDirectory" Name="Application" /> <Directory Id="ApplicationDirectory" Name="Application" />
<Directory Id="ResetDirectory" Name="Reset" /> <Directory Id="ResetDirectory" Name="Reset" />
<!--<Directory Id="ServiceDirectory" Name="Service" />--> <Directory Id="ServiceDirectory" Name="Service" />
</Directory> </Directory>
</Directory> </Directory>
<Directory Id="ProgramMenuFolder"> <Directory Id="ProgramMenuFolder">

View file

@ -14,7 +14,7 @@
<Feature Id="ProductFeature" Title="Safe Exam Browser" Level="1"> <Feature Id="ProductFeature" Title="Safe Exam Browser" Level="1">
<ComponentGroupRef Id="ApplicationComponents" /> <ComponentGroupRef Id="ApplicationComponents" />
<ComponentGroupRef Id="ResetComponents" /> <ComponentGroupRef Id="ResetComponents" />
<!--<ComponentGroupRef Id="ServiceComponents" />--> <ComponentGroupRef Id="ServiceComponents" />
<ComponentRef Id="ShortcutComponent" /> <ComponentRef Id="ShortcutComponent" />
</Feature> </Feature>
</Product> </Product>

View file

@ -67,9 +67,18 @@
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir> <RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\SafeExamBrowser.Service\SafeExamBrowser.Service.csproj">
<Name>SafeExamBrowser.Service</Name>
<Project>{fa3c6692-dfed-4afa-bd58-9a3da2753c78}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Components\Application.xslt" /> <Content Include="Components\Application.xslt" />
<Content Include="Components\Service.xslt" />
<Content Include="Components\Reset.xslt" /> <Content Include="Components\Reset.xslt" />
<Content Include="Resources\License.rtf" /> <Content Include="Resources\License.rtf" />
<Content Include="Resources\Application.ico" /> <Content Include="Resources\Application.ico" />
@ -82,11 +91,13 @@
</Target> </Target>
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>"$(WIX)bin\heat.exe" dir "$(SolutionDir)SafeExamBrowser.ResetUtility\bin\$(PlatformName)\$(ConfigurationName)" -nologo -ag -g1 -srd -cg ResetComponents -dr ResetDirectory -sfrag -var var.SafeExamBrowser.ResetUtility.TargetDir -out $(ProjectDir)Components\Reset.wxs -t $(ProjectDir)Components\Reset.xslt <PreBuildEvent>"$(WIX)bin\heat.exe" dir "$(SolutionDir)SafeExamBrowser.ResetUtility\bin\$(PlatformName)\$(ConfigurationName)" -nologo -ag -g1 -srd -cg ResetComponents -dr ResetDirectory -sfrag -var var.SafeExamBrowser.ResetUtility.TargetDir -out $(ProjectDir)Components\Reset.wxs -t $(ProjectDir)Components\Reset.xslt
"$(WIX)bin\heat.exe" dir "$(SolutionDir)SafeExamBrowser.Runtime\bin\$(PlatformName)\$(ConfigurationName)" -nologo -ag -g1 -srd -cg ApplicationComponents -dr ApplicationDirectory -sfrag -var var.SafeExamBrowser.Runtime.TargetDir -out $(ProjectDir)Components\Application.wxs -t $(ProjectDir)Components\Application.xslt</PreBuildEvent> "$(WIX)bin\heat.exe" dir "$(SolutionDir)SafeExamBrowser.Runtime\bin\$(PlatformName)\$(ConfigurationName)" -nologo -ag -g1 -srd -cg ApplicationComponents -dr ApplicationDirectory -sfrag -var var.SafeExamBrowser.Runtime.TargetDir -out $(ProjectDir)Components\Application.wxs -t $(ProjectDir)Components\Application.xslt
"$(WIX)bin\heat.exe" dir "$(SolutionDir)SafeExamBrowser.Service\bin\$(PlatformName)\$(ConfigurationName)" -nologo -ag -g1 -srd -cg ServiceComponents -dr ServiceDirectory -sfrag -var var.SafeExamBrowser.Service.TargetDir -out $(ProjectDir)Components\Service.wxs -t $(ProjectDir)Components\Service.xslt</PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>git -C $(SolutionDir) checkout -- Setup/Components/Application.wxs <PostBuildEvent>git -C $(SolutionDir) checkout -- Setup/Components/Application.wxs
git -C $(SolutionDir) checkout -- Setup/Components/Reset.wxs</PostBuildEvent> git -C $(SolutionDir) checkout -- Setup/Components/Reset.wxs
git -C $(SolutionDir) checkout -- Setup/Components/Service.wxs</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- <!--
To modify your build process, add your task inside one of the targets below and uncomment it. To modify your build process, add your task inside one of the targets below and uncomment it.