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

Commit 1173ab5

Browse files
committed
The app can now work in paths with spaces
2 parents 2116978 + 760e079 commit 1173ab5

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

AltDeploy/ALTMainViewController.m

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,24 @@ + (BOOL)isPluginInstalled {
175175
- (void)beginMailPluginInstallation {
176176
BOOL isInstalling = ![self.class isPluginInstalled];
177177
NSString *script = [NSString stringWithFormat:
178-
@"do shell script \"%@ -i\" with administrator privileges",
179-
NSBundle.mainBundle.executablePath
178+
// it works, don't touch it
179+
@"do shell script \"/bin/bash -c \\\"\\\\\\\"\\\\$(base64 -D <<< \\\\\\\"%@\\\\\\\")\\\\\\\" -i\\\"\" with administrator privileges",
180+
[[NSBundle.mainBundle.executablePath dataUsingEncoding:NSUTF8StringEncoding] base64EncodedStringWithOptions:0]
180181
];
182+
NSLog(@"%@", script);
181183
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:script];
182184
NSAlert *alert = [NSAlert new];
183185
[alert addButtonWithTitle:@"OK"];
184186
NSDictionary *error;
185187
if ([appleScript executeAndReturnError:&error]) {
186188
alert.messageText = @"Success";
187189
if (isInstalling) {
188-
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.";
190+
if (@available(macOS 10.14.0, *)) {
191+
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.";
192+
}
193+
else {
194+
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.";
195+
}
189196
}
190197
else {
191198
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)