diff --git a/RobloxLegacy/Utilities/Registry.cs b/RobloxLegacy/Utilities/Registry.cs new file mode 100644 index 0000000..bea22f3 --- /dev/null +++ b/RobloxLegacy/Utilities/Registry.cs @@ -0,0 +1,23 @@ +using Microsoft.Win32; + +namespace RobloxLegacy.Utilities; + +public 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; + } +} \ No newline at end of file