From 25cb0fcbb93804c1fff8d314c31143809af1063e Mon Sep 17 00:00:00 2001 From: Matt Karl Date: Fri, 20 May 2016 11:04:10 -0400 Subject: [PATCH] Added Learn More button --- default_app/main.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/default_app/main.js b/default_app/main.js index f4ca5f14a65..c53bb56df3d 100644 --- a/default_app/main.js +++ b/default_app/main.js @@ -253,13 +253,16 @@ function loadApplicationPackage (packagePath) { } catch (e) { if (e.code === 'MODULE_NOT_FOUND') { app.focus() - dialog.showErrorBox( - 'Error opening app', - 'Unable to open or find an Electron app. The docs on how to write an app can be found here:\n' + - `https://github.com/electron/electron/tree/v${process.versions.electron}/docs - -${e.toString()}` - ) + dialog.showMessageBox({ + message: 'Error opening app', + detail: 'Unable to open or find an Electron app. Click to learn more on how to write an app.\n\n' + + `${e.toString()}`, + buttons: ['Learn More', 'OK'] + }, (response) => { + if (response === 0) { + shell.openExternal(`https://github.com/electron/electron/tree/v${process.versions.electron}/docs`) + } + }) process.exit(1) } else { console.error('App threw an error when running', e)