From 6d86071072b9587f4fbd442d5166ff7171fecb86 Mon Sep 17 00:00:00 2001 From: Vishwas Shashidhar Date: Sat, 29 Sep 2018 12:30:17 +0530 Subject: [PATCH] ELECTRON-805: fix protocol handler uninstall issues on Windows (#510) Currently, when we uninstall symphony on Windows, the protocol handler registry entry is left as is because it is created by Electron in the first place. To avoid such leftovers, we add logic to use Electron to register protocol handler only on Mac. On Windows, we use the installer to create a registry entry and manage it during installation as well. --- installer/win/Symphony-x64.aip | 6 +++++- installer/win/Symphony-x86.aip | 6 +++++- js/main.js | 11 +++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/installer/win/Symphony-x64.aip b/installer/win/Symphony-x64.aip index 4a798f09..2d7a36b4 100644 --- a/installer/win/Symphony-x64.aip +++ b/installer/win/Symphony-x64.aip @@ -105,6 +105,8 @@ + + @@ -169,7 +171,7 @@ - + @@ -768,6 +770,8 @@ + + diff --git a/installer/win/Symphony-x86.aip b/installer/win/Symphony-x86.aip index f660071f..fdb4e43b 100644 --- a/installer/win/Symphony-x86.aip +++ b/installer/win/Symphony-x86.aip @@ -104,6 +104,8 @@ + + @@ -167,7 +169,7 @@ - + @@ -746,6 +748,8 @@ + + diff --git a/js/main.js b/js/main.js index 4890ee59..40653a04 100644 --- a/js/main.js +++ b/js/main.js @@ -232,10 +232,13 @@ app.on('activate', function () { } }); -// adds 'symphony' as a protocol -// in the system. plist file in macOS -// and registry keys in windows -app.setAsDefaultProtocolClient('symphony'); +// adds 'symphony' as a protocol in the system. plist file in macOS + +// on windows, we create the protocol handler via the installer +// because electron leaves registry traces upon uninstallation +if (isMac) { + app.setAsDefaultProtocolClient('symphony'); +} /** * This event is emitted only on macOS