Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Setup/Components/Application.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<!-- These components will be auto-generated! -->
</Fragment>
Expand Down
83 changes: 48 additions & 35 deletions Setup/Components/Application.xslt
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
<?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('SafeExamBrowser.exe') + 1) = 'SafeExamBrowser.exe']">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
<xsl:attribute name="Id">
<xsl:text>MainExecutable</xsl:text>
</xsl:attribute>
</xsl:copy>
<wix:File Id="ApplicationIconFile" Source="Resources\Application.ico" />
<wix:File Id="ConfigurationIconFile" Source="Resources\ConfigurationFile.ico" />
<wix:ProgId Id="ConfigurationFileExtension" Description="SEB Configuration File" Icon="ConfigurationIconFile" Advertise="no">
<wix:Extension Id="seb" ContentType="application/seb" Advertise="no">
<wix:Verb Id="open" Command="Open" Argument="&quot;%1&quot;" TargetFile="MainExecutable" />
</wix:Extension>
</wix:ProgId>
<wix:RegistryKey Root="HKCR" Key="seb">
<wix:RegistryValue Value="URL:Safe Exam Browser Protocol" Type="string" />
<wix:RegistryValue Name="URL Protocol" Value="" Type="string" />
<wix:RegistryValue Key="DefaultIcon" Value="[#ApplicationIconFile]" Type="string" />
<wix:RegistryValue Key="shell\open\command" Value="&quot;[ApplicationDirectory]$(var.SafeExamBrowser.Runtime.TargetFileName)&quot; &quot;%1&quot;" Type="string" />
</wix:RegistryKey>
<wix:RegistryKey Root="HKCR" Key="sebs">
<wix:RegistryValue Value="URL:Safe Exam Browser Secure Protocol" Type="string" />
<wix:RegistryValue Name="URL Protocol" Value="" Type="string" />
<wix:RegistryValue Key="DefaultIcon" Value="[#ApplicationIconFile]" Type="string" />
<wix:RegistryValue Key="shell\open\command" Value="&quot;[ApplicationDirectory]$(var.SafeExamBrowser.Runtime.TargetFileName)&quot; &quot;%1&quot;" Type="string" />
</wix:RegistryKey>
</xsl:template>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"
xmlns="http://wixtoolset.org/schemas/v4/wxs"
exclude-result-prefixes="xsl wix">

<xsl:output method="xml" indent="yes" omit-xml-declaration="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('SafeExamBrowser.exe') + 1) = 'SafeExamBrowser.exe']">
<xsl:copy>
<xsl:apply-templates select="@*"/>

<xsl:attribute name="Id">MainExecutable</xsl:attribute>
<xsl:attribute name="KeyPath">yes</xsl:attribute>

<xsl:apply-templates select="node()"/>
</xsl:copy>

<wix:File Id="ApplicationIconFile" Source="Resources\Application.ico" />
<wix:File Id="ConfigurationIconFile" Source="Resources\ConfigurationFile.ico" />

<wix:ProgId Id="ConfigurationFileExtension" Description="SEB Configuration File" Icon="ConfigurationIconFile" Advertise="no">
<wix:Extension Id="seb" ContentType="application/seb" Advertise="no">
<wix:Verb Id="open" Command="Open" Argument="&quot;%1&quot;" TargetFile="MainExecutable" />
</wix:Extension>
</wix:ProgId>

