Fixes #490 by quoting script path in Apple Script
This commit is contained in:
@ -51,12 +51,12 @@ GCDWebServer *webServer =nil;
|
|||||||
NSString *helperPath = [NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], @"install_helper.sh"];
|
NSString *helperPath = [NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], @"install_helper.sh"];
|
||||||
NSLog(@"run install script: %@", helperPath);
|
NSLog(@"run install script: %@", helperPath);
|
||||||
NSDictionary *error;
|
NSDictionary *error;
|
||||||
NSString *script = [NSString stringWithFormat:@"do shell script \"bash %@\" with administrator privileges", helperPath];
|
NSString *script = [NSString stringWithFormat:@"do shell script \"/bin/bash \\\"%@\\\"\" with administrator privileges", helperPath];
|
||||||
NSAppleScript *appleScript = [[NSAppleScript new] initWithSource:script];
|
NSAppleScript *appleScript = [[NSAppleScript new] initWithSource:script];
|
||||||
if ([appleScript executeAndReturnError:&error]) {
|
if ([appleScript executeAndReturnError:&error]) {
|
||||||
NSLog(@"installation success");
|
NSLog(@"installation success");
|
||||||
} else {
|
} else {
|
||||||
NSLog(@"installation failure");
|
NSLog(@"installation failure: %@", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user