Saving last Release Stream in Registry
This commit is contained in:
41
EZPPClient Installer/Utils/RegistryUtil.cs
Normal file
41
EZPPClient Installer/Utils/RegistryUtil.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EZPPClient_Installer.Utils
|
||||
{
|
||||
class RegistryUtil
|
||||
{
|
||||
|
||||
public static void SetUsedReleaseStream(string release)
|
||||
{
|
||||
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\EZPPClientInstaller");
|
||||
key.SetValue("ReleaseStream", release);
|
||||
key.Close();
|
||||
}
|
||||
|
||||
public static String GetUsedReleaseStream(string defaultRelease)
|
||||
{
|
||||
string release = defaultRelease;
|
||||
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\EZPPClientInstaller");
|
||||
|
||||
//if it does exist, retrieve the stored values
|
||||
if (key != null)
|
||||
{
|
||||
release = (string) key.GetValue("ReleaseStream");
|
||||
key.Close();
|
||||
}
|
||||
|
||||
return release;
|
||||
}
|
||||
|
||||
public static void DeleteUsedReleaseStream()
|
||||
{
|
||||
Registry.CurrentUser.DeleteSubKey(@"SOFTWARE\EZPPClientInstaller");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user