;-------------------------------------- ; CheckWindowsVersion ; ; By Wobl (Robert Grant), written for software used by www.logitor.com ; ; Quits program if version not recognised or not high enough ; ; Usage: ; Define $MIN_WIN_VER to be 'XP', '2000', 'NT 4', 'NT 3', 'ME', '98', '95' ; Place the output of Joost Verburg's GetWindowsVersion in $0. ; ; Call CheckWindowsVersion ; ; Info: ; Defines a 'later' version as being the order the version are listed above - ; i.e. ME is lower than NT 3. Change the order of the checkIfs to change that. ; If the version of Windows the person is running is compatible then then program ; will continue, otherwise it will quit with an error. Function CheckWindowsVersion StrCmp $0 '' unhappyEnding checkIfXP: StrCmp $0 'XP' happyEnding StrCmp $MIN_WIN_VER 'XP' unhappyEnding goto checkIfkk checkIfkk: StrCmp $0 '2000' happyEnding StrCmp $MIN_WIN_VER '2000' unhappyEnding goto checkIfNTFour checkIfNTFour: StrCmp $0 'NT 4' happyEnding StrCmp $MIN_WIN_VER 'NT 4' unhappyEnding goto checkIfNTThree checkIfNTThree: StrCmp $0 'NT 3' happyEnding ntThreeNotInstalled StrCmp $MIN_WIN_VER 'NT 3' unhappyEnding goto checkIfME checkIfME: StrCmp $0 'ME' happyEnding StrCmp $MIN_WIN_VER 'ME' unhappyEnding goto checkIfNinetyEight checkIfNinetyEight: StrCmp $0 '98' happyEnding StrCmp $MIN_WIN_VER '98' unhappyEnding goto checkIfNinetyFive checkIfNinetyFive: StrCmp $0 '95' happyEnding unhappyEnding: MessageBox MB_OK|MB_ICONEXCLAMATION "My program requires Windows $(MIN_WIN_VER) to run." Quit happyEnding: FunctionEnd