[virt-tools-list] [PATCH virt-viewer 5/6] msi: build correct 64-bit msi

Marc-André Lureau marcandre.lureau at gmail.com
Fri Apr 12 17:23:43 UTC 2013


---
 configure.ac            |  9 +++++++++
 data/Makefile.am        | 24 ++++++++++++++----------
 data/virt-viewer.wxs.in | 24 ++++++++++++++++++++----
 3 files changed, 43 insertions(+), 14 deletions(-)

diff --git a/configure.ac b/configure.ac
index b1d532b..891930a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,15 @@ AC_MSG_CHECKING([for native Win32])
 case "$host_os" in
      *mingw*|*cygwin*)
         os_win32=yes
+        case "$host" in
+            amd64*|x86_64*)
+                WIXL_ARCH="x64"
+            ;;
+            *)
+                WIXL_ARCH="x86"
+            ;;
+        esac
+        AC_SUBST(WIXL_ARCH)
         ;;
      *)
         os_win32=no
diff --git a/data/Makefile.am b/data/Makefile.am
index 1532e0a..ec14719 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -23,21 +23,25 @@ virt-viewer-$(VERSION).exe: virt-viewer.nsis deps.txt
 	makensis -NOCD -DDESTDIR=$$DESTDIR $< >/dev/null && \
 	rm -rf $$DESTDIR
 
-virt-viewer-$(VERSION).msi: virt-viewer.wxs deps.txt
-	$(AM_V_GEN)DESTDIR=`mktemp -d` && \
-	make -C $(top_builddir) install DESTDIR=$$DESTDIR >/dev/null && \
-	find $$DESTDIR | wixl-heat -p $$DESTDIR$(prefix)/ \
-	    --component-group CG.virt-viewer --var var.DESTDIR \
-	    --directory-ref=INSTALLDIR > virt-viewer-files.wxs && \
-	wixl -D SourceDir=$(prefix) \
-             -D DESTDIR=$$DESTDIR$(prefix) -o $@ \
-	     $< virt-viewer-files.wxs && \
+virt-viewer-$(WIXL_ARCH)-$(VERSION).msi: virt-viewer.wxs deps.txt
+	$(AM_V_GEN)DESTDIR=`mktemp -d` &&				\
+	make -C $(top_builddir) install DESTDIR=$$DESTDIR >/dev/null &&	\
+	find $$DESTDIR | wixl-heat -p $$DESTDIR$(prefix)/		\
+	    --component-group CG.virt-viewer --var var.DESTDIR		\
+	    --directory-ref=INSTALLDIR > virt-viewer-files.wxs &&	\
+	wixl -D SourceDir=$(prefix)					\
+             -D DESTDIR=$$DESTDIR$(prefix)				\
+             --arch $(WIXL_ARCH)					\
+             -o $@							\
+	     $< virt-viewer-files.wxs &&				\
 	rm -rf $$DESTDIR virt-viewer-files.wxs
 
+msi: virt-viewer-$(WIXL_ARCH)-$(VERSION).msi
+
 CLEANFILES +=					\
 	deps.txt				\
 	virt-viewer-$(VERSION).exe		\
-	virt-viewer-$(VERSION).msi		\
+	virt-viewer-$(WIXL_ARCH)-$(VERSION).msi	\
 	$(NULL)
 
 else #!WIN32
diff --git a/data/virt-viewer.wxs.in b/data/virt-viewer.wxs.in
index 6e3e08f..9f8973e 100644
--- a/data/virt-viewer.wxs.in
+++ b/data/virt-viewer.wxs.in
@@ -2,14 +2,30 @@
 
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
 
+  <?define Version = "@VERSION@"?>
+  <?define Arch = "@WIXL_ARCH@"?>
+  <?if $(var.Arch) = "x64"?>
+      <?define GLIB_ARCH = "win64"?>
+      <?define ArchString = "64-bit"?>
+      <?define ArchProgramFilesFolder = "ProgramFiles64Folder"?>
+      <?define Win64 = "yes"?>
+  <?else?>
+      <?define GLIB_ARCH = "win32"?>
+      <?define ArchString = "32-bit"?>
+      <?define ArchProgramFilesFolder = "ProgramFilesFolder"?>
+      <?define Win64 = "no"?>
+  <?endif?>
+
   <?require spice-gtk.wxi?>
   <?require gtk-vnc.wxi?>
   <?require libvirt.wxi?>
 
-  <?define Version = "@VERSION@"?>
   <?define UpgradeCode = "5B027138-1A63-49E6-877E-055E5EEC1903"?>
-  <Product Id="*" Name="VirtViewer" Manufacturer="$(env.MANUFACTURER)"
-           Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)"
+  <Product Id="*"
+           Name="VirtViewer $(var.Version) ($(var.ArchString))"
+           Manufacturer="$(env.MANUFACTURER)"
+           Version="$(var.Version)"
+           UpgradeCode="$(var.UpgradeCode)"
            Language="1033">
 
     <Package InstallerVersion="200" Compressed="yes" Comments="comments"/>
@@ -48,7 +64,7 @@
     </DirectoryRef>
 
     <Directory Id="TARGETDIR" Name="SourceDir">
-      <Directory Id="ProgramFilesFolder">
+      <Directory Id="$(var.ArchProgramFilesFolder)">
         <Directory Id="INSTALLDIR" Name="VirtViewer">
           <Component Id="CDepsFile" Guid="*">
             <File Id="filA1E799D196006E6DF67DACE15B8C6193" KeyPath="yes" Source="deps.txt"/>
-- 
1.8.2.1.342.gfa7285d




More information about the virt-tools-list mailing list