<wix:RegistryKey Root="HKCR" Key="seb">
<wix:RegistryValue Value="URL:Safe Exam Browser Protocol" Type="string" />
<wix:RegistryValue Name="URL Protocol" Value="" Type="string" />
<wix:RegistryValue Key="DefaultIcon" Value="[#ApplicationIconFile]" Type="string" />
<wix:RegistryValue Key="shell\open\command" Value="&quot;[#MainExecutable]&quot; &quot;%1&quot;" Type="string" />
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The registry value was changed from [ApplicationDirectory]$(var.SafeExamBrowser.Runtime.TargetFileName) to [#MainExecutable]. While [#MainExecutable] is a valid file reference in WiX v4, this change alters the path resolution. The original used a directory property plus filename variable, while the new version uses a file identifier. Verify this produces the correct full path, as the file identifier syntax may expand differently than the directory + filename approach.

Copilot uses AI. Check for mistakes.
</wix:RegistryKey>

<wix:RegistryKey Root="HKCR" Key="sebs">
<wix:RegistryValue Value="URL:Safe Exam Browser Secure Protocol" Type="string" />
<wix:RegistryValue Name="URL Protocol" Value="" Type="string" />
<wix:RegistryValue Key="DefaultIcon" Value="[#ApplicationIconFile]" Type="string" />
<wix:RegistryValue Key="shell\open\command" Value="&quot;[#MainExecutable]&quot; &quot;%1&quot;" Type="string" />
</wix:RegistryKey>

</xsl:template>
</xsl:stylesheet>
3 changes: 1 addition & 2 deletions Setup/Components/Configuration.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<!-- These components will be auto-generated! -->
</Fragment>
Expand Down
3 changes: 1 addition & 2 deletions Setup/Components/Reset.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<!-- These components will be auto-generated! -->
</Fragment>
Expand Down
3 changes: 1 addition & 2 deletions Setup/Components/Service.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<!-- These components will be auto-generated! -->
</Fragment>
Expand Down
47 changes: 24 additions & 23 deletions Setup/Directories.wxs
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?if $(var.Platform) = x64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.PlatformProgramFilesFolder)">
<Directory Id="InstallFolder" Name="SafeExamBrowser">
<Directory Id="ApplicationDirectory" Name="Application" />
<Directory Id="ConfigurationDirectory" Name="Configuration" />
<Directory Id="ResetDirectory" Name="Reset" />
<Directory Id="ServiceDirectory" Name="Service" />
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="StartMenuDirectory" Name="SafeExamBrowser" />
</Directory>
</Directory>
</Fragment>
</Wix>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?if $(var.Platform) = x64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif?>

<Fragment>
<StandardDirectory Id="$(var.PlatformProgramFilesFolder)">

<Directory Id="InstallFolder" Name="SafeExamBrowser">
<Directory Id="ApplicationDirectory" Name="Application" />
<Directory Id="ConfigurationDirectory" Name="Configuration" />
<Directory Id="ResetDirectory" Name="Reset" />
<Directory Id="ServiceDirectory" Name="Service" />
</Directory>

</StandardDirectory>

<StandardDirectory Id="ProgramMenuFolder">
<Directory Id="StartMenuDirectory" Name="SafeExamBrowser" />
</StandardDirectory>
</Fragment>
</Wix>
6 changes: 2 additions & 4 deletions Setup/LegacyCleanup.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<CustomAction Id="LegacyCleanupAction" Execute="deferred" Impersonate="no" Return="ignore"
Directory="InstallFolder" ExeCommand="cmd.exe /C &quot;rd /S /Q SebWindowsServiceWCF&quot;" />
<CustomAction Id="LegacyCleanupAction" Execute="deferred" Impersonate="no" Return="ignore" Directory="InstallFolder" ExeCommand="cmd.exe /C &quot;rd /S /Q SebWindowsServiceWCF&quot;" />
</Fragment>
</Wix>
12 changes: 5 additions & 7 deletions Setup/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Name="Safe Exam Browser ($(var.Platform))" Manufacturer="ETH Zürich" Language="1033" Codepage="1252"
Id="*" Version="!(bind.fileVersion.MainExecutable)" UpgradeCode="97A8B13E-48FB-4BE1-A7C2-DD1863F95CCB">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package Name="Safe Exam Browser ($(var.Platform))" Manufacturer="ETH Zürich" Language="1033" Codepage="1252" Version="!(bind.fileVersion.MainExecutable)" UpgradeCode="97A8B13E-48FB-4BE1-A7C2-DD1863F95CCB" InstallerVersion="200">

<MediaTemplate EmbedCab="yes" />
<UIRef Id="WixUI_Minimal" />
<ui:WixUI Id="WixUI_Minimal" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" />
<Icon Id="ApplicationIcon" SourceFile="Resources\Application.ico" />
<Icon Id="ConfigurationToolIcon" SourceFile="Resources\ConfigurationTool.ico" />
Expand All @@ -24,5 +22,5 @@
<InstallExecuteSequence>
<Custom Action="LegacyCleanupAction" After="RemoveFiles" />
</InstallExecuteSequence>
</Product>
</Package>
</Wix>
Loading
Loading