mirror of
https://github.com/JuniorDark/RustyHearts-Launcher.git
synced 2026-05-07 05:21:44 -04:00
Version 1.2.0
This commit is contained in:
parent
9b3a0e00a2
commit
e74d93fab9
83 changed files with 110087 additions and 47507 deletions
|
|
@ -2,12 +2,13 @@
|
|||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace RHLauncher.Helper
|
||||
namespace RHLauncher.RHLauncher.Helper
|
||||
{
|
||||
public class RegistryHandler
|
||||
{
|
||||
private const string KEY_NAME = "RustyHearts\\UserInfo";
|
||||
private const string INSTALL_DIR_KEY = "InstallDirectory";
|
||||
private const string TEMP_INSTALL_DIR_KEY = "TempInstallDirectory";
|
||||
private readonly RegistryKey key;
|
||||
|
||||
public RegistryHandler()
|
||||
|
|
@ -56,6 +57,11 @@ namespace RHLauncher.Helper
|
|||
key.SetValue(INSTALL_DIR_KEY, directory ?? string.Empty);
|
||||
}
|
||||
|
||||
public void SaveTempInstallDirectory(string directory)
|
||||
{
|
||||
key.SetValue(TEMP_INSTALL_DIR_KEY, directory ?? string.Empty);
|
||||
}
|
||||
|
||||
public string GetInstallDirectory()
|
||||
{
|
||||
return key.GetValue(INSTALL_DIR_KEY)?.ToString() ?? string.Empty;
|
||||
|
|
@ -70,6 +76,20 @@ namespace RHLauncher.Helper
|
|||
}
|
||||
}
|
||||
|
||||
public string GetTempInstallDirectory()
|
||||
{
|
||||
return key.GetValue(TEMP_INSTALL_DIR_KEY)?.ToString() ?? string.Empty;
|
||||
}
|
||||
|
||||
public void ClearTempInstallDirectory()
|
||||
{
|
||||
var value = key.GetValue(TEMP_INSTALL_DIR_KEY)?.ToString();
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
key.DeleteValue(TEMP_INSTALL_DIR_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteValues(string KEY_NAME)
|
||||
{
|
||||
var value = key.GetValue(KEY_NAME) as string ?? "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue