Skip to content

Commit

Permalink
Don't try to move the app file to the Application folder ourselves
Browse files Browse the repository at this point in the history
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.

Conflicts:
	internal_packages/verify-install-location/lib/main.es6
  • Loading branch information
khamidou committed Jan 16, 2017
1 parent 1aa14ce commit 47296e9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions internal_packages/verify-install-location/lib/main.es6
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import {ipcRenderer, remote} from 'electron'

function onDialogActionTaken(numAsks) {
return (buttonIndex) => {
if (buttonIndex === 0) {
ipcRenderer.send("move-to-applications")
}

if (numAsks >= 1) {
if (buttonIndex === 1) {
NylasEnv.config.set("asksAboutAppMove", 5)
Expand Down Expand Up @@ -44,32 +40,36 @@ export function activate() {
return;
}

const numAsks = NylasEnv.config.get("asksAboutAppMove")
const numAsks = NylasEnv.config.get("asksAboutAppMove") || 0
if (numAsks <= 0) {
NylasEnv.config.set("asksAboutAppMove", 1)
return;
}

NylasEnv.config.set("asksAboutAppMove", numAsks + 1)
if (numAsks >= 5) return;

let buttons;
if (numAsks >= 1) {
buttons = [
"Move to Applications folder",
"Okay",
"Don't ask again",
"Do not move",
]
} else {
buttons = [
"Move to Applications folder",
"Do not move",
"Okay",
]
}

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

const CANCEL_ID = 3;
const CANCEL_ID = 0;

remote.dialog.showMessageBox({
type: "question",
type: "warning",
buttons: buttons,
title: "A Better Place to Install N1",
message: "Move to Applications folder?",
title: "A Better Place to Install Nylas Mail",
message: "Please move Nylas Mail to your Applications folder",
detail: msg,
defaultId: 0,
cancelId: CANCEL_ID,
Expand Down

0 comments on commit 47296e9

Please sign in to comment.