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.

This commit is contained in:
Steve Checkoway
2003-10-07 07:47:31 +00:00
parent 4cafa2eb7d
commit 8e3d6518dc
+32
View File
@@ -8,8 +8,40 @@
*/
#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>
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, &params, &dialog);
AutoSizeDialog(dialog);
RunStandardAlert(dialog, NULL, &result);
CFRelease(error);
exit(0);
}
return NSApplicationMain(argc, argv);
}