Version 1.2.0

This commit is contained in:
Junior 2024-01-04 22:59:30 -03:00
parent 9b3a0e00a2
commit e74d93fab9
83 changed files with 110087 additions and 47507 deletions

View file

@ -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 ?? "";