From 4bc7d806a00a1fcb64ea1680d3cc1ba5d8abfac8 Mon Sep 17 00:00:00 2001 From: murdle Date: Thu, 1 May 2025 16:58:10 -0700 Subject: [PATCH] forgot to add registry.cs --- RobloxLegacy/Utilities/Registry.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 RobloxLegacy/Utilities/Registry.cs 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