Skip to content

Commit

Permalink
qemu-ga: Prevent QEMU-GA VSS provider from being unregistered on MSI …
Browse files Browse the repository at this point in the history
…reinstall

Previously, running the .msi would unregister the QEMU GA VSS service if QEMU GA was already installed on the machine, and then register it only if QEMU GA was NOT previously installed. This behavior caused the service to be registered only after the INITIAL installation, and any subsequent run of the .msi (to redo, repair, or upgrade the installation) ended in the service being unregistered.

Now, the VSS service is still unregistered if QEMU GA is already installed (so that a fix or an update could be performed) but then it is registered again (if the GA is not being uninstalled) thus finishing the repair/upgrade correctly. Additionally, downgrading is now prevented. If a user would like to downgrade a version, he/she must uninstall the newer version first.

Signed-off-by: Leonid Bloch <leonid@daynix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
blochl authored and mdroth committed Sep 1, 2015
1 parent 5e994f9 commit 848849d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions qga/installer/qemu-ga.wxs
Expand Up @@ -58,13 +58,9 @@
/>
<Media Id="1" Cabinet="qemu_ga.$(env.QEMU_GA_VERSION).cab" EmbedCab="yes" />
<Property Id="WHSLogo">1</Property>
<Property Id="PREVIOUSVERSIONSINSTALLED" />
<Upgrade Id="{EB6B8302-C06E-4bec-ADAC-932C68A3A98D}">
<UpgradeVersion
Minimum="1.0.0.0" Maximum="$(env.QEMU_GA_VERSION)"
Property="PREVIOUSVERSIONSINSTALLED"
IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>
<MajorUpgrade
DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
/>

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.GaProgramFilesFolder)" Name="QEMU Guest Agent">
Expand Down Expand Up @@ -125,6 +121,7 @@
</Directory>

<Property Id="cmd" Value="cmd.exe"/>
<Property Id="REINSTALLMODE" Value="amus"/>

<?ifdef var.InstallVss?>
<CustomAction Id="RegisterCom"
Expand Down Expand Up @@ -161,10 +158,9 @@
</Feature>

<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
<?ifdef var.InstallVss?>
<Custom Action="RegisterCom" After="InstallServices">NOT Installed</Custom>
<Custom Action="UnRegisterCom" After="StopServices">Installed</Custom>
<Custom Action="RegisterCom" After="InstallServices">NOT REMOVE</Custom>
<?endif?>
</InstallExecuteSequence>
</Product>
Expand Down

0 comments on commit 848849d

Please sign in to comment.