From 1ada4338b7bec9864482389322ee0de4ecb36e27 Mon Sep 17 00:00:00 2001 From: Cyril Taylor Date: Mon, 13 Jan 2020 14:08:58 +0800 Subject: [PATCH 1/2] 1. Fit the shell integration with windos registry style 2. Add folder context menu with Terminus --- .../src/services/shellIntegration.service.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/terminus-core/src/services/shellIntegration.service.ts b/terminus-core/src/services/shellIntegration.service.ts index 0c85362d..5d49ceeb 100644 --- a/terminus-core/src/services/shellIntegration.service.ts +++ b/terminus-core/src/services/shellIntegration.service.ts @@ -18,11 +18,18 @@ export class ShellIntegrationService { private automatorWorkflowsDestination: string private registryKeys = [ { - path: 'Software\\Classes\\Directory\\Background\\shell\\Open Terminus here', + path: 'Software\\Classes\\Directory\\Background\\shell\\Terminus', + value: 'Open Terminus here', command: 'open "%V"', }, { - path: 'Software\\Classes\\*\\shell\\Paste path into Terminus', + path: 'SOFTWARE\\Classes\\Directory\\shell\\Terminus', + value: 'Open Terminus here', + command: 'open "%V"', + }, + { + path: 'Software\\Classes\\*\\shell\\Terminus', + value: 'Paste path into Terminus', command: 'paste "%V"', }, ] @@ -61,6 +68,7 @@ export class ShellIntegrationService { for (const registryKey of this.registryKeys) { wnr.createRegistryKey(wnr.HK.CU, registryKey.path) wnr.createRegistryKey(wnr.HK.CU, registryKey.path + '\\command') + wnr.setRegistryValue(wnr.HK.CU, registryKey.path, '', wnr.REG.SZ, registryKey.value) wnr.setRegistryValue(wnr.HK.CU, registryKey.path, 'Icon', wnr.REG.SZ, exe) wnr.setRegistryValue(wnr.HK.CU, registryKey.path + '\\command', '', wnr.REG.SZ, exe + ' ' + registryKey.command) } From b0a8832499705f61969b83f000fa46e05a8c4933 Mon Sep 17 00:00:00 2001 From: Cyril Taylor Date: Mon, 13 Jan 2020 18:59:15 +0800 Subject: [PATCH 2/2] remove old entry for windows shell integration --- terminus-core/src/services/shellIntegration.service.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/terminus-core/src/services/shellIntegration.service.ts b/terminus-core/src/services/shellIntegration.service.ts index 5d49ceeb..dbf32f9d 100644 --- a/terminus-core/src/services/shellIntegration.service.ts +++ b/terminus-core/src/services/shellIntegration.service.ts @@ -72,6 +72,13 @@ export class ShellIntegrationService { wnr.setRegistryValue(wnr.HK.CU, registryKey.path, 'Icon', wnr.REG.SZ, exe) wnr.setRegistryValue(wnr.HK.CU, registryKey.path + '\\command', '', wnr.REG.SZ, exe + ' ' + registryKey.command) } + + if(wnr.getRegistryKey(wnr.HK.CU, 'Software\\Classes\\Directory\\Background\\shell\\Open Terminus here')) { + wnr.deleteRegistryKey(wnr.HK.CU, 'Software\\Classes\\Directory\\Background\\shell\\Open Terminus here') + } + if(wnr.getRegistryKey(wnr.HK.CU, 'Software\\Classes\\*\\shell\\Paste path into Terminus')) { + wnr.deleteRegistryKey(wnr.HK.CU, 'Software\\Classes\\*\\shell\\Paste path into Terminus') + } } }