comparison tools/makeinst-script.sh.in @ 4387:05b44661c970

nsis-installer: Check new reg values for Win10 (Bug #50552) * tools/makeinst-script.sh.in (CheckWinVer): use CurrentMajorVersionNumber, CurrentMinorVersionNumber reg values for version number and fall back to Version, if didnt get a version number
author John D
date Thu, 18 May 2017 14:29:43 -0400
parents 722693b132ad
children 8f0a309bf280
comparison
equal deleted inserted replaced
4386:d28a54afe7e7 4387:05b44661c970
426 ; Function to detect Windows version and abort if Octave is unsupported in the current platform 426 ; Function to detect Windows version and abort if Octave is unsupported in the current platform
427 Function CheckWinVer 427 Function CheckWinVer
428 Push \$0 428 Push \$0
429 Push \$1 429 Push \$1
430 430
431 ; try read new way of getting version
432 ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" CurrentMajorVersionNumber
433 ; since is DWORD reg value, error will be set, however will be "" if no value read
434 StrCmp \$0 "" is_less_than_win10
435 ReadRegStr \$1 HKLM "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" CurrentMinorVersionNumber
436 StrCmp \$1 "" is_less_than_win10
437
438 StrCpy \$0 "\$0.\$1"
439 Goto is_winnt
440
441 is_less_than_win10:
442 ClearErrors
431 ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" CurrentVersion 443 ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" CurrentVersion
432 IfErrors is_error is_winnt 444 IfErrors is_error is_winnt
445
433 is_winnt: 446 is_winnt:
434 StrCpy \$1 \$0 1 447 StrCpy \$1 \$0 1
435 StrCmp \$1 4 is_error ; Aborting installation for Windows versions older than Windows 2000 448 StrCmp \$1 4 is_error ; Aborting installation for Windows versions older than Windows 2000
436 StrCmp \$0 "5.0" is_error ; Removing Windows 2000 as supported Windows version 449 StrCmp \$0 "5.0" is_error ; Removing Windows 2000 as supported Windows version
437 StrCmp \$0 "5.1" is_winnt_XP 450 StrCmp \$0 "5.1" is_winnt_XP
438 StrCmp \$0 "5.2" is_winnt_2003 451 StrCmp \$0 "5.2" is_winnt_2003
439 StrCmp \$0 "6.0" is_winnt_vista 452 StrCmp \$0 "6.0" is_winnt_vista
440 StrCmp \$0 "6.1" is_winnt_7 453 StrCmp \$0 "6.1" is_winnt_7
441 StrCmp \$0 "6.2" is_winnt_8 454 StrCmp \$0 "6.2" is_winnt_8
442 StrCmp \$0 "6.3" is_winnt_10 455 StrCmp \$0 "6.3" is_winnt_8 ; win 8.1
456 StrCmp \$0 "10.0" is_winnt_10
443 StrCmp \$1 6 is_winnt_10 ; Checking for future versions of Windows 10+ 457 StrCmp \$1 6 is_winnt_10 ; Checking for future versions of Windows 10+
458 StrCmp \$1 1 is_winnt_10 ; Checking for future versions of Windows 10+
444 Goto is_error 459 Goto is_error
445 460
446 is_winnt_10: 461 is_winnt_10:
447 462
448 MessageBox MB_YESNO|MB_ICONEXCLAMATION "Setup has detected Windows 10 installed on your system. Octave is currently not fully tested on Windows 10. Testers are welcome to provide feedback. Do you want to proceed with the installation anyway?" /SD IDYES IDYES done IDNO 0 463 MessageBox MB_YESNO|MB_ICONEXCLAMATION "Setup has detected Windows 10 installed on your system. Octave is currently not fully tested on Windows 10. Testers are welcome to provide feedback. Do you want to proceed with the installation anyway?" /SD IDYES IDYES done IDNO 0
453 is_winnt_7: 468 is_winnt_7:
454 is_winnt_8: 469 is_winnt_8:
455 Goto done 470 Goto done
456 is_error: 471 is_error:
457 StrCpy \$1 \$0 472 StrCpy \$1 \$0
473 ClearErrors
458 ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" ProductName 474 ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" ProductName
459 IfErrors 0 +4 475 IfErrors 0 +4
460 ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows\\CurrentVersion" Version 476 ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows\\CurrentVersion" Version
461 IfErrors 0 +2 477 IfErrors 0 +2
462 StrCpy \$0 "Unknown" 478 StrCpy \$0 "Unknown"