Skip to content

Commit

Permalink
Installer: Fix MSI reinstallation and downgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Fleytman <[email protected]>
  • Loading branch information
Dmitry Fleytman committed Jun 18, 2015
1 parent cf28102 commit 458ad0f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions Tools/Installer/UsbDkInstaller.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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">
Expand Down
4 changes: 2 additions & 2 deletions Tools/Installer/buildmsi.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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

Expand Down

0 comments on commit 458ad0f

Please sign in to comment.