static void RegisterProtocol(string protocol) { var key = Registry.CurrentUser.CreateSubKey(Path.Combine(Common.AppCommon.Classes, protocol)); key.SetValue(string.Empty, "URL:Sync withSIX " + protocol + " Protocol"); key.SetValue("URL Protocol", string.Empty); var iconKey = key.CreateSubKey("DefaultIcon"); var updateExe = StartWithWindowsHandler.GetUpdateExe(Common.Paths.EntryLocation); iconKey.SetValue(string.Empty, (updateExe ?? Common.Paths.EntryLocation) + ",1"); key = key.CreateSubKey(@"shell\open\command"); key.SetValue(string.Empty, GenerateCommandLine()); }
private static string GenerateCommandLine() => StartWithWindowsHandler.GenerateCommandLineExecution(Common.Paths.EntryLocation, "Sync.exe", "%1") .CombineParameters();