changeset 3185:f3054ae7a492

makeinst-script.sh: Added checking of Windows version
author Anirudha Bose <ani07nov@gmail.com>
date Fri, 26 Jul 2013 04:18:36 +0530
parents faa79d1f476d
children 0385664d2daf
files makeinst-script.sh
diffstat 1 files changed, 42 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/makeinst-script.sh
+++ b/makeinst-script.sh
@@ -90,6 +90,7 @@
 ######################################################################
 
 Function .onInit
+  Call DetectWinVer
   Call CheckPrevVersion
   Call CheckJRE
   InitPluginsDir
@@ -157,6 +158,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