[MM-62196] Add support for downgrades using the MSI (#3249)
Co-authored-by: Devin Binnie <devin@sourcestorm.net>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/node_modules/app-builder-lib/templates/msi/template.xml b/node_modules/app-builder-lib/templates/msi/template.xml
|
diff --git a/node_modules/app-builder-lib/templates/msi/template.xml b/node_modules/app-builder-lib/templates/msi/template.xml
|
||||||
index 2d5cd3c..3c2d128 100644
|
index 2d5cd3c..9bf447e 100644
|
||||||
--- a/node_modules/app-builder-lib/templates/msi/template.xml
|
--- a/node_modules/app-builder-lib/templates/msi/template.xml
|
||||||
+++ b/node_modules/app-builder-lib/templates/msi/template.xml
|
+++ b/node_modules/app-builder-lib/templates/msi/template.xml
|
||||||
@@ -1,5 +1,8 @@
|
@@ -1,5 +1,8 @@
|
||||||
@@ -12,21 +12,23 @@ index 2d5cd3c..3c2d128 100644
|
|||||||
<!-- https://blogs.msdn.microsoft.com/gremlininthemachine/2006/12/05/msi-wix-and-unicode/ -->
|
<!-- https://blogs.msdn.microsoft.com/gremlininthemachine/2006/12/05/msi-wix-and-unicode/ -->
|
||||||
<Product Id="*" Name="${productName}" UpgradeCode="${upgradeCode}" Version="${version}" Language="1033" Codepage="65001" Manufacturer="${manufacturer}">
|
<Product Id="*" Name="${productName}" UpgradeCode="${upgradeCode}" Version="${version}" Language="1033" Codepage="65001" Manufacturer="${manufacturer}">
|
||||||
<Package Compressed="yes" InstallerVersion="500"/>
|
<Package Compressed="yes" InstallerVersion="500"/>
|
||||||
@@ -13,6 +16,10 @@
|
@@ -13,19 +16,50 @@
|
||||||
|
|
||||||
So, AllowSameVersionUpgrades="yes" allows to build and test MSI with the same version, and previously installed app will be removed.
|
So, AllowSameVersionUpgrades="yes" allows to build and test MSI with the same version, and previously installed app will be removed.
|
||||||
-->
|
-->
|
||||||
|
- <MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage='A newer version of "[ProductName]" is already installed.'/>
|
||||||
+ <!-- Remove versions of newer MSI using the wrong UpgradeCode -->
|
+ <!-- Remove versions of newer MSI using the wrong UpgradeCode -->
|
||||||
+ <Upgrade Id="{0F183CAA-DF79-5400-A71F-684F563AF31C}">
|
+ <Upgrade Id="{0F183CAA-DF79-5400-A71F-684F563AF31C}">
|
||||||
+ <UpgradeVersion Property="PREVMSIINSTALLER" IncludeMaximum="yes" Maximum="${version}" MigrateFeatures="yes" OnlyDetect="no"/>
|
+ <UpgradeVersion Property="PREVMSIINSTALLER" IncludeMaximum="yes" Maximum="${version}" MigrateFeatures="yes" OnlyDetect="no"/>
|
||||||
+ </Upgrade>
|
+ </Upgrade>
|
||||||
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage='A newer version of "[ProductName]" is already installed.'/>
|
+ <MajorUpgrade AllowDowngrades='yes'/>
|
||||||
<MediaTemplate CompressionLevel="${compressionLevel}" EmbedCab="yes"/>
|
<MediaTemplate CompressionLevel="${compressionLevel}" EmbedCab="yes"/>
|
||||||
|
|
||||||
@@ -20,12 +27,38 @@
|
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER"/>
|
||||||
<Property Id="ApplicationFolderName" Value="${installationDirectoryWixName}"/>
|
<Property Id="ApplicationFolderName" Value="${installationDirectoryWixName}"/>
|
||||||
<Property Id="WixAppFolder" Value="WixPerUserFolder"/>
|
<Property Id="WixAppFolder" Value="WixPerUserFolder"/>
|
||||||
<Property Id="DISABLEADVTSHORTCUTS" Value="1"/>
|
<Property Id="DISABLEADVTSHORTCUTS" Value="1"/>
|
||||||
|
+ <Property Id="REINSTALLMODE" Value="amus" />
|
||||||
+ <Property Id="EXEINSTALLEREXISTS">
|
+ <Property Id="EXEINSTALLEREXISTS">
|
||||||
+ <DirectorySearch Path="[LocalAppDataFolder]\Programs\mattermost-desktop" Depth="0">
|
+ <DirectorySearch Path="[LocalAppDataFolder]\Programs\mattermost-desktop" Depth="0">
|
||||||
+ <FileSearch Id="SearchEXEUninstaller" Name="Uninstall ${productName}.exe" />
|
+ <FileSearch Id="SearchEXEUninstaller" Name="Uninstall ${productName}.exe" />
|
||||||
@@ -62,7 +64,7 @@ index 2d5cd3c..3c2d128 100644
|
|||||||
{{ if (isRunAfterFinish) { }}
|
{{ if (isRunAfterFinish) { }}
|
||||||
<CustomAction Id="runAfterFinish" FileKey="mainExecutable" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait"/>
|
<CustomAction Id="runAfterFinish" FileKey="mainExecutable" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait"/>
|
||||||
{{ if (!isAssisted) { }}
|
{{ if (!isAssisted) { }}
|
||||||
@@ -42,6 +75,7 @@
|
@@ -42,6 +76,7 @@
|
||||||
<Property Id="ALLUSERS" Secure="yes" Value="2"/>
|
<Property Id="ALLUSERS" Secure="yes" Value="2"/>
|
||||||
{{ } -}}
|
{{ } -}}
|
||||||
<Property Id="MSIINSTALLPERUSER" Secure="yes" Value="1"/>
|
<Property Id="MSIINSTALLPERUSER" Secure="yes" Value="1"/>
|
||||||
@@ -70,7 +72,7 @@ index 2d5cd3c..3c2d128 100644
|
|||||||
|
|
||||||
{{ if (isAssisted) { }}
|
{{ if (isAssisted) { }}
|
||||||
<WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes"/>
|
<WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes"/>
|
||||||
@@ -80,6 +114,7 @@
|
@@ -80,6 +115,7 @@
|
||||||
</UI>
|
</UI>
|
||||||
{{ } -}}
|
{{ } -}}
|
||||||
|
|
||||||
@@ -78,7 +80,7 @@ index 2d5cd3c..3c2d128 100644
|
|||||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||||
<Directory Id="${programFilesId}">
|
<Directory Id="${programFilesId}">
|
||||||
{{ if (menuCategory) { }}
|
{{ if (menuCategory) { }}
|
||||||
@@ -110,6 +145,10 @@
|
@@ -110,6 +146,10 @@
|
||||||
{{-dirs}}
|
{{-dirs}}
|
||||||
|
|
||||||
<ComponentGroup Id="ProductComponents" Directory="APPLICATIONFOLDER">
|
<ComponentGroup Id="ProductComponents" Directory="APPLICATIONFOLDER">
|
||||||
|
Reference in New Issue
Block a user