From 06718c580e49e4f506f01a1cf938889aaa6b371d Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Jan 2017 16:27:40 +0000 Subject: [PATCH] Hopefully fix Windows shortcuts * Revert https://github.com/vector-im/riot-web/commit/79d164309f7926cb1c24008e464a516d7a872325 as it seems to break shortcuts altogether * Update electron-builder (and add the squirrel windows package that the newer version now requires: it's been split out). This uses a newer version of squirrel which has some fixes for shortcuts. I'm unsure exactly what was going wrong originally in https://github.com/vector-im/riot-web/issues/2775 but #79d1643 seems to break shortcut creation as far as I can see. --- electron/src/squirrelhooks.js | 7 ++++++- package.json | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/electron/src/squirrelhooks.js b/electron/src/squirrelhooks.js index 295ef5cfda..ca0983b66e 100644 --- a/electron/src/squirrelhooks.js +++ b/electron/src/squirrelhooks.js @@ -3,7 +3,12 @@ const spawn = require('child_process').spawn; const app = require('electron').app; function run_update_exe(args, done) { - const updateExe = path.resolve(path.dirname(process.execPath), 'Update.exe'); + // Invokes Squirrel's Update.exe which will do things for us like create shortcuts + // Note that there's an Update.exe in the app-x.x.x directory and one in the parent + // directory: we need to run the one in the parent directory, because it discovers + // information about the app by inspecting the directory it's run from. + const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe'); + console.log('Spawning `%s` with args `%s`', updateExe, args); spawn(updateExe, args, { detached: true }).on('close', done); diff --git a/package.json b/package.json index 52cc41be32..b110b2aff6 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,8 @@ "chokidar": "^1.6.1", "cpx": "^1.3.2", "css-raw-loader": "^0.1.1", - "electron-builder": "^10.4.1", + "electron-builder": "^11.2.4", + "electron-builder-squirrel-windows": "^11.2.1", "emojione": "^2.2.3", "expect": "^1.16.0", "fs-extra": "^0.30.0",