Uninstall previously installed versions on install

- For enterprise versions all Cura-Enterprise versions older than 4.13 are removed.
- All Cura versions >= 4.13 are removed optionally with a setting in the custom dialog.

CURA-9157
This commit is contained in:
Casper Lamboo 2022-12-16 16:21:01 +01:00
parent 994e867b3d
commit bd66872d77
2 changed files with 33 additions and 1 deletions

View File

@ -15,6 +15,7 @@
<Text>{\WixUI_Font_Title}Manage installed versions</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="PREVIOUS_VERSIONS_INSTALLED" CheckBoxValue="0" Text="Uninstall previous Cura versions." />
</Dialog>
</UI>
</Fragment>

View File

@ -1,6 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="{{ app_name }}" Language="1033" Version="{{ version_major }}.{{ version_minor }}.{{ version_patch }}" Manufacturer="{{ company }}" UpgradeCode="{{ upgrade_code }}" >
<Product
Id="*"
Name="{{ app_name }}"
Language="1033"
Version="{{ version_major }}.{{ version_minor }}.{{ version_patch }}"
Manufacturer="{{ company }}"
UpgradeCode="{{ upgrade_code }}"
>
<Package InstallerVersion="500"
Compressed="yes"
InstallScope="perMachine"
@ -9,6 +16,30 @@
Keywords="UltiMaker,Cura,3D,printing,slicer"
Comments="Copyright (c) {{ year }} UltiMaker" />
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
</InstallExecuteSequence>
<Property Id="PREVIOUS_VERSIONS_INSTALLED" Secure="yes" />
<Upgrade Id="{{ upgrade_code }}">
<UpgradeVersion
Minimum="4.13.2" Maximum="{{ version_major }}.{{ version_minor }}.{{ version_patch }}"
Property="PREVIOUS_VERSIONS_INSTALLED"
IncludeMinimum="no" IncludeMaximum="no"
/>
</Upgrade>
{% if "Enterpise" in app_name %}
<Property Id="PREVIOUS_413_INSTALLED" Secure="yes" />
<Upgrade Id="53C603BB-2B17-4206-A609-29C2E0D0B0AE">
<UpgradeVersion
Minimum="1.0.0" Maximum="4.13.2"
Property="PREVIOUS_413_INSTALLED"
IncludeMinimum="yes" IncludeMaximum="yes"
/>
</Upgrade>
{% endif %}
<Condition Message= "OS must be Windows 8.1 64bit or higher.">
<![CDATA[Installed OR VersionNT64 >= 600]]>
</Condition>