qemu-ga: Fixes to the QEMU GA MSI installer
v3 cover qemu-ga: Fixes to the QEMU GA MSI installer
The main purpose here is to fix a bug that caused the QEMU GA VSS service to be unregistered on reinstallation using the .msi file.
Also, two fixes are introduced to the .wxs file, which is used to create the MSI with Wixl: GUID capitalization and introduction of a separate component for each of the installed files. This is done to better comply with Microsoft's recommendations. Additionally, minor cosmetic changes are introduced. Please also note the other two related small changes that I sent to the Trivial Patches list before:
http://lists.nongnu.org/archive/html/qemu-trivial/2015-07/msg00112.html
http://lists.nongnu.org/archive/html/qemu-trivial/2015-07/msg00111.html
Leonid Bloch (4):
qemu-ga: Fixed GUID capitalization
qemu-ga: Minor cosmetic changes to the WXS file
qemu-ga: Created a separate component for each installed file in the
MSI
qemu-ga: Prevent QEMU-GA VSS provider from being unregistered on MSI
reinstall
qga/installer/qemu-ga.wxs | 73 ++++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 26 deletions(-)
Signature · 1 line
2.4.3
PATCH v3 1/4 qemu-ga: Fixed GUID capitalization
For compatibility, all the letters in GUID should be capital.
--- qga/installer/qemu-ga.wxs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
qga/installer/qemu-ga.wxs +3 -3
@@ -42,7 +42,7 @@ <Product Name="QEMU guest agent" Id="*" - UpgradeCode="{EB6B8302-C06E-4bec-ADAC-932C68A3A98D}" + UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}" Manufacturer="$(env.QEMU_GA_MANUFACTURER)" Version="$(env.QEMU_GA_VERSION)" Language="1033">
@@ -69,7 +69,7 @@ <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="$(var.GaProgramFilesFolder)" Name="QEMU Guest Agent"> <Directory Id="qemu_ga_directory" Name="Qemu-ga"> - <Component Id="qemu_ga" Guid="{908B7199-DE2A-4dc6-A8D0-27A5AE444FEA}"> + <Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}"> <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="../../qemu-ga.exe" KeyPath="yes" DiskId="1"/> <?ifdef var.InstallVss ?> <File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="no" DiskId="1"/>
@@ -98,7 +98,7 @@ <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="QEMU-GA" Wait="no" /> </Component> - <Component Id="registry_entries" Guid="d075d109-51ca-11e3-9f8b-000c29858960"> + <Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}"> <RegistryKey Root="HKLM" Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA"> <RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
Signature · 1 line
2.4.3
PATCH v3 2/4 qemu-ga: Minor cosmetic changes to the WXS file
In reply to Leonid Bloch--- qga/installer/qemu-ga.wxs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
qga/installer/qemu-ga.wxs +3 -3
@@ -111,9 +111,9 @@ <Property Id="cmd" Value="cmd.exe"/> - <?ifdef var.InstallVss ?> + <?ifdef var.InstallVss?> <CustomAction Id="RegisterCom" - ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-install' + ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-install' Execute="deferred" Property="cmd" Impersonate="no"
@@ -136,7 +136,7 @@ <InstallExecuteSequence> <RemoveExistingProducts Before="InstallInitialize" /> - <?ifdef var.InstallVss ?> + <?ifdef var.InstallVss?> <Custom Action="RegisterCom" After="InstallServices">NOT Installed</Custom> <Custom Action="UnRegisterCom" After="StopServices">Installed</Custom> <?endif?>
Signature · 1 line
2.4.3
PATCH v3 3/4 qemu-ga: Created a separate component for each installed file in the MSI
In reply to Leonid BlochThis is done to follow the recommendations given here: https://msdn.microsoft.com/en-us/library/aa368269%28VS.85%29.aspx
--- qga/installer/qemu-ga.wxs | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-)
qga/installer/qemu-ga.wxs +36 -11
@@ -71,16 +71,6 @@ <Directory Id="qemu_ga_directory" Name="Qemu-ga"> <Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}"> <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="../../qemu-ga.exe" KeyPath="yes" DiskId="1"/> - <?ifdef var.InstallVss ?> - <File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="no" DiskId="1"/> - <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="../vss-win32/qga-vss.tlb" KeyPath="no" DiskId="1"/> - <?endif?> - <File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="no" DiskId="1"/> - <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="no" DiskId="1"/> - <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="no" DiskId="1"/> - <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="no" DiskId="1"/> - <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="no" DiskId="1"/> - <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="no" DiskId="1"/> <ServiceInstall Id="ServiceInstaller" Type="ownProcess"
@@ -97,7 +87,32 @@ </ServiceInstall> <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="QEMU-GA" Wait="no" /> </Component> - + <?ifdef var.InstallVss?> + <Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}"> + <File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/> + </Component> + <Component Id="qga_vss_tlb" Guid="{D8D584B1-59C2-4FB7-A91F-636FF7BFA66E}"> + <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="../vss-win32/qga-vss.tlb" KeyPath="yes" DiskId="1"/> + </Component> + <?endif?> + <Component Id="iconv" Guid="{35EE3558-D34B-4F0A-B8BD-430FF0775246}"> + <File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="yes" DiskId="1"/> + </Component> + <Component Id="libgcc_arch_lib" Guid="{ADD4D07D-4515-4AB6-AF3E-C904961B4BB0}"> + <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="yes" DiskId="1"/> + </Component> + <Component Id="libglib" Guid="{D31BFD83-2773-4B65-B45A-E0D2ADA58679}"> + <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="yes" DiskId="1"/> + </Component> + <Component Id="libintl" Guid="{A641BC2D-A907-4A94-9149-F30ED430878F}"> + <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="yes" DiskId="1"/> + </Component> + <Component Id="libssp" Guid="{7880087B-02B4-4EF6-A5D3-D18F8E3D90E1}"> + <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="yes" DiskId="1"/> + </Component> + <Component Id="libwinpthread" Guid="{6C117C78-0F47-4B07-8F34-6BEE11643829}"> + <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="yes" DiskId="1"/> + </Component> <Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}"> <RegistryKey Root="HKLM" Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
@@ -131,6 +146,16 @@ <Feature Id="QEMUFeature" Title="QEMU Guest Agent" Level="1"> <ComponentRef Id="qemu_ga" /> + <?ifdef var.InstallVss?> + <ComponentRef Id="qga_vss_dll" /> + <ComponentRef Id="qga_vss_tlb" /> + <?endif?> + <ComponentRef Id="iconv" /> + <ComponentRef Id="libgcc_arch_lib" /> + <ComponentRef Id="libglib" /> + <ComponentRef Id="libintl" /> + <ComponentRef Id="libssp" /> + <ComponentRef Id="libwinpthread" /> <ComponentRef Id="registry_entries" /> </Feature>
Signature · 1 line
2.4.3
Re: [Qemu-devel] [PATCH v3 3/4] qemu-ga: Created a separate component for each installed file in the MSI
You could just use generated GUID with * now, with that Reviewed-by:
Marc-André Lureau <[email protected]>
Re: [Qemu-devel] [PATCH v3 3/4] qemu-ga: Created a separate component for each installed file in the MSI
In reply to Leonid BlochQuoting Leonid Bloch (2015-08-03 12:54:23)
Quoted 29 lines
This is done to follow the recommendations given here: https://msdn.microsoft.com/en-us/library/aa368269%28VS.85%29.aspx
Signed-off-by Leonid Bloch <[email protected]>--- qga/installer/qemu-ga.wxs | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-)qga/installer/qemu-ga.wxs +0
-10@@ -71,16 +71,6 @@ <Directory Id="qemu_ga_directory" Name="Qemu-ga"> <Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}"> <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="../../qemu-ga.exe" KeyPath="yes" DiskId="1"/> - <?ifdef var.InstallVss ?> - <File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="no" DiskId="1"/> - <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="../vss-win32/qga-vss.tlb" KeyPath="no" DiskId="1"/> - <?endif?> - <File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="no" DiskId="1"/> - <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="no" DiskId="1"/> - <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="no" DiskId="1"/> - <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="no" DiskId="1"/> - <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="no" DiskId="1"/> - <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="no" DiskId="1"/> <ServiceInstall Id="ServiceInstaller" Type="ownProcess"
qga/installer/qemu-ga.wxs line 92
Quoted 7 lines
qga/installer/qemu-ga.wxs +3
-1@@ -97,7 +87,32 @@ </ServiceInstall> <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="QEMU-GA" Wait="no" /> </Component> - + <?ifdef var.InstallVss?> + <Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}"> + <File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/>
Is there a reason these paths are seemingly relative to qga/installer/qemu-ga.wxs? I'd imagine that works for running wixl command within that directly, but top-level Makefile 'msi' ends up bombing if I do 'make msi':
[mdroth@vm4 qemu-build-w64]$ ../w/qemu4.git/configure --cross-prefix=x86_64-w64-mingw32- \
--with-vss-sdk=/home/mdroth/w/vss-win32/ --target-list=x86_64-softmmu --extra-cflags=-Wall --enable-guest-agent --enable-guest-agent-msi
...
[mdroth@vm4 qemu-build-w64]$ make -j4 qemu
...
CC trace/generated-events.o AR libqemustub.a CC qemu-img.o CC qmp-marshal.o AR libqemuutil.a LINK qemu-ga.exe LINK qemu-img.exe LINK qemu-io.exe
...
[mdroth@vm4 qemu-build-w64]$ make msi
LEX convert-dtsv0-lexer.lex.c
make[1]: flex: Command not found
BISON dtc-parser.tab.c
make[1]: bison: Command not found
LEX dtc-lexer.lex.c
make[1]: flex: Command not found
WIXL qemu-ga-x86_64.msi
Couldn't find file ../../qemu-ga.exe
make: *** [qemu-ga-x86_64.msi] Error 1
The fix seems simple enough, but I want to make sure I'm not doing something stupid and have some idea of how people are using the current MSI installer code.
Re: [Qemu-devel] [PATCH v3 3/4] qemu-ga: Created a separate component for each installed file in the MSI
Quoting Michael Roth (2015-08-25 16:48:25)
Quoted 33 lines
Quoting Leonid Bloch (2015-08-03 12:54:23)
Quoted 32 lines
This is done to follow the recommendations given here: https://msdn.microsoft.com/en-us/library/aa368269%28VS.85%29.aspx
Signed-off-by Leonid Bloch <[email protected]>--- qga/installer/qemu-ga.wxs | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-)qga/installer/qemu-ga.wxs +0
-10@@ -71,16 +71,6 @@ <Directory Id="qemu_ga_directory" Name="Qemu-ga"> <Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}"> <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="../../qemu-ga.exe" KeyPath="yes" DiskId="1"/> - <?ifdef var.InstallVss ?> - <File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="no" DiskId="1"/> - <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="../vss-win32/qga-vss.tlb" KeyPath="no" DiskId="1"/> - <?endif?> - <File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="no" DiskId="1"/> - <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="no" DiskId="1"/> - <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="no" DiskId="1"/> - <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="no" DiskId="1"/> - <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="no" DiskId="1"/> - <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="no" DiskId="1"/> <ServiceInstall Id="ServiceInstaller" Type="ownProcess"@@ -97,7 +87,32 @@ </ServiceInstall> <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="QEMU-GA" Wait="no" /> </Component>
Quoted 8 lines
qga/installer/qemu-ga.wxs line 92
Quoted 4 lines
qga/installer/qemu-ga.wxs +3
-1- + <?ifdef var.InstallVss?> + <Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}"> + <File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/>Is there a reason these paths are seemingly relative to qga/installer/qemu-ga.wxs? I'd imagine that works for running wixl command within that directly, but top-level
Makefile'msi' ends up
*'msi' target
*within that directory
Quoted 8 lines
bombing if I do 'make msi':
[mdroth@vm4 qemu-build-w64]$ ../w/qemu4.git/configure --cross-prefix=x86_64-w64-mingw32- \
--with-vss-sdk=/home/mdroth/w/vss-win32/ --target-list=x86_64-softmmu --extra-cflags=-Wall --enable-guest-agent --enable-guest-agent-msi
...[mdroth@vm4 qemu-build-w64]$ make -j4 qemu
make -j4 was the command, not sure how that 'qemu' slipped in.
Quoted 27 lines
...
CC trace/generated-events.o AR libqemustub.a CC qemu-img.o CC qmp-marshal.o AR libqemuutil.a LINK qemu-ga.exe LINK qemu-img.exe LINK qemu-io.exe...
[mdroth@vm4 qemu-build-w64]$ make msi
LEXconvert-dtsv0-lexer.lex.c
make[1]: flex: Command not found
BISONdtc-parser.tab.c
make[1]: bison: Command not found
LEXdtc-lexer.lex.c
make[1]: flex: Command not found
WIXL qemu-ga-x86_64.msi
Couldn't find file ../../qemu-ga.exe
make: *** [qemu-ga-x86_64.msi] Error 1The fix seems simple enough, but I want to make sure I'm not doing something stupid and have some idea of how people are using the current MSI installer code.
Re: [Qemu-devel] [PATCH v3 3/4] qemu-ga: Created a separate component for each installed file in the MSI
In reply to Michael RothThanks for pointing that out, Michael!
This indeed happens when configure is called out of tree. But this bug was not introduced with this series of patches, so it is irrelevant here.
We will issue another patch to address it shortly.
Thanks again,
Leonid.
Quoted 75 lines · Michael Roth
Quoting Leonid Bloch (2015-08-03 12:54:23)
Quoted 29 lines
This is done to follow the recommendations given here: https://msdn.microsoft.com/en-us/library/aa368269%28VS.85%29.aspx
Signed-off-by Leonid Bloch <[email protected]>--- qga/installer/qemu-ga.wxs | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-)qga/installer/qemu-ga.wxs +0
-10@@ -71,16 +71,6 @@ <Directory Id="qemu_ga_directory" Name="Qemu-ga"> <Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}"> <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="../../qemu-ga.exe" KeyPath="yes" DiskId="1"/> - <?ifdef var.InstallVss ?> - <File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="no" DiskId="1"/> - <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="../vss-win32/qga-vss.tlb" KeyPath="no" DiskId="1"/> - <?endif?> - <File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="no" DiskId="1"/> - <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="no" DiskId="1"/> - <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="no" DiskId="1"/> - <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="no" DiskId="1"/> - <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="no" DiskId="1"/> - <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="no" DiskId="1"/> <ServiceInstall Id="ServiceInstaller" Type="ownProcess"qga/installer/qemu-ga.wxs line 92
Quoted 7 lines
qga/installer/qemu-ga.wxs +3
-1@@ -97,7 +87,32 @@ </ServiceInstall> <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="QEMU-GA" Wait="no" /> </Component> - + <?ifdef var.InstallVss?> + <Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}"> + <File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/>Is there a reason these paths are seemingly relative to qga/installer/qemu-ga.wxs? I'd imagine that works for running wixl command within that directly, but top-level
Makefile'msi' ends up bombing if I do 'make msi':[mdroth@vm4 qemu-build-w64]$ ../w/qemu4.git/configure --cross-prefix=x86_64-w64-mingw32- \
--with-vss-sdk=/home/mdroth/w/vss-win32/ --target-list=x86_64-softmmu --extra-cflags=-Wall --enable-guest-agent --enable-guest-agent-msi
...[mdroth@vm4 qemu-build-w64]$ make -j4 qemu
...CC trace/generated-events.o AR libqemustub.a CC qemu-img.o CC qmp-marshal.o AR libqemuutil.a LINK qemu-ga.exe LINK qemu-img.exe LINK qemu-io.exe...
[mdroth@vm4 qemu-build-w64]$ make msi
LEXconvert-dtsv0-lexer.lex.c
make[1]: flex: Command not found
BISONdtc-parser.tab.c
make[1]: bison: Command not found
LEXdtc-lexer.lex.c
make[1]: flex: Command not found
WIXL qemu-ga-x86_64.msi
Couldn't find file ../../qemu-ga.exe
make: *** [qemu-ga-x86_64.msi] Error 1The fix seems simple enough, but I want to make sure I'm not doing something stupid and have some idea of how people are using the current MSI installer code.
PATCH v3 4/4 qemu-ga: Prevent QEMU-GA VSS provider from being unregistered on MSI reinstall
In reply to Leonid BlochPreviously, 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.
--- qga/installer/qemu-ga.wxs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
qga/installer/qemu-ga.wxs +5 -9
@@ -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">
@@ -125,6 +121,7 @@ </Directory> <Property Id="cmd" Value="cmd.exe"/> + <Property Id="REINSTALLMODE" Value="amus"/> <?ifdef var.InstallVss?> <CustomAction Id="RegisterCom"
@@ -160,10 +157,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>
Signature · 1 line
2.4.3
Re: [Qemu-devel] [PATCH v3 4/4] qemu-ga: Prevent QEMU-GA VSS provider from being unregistered on MSI reinstall
Quoted 53 lines · Leonid Bloch
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 <[email protected]>--- qga/installer/qemu-ga.wxs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)qga/installer/qemu-ga.wxs +5
-10@@ -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">@@ -125,6 +121,7 @@ </Directory> <Property Id="cmd" Value="cmd.exe"/> + <Property Id="REINSTALLMODE" Value="amus"/> <?ifdef var.InstallVss?> <CustomAction Id="RegisterCom"@@ -160,10 +157,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> --2.4.3
Signature · 1 line
Marc-André Lureau
Quoting Leonid Bloch (2015-08-03 12:54:20)
Quoted 6 lines
The main purpose here is to fix a bug that caused the QEMU GA VSS service to be unregistered on reinstallation using the .msi file.
Also, two fixes are introduced to the .wxs file, which is used to create the MSI with Wixl: GUID capitalization and introduction of a separate component for each of the installed files. This is done to better comply with Microsoft's recommendations. Additionally, minor cosmetic changes are introduced. Please also note the other two related small changes that I sent to the Trivial Patches list before:
http://lists.nongnu.org/archive/html/qemu-trivial/2015-07/msg00112.html
http://lists.nongnu.org/archive/html/qemu-trivial/2015-07/msg00111.html
Quoted 7 lines
Leonid Bloch (4):
qemu-ga: Fixed GUID capitalization
qemu-ga: Minor cosmetic changes to the WXS file
qemu-ga: Created a separate component for each installed file in the
MSI
qemu-ga: Prevent QEMU-GA VSS provider from being unregistered on MSI
reinstall
I have this series, along with:
qemu-ga: Add .msi files to .gitignore
qemu-ga: Two MSI related cosmetic changes
applied to qga-dev. Need to work out kinks in win32/msi build before I can adequately test and send a pull request though:
https://github.com/mdroth/qemu/tree/qga-dev
Quoted 8 lines
qga/installer/qemu-ga.wxs | 73 ++++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 26 deletions(-)Signature · 1 line
2.4.3
Michael Roth
AppliedQuoting Leonid Bloch (2015-08-03 12:54:20)
Quoted 6 lines
The main purpose here is to fix a bug that caused the QEMU GA VSS service to be unregistered on reinstallation using the .msi file.
Also, two fixes are introduced to the .wxs file, which is used to create the MSI with Wixl: GUID capitalization and introduction of a separate component for each of the installed files. This is done to better comply with Microsoft's recommendations. Additionally, minor cosmetic changes are introduced. Please also note the other two related small changes that I sent to the Trivial Patches list before:
http://lists.nongnu.org/archive/html/qemu-trivial/2015-07/msg00112.html
http://lists.nongnu.org/archive/html/qemu-trivial/2015-07/msg00111.html
Quoted 7 lines
Leonid Bloch (4):
qemu-ga: Fixed GUID capitalization
qemu-ga: Minor cosmetic changes to the WXS file
qemu-ga: Created a separate component for each installed file in the
MSI
qemu-ga: Prevent QEMU-GA VSS provider from being unregistered on MSI
reinstall
Thanks, applied to qga tree:
https://github.com/mdroth/qemu/commits/qga
Quoted 8 lines
qga/installer/qemu-ga.wxs | 73 ++++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 26 deletions(-)Signature · 1 line
2.4.3