Saving last Release Stream in Registry
This commit is contained in:
1 parent
d71f0d38fc
commit
0937fa43a3
3 files changed
+62
-6
No files matched your search
@@ -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