From 8e3d6518dcadbf817608662e1582c7d117cd43ce Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 7 Oct 2003 07:47:31 +0000 Subject: [PATCH] With any luck, this will give an error message if the user tries to install on OS X 10.1.x. I have no idea if the installer will even open and no way to test it. Worst case, installer still works for >= 10.2 and crashes for < 10.2. The same as before. Best case, it gives a message about not being compatible and then quits. --- stepmania/PBProject/Installer/main.c | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/stepmania/PBProject/Installer/main.c b/stepmania/PBProject/Installer/main.c index c3072a9bdc..56ce4b0d46 100644 --- a/stepmania/PBProject/Installer/main.c +++ b/stepmania/PBProject/Installer/main.c @@ -8,8 +8,40 @@ */ #import +#import + +enum +{ + kMacOSX_10_2 = 0x1020, +}; + int main(int argc, const char *argv[]) { + long response; + OSErr err = Gestalt(gestaltSystemVersion, &response); + CFStringRef error = NULL; + + if (err != noErr) + error = CFStringCreateWithCString(NULL, "Couldn't determine OS version.", kCFStringEncodingASCII); + else if (response < kMacOSX_10_2) + error = CFStringCreateWithCString(NULL, "StepMania will not run on any version of Mac OS X 10.1.x " + "or earlier.", kCFStringEncodingASCII); + if (error) + { + CFStringRef OK = CFSTR("OK"); + struct AlertStdCFStringAlertParamRec params = {kStdCFStringAlertVersionOne, TRUE, FALSE, OK, NULL, NULL, + kAlertStdAlertOKButton, NULL, kWindowAlertPositionParentWindowScreen, NULL}; + DialogRef dialog; + SInt16 result; + + CreateStandardAlert(kAlertStopAlert, error, NULL, ¶ms, &dialog); + AutoSizeDialog(dialog); + RunStandardAlert(dialog, NULL, &result); + CFRelease(error); + + exit(0); + } + return NSApplicationMain(argc, argv); }