Skip to content
This repository has been archived by the owner on Apr 12, 2020. It is now read-only.

Commit

Permalink
The app can now work in paths with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelomer committed Jan 9, 2020
1 parent 20122d0 commit 760e079
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 10 additions & 3 deletions AltDeploy/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,24 @@ - (void)askForAppleID {
- (void)beginMailPluginInstallation {
BOOL isInstalling = ![self.class isPluginInstalled];
NSString *script = [NSString stringWithFormat:
@"do shell script \"%@ -i\" with administrator privileges",
NSBundle.mainBundle.executablePath
// it works, don't touch it
@"do shell script \"/bin/bash -c \\\"\\\\\\\"\\\\$(base64 -D <<< \\\\\\\"%@\\\\\\\")\\\\\\\" -i\\\"\" with administrator privileges",
[[NSBundle.mainBundle.executablePath dataUsingEncoding:NSUTF8StringEncoding] base64EncodedStringWithOptions:0]
];
NSLog(@"%@", script);
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:script];
NSAlert *alert = [NSAlert new];
[alert addButtonWithTitle:@"OK"];
NSDictionary *error;
if ([appleScript executeAndReturnError:&error]) {
alert.messageText = @"Success";
if (isInstalling) {
alert.informativeText = @"The mail plugin is now installed. To enable this plugin:\n1) Restart the mail app\n2) In mail preferences, press \"Manage Plug-ins...\"\n3) Enable \"AltPlugin.mailbundle\"\n4) Press \"Apply and Restart Mail\"\nThis application relies on this plugin so this plugin must be enabled. It is also necessary to keep the Mail application open while AltDeploy is running.";
if (@available(macOS 10.14.0, *)) {
alert.informativeText = @"The mail plugin is now installed. To enable this plugin:\n1) Restart the mail app\n2) In mail preferences, press \"Manage Plug-ins...\"\n3) Enable \"AltPlugin.mailbundle\"\n4) Press \"Apply and Restart Mail\"\nThis application relies on this plugin so this plugin must be enabled. It is also necessary to keep the Mail application open while AltDeploy is running.";
}
else {
alert.informativeText = @"The mail plugin is now installed. If Mail is currently open, please close and reopen it for the changes to take effect. The Mail app has to be open while AltDeploy is running.";
}
}
else {
alert.informativeText = @"The mail plugin was uninstalled successfully.";
Expand Down
5 changes: 1 addition & 4 deletions Dependencies/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Dependencies

**Q:** Why are these precompiled?
**Q:** Why are these precompiled?
**A:** I tried to add them as a dependency in the code. I tried for hours. I couldn't. These precompiled libraries come from brew.sh since I just wasn't able to compile them myself.

**Q:** What's "Individual" and what's "dependencies.deb"?
**A:** When I individually linked the libraries, Xcode always linked the dynamic libraries as well, which I didn't want. So I packed all of the objects inside of one archive and linked that instead, which worked

0 comments on commit 760e079

Please sign in to comment.