private void Init_ShellExtension() { if (!Directory.Exists(AppSetting.ApplicationData_SecuruStikPath)) { Directory.CreateDirectory(AppSetting.ApplicationData_SecuruStikPath); } //NOTE: The "SharpShell.dll" must locate in app folder File.Copy(AppSetting.App_ShellExtension, AppSetting.AppDataFolder_ShellExtensionsFullPath, true); File.Copy(AppSetting.App_ShellExtension_Sharpdll, AppSetting.AppDataFolder_ShellExtensions_SharpdllFullPath, true); ComRegisterHelper.Register(AppSetting.AppDataFolder_ShellExtensionsFullPath); }
public static void UnRegisterShellExtension() { try { ComRegisterHelper.UnRegister(AppSetting.AppDataFolder_ShellExtensionsFullPath); if (File.Exists(AppSetting.AppDataFolder_ShellExtensionsFullPath)) { File.Delete(AppSetting.AppDataFolder_ShellExtensionsFullPath); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
protected static void Unregister(string key) { ComRegisterHelper.Unregister(key); }