[virt-tools-list] [virt-viewer] [PATCH 1/2] Add support for building a msi file using GTK3

Marc-André Lureau mlureau at redhat.com
Mon Nov 3 23:08:48 UTC 2014


Have you tried using the wix preprocessor variables and conditions?

To me building gtk3 or gtk2 version shouldn't be much different from building x86 or x64 version.

In the end, make msi should be enough to produce the right msi depending on your current "configure/build" state.

----- Original Message -----
> This commit is basically for helping developers to test the GTK3's
> support for virt-viewer on Windows. However, the support is highly
> experimental at this point and should not be distributed.
> For generating the virt-viewer's msi with GTK3 support, just do:
> make -C data msi-gtk3 (after mingw-configure and mingw-make)
> ---
> Depends on msitools' git master:
> https://git.gnome.org/browse/msitools/commit/?id=c03676f95a348fd7da511355398f3a073400f819
> https://git.gnome.org/browse/msitools/commit/?id=08cdc65a46f9eaaf49cd0acde0c3aaead341973d
> https://git.gnome.org/browse/msitools/commit/?id=19c465b9f89583cdc905609abfd9cfb2c6beb26f
> ---
>  configure.ac                 |   1 +
>  data/Makefile.am             |  27 +++++++--
>  data/virt-viewer-gtk3.wxs.in | 133
>  +++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 156 insertions(+), 5 deletions(-)
>  create mode 100644 data/virt-viewer-gtk3.wxs.in
> 
> diff --git a/configure.ac b/configure.ac
> index d0ae79e..5bb991a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -244,6 +244,7 @@ AC_CONFIG_FILES([
>      Makefile
>      data/Makefile
>      data/virt-viewer.wxs
> +    data/virt-viewer-gtk3.wxs
>      data/virt-viewer.nsis
>      data/virt-viewer-debug.nsis
>      icons/Makefile
> diff --git a/data/Makefile.am b/data/Makefile.am
> index 086efca..78ccd41 100644
> --- a/data/Makefile.am
> +++ b/data/Makefile.am
> @@ -5,13 +5,14 @@ MANUFACTURER = Virt Manager Project
>  EXTRA_DIST =					\
>  	spice-xpi-client-remote-viewer		\
>  	virt-viewer.wxs.in			\
> +	virt-viewer-gtk3.wxs.in			\
>  	virt-viewer.nsis.in			\
>  	virt-viewer-debug.nsis.in		\
>  	$(NULL)
>  
>  # this make sure those files are regenerated when they change
>  # (in maintainer-mode)
> -all-local: virt-viewer.wxs virt-viewer.nsis virt-viewer-debug.nsis
> +all-local: virt-viewer.wxs virt-viewer-gtk3.wxs virt-viewer.nsis
> virt-viewer-debug.nsis
>  
>  if OS_WIN32
>  
> @@ -45,10 +46,26 @@ virt-viewer-$(WIXL_ARCH)-$(VERSION).msi: virt-viewer.wxs
> deps.txt
>  
>  msi: virt-viewer-$(WIXL_ARCH)-$(VERSION).msi
>  
> -CLEANFILES +=					\
> -	deps.txt				\
> -	virt-viewer-$(VERSION).exe		\
> -	virt-viewer-$(WIXL_ARCH)-$(VERSION).msi	\
> +virt-viewer-gtk3-$(WIXL_ARCH)-$(VERSION).msi: virt-viewer-gtk3.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-gtk3 --var var.DESTDIR	\
> +	    --directory-ref=INSTALLDIR > virt-viewer-gtk3-files.wxs &&	\
> +	MANUFACTURER="$(MANUFACTURER)" wixl -D SourceDir=$(prefix)	\
> +             -D DESTDIR=$$DESTDIR$(prefix)				\
> +             --arch $(WIXL_ARCH)					\
> +             -o $@							\
> +	     $< virt-viewer-gtk3-files.wxs &&				\
> +	rm -rf $$DESTDIR virt-viewer-gtk3-files.wxs
> +
> +msi-gtk3: virt-viewer-gtk3-$(WIXL_ARCH)-$(VERSION).msi
> +
> +CLEANFILES +=						\
> +	deps.txt					\
> +	virt-viewer-$(VERSION).exe			\
> +	virt-viewer-$(WIXL_ARCH)-$(VERSION).msi		\
> +	virt-viewer-gtk3-$(WIXL_ARCH)-$(VERSION).msi	\
>  	$(NULL)
>  
>  else #!WIN32
> diff --git a/data/virt-viewer-gtk3.wxs.in b/data/virt-viewer-gtk3.wxs.in
> new file mode 100644
> index 0000000..1ae1d25
> --- /dev/null
> +++ b/data/virt-viewer-gtk3.wxs.in
> @@ -0,0 +1,133 @@
> +<?xml version="1.0" encoding="utf-8"?>
> +
> +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
> +
> +  <?define Version = "@WINDOWS_PRODUCTVERSION@"?>
> +  <?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-gtk3.wxi?>
> +  <?require gtk-vnc2.wxi?>
> +  <?require libvirt.wxi?>
> +
> +  <?define UpgradeCode = "5B027138-1A63-49E6-877E-055E5EEC1903"?>
> +  <Product Id="*"
> +           Name="VirtViewer @VERSION@@BUILDID@ ($(var.ArchString))"
> +           Manufacturer="$(env.MANUFACTURER)"
> +           Version="$(var.Version)"
> +           UpgradeCode="$(var.UpgradeCode)"
> +           Language="1033">
> +
> +    <Package InstallerVersion="200" Compressed="yes" Comments="comments"/>
> +    <Media Id="1" Cabinet="cabinet.cab" EmbedCab="yes"/>
> +
> +    <Property Id="ARPHELPLINK" Value="http://www.virt-tools.org"/>
> +    <Property Id="ARPNOMODIFY" Value="1"/>
> +    <Property Id="ARPNOREPAIR" Value="1"/>
> +    <Property Id="ARPPRODUCTICON" Value="virt-viewer.ico"/>
> +    <Property Id="ARPURLINFOABOUT" Value="http://www.virt-tools.org/about"/>
> +    <Upgrade Id="$(var.UpgradeCode)">
> +      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes"
> Property="NEWERVERSIONDETECTED"/>
> +      <UpgradeVersion Minimum="0.0.0" Maximum="$(var.Version)"
> IncludeMinimum="yes" IncludeMaximum="no"
> Property="OLDERVERSIONBEINGUPGRADED"/>
> +    </Upgrade>
> +    <Condition Message="VirtViewer is already installed.">NOT
> NEWERVERSIONDETECTED</Condition>
> +
> +    <DirectoryRef Id="TARGETDIR">
> +      <Component Id="CRegistryEntries" Guid="*">
> +        <RegistryKey Root='HKLM' Key='Software\Microsoft\Internet
> Explorer\Low Rights\ElevationPolicy\{96190E9D-6FBB-64DB-9095-29F6FDE0B897}'>
> +          <RegistryValue Type='string' Name='AppPath'
> Value='[INSTALLDIR]\bin'/>
> +          <RegistryValue Type='string' Name='AppName'
> Value='remote-viewer.exe'/>
> +          <RegistryValue Type='integer' Name='Policy' Value='3'/>
> +        </RegistryKey>
> +        <RegistryKey Root='HKLM' Key='Software\spice-space.org\spicex'>
> +          <RegistryValue Type='string' Name='client'
> Value='[INSTALLDIR]\bin\remote-viewer.exe --spice-controller'/>
> +        </RegistryKey>
> +      </Component>
> +      <Component Id="CProgIds" Guid="89D6F46D-9C5E-4D65-8456-58FC361E553E">
> +        <ProgId Id='VirtViewer.vvfile' Description='VirtViewer connection
> file'>
> +          <Extension Id='vv' ContentType='application/x-virt-viewer'>
> +            <Verb Id='open' Command='Open'
> TargetFile='fil808B4A5BAB4ACD727D3823632E798743' Argument='"%1"' />
> +            <MIME ContentType="application/x-virt-viewer" Default="yes"/>
> +          </Extension>
> +        </ProgId>
> +      </Component>
> +    </DirectoryRef>
> +
> +    <Directory Id="TARGETDIR" Name="SourceDir">
> +      <Directory Id="$(var.ArchProgramFilesFolder)">
> +        <Directory Id="INSTALLDIR" Name="VirtViewer">
> +          <Component Id="CDepsFile" Guid="*">
> +            <File Id="filA1E799D196006E6DF67DACE15B8C6193" KeyPath="yes"
> Source="deps.txt"/>
> +          </Component>
> +        </Directory>
> +      </Directory>
> +      <Directory Id="ProgramMenuFolder">
> +        <Directory Id="MENUDIR" Name="VirtViewer"/>
> +      </Directory>
> +    </Directory>
> +
> +    <DirectoryRef Id="INSTALLDIR">
> +      <Directory Id="DirShare" Name="share">
> +        <Directory Id="DirHwdata" Name="hwdata">
> +          <Component Id="CHwdataUSB" Guid="*">
> +            <File Id="FHwdataUSB" KeyPath="yes"
> Source="/usr/share/hwdata/usb.ids"/>
> +          </Component>
> +        </Directory>
> +
> +        <Directory Id="DirIcons" Name="icons">
> +          <Directory Id="DirIconsHi" Name="hicolor">
> +            <Directory Id="DirIconsHi16x16" Name="16x16">
> +              <Directory Id="DirIconsHi16x16Apps" Name="apps">
> +                <Component Id="CIconsHi16x16Apps" Guid="*">
> +                  <File Id="FIconskeyboardshortcuts" KeyPath="yes"
> +
> Source="/usr/share/icons/gnome/16x16/apps/preferences-desktop-keyboard-shortcuts.png"/>
> +                </Component>
> +              </Directory>
> +            </Directory>
> +          </Directory>
> +        </Directory>
> +      </Directory>
> +    </DirectoryRef>
> +
> +    <DirectoryRef Id="MENUDIR">
> +      <Component Id="CShortcut" Guid="*">
> +        <Shortcut Id="ApplicationStartMenuShortcut"
> +                  Name="Remote viewer"
> +                  Description="A SPICE/VNC client"
> +                  Target="[INSTALLDIR]\bin\remote-viewer.exe"
> +                  Icon="virt-viewer.ico"/>
> +        <RemoveFolder Id="MENUDIR" On="uninstall"/>
> +        <RegistryValue Root="HKCU"
> Key="Software\VirtViewer\remote-viewer-shortcut" Name="installed"
> Type="integer" Value="1" KeyPath="yes"/>
> +      </Component>
> +    </DirectoryRef>
> +
> +    <Feature Id="Complete"  Level="1">
> +      <ComponentGroupRef Id="CG.spice-gtk3"/>
> +      <ComponentGroupRef Id="CG.libvirt"/>
> +      <ComponentGroupRef Id="CG.gtk-vnc2"/>
> +      <ComponentGroupRef Id="CG.virt-viewer-gtk3"/>
> +      <ComponentRef Id="CDepsFile"/>
> +      <ComponentRef Id="CShortcut"/>
> +      <ComponentRef Id="CRegistryEntries"/>
> +      <ComponentRef Id="CProgIds"/>
> +      <ComponentRef Id="CIconsHi16x16Apps"/>
> +      <ComponentRef Id="CHwdataUSB"/>
> +    </Feature>
> +
> +    <InstallExecuteSequence>
> +      <RemoveExistingProducts After="InstallValidate"/>
> +    </InstallExecuteSequence>
> +
> +    <Icon Id="virt-viewer.ico" SourceFile="../icons/virt-viewer.ico"/>
> +  </Product>
> +</Wix>
> --
> 2.1.0
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 




More information about the virt-tools-list mailing list