SEBWIN-300: Added reset utility to installer.

This commit is contained in:
dbuechel 2019-07-26 16:13:57 +02:00
parent b26c77e578
commit 18ac56f1c6
5 changed files with 43 additions and 14 deletions

View file

@ -0,0 +1,16 @@
<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('ResetUtility.exe') + 1) = 'ResetUtility.exe']">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
<xsl:attribute name="Id">
<xsl:text>ResetUtilityExecutable</xsl:text>
</xsl:attribute>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

View file

@ -5,12 +5,12 @@
<Directory Id="ProgramFilesFolder"> <Directory Id="ProgramFilesFolder">
<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">
<Directory Id="StartMenuDirectory" Name="SafeExamBrowser"/> <Directory Id="StartMenuDirectory" Name="SafeExamBrowser" />
</Directory> </Directory>
</Directory> </Directory>
</Fragment> </Fragment>

View file

@ -13,9 +13,9 @@
<!-- <WixVariable Id="WixUIBannerBmp" Value="Resources\Banner.bmp" /> 493 × 58 --> <!-- <WixVariable Id="WixUIBannerBmp" Value="Resources\Banner.bmp" /> 493 × 58 -->
<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="Shortcuts" /> <ComponentGroupRef Id="ResetComponents" />
<!--<ComponentGroupRef Id="ResetComponents" />-->
<!--<ComponentGroupRef Id="ServiceComponents" />--> <!--<ComponentGroupRef Id="ServiceComponents" />-->
<ComponentRef Id="ShortcutComponents" />
</Feature> </Feature>
</Product> </Product>
</Wix> </Wix>

View file

@ -51,6 +51,14 @@
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir> <RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\SafeExamBrowser.ResetUtility\SafeExamBrowser.ResetUtility.csproj">
<Name>SafeExamBrowser.ResetUtility</Name>
<Project>{bc229e80-ff93-424f-9930-d9c07d9b57b4}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\SafeExamBrowser.Runtime\SafeExamBrowser.Runtime.csproj"> <ProjectReference Include="..\SafeExamBrowser.Runtime\SafeExamBrowser.Runtime.csproj">
<Name>SafeExamBrowser.Runtime</Name> <Name>SafeExamBrowser.Runtime</Name>
<Project>{e3aed2f8-b5df-45d1-ac19-48066923d6d8}</Project> <Project>{e3aed2f8-b5df-45d1-ac19-48066923d6d8}</Project>
@ -62,6 +70,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Components\Application.xslt" /> <Content Include="Components\Application.xslt" />
<Content Include="Components\Reset.xslt" />
<Content Include="Resources\License.rtf" /> <Content Include="Resources\License.rtf" />
<Content Include="Resources\SafeExamBrowser.ico" /> <Content Include="Resources\SafeExamBrowser.ico" />
</ItemGroup> </ItemGroup>
@ -71,10 +80,12 @@
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" /> <Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target> </Target>
<PropertyGroup> <PropertyGroup>
<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</PreBuildEvent> <PostBuildEvent>git -C $(SolutionDir) checkout -- Setup/Components/Application.wxs
git -C $(SolutionDir) checkout -- Setup/Components/Reset.wxs</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>git -C $(SolutionDir) checkout -- Setup/Components/Application.wxs</PostBuildEvent> <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>
</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.

View file

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment> <Fragment>
<ComponentGroup Id="Shortcuts"> <Component Id="ShortcutComponents" Guid="F6B8A57A-84BB-4264-96C5-3DD59F745E58" Directory="StartMenuDirectory">
<Component Id="ApplicationShortcutComponent" Guid="F6B8A57A-84BB-4264-96C5-3DD59F745E58" Directory="StartMenuDirectory"> <Shortcut Id="ApplicationShortcut" Name="Safe Exam Browser" Icon="ApplicationIcon" IconIndex="0" Advertise="no" Directory="ProgramMenuFolder"
<Shortcut Id="ApplicationShortcut" Name="Safe Exam Browser" Icon="ApplicationIcon" IconIndex="0" Advertise="no" Target="[ApplicationDirectory]\$(var.SafeExamBrowser.Runtime.TargetFileName)" WorkingDirectory="ApplicationDirectory"
Target="[ApplicationDirectory]\$(var.SafeExamBrowser.Runtime.TargetFileName)" WorkingDirectory="ApplicationDirectory" /> Description="Starts the main application." />
<RemoveFolder Id="StartMenuDirectory" On="uninstall" /> <Shortcut Id="ResetUtilityShortcut" Name="SEB Reset Utility" Icon="ApplicationIcon" IconIndex="0" Advertise="no" Directory="StartMenuDirectory"
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Name="installed" Type="integer" Value="1" KeyPath="yes"/> Target="[ResetDirectory]\$(var.SafeExamBrowser.ResetUtility.TargetFileName)" WorkingDirectory="ResetDirectory"
</Component> Description="Provides options to reset any changes made by the main application." />
</ComponentGroup> <RemoveFolder Id="StartMenuDirectory" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Fragment> </Fragment>
</Wix> </Wix>