Wininstaller, fix bug where previous installations, with emergency version greater than 1, could not be seen in registry on overinstall

This commit is contained in:
Eugene Chornyi 2020-07-07 21:13:34 +02:00
parent 328c70a31a
commit 32e501a282

View File

@ -660,13 +660,17 @@ Function .onInit
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion" ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
# also check for an emergency release # also check for an emergency release
${if} $0 == "" ${if} $0 == ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion" ${For} $7 0 20
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5$7" "DisplayVersion"
${Next}
${endif} ${endif}
${else} ${else}
ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion" ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
# also check for an emergency release # also check for an emergency release
${if} $0 == "" ${if} $0 == ""
ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion" ${For} $7 0 20
ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5$7" "DisplayVersion"
${Next}
${endif} ${endif}
${endif} ${endif}
${if} $0 != "" ${if} $0 != ""