diff mbox series

[09/41] build-sys: simplify MSI's QEMU_GA_VERSION

Message ID 20220420132624.2439741-10-marcandre.lureau@redhat.com (mailing list archive)
State New, archived
Headers show
Series Misc cleanups | expand

Commit Message

Marc-André Lureau April 20, 2022, 1:25 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

No need to pass it from configure environment down to wixl. Let simply
set a wixl -D variable. If it needs to be configurable, we should have a
proper option.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure                 |  4 ----
 qga/installer/qemu-ga.wxs | 10 +++++-----
 qga/meson.build           |  2 +-
 3 files changed, 6 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/configure b/configure
index 5ac653b21351..321e66809234 100755
--- a/configure
+++ b/configure
@@ -2697,9 +2697,6 @@  fi
 if test "$QEMU_GA_DISTRO" = ""; then
   QEMU_GA_DISTRO=Linux
 fi
-if test "$QEMU_GA_VERSION" = ""; then
-    QEMU_GA_VERSION=$(cat $source_path/VERSION)
-fi
 
 # Mac OS X ships with a broken assembler
 roms=
@@ -2788,7 +2785,6 @@  fi
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
   echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
-  echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
 else
   echo "CONFIG_POSIX=y" >> $config_host_mak
 fi
diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
index 53d836c06a96..2c49a2336e11 100644
--- a/qga/installer/qemu-ga.wxs
+++ b/qga/installer/qemu-ga.wxs
@@ -1,7 +1,7 @@ 
 <?xml version="1.0" encoding="UTF-8"?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
-  <?ifndef env.QEMU_GA_VERSION ?>
-    <?error Environment variable QEMU_GA_VERSION undefined?>
+  <?ifndef var.QEMU_GA_VERSION ?>
+    <?error Variable QEMU_GA_VERSION undefined ?>
   <?endif?>
 
   <?ifndef env.QEMU_GA_DISTRO ?>
@@ -42,7 +42,7 @@ 
     Id="*"
     UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}"
     Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
-    Version="$(env.QEMU_GA_VERSION)"
+    Version="$(var.QEMU_GA_VERSION)"
     Language="1033">
     <?if $(var.Arch) = 32 ?>
     <Condition Message="Error: 32-bit version of Qemu GA can not be installed on 64-bit Windows.">NOT VersionNT64</Condition>
@@ -54,7 +54,7 @@ 
       Compressed="yes"
       InstallScope="perMachine"
       />
-    <Media Id="1" Cabinet="qemu_ga.$(env.QEMU_GA_VERSION).cab" EmbedCab="yes" />
+    <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" />
     <Property Id="WHSLogo">1</Property>
     <MajorUpgrade
       DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
@@ -133,7 +133,7 @@ 
             <RegistryKey Root="HKLM"
                          Key="Software\$(var.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
               <RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
-              <RegistryValue Type="string" Name="Version" Value="$(env.QEMU_GA_VERSION)" />
+              <RegistryValue Type="string" Name="Version" Value="$(var.QEMU_GA_VERSION)" />
             </RegistryKey>
           </Component>
         </Directory>
diff --git a/qga/meson.build b/qga/meson.build
index 6e57de430d29..fb437062612e 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -122,12 +122,12 @@  if targetos == 'windows'
                             depends: deps,
                             command: [
                               find_program('env'),
-                              'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
                               'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
                               'BUILD_DIR=' + meson.build_root(),
                               wixl, '-o', '@OUTPUT0@', '@INPUT0@',
                               qemu_ga_msi_arch[cpu],
                               qemu_ga_msi_vss,
+                              '-D', 'QEMU_GA_VERSION=' + meson.project_version(),
                             ])
     all_qga += [qga_msi]
     alias_target('msi', qga_msi)