From ccea483f4f74b0b076a1b6874ede50d11ec6b149 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 8 Nov 2016 11:20:47 +0000 Subject: [PATCH] Missed files electron windows fixes Missed from https://github.com/vector-im/vector-web/pull/2551 * squirrel hooks file for handling install / uninstall events * Install 'spinner' gif for windows (ours does not spin) --- electron/build/install-spinner.gif | Bin 0 -> 4460 bytes electron/src/squirrelhooks.js | 30 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 electron/build/install-spinner.gif create mode 100644 electron/src/squirrelhooks.js diff --git a/electron/build/install-spinner.gif b/electron/build/install-spinner.gif new file mode 100644 index 0000000000000000000000000000000000000000..c4f832c34230af5d0267962c7e1d0fab4bab5dd0 GIT binary patch literal 4460 zcmV-y5tHsmNk%w1VITn@0q6e!t!bsHYo)Jhrl)P7p>Ln6Y^I!Yl%H{#k9Uojbd!jB zhnjPluxqHIaG;ZRlZ|vi;aqSl!cLsqKuAK_k)V*0kB5_>cbkfFor{r^kcgC_hnAdjo{W-|k&Ts{h?kvnpN*51 zl5L@mg_)RippKN5lY^R`m6w!+o1b!{ih`Y+mY9`uq>Fr@oP(a6mzkDrr;L4}otT=J zZm5lZqMn+Yn0%y}Z>f%Ur<#4GnsBO*YOIi(otby2n{ld~Yps!-o||~7oOY|1ou8a= zt(ax8lWnh)o}is^u9;@Cl%JuVa<7_avz2SJkZZD=prW5|vXyAGmZ77daI=zQMh~ z!oI=7zrw`9!^OhH#>2(O#Ky?Q$H~UY%gD;i$;-~l&Ckov(azA)&(YJ+($vw@)zZ|~ z)7971*4Wk9+Sb|I*V^3K+uhpS-rL^b-QVHf;Nsum%z)=;i0>=IH9@ z>Fem~?CI<7>h16A?(psJ@$T^Q@A32S^7QfZ_44%h^Y-}k_xbkt`uF+!`1<_$`~CX- z|NH*`{Qv*|A^8LW3IP8AEC2ui03ZP%0RRa80RIUbNU)&6g9sBUT*$DY!-o(fN}Ncs zqQ#3CGiuz(kzt6BAVZ2AN%CX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xLi?;1QnYOW yrAT|N01rKRn;^b%wfd?WT8pt!*|jjsn_xS(Wa|(C0RTH8VRfPa literal 0 HcmV?d00001 diff --git a/electron/src/squirrelhooks.js b/electron/src/squirrelhooks.js new file mode 100644 index 0000000000..10fb8d9ec5 --- /dev/null +++ b/electron/src/squirrelhooks.js @@ -0,0 +1,30 @@ +const path = require('path'); +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'); + spawn(updateExe, args, { + detached: true + }).on('close', done); +}; + +function check_squirrel_hooks() { + if (process.platform != 'win32') return false; + + const cmd = process.argv[1]; + const target = path.basename(process.execPath); + if (cmd === '--squirrel-install' || cmd === '--squirrel-updated') { + run_update_exe(['--createShortcut=' + target + ''], app.quit); + return true; + } else if (cmd === '--squirrel-uninstall') { + run_update_exe(['--removeShortcut=' + target + ''], app.quit); + return true; + } else if (cmd === '--squirrel-obsolete') { + app.quit(); + return true; + } + return false; +} + +module.exports = check_squirrel_hooks;