Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ jobs:
if: matrix.os == 'windows-latest'
shell: bash
run: |
# MSI ProductVersion only supports three numeric fields (major.minor.build, each
# 0-65535) and cannot represent a SemVer prerelease suffix (e.g. "-beta.12"), so
# it's simply truncated off here. Package.wxs's MajorUpgrade AllowDowngrades="yes"
# is what makes this safe: it always replaces whatever version is installed -
# older, same, or newer - so two builds truncating to the same MSI version (e.g.
# a prerelease and its eventual stable release) is not a problem.
MSI_VERSION=$(echo "${{ inputs.version }}" | cut -d'-' -f1)
echo "MSI_VERSION=${MSI_VERSION}" >> "$GITHUB_ENV"
echo "Computed MSI version: ${MSI_VERSION}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
<!-- Exposes MSBuild properties as WiX preprocessor variables ($(Version), $(SysML2WorkbenchPublishDir),
$(SysML2WorkbenchIconFile) in .wxs). -->
<DefineConstants>Version=$(Version);SysML2WorkbenchPublishDir=$(SysML2WorkbenchPublishDir);SysML2WorkbenchIconFile=$(SysML2WorkbenchIconFile)</DefineConstants>
<!-- ICE61 flags this product's Upgrade table as having no Maximum version - that is exactly
what Package.wxs's MajorUpgrade AllowDowngrades="yes" intentionally configures, so any
version (older, same, or newer) always replaces what's installed instead of ever being
refused (see https://docs.firegiant.com/wix/schema/wxs/majorupgrade/). This ICE is a
known false positive for that setting and must be suppressed rather than acted on. -->
<SuppressIces>ICE61</SuppressIces>
</PropertyGroup>

<ItemGroup>
<!-- Provides the WixCloseApplication custom action used to prompt the user to close
a running SysML2 Workbench before the installer replaces its files. -->
<PackageReference Include="WixToolset.Util.wixext" Version="5.0.2" />
</ItemGroup>

</Project>
34 changes: 32 additions & 2 deletions src/DemaConsulting.SysML2Workbench.Installer/Package.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Package
Name="SysML2 Workbench"
Manufacturer="DEMA Consulting"
Expand All @@ -9,13 +10,42 @@
Compressed="yes"
Scope="perMachine">

<MajorUpgrade DowngradeErrorMessage="A newer version of SysML2 Workbench is already installed." />
<!-- AllowDowngrades="yes" means installing SysML2 Workbench always replaces whatever
version is already present - older, same, or newer - rather than ever refusing
to install or leaving two side-by-side entries in Add/Remove Programs. This also
covers the same-version case (WiX docs: "AllowDowngrades already allows two
products with the same version number to upgrade each other"), so it must not be
combined with AllowSameVersionUpgrades. -->
<MajorUpgrade AllowDowngrades="yes" />
<MediaTemplate EmbedCab="yes" />

<!-- Closes a running SysML2 Workbench before install/upgrade so file replacement never
fails because the app is open. Sends a close message first (giving the user a chance
to save work), then forcibly terminates it after Timeout seconds if it hasn't exited -
RebootPrompt must be "no" to combine with TerminateProcess. -->
<util:CloseApplication
Id="CloseSysML2Workbench"
Target="DemaConsulting.SysML2Workbench.Desktop.exe"
Description="SysML2 Workbench is running and will be closed to continue installing."
CloseMessage="yes"
RebootPrompt="no"
TerminateProcess="1"
Timeout="5" />

<!-- Sets the icon shown in Add/Remove Programs (Apps & Features). -->
<Icon Id="AppIcon" SourceFile="$(SysML2WorkbenchIconFile)" />
<Property Id="ARPPRODUCTICON" Value="AppIcon" />

<!-- Points Add/Remove Programs' support/about links at the project's GitHub page. -->
<Property Id="ARPHELPLINK" Value="https://github.com/demaconsulting/SysML2Workbench" />
<Property Id="ARPURLINFOABOUT" Value="https://github.com/demaconsulting/SysML2Workbench" />
<Property Id="ARPCONTACT" Value="DEMA Consulting" />

<!-- There is no WixUI dialog sequence, so the "Modify" and "Repair" buttons in Add/Remove
Programs have no UI to drive - hide them rather than offer non-functional options. -->
<Property Id="ARPNOMODIFY" Value="1" />
<Property Id="ARPNOREPAIR" Value="1" />

<Feature Id="MainFeature" Title="SysML2 Workbench" Level="1">
<ComponentGroupRef Id="ApplicationFiles" />
<ComponentRef Id="ApplicationShortcut" />
Expand Down
Loading