mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-05-21 12:53:18 +12:00
Merge pull request #293 from Stevoisiak/oneclick-registry-description
Add description for OneClick registry keys
This commit is contained in:
commit
37375b1026
|
@ -162,18 +162,18 @@ namespace ModAssistant
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "--register":
|
case "--register":
|
||||||
if (args.Length < 2 || string.IsNullOrEmpty(args[1]))
|
if (args.Length < 3 || string.IsNullOrEmpty(args[1]))
|
||||||
{
|
{
|
||||||
Utils.SendNotify(string.Format((string)Current.FindResource("App:InvalidArgument"), "--register"));
|
Utils.SendNotify(string.Format((string)Current.FindResource("App:InvalidArgument"), "--register"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OneClickInstaller.Register(args[1], true);
|
OneClickInstaller.Register(args[1], true, args[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Update = false;
|
Update = false;
|
||||||
GUI = false;
|
GUI = false;
|
||||||
args = Shift(args, 2);
|
args = Shift(args, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "--unregister":
|
case "--unregister":
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace ModAssistant
|
||||||
await API.Playlists.DownloadAll(uri);
|
await API.Playlists.DownloadAll(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Register(string Protocol, bool Background = false)
|
public static void Register(string Protocol, bool Background = false, string Description = null)
|
||||||
{
|
{
|
||||||
if (IsRegistered(Protocol) == true)
|
if (IsRegistered(Protocol) == true)
|
||||||
return;
|
return;
|
||||||
|
@ -75,6 +75,10 @@ namespace ModAssistant
|
||||||
|
|
||||||
if (ProtocolKey.GetValue("OneClick-Provider", "").ToString() != "ModAssistant")
|
if (ProtocolKey.GetValue("OneClick-Provider", "").ToString() != "ModAssistant")
|
||||||
{
|
{
|
||||||
|
if (Description != null)
|
||||||
|
{
|
||||||
|
ProtocolKey.SetValue("", Description, RegistryValueKind.String);
|
||||||
|
}
|
||||||
ProtocolKey.SetValue("URL Protocol", "", RegistryValueKind.String);
|
ProtocolKey.SetValue("URL Protocol", "", RegistryValueKind.String);
|
||||||
ProtocolKey.SetValue("OneClick-Provider", "ModAssistant", RegistryValueKind.String);
|
ProtocolKey.SetValue("OneClick-Provider", "ModAssistant", RegistryValueKind.String);
|
||||||
CommandKey.SetValue("", $"\"{Utils.ExePath}\" \"--install\" \"%1\"");
|
CommandKey.SetValue("", $"\"{Utils.ExePath}\" \"--install\" \"%1\"");
|
||||||
|
@ -84,7 +88,7 @@ namespace ModAssistant
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Utils.StartAsAdmin($"\"--register\" \"{Protocol}\"");
|
Utils.StartAsAdmin($"\"--register\" \"{Protocol}\" \"{Description}\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -137,7 +137,7 @@ namespace ModAssistant.Pages
|
||||||
|
|
||||||
public void ModelSaberProtocolHandler_Checked(object sender, RoutedEventArgs e)
|
public void ModelSaberProtocolHandler_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
OneClickInstaller.Register("modelsaber");
|
OneClickInstaller.Register("modelsaber", Description: "URL:ModelSaber OneClick Install");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ModelSaberProtocolHandler_Unchecked(object sender, RoutedEventArgs e)
|
public void ModelSaberProtocolHandler_Unchecked(object sender, RoutedEventArgs e)
|
||||||
|
@ -147,7 +147,7 @@ namespace ModAssistant.Pages
|
||||||
|
|
||||||
public void BeatSaverProtocolHandler_Checked(object sender, RoutedEventArgs e)
|
public void BeatSaverProtocolHandler_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
OneClickInstaller.Register("beatsaver");
|
OneClickInstaller.Register("beatsaver", Description: "URL:BeatSaver OneClick Install");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BeatSaverProtocolHandler_Unchecked(object sender, RoutedEventArgs e)
|
public void BeatSaverProtocolHandler_Unchecked(object sender, RoutedEventArgs e)
|
||||||
|
@ -156,7 +156,7 @@ namespace ModAssistant.Pages
|
||||||
}
|
}
|
||||||
public void PlaylistsProtocolHandler_Checked(object sender, RoutedEventArgs e)
|
public void PlaylistsProtocolHandler_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
OneClickInstaller.Register("bsplaylist");
|
OneClickInstaller.Register("bsplaylist", Description: "URL:BeatSaver Playlist OneClick Install");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlaylistsProtocolHandler_Unchecked(object sender, RoutedEventArgs e)
|
public void PlaylistsProtocolHandler_Unchecked(object sender, RoutedEventArgs e)
|
||||||
|
|
Loading…
Reference in a new issue