diff --git a/Changelog.md b/Changelog.md index 5fde3c2..ea0bfff 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,6 +9,7 @@ - config options specific to mpv.net are now available from the command line - the input editor no longer as known limitations, 'alt gr' and ctrl+alt are working now - the help in the input editor was simplified and the filter logic was improved +- fixed issue in file associations causing mpv.net not to appear in OS default apps ### 5.0 diff --git a/README.md b/README.md index 1ac2727..6d03125 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,7 @@ Third party components: [Support thread in VideoHelp forum](https://forum.videohelp.com/threads/392514-mpv-net-a-extendable-media-player-for-windows) -[Issue tracker, feel free to use for anything mpv.net related](https://github.com/stax76/mpv.net/issues) +[Issue tracker](https://github.com/stax76/mpv.net/issues), feel free to use for anything mpv.net related [frank.skare.de@gmail.com](mailto:frank.skare.de@gmail.com?Subject=mpv.net%20support) @@ -237,7 +237,7 @@ If you want to support the development of mpv.net or express your appreciation y - mpv.net default key bindings: - mpv.net download: - mpv.net bugs and requests: - +- mpv website: - mpv manual: - mpv wiki: - mpv apps: diff --git a/mpv.net/Misc/Misc.cs b/mpv.net/Misc/Misc.cs index f5d8398..e2a1522 100644 --- a/mpv.net/Misc/Misc.cs +++ b/mpv.net/Misc/Misc.cs @@ -152,25 +152,23 @@ namespace mpvnet { Types = types; - RegHelp.SetObject(@"HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" + ExeFilename, null, ExePath); + RegHelp.SetObject($"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\{ExeFilename}", null, ExePath); RegHelp.SetObject($"HKCR\\Applications\\{ExeFilename}", "FriendlyAppName", "mpv.net media player"); RegHelp.SetObject($"HKCR\\Applications\\{ExeFilename}\\shell\\open\\command", null, $"\"{ExePath}\" \"%1\""); RegHelp.SetObject(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities", "ApplicationDescription", "mpv.net media player"); RegHelp.SetObject(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities", "ApplicationName", "mpv.net"); RegHelp.SetObject($"HKCR\\SystemFileAssociations\\video\\OpenWithList\\{ExeFilename}", null, ""); RegHelp.SetObject($"HKCR\\SystemFileAssociations\\audio\\OpenWithList\\{ExeFilename}", null, ""); + RegHelp.SetObject(@"HKLM\SOFTWARE\RegisteredApplications", "mpv.net", @"SOFTWARE\Clients\Media\mpv.net\Capabilities"); foreach (string ext in Types) { RegHelp.SetObject($"HKCR\\Applications\\{ExeFilename}\\SupportedTypes", "." + ext, ""); RegHelp.SetObject($"HKCR\\" + "." + ext, null, ExeFilenameNoExt + "." + ext); RegHelp.SetObject($"HKCR\\" + "." + ext + "\\OpenWithProgIDs", ExeFilenameNoExt + "." + ext, ""); - if (App.VideoTypes.Contains(ext)) - RegHelp.SetObject($"HKCR\\" + "." + ext, "PerceivedType", "video"); - if (App.AudioTypes.Contains(ext)) - RegHelp.SetObject($"HKCR\\" + "." + ext, "PerceivedType", "audio"); - if (App.ImageTypes.Contains(ext)) - RegHelp.SetObject($"HKCR\\" + "." + ext, "PerceivedType", "image"); + if (App.VideoTypes.Contains(ext)) RegHelp.SetObject($"HKCR\\" + "." + ext, "PerceivedType", "video"); + if (App.AudioTypes.Contains(ext)) RegHelp.SetObject($"HKCR\\" + "." + ext, "PerceivedType", "audio"); + if (App.ImageTypes.Contains(ext)) RegHelp.SetObject($"HKCR\\" + "." + ext, "PerceivedType", "image"); RegHelp.SetObject($"HKCR\\" + ExeFilenameNoExt + "." + ext + "\\shell\\open", null, "Play with " + Application.ProductName); RegHelp.SetObject($"HKCR\\" + ExeFilenameNoExt + "." + ext + "\\shell\\open\\command", null, $"\"{ExePath}\" \"%1\""); RegHelp.SetObject(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities\FileAssociations", "." + ext, ExeFilenameNoExt + "." + ext); @@ -179,17 +177,16 @@ namespace mpvnet public static void Unregister() { - RegHelp.RemoveKey(@"HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" + ExeFilename); + RegHelp.RemoveKey($"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\{ExeFilename}"); RegHelp.RemoveKey($"HKCR\\Applications\\{ExeFilename}"); - RegHelp.RemoveKey(@"HKLM\SOFTWARE\Clients\Media\mpv.net"); + RegHelp.RemoveKey($"HKLM\\SOFTWARE\\Clients\\Media\\mpv.net"); RegHelp.RemoveKey($"HKCR\\SystemFileAssociations\\video\\OpenWithList\\{ExeFilename}"); RegHelp.RemoveKey($"HKCR\\SystemFileAssociations\\audio\\OpenWithList\\{ExeFilename}"); + RegHelp.RemoveValue(@"HKLM\SOFTWARE\RegisteredApplications", "mpv.net"); foreach (string id in Registry.ClassesRoot.GetSubKeyNames()) { - if (id.StartsWith(ExeFilenameNoExt + ".")) - Registry.ClassesRoot.DeleteSubKeyTree(id); - + if (id.StartsWith(ExeFilenameNoExt + ".")) Registry.ClassesRoot.DeleteSubKeyTree(id); RegHelp.RemoveValue($"HKCR\\Software\\Classes\\" + id + "\\OpenWithProgIDs", ExeFilenameNoExt + id); RegHelp.RemoveValue($"HKLM\\Software\\Classes\\" + id + "\\OpenWithProgIDs", ExeFilenameNoExt + id); }