Skip to content
Snippets Groups Projects
Commit 458ad0f9 authored by Dmitry Fleytman's avatar Dmitry Fleytman
Browse files

Installer: Fix MSI reinstallation and downgrade

parent cf281029
No related merge requests found
......@@ -43,6 +43,11 @@
Minimum="0.0.0.0" Maximum="$(var.UsbDkVersion)"
Property="PREVIOUSVERSIONSINSTALLED"
IncludeMinimum="yes" IncludeMaximum="no" />
<UpgradeVersion
Minimum="$(var.UsbDkVersion)" Maximum="99.99.99.99"
Property="NEWERVERSIONINSTALLED"
IncludeMinimum="no" IncludeMaximum="yes" />
</Upgrade>
<Directory Id="TARGETDIR" Name="SourceDir">
......@@ -105,10 +110,15 @@
Return="ignore">
</CustomAction>
<CustomAction Id="PreventDowngrading"
Error="Error: Newer version of UsbDk already installed.">
</CustomAction>
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
<RemoveExistingProducts After="InstallInitialize">PREVIOUSVERSIONSINSTALLED&lt;&gt;""</RemoveExistingProducts>
<Custom Action="InstallDriver" After="InstallFiles">NOT Installed</Custom>
<Custom Action="UninstallDriver" Before="RemoveFiles">Installed</Custom>
<Custom Action="UninstallDriver" Before="RemoveFiles">REMOVE</Custom>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWERVERSIONINSTALLED&lt;&gt;"" AND NOT Installed</Custom>
</InstallExecuteSequence>
<Feature Id="ProductFeature" Title="UsbDk Runtime Libraries" Level="1">
......
SETLOCAL EnableExtensions EnableDelayedExpansion
IF [%UsbDkVersion%] == [] SET UsbDkVersion=99.99.99
IF [%UsbDkVersion%] == [".."] SET UsbDkVersion=99.99.99
IF [%UsbDkVersion%] == [] SET UsbDkVersion=99.99.90
IF [%UsbDkVersion%] == [".."] SET UsbDkVersion=99.99.90
pushd ..\..\Install_Debug\x86
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment