From fb4d6823051ad800e1adc79c9bcd5358c3b610c9 Mon Sep 17 00:00:00 2001 From: Robbert Klarenbeek Date: Sun, 6 Nov 2016 19:53:05 +0100 Subject: [PATCH] Improve version error --- TouchBarServer/AppDelegate.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/TouchBarServer/AppDelegate.m b/TouchBarServer/AppDelegate.m index 87c47b3..280f866 100644 --- a/TouchBarServer/AppDelegate.m +++ b/TouchBarServer/AppDelegate.m @@ -128,9 +128,13 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { if (!NSClassFromString(@"DFRElement")) { NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:@"Error: could not detect Touch Bar support"]; - [alert setInformativeText:@"We need at least macOS 10.12.1 (build 16B2657)"]; + [alert setInformativeText:[NSString stringWithFormat:@"We need at least macOS 10.12.1 (Build 16B2657).\n\nYou have: %@.\n", [NSProcessInfo processInfo].operatingSystemVersionString]]; [alert addButtonWithTitle:@"Exit"]; - [alert runModal]; + [alert addButtonWithTitle:@"Get macOS Update"]; + NSModalResponse response = [alert runModal]; + if(response == NSAlertSecondButtonReturn) { + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://support.apple.com/kb/dl1897"]]; + } [NSApp terminate:nil]; return;