This repository has been archived on 2025-06-05. You can view files and clone it, but cannot push or open issues or pull requests.
2025-05-02 08:50:12 -07:00

23 lines
635 B
C#

using Microsoft.Win32;
namespace RobloxLegacy.Utilities;
public static class Registry
{
private static RegistryKey? OpenKey(bool writable = true)
{
return Microsoft.Win32.Registry.CurrentUser.CreateSubKey(@"Software\RobloxLegacy", writable);
}
public static void SaveVersion(string appName, string version)
{
using var key = OpenKey();
key?.SetValue($"{appName}Version", version, RegistryValueKind.String);
}
public static string? GetVersion(string appName)
{
using var key = OpenKey(false);
return key?.GetValue($"{appName}Version") as string;
}
}