/// <summary> /// Installs the current Key in the Registry /// </summary> /// <param name="K">Key details</param> public static void InstallKey(MakeMKV K) { Registry.SetValue(KEYNAME, "app_Key", K.key); Registry.SetValue(KEYNAME, "updater_Version", GetVersion()); Registry.SetValue(KEYNAME, "updater_KeyCheck", K.date, RegistryValueKind.DWord); Registry.SetValue(KEYNAME, "updater_KeyExpires", K.keydate, RegistryValueKind.DWord); }
/// <summary> /// Gets the Date and Time of the last Key Update /// </summary> /// <returns>DateTime for KeyUpdate.</returns> public static DateTime LastKeyInstall() { var Raw = Registry.GetValue(KEYNAME, "updater_KeyCheck", -1); var UnixTime = Raw == null ? -1 : (int)Raw; if (UnixTime == -1) { return(DateTime.MinValue); } return(MakeMKV.FromUnixTime(UnixTime)); }
/// <summary> /// Gets the Date and Time when the currently used key will expire /// </summary> /// <returns>DateTime for KeyUpdate.</returns> public static DateTime InstalledKeyExpiration() { var Raw = Registry.GetValue(KEYNAME, "updater_KeyExpires", -1); var UnixTime = Raw == null ? -1 : (int)Raw; if (UnixTime == -1) { return(DateTime.MinValue); } return(MakeMKV.FromUnixTime(UnixTime)); }