; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/
Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini"
Set $IniFile64$ = $InstallDir64$ + "\opsi-" + $ProductId$ + ".ini"
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
if FileExists($IniFile32$)
Set $OLD_VERSION$ = GetValueFromInifile($IniFile32$,"COMMON","VERSION","")
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile32$,"COMMON","CREATOR_TAG","")
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile32$,"COMMON","RELEASE","")
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"
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOldHelpDe32$ + "] DisplayName") = "")
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"
Winbatch_uninstall_msi_old_32
sub_check_exitcode
endif
endif
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdHelpDe32$ + "] DisplayName") = "")
comment "MSI id " + $MsiId32HelpDe$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall_msi_help_de_32
sub_check_exitcode
endif
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId32$ + "] DisplayName") = "")
comment "MSI id " + $MsiId32$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall_msi_32
sub_check_exitcode
endif
comment "Delete files"
Files_uninstall_32 /32Bit
comment "Cleanup registry"
Registry_uninstall /32Bit
endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
if FileExists($IniFile64$)
Set $OLD_VERSION$ = GetValueFromInifile($IniFile64$,"COMMON","VERSION","")
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile64$,"COMMON","CREATOR_TAG","")
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile64$,"COMMON","RELEASE","")
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"
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"