From 9ad6ea965341f4f6401a3fce7a032a85147951b7 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 15 Nov 2012 11:38:57 +0000 Subject: [PATCH] The windows installer now asks to run the uninstaller if an existing STK installation is found, and will not install otherwise. This avoids problems when installing a new stk on top of an older stk installation (e.g. old tracks might show up in new installation, but not work). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11953 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/windows_installer/supertuxkart.nsi | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/windows_installer/supertuxkart.nsi b/src/windows_installer/supertuxkart.nsi index 7305510b8..7ed138747 100644 --- a/src/windows_installer/supertuxkart.nsi +++ b/src/windows_installer/supertuxkart.nsi @@ -56,12 +56,29 @@ !define MUI_ABORTWARNING +;-------------------------------- +Function validate_dir + IfFileExists $INSTDIR\data\*.* 0 return + IfFileExists $INSTDIR\Uninstall.exe 0 dont_uninstall + MessageBox MB_YESNO "You can't install SuperTuxKart 0.8 in an existing directory. Do you wish to run the uninstaller in $INSTDIR?" IDNO dont_uninstall + ; -?=$INSTDIR makes sure that this installer waits for the uninstaller + ; to finish. The uninstaller (and directory) are not removed, but the + ; uninstaller will be overwritten by our installer anyway. + ExecWait '"$INSTDIR\Uninstall.exe" _?=$INSTDIR' + goto return + dont_uninstall: + MessageBox MB_OK "You can't install SuperTuxKart 0.8 in an existing directory. Please select a new directory." + abort + return: +FunctionEnd ;-------------------------------- ;Pages ;Installer pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "SuperTuxKart\License.txt" + + !define MUI_PAGE_CUSTOMFUNCTION_LEAVE validate_dir !insertmacro MUI_PAGE_DIRECTORY ;Start Menu Folder Page Configuration @@ -92,7 +109,7 @@ Section "Main Section" SecMain SetOutPath "$INSTDIR" - ;Adds all the tux kart files + ; Adds all SuperTuxKart files File /r supertuxkart\*.* ;Store installation folder