Mercurial > mxe-octave
comparison makeinst-script.sh @ 3728:8c11c5a1a939
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.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Sat, 08 Nov 2014 21:28:59 -0500 |
parents | 70480095b6ed |
children | 7a6637aa3aae |
comparison
equal
deleted
inserted
replaced
3727:5e79ab51035f | 3728:8c11c5a1a939 |
---|---|
102 !define MUI_LICENSEPAGE_BUTTON "Next >" | 102 !define MUI_LICENSEPAGE_BUTTON "Next >" |
103 !insertmacro MUI_PAGE_LICENSE "\${INSTALLER_FILES}/gpl-3.0.txt" | 103 !insertmacro MUI_PAGE_LICENSE "\${INSTALLER_FILES}/gpl-3.0.txt" |
104 | 104 |
105 Page custom octaveOptionsPage octaveOptionsLeave | 105 Page custom octaveOptionsPage octaveOptionsLeave |
106 | 106 |
107 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckPrevInstall | 107 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckPrevInstallAndDest |
108 !insertmacro MUI_PAGE_DIRECTORY | 108 !insertmacro MUI_PAGE_DIRECTORY |
109 | 109 |
110 !insertmacro MUI_PAGE_INSTFILES | 110 !insertmacro MUI_PAGE_INSTFILES |
111 | 111 |
112 !define MUI_FINISHPAGE_RUN "\$INSTDIR\\\${MAIN_APP_EXE}" | 112 !define MUI_FINISHPAGE_RUN "\$INSTDIR\\\${MAIN_APP_EXE}" |
426 Abort | 426 Abort |
427 curr_check_ok: | 427 curr_check_ok: |
428 Pop \$0 | 428 Pop \$0 |
429 FunctionEnd | 429 FunctionEnd |
430 | 430 |
431 ; Check whether prev install is here | 431 ; Check whether prev install is here and no spaces in dest name |
432 Function CheckPrevInstall | 432 Function CheckPrevInstallAndDest |
433 IfFileExists "\$INSTDIR\\bin\\octave.exe" inst_exists inst_none | 433 IfFileExists "\$INSTDIR\\bin\\octave.exe" inst_exists inst_none |
434 inst_exists: | 434 inst_exists: |
435 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 | 435 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 |
436 Abort | 436 Abort |
437 GoTo inst_end | |
437 inst_none: | 438 inst_none: |
439 | |
440 | |
441 ; check for spaces in dest filename | |
442 Push \$R0 | |
443 Push \$R1 | |
444 | |
445 StrCpy \$R1 0 # r1 = counter | |
446 space_loop: | |
447 StrCpy \$R0 \$INSTDIR 1 \$R1 # R0 = character in string to check | |
448 StrCmp \$R0 "" space_end # end of string | |
449 StrCmp \$R0 " " space_found | |
450 IntOp \$R1 \$R1 + 1 | |
451 GoTo space_loop | |
452 space_found: | |
453 MessageBox MB_OK|MB_ICONEXCLAMATION "Octave should not be installed to a destination folder containing spaces. Please select another destination." | |
454 Abort | |
455 space_end: | |
456 Pop \$R1 | |
457 Pop \$R0 | |
458 | |
459 inst_end: | |
460 | |
438 FunctionEnd | 461 FunctionEnd |
439 | 462 |
440 ; Function to check Java Runtime Environment | 463 ; Function to check Java Runtime Environment |
441 Function CheckJRE | 464 Function CheckJRE |
442 ; looks in: | 465 ; looks in: |