Skip to content

Commit 45a094e

Browse files
committed
Don't try to move the app file to the Application folder ourselves
Because of MacOS Gatekeeper path randomization issues (Squirrel/Squirrel.Mac#182) we need the user to move the app themselves. Changed the dialog to ask them to do this politely.
1 parent b23cad7 commit 45a094e

File tree

1 file changed

+12
-12
lines changed
  • internal_packages/verify-install-location/lib

1 file changed

+12
-12
lines changed

internal_packages/verify-install-location/lib/main.es6

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import {ipcRenderer, remote} from 'electron'
1212

1313
function onDialogActionTaken(numAsks) {
1414
return (buttonIndex) => {
15-
if (buttonIndex === 0) {
16-
ipcRenderer.send("move-to-applications")
17-
}
18-
1915
if (numAsks >= 1) {
2016
if (buttonIndex === 1) {
2117
NylasEnv.config.set("asksAboutAppMove", 5)
@@ -44,32 +40,36 @@ export function activate() {
4440
return;
4541
}
4642

47-
const numAsks = NylasEnv.config.get("asksAboutAppMove")
43+
const numAsks = NylasEnv.config.get("asksAboutAppMove") || 0
44+
if (numAsks <= 0) {
45+
NylasEnv.config.set("asksAboutAppMove", 1)
46+
return;
47+
}
48+
49+
NylasEnv.config.set("asksAboutAppMove", numAsks + 1)
4850
if (numAsks >= 5) return;
4951

5052
let buttons;
5153
if (numAsks >= 1) {
5254
buttons = [
53-
"Move to Applications folder",
55+
"Okay",
5456
"Don't ask again",
55-
"Do not move",
5657
]
5758
} else {
5859
buttons = [
59-
"Move to Applications folder",
60-
"Do not move",
60+
"Okay",
6161
]
6262
}
6363

6464
const msg = `We recommend that you move Nylas Mail to your Applications folder to get updates correctly and keep this folder uncluttered.`
6565

66-
const CANCEL_ID = 3;
66+
const CANCEL_ID = 0;
6767

6868
remote.dialog.showMessageBox({
69-
type: "question",
69+
type: "warning",
7070
buttons: buttons,
7171
title: "A Better Place to Install Nylas Mail",
72-
message: "Move to Applications folder?",
72+
message: "Please move Nylas Mail to your Applications folder",
7373
detail: msg,
7474
defaultId: 0,
7575
cancelId: CANCEL_ID,

0 commit comments

Comments
 (0)