From 9ad0cfa87d2368bb8f7aa624e330290fc193458c Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 28 Aug 2016 10:23:16 +0200 Subject: [PATCH] unistall 32bit package on 64bit system --- CLIENT_DATA/delsub3264.ins | 50 +++++++++++++++++++++++++++++++++++ CLIENT_DATA/setup3264.ins | 4 +++ CLIENT_DATA/uninstall3264.ins | 4 +++ 3 files changed, 58 insertions(+) diff --git a/CLIENT_DATA/delsub3264.ins b/CLIENT_DATA/delsub3264.ins index fe6033e..955ee00 100644 --- a/CLIENT_DATA/delsub3264.ins +++ b/CLIENT_DATA/delsub3264.ins @@ -16,12 +16,24 @@ if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specif endif Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 32 Bit..." if FileExists($IniFile32$) + Set $MsiIdLegacyHelpDe32$ = GetValueFromInifile($IniFile32$,"X86","MsiIdHelpDe","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdLegacyHelpDe32$ + "] DisplayName") = "") + comment "Legacy MSI id " + $MsiIdLegacyHelpDe32$ + " found in registry, starting msiexec to uninstall legacy version" + Winbatch_uninstall_msi_legacy_help_de_32 + sub_check_exitcode + endif Set $MsiIdOldHelpDe32$ = GetValueFromInifile($IniFile32$,"X86","MsiIdHelpDe32","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOldHelpDe32$ + "] DisplayName") = "") comment "Old MSI id " + $MsiIdOldHelpDe32$ + " found in registry, starting msiexec to uninstall old version" Winbatch_uninstall_msi_old_help_de_32 sub_check_exitcode endif + Set $MsiIdLegacy32$ = GetValueFromInifile($IniFile32$,"X86","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdLegacy32$ + "] DisplayName") = "") + comment "Legacy MSI id " + $MsiIdLegacy32$ + " found in registry, starting msiexec to uninstall legacy version" + Winbatch_uninstall_msi_legacy_32 + sub_check_exitcode + endif Set $MsiIdOld32$ = GetValueFromInifile($IniFile32$,"X86","MsiId32","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld32$ + "] DisplayName") = "") comment "Old MSI id " + $MsiIdOld32$ + " found in registry, starting msiexec to uninstall old version" @@ -54,13 +66,39 @@ if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system spe endif Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 64 Bit..." + if FileExists($IniFile32$) + Set $MsiIdLegacyHelpDe64$ = GetValueFromInifile($IniFile32$,"X86","MsiIdHelpDe","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdLegacyHelpDe64$ + "] DisplayName") = "") + comment "Legacy MSI id " + $MsiIdLegacyHelpDe64$ + " found in registry, starting msiexec to uninstall legacy version" + Winbatch_uninstall_msi_legacy_help_de_64 + sub_check_exitcode + endif + Set $MsiIdLegacy64$ = GetValueFromInifile($IniFile32$,"X86","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdLegacy64$ + "] DisplayName") = "") + comment "Legacy MSI id " + $MsiIdLegacy64$ + " found in registry, starting msiexec to uninstall legacy version" + Winbatch_uninstall_msi_legacy_64 + sub_check_exitcode + endif + endif if FileExists($IniFile64$) + Set $MsiIdLegacyHelpDe64$ = GetValueFromInifile($IniFile64$,"X86_64","MsiIdHelpDe","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdLegacyHelpDe64$ + "] DisplayName") = "") + comment "Legacy MSI id " + $MsiIdLegacyHelpDe64$ + " found in registry, starting msiexec to uninstall legacy version" + Winbatch_uninstall_msi_legacy_help_de_64 + sub_check_exitcode + endif Set $MsiIdOldHelpDe64$ = GetValueFromInifile($IniFile64$,"X86_64","MsiIdHelpDe64","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOldHelpDe64$ + "] DisplayName") = "") comment "Old MSI id " + $MsiIdOldHelpDe64$ + " found in registry, starting msiexec to uninstall old version" Winbatch_uninstall_msi_old_help_de_64 sub_check_exitcode endif + Set $MsiIdLegacy64$ = GetValueFromInifile($IniFile64$,"X86_64","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdLegacy64$ + "] DisplayName") = "") + comment "Legacy MSI id " + $MsiIdLegacy64$ + " found in registry, starting msiexec to uninstall legacy version" + Winbatch_uninstall_msi_legacy_64 + sub_check_exitcode + endif Set $MsiIdOld64$ = GetValueFromInifile($IniFile64$,"X86_64","MsiId64","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld64$ + "] DisplayName") = "") comment "Old MSI id " + $MsiIdOld64$ + " found in registry, starting msiexec to uninstall old version" @@ -88,6 +126,12 @@ endif comment "Delete program shortcuts" LinkFolder_uninstall +[Winbatch_uninstall_msi_legacy_help_de_32] +msiexec /x $MsiIdLegacyHelpDe32$ /qb! REBOOT=ReallySuppress + +[Winbatch_uninstall_msi_legacy_32] +msiexec /x $MsiIdLegacy32$ /qb! REBOOT=ReallySuppress + [Winbatch_uninstall_msi_old_help_de_32] msiexec /x $MsiIdOldHelpDe32$ /qb! REBOOT=ReallySuppress @@ -105,6 +149,12 @@ msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress ; delete -sf "$InstallDir32$\" +[Winbatch_uninstall_msi_legacy_help_de_64] +msiexec /x $MsiIdLegacyHelpDe64$ /qb! REBOOT=ReallySuppress + +[Winbatch_uninstall_msi_legacy_64] +msiexec /x $MsiIdLegacy64$ /qb! REBOOT=ReallySuppress + [Winbatch_uninstall_msi_old_help_de_64] msiexec /x $MsiIdOldHelpDe64$ /qb! REBOOT=ReallySuppress diff --git a/CLIENT_DATA/setup3264.ins b/CLIENT_DATA/setup3264.ins index c616dd8..a44bc0f 100644 --- a/CLIENT_DATA/setup3264.ins +++ b/CLIENT_DATA/setup3264.ins @@ -6,6 +6,10 @@ [Actions] requiredWinstVersion >= "4.11.2.6" +DefVar $MsiIdLegacy32$ +DefVar $MsiIdLegacyHelpDe32$ +DefVar $MsiIdLegacy64$ +DefVar $MsiIdLegacyHelpDe64$ DefVar $MsiIdOld32$ DefVar $MsiIdOldHelpDe32$ DefVar $MsiIdOld64$ diff --git a/CLIENT_DATA/uninstall3264.ins b/CLIENT_DATA/uninstall3264.ins index a171cab..a44f792 100644 --- a/CLIENT_DATA/uninstall3264.ins +++ b/CLIENT_DATA/uninstall3264.ins @@ -6,6 +6,10 @@ [Actions] requiredWinstVersion >= "4.11.2.6" +DefVar $MsiIdLegacy32$ +DefVar $MsiIdLegacyHelpDe32$ +DefVar $MsiIdLegacy64$ +DefVar $MsiIdLegacyHelpDe64$ DefVar $MsiIdOld32$ DefVar $MsiIdOldHelpDe32$ DefVar $MsiIdOld64$