# HG changeset patch # User John Donoghue # Date 1415500139 18000 # Node ID 8c11c5a1a9395e498c47579eebe4e914e7c93f24 # Parent 5e79ab51035f09c61d2d98e145c207f228e67f1e Prevent octave install to path with spaces * makeinst-script.sh: check for spaces destination directory in NSIS installer and notify user to not install there. diff -r 5e79ab51035f -r 8c11c5a1a939 makeinst-script.sh --- a/makeinst-script.sh Fri Nov 07 23:37:30 2014 -0500 +++ b/makeinst-script.sh Sat Nov 08 21:28:59 2014 -0500 @@ -104,7 +104,7 @@ Page custom octaveOptionsPage octaveOptionsLeave -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckPrevInstall +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckPrevInstallAndDest !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES @@ -428,13 +428,36 @@ Pop \$0 FunctionEnd -; Check whether prev install is here -Function CheckPrevInstall +; Check whether prev install is here and no spaces in dest name +Function CheckPrevInstallAndDest IfFileExists "\$INSTDIR\\bin\\octave.exe" inst_exists inst_none inst_exists: MessageBox MB_YESNO|MB_ICONEXCLAMATION "Another Octave installation has been detected at that destination. It is recommended to uninstall it if you intend to use the same installation directory. Do you want to proceed with the installation anyway?" IDYES inst_none IDNO 0 Abort + GoTo inst_end inst_none: + + + ; check for spaces in dest filename + Push \$R0 + Push \$R1 + + StrCpy \$R1 0 # r1 = counter +space_loop: + StrCpy \$R0 \$INSTDIR 1 \$R1 # R0 = character in string to check + StrCmp \$R0 "" space_end # end of string + StrCmp \$R0 " " space_found + IntOp \$R1 \$R1 + 1 + GoTo space_loop +space_found: + MessageBox MB_OK|MB_ICONEXCLAMATION "Octave should not be installed to a destination folder containing spaces. Please select another destination." + Abort +space_end: + Pop \$R1 + Pop \$R0 + +inst_end: + FunctionEnd ; Function to check Java Runtime Environment