From 067eef65eebb31da27e9ea7fb730fbd6ffea288b Mon Sep 17 00:00:00 2001 From: chylex <info@chylex.com> Date: Tue, 7 Apr 2015 21:27:08 +0200 Subject: [PATCH] Fixed Explorer integration having wrong path + added try/catch to Remove --- BackupEssentials/Backup/ExplorerIntegration.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BackupEssentials/Backup/ExplorerIntegration.cs b/BackupEssentials/Backup/ExplorerIntegration.cs index dfefa66..ad4a7fd 100644 --- a/BackupEssentials/Backup/ExplorerIntegration.cs +++ b/BackupEssentials/Backup/ExplorerIntegration.cs @@ -1,12 +1,10 @@ -using Microsoft.Win32; +using BackupEssentials.Utils; +using Microsoft.Win32; using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Diagnostics; -using System.Reflection; -using System.Windows.Threading; using System.Linq; -using BackupEssentials.Utils; +using System.Reflection; namespace BackupEssentials.Backup{ static class ExplorerIntegration{ @@ -71,7 +69,7 @@ namespace BackupEssentials.Backup{ Registry.SetValue(@"HKEY_CLASSES_ROOT\"+target+@"\shell\BackupEssentials","SubCommands",commands); } - string path = Assembly.GetExecutingAssembly().GetName().CodeBase.Substring(8); // remove file:/// + string path = Assembly.GetExecutingAssembly().GetName().CodeBase.Substring(8).Replace('/','\\'); // remove file:/// int cmd = 0; foreach(BackupLocation loc in valid){ @@ -90,8 +88,10 @@ namespace BackupEssentials.Backup{ } public static void Remove(){ - Registry.ClassesRoot.DeleteSubKey(@"*\shell\BackupEssentials",false); - Registry.ClassesRoot.DeleteSubKey(@"Directory\shell\BackupEssentials",false); + try{ + Registry.ClassesRoot.DeleteSubKey(@"*\shell\BackupEssentials",false); + Registry.ClassesRoot.DeleteSubKey(@"Directory\shell\BackupEssentials",false); + }catch{} int cmd = 0;