Exemplo n.º 1
0
        private static void setProgId()
        {
            using (RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Classes\NexDirect.Url"))
            {
                key.SetValue("", "NexDirect http passthrough");

                string appLocation = WinTools.GetExecLocation();
                using (RegistryKey shellOpenKey = key.CreateSubKey(@"shell\open\command"))
                    shellOpenKey.SetValue("", $"\"{appLocation}\" \"/link:%1\"");
            }
        }
Exemplo n.º 2
0
        private static void registerCapabilities()
        {
            string appLocation = WinTools.GetExecLocation();

            using (RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Clients\StartMenuInternet\NexDirect"))
            {
                key.SetValue("", "NexDirect");

                using (RegistryKey capibilitySubkey = key.CreateSubKey(@"Capabilities"))
                {
                    capibilitySubkey.SetValue("ApplicationDescription", "Intercepts browser requests so that relevant ones can be sent to NexDirect.");
                    capibilitySubkey.SetValue("ApplicationName", "NexDirect");

                    using (RegistryKey urlAssocKey = capibilitySubkey.CreateSubKey(@"URLAssociations"))
                    {
                        urlAssocKey.SetValue("http", "NexDirect.Url");
                        urlAssocKey.SetValue("https", "NexDirect.Url");
                    }
                }

                using (RegistryKey iconSubkey = key.CreateSubKey(@"DefaultIcon"))
                    iconSubkey.SetValue("", $"{appLocation},0");
            }
        }