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" />
paket add URISchemeTools --version 1.0.2
#r "nuget: URISchemeTools, 1.0.2"
// 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
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.
Dependencies
-
.NETCoreApp 3.1
- Microsoft.Win32.Registry (>= 5.0.0)
-
.NETFramework 4.8
- Microsoft.Win32.Registry (>= 5.0.0)
-
.NETStandard 2.0
- Microsoft.Win32.Registry (>= 5.0.0)
Used By
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 |