# HG changeset patch # User Anirudha Bose # Date 1374792516 -19800 # Node ID 0f2a5e218359a149039c9efa5142e3ceecb54c9e # Parent 9781db518638f78a38582b9b01fb3ff6c62cfcca makeinst-script.sh: Added checking of Windows version diff -r 9781db518638 -r 0f2a5e218359 makeinst-script.sh --- a/makeinst-script.sh Thu Jul 25 21:14:43 2013 +0530 +++ b/makeinst-script.sh Fri Jul 26 04:18:36 2013 +0530 @@ -91,6 +91,7 @@ RequestExecutionLevel admin Function .onInit + Call DetectWinVer Call CheckPrevVersion Call CheckJRE InitPluginsDir @@ -158,6 +159,47 @@ RmDir "\$INSTDIR" SectionEnd +; Function to detect Windows version and abort if Octave is unsupported in the current platform +Function DetectWinVer + Push \$0 + Push \$1 + ReadRegStr \$0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + IfErrors is_error is_winnt +is_winnt: + StrCpy \$1 \$0 1 + StrCmp \$1 4 is_error ; Aborting installation for Windows versions older than Windows 2000 + StrCmp \$0 "5.0" is_winnt_2000 + StrCmp \$0 "5.1" is_winnt_XP + StrCmp \$0 "5.2" is_winnt_2003 + StrCmp \$0 "6.0" is_winnt_vista + StrCmp \$0 "6.1" is_winnt_7 + StrCmp \$0 "6.2" is_winnt_8 + StrCmp \$1 6 is_winnt_8 ; Checking for future versions of Windows 8 + Goto is_error + +is_winnt_8: + MessageBox MB_YESNO|MB_ICONEXCLAMATION "Setup has detected Windows 8 installed on your system. Octave is currently not fully supported on Windows 8. If you choose to continue with the installation, you might not be able to access Octave GUI. Do you want to proceed with the installation anyway?" IDYES done IDNO 0 + Abort +is_winnt_2000: +is_winnt_XP: +is_winnt_2003: +is_winnt_vista: +is_winnt_7: + Goto done +is_error: + StrCpy \$1 \$0 + ReadRegStr \$0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" ProductName + IfErrors 0 +4 + ReadRegStr \$0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" Version + IfErrors 0 +2 + StrCpy \$0 "Unknown" + MessageBox MB_ICONSTOP|MB_OK "This version of Octave cannot be installed on this system. Octave is supported only on Windows NT systems. Current system: \$0 (version: \$1)" + Abort +done: + Pop \$1 + Pop \$0 +FunctionEnd + ; Function to check any previously installed version of Octave in the system Function CheckPrevVersion Push \$0