Asking a question, I came across Registering a protocol handler in Windows 8
The surest answer I gave was on the right track, although there were other problems. In the end, this is what I ended up with:
// Register as the default handler for the tel: protocol. const string protocolValue = "TEL:Telephone Invocation"; Registry.SetValue( @"HKEY_CLASSES_ROOT\tel", string.Empty, protocolValue, RegistryValueKind.String ); Registry.SetValue( @"HKEY_CLASSES_ROOT\tel", "URL Protocol", String.Empty, RegistryValueKind.String ); const string binaryName = "tel.exe"; string command = string.Format( "\"{0}{1}\" \"%1\"", AppDomain.CurrentDomain.BaseDirectory, binaryName ); Registry.SetValue( @"HKEY_CLASSES_ROOT\tel\shell\open\command", string.Empty, command, RegistryValueKind.String ); // For Windows 8+, register as a choosable protocol handler. // Version detection from https://stackoverflow.com/a/17796139/259953 Version win8Version = new Version( 6, 2, 9200, 0 ); if( Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version >= win8Version ) { Registry.SetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TelProtocolHandler", string.Empty, protocolValue, RegistryValueKind.String ); Registry.SetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TelProtocolHandler\shell\open\command", string.Empty, command, RegistryValueKind.String ); Registry.SetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\TelProtocolHandler\Capabilities\URLAssociations", "tel", "TelProtocolHandler", RegistryValueKind.String ); Registry.SetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications", "TelProtocolHandler", @"SOFTWARE\TelProtocolHandler\Capabilities", RegistryValueKind.String ); }
TelProtocolHandler is the name of my application and should be replaced with any name of your handler.
The accepted answer in another question also has ApplicationDescription in the registry. I did not see the same key for any of the registered registered handlers that I checked, so I left it and could not detect any problems.
Another key problem was that all this would not work if my application installing the handler would be 32 bits. When the entries were made in Wow6432Node, I could not select the handler as the default value for this protocol. It took me a while to figure this out because my application was compiled as AnyCPU. This is the first time I have missed this little flag in the project properties:
