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

Commit 760e079

Browse files
committed
The app can now work in paths with spaces
1 parent 20122d0 commit 760e079

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

AltDeploy/ViewController.m

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,24 @@ - (void)askForAppleID {
7070
- (void)beginMailPluginInstallation {
7171
BOOL isInstalling = ![self.class isPluginInstalled];
7272
NSString *script = [NSString stringWithFormat:
73-
@"do shell script \"%@ -i\" with administrator privileges",
74-
NSBundle.mainBundle.executablePath
73+
// it works, don't touch it
74+
@"do shell script \"/bin/bash -c \\\"\\\\\\\"\\\\$(base64 -D <<< \\\\\\\"%@\\\\\\\")\\\\\\\" -i\\\"\" with administrator privileges",
75+
[[NSBundle.mainBundle.executablePath dataUsingEncoding:NSUTF8StringEncoding] base64EncodedStringWithOptions:0]
7576
];
77+
NSLog(@"%@", script);
7678
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:script];
7779
NSAlert *alert = [NSAlert new];
7880
[alert addButtonWithTitle:@"OK"];
7981
NSDictionary *error;
8082
if ([appleScript executeAndReturnError:&error]) {
8183
alert.messageText = @"Success";
8284
if (isInstalling) {
83-
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.";
85+
if (@available(macOS 10.14.0, *)) {
86+
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.";
87+
}
88+
else {
89+
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.";
90+
}
8491
}
8592
else {
8693
alert.informativeText = @"The mail plugin was uninstalled successfully.";

Dependencies/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# Dependencies
22

3-
**Q:** Why are these precompiled?
3+
**Q:** Why are these precompiled?
44
**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.
5-
6-
**Q:** What's "Individual" and what's "dependencies.deb"?
7-
**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 commit comments

Comments
 (0)