diff options
author | Kostiantyn Kostiuk <kkostiuk@redhat.com> | 2025-08-25 17:31:55 +0300 |
---|---|---|
committer | Kostiantyn Kostiuk <kkostiuk@redhat.com> | 2025-09-01 14:02:18 +0300 |
commit | 85ff0e956bf26a93c92e4dca8f6257613269a0cf (patch) | |
tree | b85553c2c0218de51c34f469fe1a8c9a0cd99725 | |
parent | edf3780a7dad4658ab7b72ea37e310a2be9b16d3 (diff) | |
download | qemu-85ff0e956bf26a93c92e4dca8f6257613269a0cf.zip qemu-85ff0e956bf26a93c92e4dca8f6257613269a0cf.tar.gz qemu-85ff0e956bf26a93c92e4dca8f6257613269a0cf.tar.bz2 |
qga/installer: Remove QGA VSS if QGA installation failed
When QGA Installer failed to install QGA service but install
QGA VSS provider, provider should be removed before installer
exits. Otherwise QGA VSS will has broken infomation and
prevent QGA installation in next run.
Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250825143155.160913-1-kkostiuk@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
-rw-r--r-- | qga/installer/qemu-ga.wxs | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs index df572ad..32b8308 100644 --- a/qga/installer/qemu-ga.wxs +++ b/qga/installer/qemu-ga.wxs @@ -151,6 +151,14 @@ Return="check" > </CustomAction> + <CustomAction Id="UnRegisterCom_Rollback" + ExeCommand='"[qemu_ga_directory]qga-vss.dll",DLLCOMUnregister' + Execute="rollback" + Property="rundll" + Impersonate="no" + Return="check" + > + </CustomAction> <?endif?> <Feature Id="QEMUFeature" Title="QEMU Guest Agent" Level="1"> @@ -174,8 +182,19 @@ <InstallExecuteSequence> <?ifdef var.InstallVss?> - <Custom Action="UnRegisterCom" After="StopServices">Installed</Custom> - <Custom Action="RegisterCom" After="InstallServices">NOT REMOVE</Custom> + <!-- Use explicit Sequence number to provide an absolute position in the sequence--> + <!-- This is needed to set "UnRegisterCom_Rollback" before "RegisterCom" and after "InstallFiles"--> + <!-- but, Wix detect this double condition incorrectly --> + + <!-- UnRegisterCom_Rollback (for install rollback): at 5849, right before RegisterCom (5850)--> + <!-- Runs only if the installation fails and rolls back--> + <Custom Action="UnRegisterCom_Rollback" Sequence="5849">NOT REMOVE</Custom> + + <!-- RegisterCom (for install): at 5850, right after InstallFiles (5849) (old: After="InstallServices")--> + <Custom Action="RegisterCom" Sequence="5850">NOT REMOVE</Custom> + + <!-- UnRegisterCom (for uninstall): at 1901, right after StopServices (1900) (old: After="StopServices")--> + <Custom Action="UnRegisterCom" Sequence="1901">Installed</Custom> <?endif?> </InstallExecuteSequence> </Product> |