From ae935af15322b18b60e6249dc817691446215204 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 19 Mar 2016 18:59:20 -0700 Subject: [PATCH] Windows: register protocol handler without needing Admin privledges --- main/register-protocol-handler.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/register-protocol-handler.js b/main/register-protocol-handler.js index cc167b10..69d36b1a 100644 --- a/main/register-protocol-handler.js +++ b/main/register-protocol-handler.js @@ -8,15 +8,15 @@ function registerProtocolHandler (protocol, name, command) { var Registry = require('winreg') var protocolKey = new Registry({ - hive: Registry.HKCR, // HKEY_CLASSES_ROOT - key: '\\' + protocol + hive: Registry.HKCU, // HKEY_CURRENT_USER + key: '\\Software\\Classes\\' + protocol }) protocolKey.set('', Registry.REG_SZ, name, callback) protocolKey.set('URL Protocol', Registry.REG_SZ, '', callback) var commandKey = new Registry({ - hive: Registry.HKCR, - key: '\\' + protocol + '\\shell\\open\\command' + hive: Registry.HKCU, + key: '\\Software\\Classes\\' + protocol + '\\shell\\open\\command' }) commandKey.set('', Registry.REG_SZ, '"' + command + '" "%1"', callback)