URISchemeTools 1.0.2

A cross platform solution to register your application to a URI scheme.

Install-Package URISchemeTools -Version 1.0.2
dotnet add package URISchemeTools --version 1.0.2
<PackageReference Include="URISchemeTools" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add URISchemeTools --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: URISchemeTools, 1.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install URISchemeTools as a Cake Addin
#addin nuget:?package=URISchemeTools&version=1.0.2

// Install URISchemeTools as a Cake Tool
#tool nuget:?package=URISchemeTools&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

URIScheme

Usage

const string key = @"ssa";

// Creates a IURISchemeService object of the correct type for each supported OS. 
var service = URISchemeServiceFactory.GetURISchemeSerivce(key, @"URL:ssa Protocol", @"D:\MyAppPath\MyApp.exe --openurl");
// var service = URISchemeServiceFactory.GetURISchemeSerivce(key, @"URL:ssa Protocol", @"D:\MyAppPath\MyApp.exe --openurl", RegisterType.LocalMachine);

// Check if the protocol is registered to any application.
var hasProtocol = service.CheckAny();

// Check if the protocol is registered to the current application.
var isSet = service.Check();

// Register the service.
service.Set();

// Unregister the service.
service.Delete();

Notes

This library supports Windows and all Linux distros that follows the FreeDesktop specification.

MacOS is not supported, as there seems to be no API to register URI schemes programatically on this platform.
Registering must be done by saving some in kind of Info file in a application package. See more information here.

Feel free to create issues here for any bugs you encounter.

If you know how to register URI schemes on other platforms, pull requests are welcome.

URIScheme

Usage

const string key = @"ssa";

// Creates a IURISchemeService object of the correct type for each supported OS. 
var service = URISchemeServiceFactory.GetURISchemeSerivce(key, @"URL:ssa Protocol", @"D:\MyAppPath\MyApp.exe --openurl");
// var service = URISchemeServiceFactory.GetURISchemeSerivce(key, @"URL:ssa Protocol", @"D:\MyAppPath\MyApp.exe --openurl", RegisterType.LocalMachine);

// Check if the protocol is registered to any application.
var hasProtocol = service.CheckAny();

// Check if the protocol is registered to the current application.
var isSet = service.Check();

// Register the service.
service.Set();

// Unregister the service.
service.Delete();

Notes

This library supports Windows and all Linux distros that follows the FreeDesktop specification.

MacOS is not supported, as there seems to be no API to register URI schemes programatically on this platform.
Registering must be done by saving some in kind of Info file in a application package. See more information here.

Feel free to create issues here for any bugs you encounter.

If you know how to register URI schemes on other platforms, pull requests are welcome.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.2 63 2/18/2021