From 18eb710818f5cf327515a19c6dd5a0f4db8875c1 Mon Sep 17 00:00:00 2001 From: dolphin6k Date: Thu, 21 Oct 2021 17:59:38 +0900 Subject: [PATCH] [CRITICAL] Abort installation after the suggestion to uninstall old version when previous installation to 'Program Files (x86)' Folder detected. It seems to work, but very carefull test required. --- win32/tuxpaint.iss | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/win32/tuxpaint.iss b/win32/tuxpaint.iss index fdd056b0f..452ebf02d 100644 --- a/win32/tuxpaint.iss +++ b/win32/tuxpaint.iss @@ -242,6 +242,18 @@ begin Result := Path; end; +Procedure ForceUninstallPreviousX86Install(); +var + Version: String; +begin + if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\WOW6432Node\TuxPaint', + 'Version', Version) then + begin + MsgBox('Please uninstall previous version.', mbInformation, MB_OK); + Abort; + end; +end; + procedure CreateTheWizardPages; var Page: TWizardPage; @@ -530,6 +542,7 @@ end; procedure InitializeWizard(); begin begin + ForceUninstallPreviousX86Install(); CreateTheWizardPages; end end;