From 489f0fd06610697ef5979f347e38c8c7e59cc533 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 29 May 2023 15:07:44 +1000 Subject: [PATCH] Continue with install if old installer fails User may have manually removed files, or the installation may be corrupt. https://forums.ankiweb.net/t/installing-anki-when-there-seems-to-be-a-previous-version/30621 --- qt/bundle/win/anki.template.nsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qt/bundle/win/anki.template.nsi b/qt/bundle/win/anki.template.nsi index 730cbc444..e0f3173a1 100644 --- a/qt/bundle/win/anki.template.nsi +++ b/qt/bundle/win/anki.template.nsi @@ -170,10 +170,18 @@ Section "" ${IF} $0 != "" ; old value exists, we want to inform the user that a manual uninstall is required first and then start the uninstall.exe MessageBox MB_ICONEXCLAMATION|MB_OK "A previous Anki version needs to be uninstalled first. After uninstallation completes, please run this installer again." + ClearErrors ExecShell "open" "$0\uninstall.exe" + IfErrors shellError Quit + ${ELSE} + goto notOldUpgrade ${ENDIF} + shellError: + MessageBox MB_OK|MB_ICONEXCLAMATION "Failed to uninstall the old version of Anki. Proceeding with installation." + notOldUpgrade: + Call removeManifestFiles ; Set output path to the installation directory.