From 5e3bce9a922479e10627a9cb7354cb35001fa57c Mon Sep 17 00:00:00 2001
From: xRushG <145561288+xRushG@users.noreply.github.com>
Date: Tue, 1 Oct 2024 12:19:41 +0200
Subject: [PATCH] refactor: Apply the async logic for Credentials and Updates
registry settings, remove obsolete code
- Moved async registry loading logic to OptRegistryCredentialsPage and OptRegistryUpdatesPage to improve structure and maintainability.
- Removed obsolete logic and redundant code that is no longer needed due to the new asynchronous architecture.
- Enhanced settings management to take advantage of the just-in-time loading mechanism.
- Improved performance by ensuring registry settings are loaded asynchronously right before they are needed by the UI or application logic, minimizing unnecessary loads.
- Update documents
---
mRemoteNG/App/Info/WindowsRegistryInfo.cs | 55 ++++
.../Registry/CommonRegistrySettings.cs | 15 +-
.../Registry/OptRegistryCredentialsPage.cs | 138 ++++++++--
.../Registry/OptRegistryUpdatesPage.cs | 197 +++++++++++--
.../UI/Forms/OptionsPages/CredentialsPage.cs | 181 ++++--------
.../UI/Forms/OptionsPages/OptionsPage.cs | 20 +-
.../UI/Forms/OptionsPages/UpdatesPage.cs | 259 +++++-------------
mRemoteNG/UI/Forms/frmMain.cs | 1 -
mRemoteNGDocumentation/index.rst | 1 -
.../registry/credential_settings.rst | 253 +++++++++--------
.../registry_settings_information.rst | 1 +
.../registry/updates_settings.rst | 241 ++++++++--------
.../registry_settings_guide.rst | 14 +-
13 files changed, 754 insertions(+), 622 deletions(-)
rename mRemoteNGDocumentation/{ => registry}/registry_settings_information.rst (99%)
diff --git a/mRemoteNG/App/Info/WindowsRegistryInfo.cs b/mRemoteNG/App/Info/WindowsRegistryInfo.cs
index 04e4824bb..ae35ae8d0 100644
--- a/mRemoteNG/App/Info/WindowsRegistryInfo.cs
+++ b/mRemoteNG/App/Info/WindowsRegistryInfo.cs
@@ -16,17 +16,72 @@ public static class WindowsRegistryInfo
#region Key Locations
+ // StartupExit
+ // Registry subkey for general application startup and exit settings
+ // Registry subkey for startup and exit options page settings
+ public const string StartupExit = RootKey + "\\StartupExit";
+ public const string StartupExitOptions = StartupExit + "\\" + OptionsSubKey;
+
+ // Appearance
+ // Registry subkey for general application appearance settings
+ // Registry subkey for appearance options page settings
+ public const string Appearance = RootKey + "\\Appearance";
+ public const string AppearanceOptions = Appearance + "\\" + OptionsSubKey;
+
+ // Connections
+ // Registry subkey for general application connection settings
+ // Registry subkey for connections options page settings
+ public const string Connection = RootKey + "\\Connections";
+ public const string ConnectionOptions = Connection + "\\" + OptionsSubKey;
+
+ // Tabs & Panels
+ // Registry subkey for general application tabs and panels settings
+ // Registry subkey for tabs and panels options page settings
+ public const string TabsAndPanels = RootKey + "\\TabsAndPanels";
+ public const string TabsAndPanelsOptions = TabsAndPanels + "\\" + OptionsSubKey;
+
+ // Notifications
+ // Registry subkey for general application notifications settings
+ // Registry subkey for notifications options page settings
+ public const string Notification = RootKey + "\\Notifications";
+ public const string NotificationOptions = Notification + "\\" + OptionsSubKey;
+
// Credential
// Registry subkey for general application credentials settings
// Registry subkey for credentials options page settings
public const string Credential = RootKey + "\\Credentials";
public const string CredentialOptions = Credential + "\\" + OptionsSubKey;
+ // SQL Server
+ // Registry subkey for general application SQL server settings
+ // Registry subkey for SQL server options page settings
+ public const string SQLServer = RootKey + "\\SQLServer";
+ public const string SQLServerOptions = SQLServer + "\\" + OptionsSubKey;
+
// Updates
// Registry subkey for general application update settings
// Registry subkey for updates options page settings
public const string Update = RootKey + "\\Updates";
public const string UpdateOptions = Update + "\\" + OptionsSubKey;
+
+ // Security
+ // Registry subkey for general application security settings
+ // Registry subkey for security options page settings
+ public const string Security = RootKey + "\\Security";
+ public const string SecurityOptions = Security + "\\" + OptionsSubKey;
+
+ // Advanced
+ // Registry subkey for general application advanced settings
+ // Registry subkey for advanced options page settings
+ public const string Advanced = RootKey + "\\Advanced";
+ public const string AdvancedOptions = Advanced + "\\" + OptionsSubKey;
+
+ // Backup
+ // Registry subkey for general application backup settings
+ // Registry subkey for backup options page settings
+ public const string Backup = RootKey + "\\Backup";
+ public const string BackupOptions = Backup + "\\" + OptionsSubKey;
+
#endregion
}
}
\ No newline at end of file
diff --git a/mRemoteNG/Config/Settings/Registry/CommonRegistrySettings.cs b/mRemoteNG/Config/Settings/Registry/CommonRegistrySettings.cs
index 43f13ffb1..6377f02a7 100644
--- a/mRemoteNG/Config/Settings/Registry/CommonRegistrySettings.cs
+++ b/mRemoteNG/Config/Settings/Registry/CommonRegistrySettings.cs
@@ -6,9 +6,6 @@
namespace mRemoteNG.Config.Settings.Registry
{
[SupportedOSPlatform("windows")]
- /// Static utility class that provides access to and management of registry settings on the local machine.
- /// It abstracts complex registry operations and centralizes the handling of various registry keys.
- /// Benefits: Simplified code, enhances maintainability, and ensures consistency. #ReadOnly
public static class CommonRegistrySettings
{
#region general update registry settings
@@ -37,10 +34,6 @@ public static class CommonRegistrySettings
///
public static bool AllowCheckForUpdatesManual { get; }
- ///
- /// Specifies whether a question about checking for updates is displayed at startup.
- ///
- public static bool AllowPromptForUpdatesPreference { get; }
#endregion
@@ -70,21 +63,21 @@ public static class CommonRegistrySettings
static CommonRegistrySettings()
{
- IRegistry regValueUtility = new WinRegistry();
+ IRegistryRead regValueUtility = new WinRegistry();
RegistryHive hive = WindowsRegistryInfo.Hive;
- #region update registry settings setup
+ #region update registry settings
string updateSubkey = WindowsRegistryInfo.Update;
AllowCheckForUpdates = regValueUtility.GetBoolValue(hive, updateSubkey, nameof(AllowCheckForUpdates), true);
AllowCheckForUpdatesAutomatical = regValueUtility.GetBoolValue(hive, updateSubkey, nameof(AllowCheckForUpdatesAutomatical), AllowCheckForUpdates);
AllowCheckForUpdatesManual = regValueUtility.GetBoolValue(hive, updateSubkey, nameof(AllowCheckForUpdatesManual), AllowCheckForUpdates);
- AllowPromptForUpdatesPreference = regValueUtility.GetBoolValue(hive, updateSubkey, nameof(AllowPromptForUpdatesPreference), AllowCheckForUpdates);
+
#endregion
- #region credential registry settings setup
+ #region credential registry settings
string credentialSubkey = WindowsRegistryInfo.Credential;
diff --git a/mRemoteNG/Config/Settings/Registry/OptRegistryCredentialsPage.cs b/mRemoteNG/Config/Settings/Registry/OptRegistryCredentialsPage.cs
index f4de2e41d..2de4d7616 100644
--- a/mRemoteNG/Config/Settings/Registry/OptRegistryCredentialsPage.cs
+++ b/mRemoteNG/Config/Settings/Registry/OptRegistryCredentialsPage.cs
@@ -1,30 +1,24 @@
using System.Runtime.Versioning;
using Microsoft.Win32;
+using mRemoteNG.App;
using mRemoteNG.App.Info;
+using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tools.WindowsRegistry;
namespace mRemoteNG.Config.Settings.Registry
{
[SupportedOSPlatform("windows")]
- /// Static utility class that provides access to and management of registry settings on the local machine.
- /// It abstracts complex registry operations and centralizes the handling of various registry keys.
- /// Benefits: Simplified code, enhances maintainability, and ensures consistency. #ReadOnly
public sealed partial class OptRegistryCredentialsPage
{
#region option page credential registry settings
- ///
- /// Indicates whether modifying credential page settings is enabled.
- ///
- public bool CredentialPageEnabled { get; }
-
///
/// Specifies the radio button is set to none, windows or custom on the credentials page.
///
///
/// When set to noinfo or windows, WindowsCredentials and CustomCredentials are not evaluated and disabled.
///
- public WinRegistryEntry UseCredentials { get; }
+ public WinRegistryEntry UseCredentials { get; private set; }
///
/// Specifies the user set via API as the default username.
@@ -32,7 +26,7 @@ public sealed partial class OptRegistryCredentialsPage
///
/// Only avaiable if UseCredentials is set to custom!
///
- public WinRegistryEntry UserViaAPIDefault { get; }
+ public WinRegistryEntry UserViaAPIDefault { get; private set; }
///
/// Specifies the default username.
@@ -40,7 +34,7 @@ public sealed partial class OptRegistryCredentialsPage
///
/// Only avaiable if UseCredentials is set to custom!
///
- public WinRegistryEntry DefaultUsername { get; }
+ public WinRegistryEntry DefaultUsername { get; private set; }
///
/// Specifies the default password.
@@ -48,7 +42,7 @@ public sealed partial class OptRegistryCredentialsPage
///
/// Only avaiable if UseCredentials is set to custom!
///
- public WinRegistryEntry DefaultPassword { get; }
+ public WinRegistryEntry DefaultPassword { get; private set; }
///
/// Specifies the default domain.
@@ -56,27 +50,129 @@ public sealed partial class OptRegistryCredentialsPage
///
/// Only avaiable if UseCredentials is set to custom!
///
- public WinRegistryEntry DefaultDomain { get; }
+ public WinRegistryEntry DefaultDomain { get; private set; }
+
+ ///
+ /// Specifies that entering the custom default username field is enabled.
+ ///
+ public bool DefaultUsernameEnabled { get; private set; }
+
+ ///
+ /// Specifies that entering the custom default password field is enabled.
+ ///
+ public bool DefaultPasswordEnabled { get; private set; }
+
+ ///
+ /// Specifies that entering the custom default api user field is enabled.
+ ///
+ public bool DefaultUserViaAPIEnabled { get; private set; }
#endregion
public OptRegistryCredentialsPage()
{
- IRegistry regValueUtility = new WinRegistry();
+ IRegistryRead regValueUtility = new WinRegistry();
RegistryHive hive = WindowsRegistryInfo.Hive;
string subKey = WindowsRegistryInfo.CredentialOptions;
- CredentialPageEnabled = regValueUtility.GetBoolValue(hive, subKey, nameof(CredentialPageEnabled), true);
- UseCredentials = new WinRegistryEntry(hive, subKey, nameof(UseCredentials)).SetValidation(
- new string[] {
- "noinfo",
- "windows",
- "custom"
- }).Read();
+ UseCredentials = new WinRegistryEntry(hive, subKey, nameof(UseCredentials)).Read();
UserViaAPIDefault = new WinRegistryEntry(hive, subKey, nameof(UserViaAPIDefault)).Read();
DefaultUsername = new WinRegistryEntry(hive, subKey, nameof(DefaultUsername)).Read();
DefaultPassword = new WinRegistryEntry(hive, subKey, nameof(DefaultPassword)).Read();
DefaultDomain = new WinRegistryEntry(hive, subKey, nameof(DefaultDomain)).Read();
+
+ DefaultUsernameEnabled = regValueUtility.GetBoolValue(hive, subKey, nameof(DefaultUsernameEnabled), true);
+ DefaultPasswordEnabled = regValueUtility.GetBoolValue(hive, subKey, nameof(DefaultPasswordEnabled), true);
+ DefaultUserViaAPIEnabled = regValueUtility.GetBoolValue(hive, subKey, nameof(DefaultUserViaAPIEnabled), true);
+
+ SetupValidation();
+ Apply();
+ }
+
+ ///
+ /// Configures validation settings for various parameters
+ ///
+ private void SetupValidation()
+ {
+ UseCredentials.SetValidation(
+ new string[] {
+ "noinfo",
+ "windows",
+ "custom"
+ });
+ }
+
+ ///
+ /// Applies registry settings and overrides various properties.
+ ///
+ private void Apply()
+ {
+ // UseCredentials musst be present in registry.
+ if (! UseCredentials.IsSet)
+ return;
+ ApplyUseCredentials();
+
+ // UseCredentials musst be set to custom.
+ if (UseCredentials.Value != "custom")
+ return;
+
+ ApplyDefaultUsername();
+ ApplyDefaultPassword();
+ ApplyDefaultDomain();
+ ApplyUserViaAPIDefault();
+ }
+
+ private void ApplyUseCredentials()
+ {
+ if (UseCredentials.IsValid)
+ Properties.OptionsCredentialsPage.Default.EmptyCredentials = UseCredentials.Value;
+ }
+
+ private void ApplyDefaultUsername()
+ {
+ if (DefaultUsername.IsSet && DefaultUsernameEnabled)
+ Properties.OptionsCredentialsPage.Default.DefaultUsername = DefaultUsername.Value;
+ else if (!DefaultUsernameEnabled)
+ Properties.OptionsCredentialsPage.Default.DefaultUsername = "";
+ }
+
+ private void ApplyDefaultPassword()
+ {
+ if (DefaultPassword.IsSet && DefaultPasswordEnabled)
+ {
+ try
+ {
+ LegacyRijndaelCryptographyProvider cryptographyProvider = new();
+ string decryptedPassword;
+ string defaultPassword = DefaultPassword.Value;
+
+ decryptedPassword = cryptographyProvider.Decrypt(defaultPassword, Runtime.EncryptionKey);
+ Properties.OptionsCredentialsPage.Default.DefaultPassword = defaultPassword;
+ }
+ catch
+ {
+ // Fire-and-forget: The DefaultPassword in the registry is not encrypted.
+ DefaultPassword.Clear();
+ }
+ }
+ else if (!DefaultPasswordEnabled)
+ {
+ Properties.OptionsCredentialsPage.Default.DefaultPassword = "";
+ }
+ }
+
+ private void ApplyDefaultDomain()
+ {
+ if (DefaultDomain.IsSet)
+ Properties.OptionsCredentialsPage.Default.DefaultDomain = DefaultDomain.Value;
+ }
+
+ private void ApplyUserViaAPIDefault()
+ {
+ if (UserViaAPIDefault.IsSet && DefaultUserViaAPIEnabled)
+ Properties.OptionsCredentialsPage.Default.UserViaAPIDefault = UserViaAPIDefault.Value;
+ else if (!DefaultUserViaAPIEnabled)
+ Properties.OptionsCredentialsPage.Default.UserViaAPIDefault = "";
}
}
}
\ No newline at end of file
diff --git a/mRemoteNG/Config/Settings/Registry/OptRegistryUpdatesPage.cs b/mRemoteNG/Config/Settings/Registry/OptRegistryUpdatesPage.cs
index 8de6f8c94..f07114601 100644
--- a/mRemoteNG/Config/Settings/Registry/OptRegistryUpdatesPage.cs
+++ b/mRemoteNG/Config/Settings/Registry/OptRegistryUpdatesPage.cs
@@ -1,20 +1,24 @@
using System.Runtime.Versioning;
using Microsoft.Win32;
+using mRemoteNG.App;
using mRemoteNG.App.Info;
+using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tools.WindowsRegistry;
namespace mRemoteNG.Config.Settings.Registry
{
[SupportedOSPlatform("windows")]
- /// Static utility class that provides access to and management of registry settings on the local machine.
- /// It abstracts complex registry operations and centralizes the handling of various registry keys.
- /// Benefits: Simplified code, enhances maintainability, and ensures consistency. #ReadOnly
public sealed partial class OptRegistryUpdatesPage
{
+ ///
+ /// Specifies whether a popup is shown to configure update preferences at startup.
+ ///
+ public WinRegistryEntry DisallowPromptForUpdatesPreference { get; private set; }
+
///
/// Specifies the number of days between update checks.
///
- public WinRegistryEntry CheckForUpdatesFrequencyDays { get; }
+ public WinRegistryEntry CheckForUpdatesFrequencyDays { get; private set; }
///
/// Specifies the update channel for updates.
@@ -22,58 +26,213 @@ public sealed partial class OptRegistryUpdatesPage
///
/// The update channel should be one of the predefined values: Stable, Preview, Nightly.
///
- public WinRegistryEntry UpdateChannel { get; }
+ public WinRegistryEntry UpdateChannel { get; private set; }
///
/// Indicates whether proxy usage for updates is enabled.
///
- public WinRegistryEntry UseProxyForUpdates { get; }
+ public WinRegistryEntry UseProxyForUpdates { get; private set; }
///
/// Specifies the proxy address for updates.
///
- public WinRegistryEntry ProxyAddress { get; }
+ public WinRegistryEntry ProxyAddress { get; private set; }
///
/// Specifies the proxy port for updates.
///
- public WinRegistryEntry ProxyPort { get; }
+ public WinRegistryEntry ProxyPort { get; private set; }
///
/// Indicates whether proxy authentication is enabled.
///
- public WinRegistryEntry UseProxyAuthentication { get; }
+ public WinRegistryEntry UseProxyAuthentication { get; private set; }
///
/// Specifies the authentication username for the proxy.
///
- public WinRegistryEntry ProxyAuthUser { get; }
+ public WinRegistryEntry ProxyAuthUser { get; private set; }
///
/// Specifies the authentication password for the proxy.
///
- public WinRegistryEntry ProxyAuthPass { get; }
+ public WinRegistryEntry ProxyAuthPass { get; private set; }
public OptRegistryUpdatesPage()
{
RegistryHive hive = WindowsRegistryInfo.Hive;
string subKey = WindowsRegistryInfo.UpdateOptions;
+ DisallowPromptForUpdatesPreference = new WinRegistryEntry(hive, subKey, nameof(DisallowPromptForUpdatesPreference)).Read();
CheckForUpdatesFrequencyDays = new WinRegistryEntry(hive, subKey, nameof(CheckForUpdatesFrequencyDays)).Read();
- UpdateChannel = new WinRegistryEntry(hive, subKey, nameof(UpdateChannel))
- .SetValidation(new string[] {
- UpdateChannelInfo.STABLE,
- UpdateChannelInfo.PREVIEW,
- UpdateChannelInfo.NIGHTLY
- }).Read();
-
+ UpdateChannel = new WinRegistryEntry(hive, subKey, nameof(UpdateChannel)).Read();
UseProxyForUpdates = new WinRegistryEntry(hive, subKey, nameof(UseProxyForUpdates)).Read();
ProxyAddress = new WinRegistryEntry(hive, subKey, nameof(ProxyAddress)).Read();
ProxyPort = new WinRegistryEntry(hive, subKey, nameof(ProxyPort)).Read();
-
UseProxyAuthentication = new WinRegistryEntry(hive, subKey, nameof(UseProxyAuthentication)).Read();
ProxyAuthUser = new WinRegistryEntry(hive, subKey, nameof(ProxyAuthUser)).Read();
ProxyAuthPass = new WinRegistryEntry(hive, subKey, nameof(ProxyAuthPass)).Read();
+
+ SetupValidation();
+ Apply();
+ }
+
+ ///
+ /// Configures validation settings for various parameters
+ ///
+ private void SetupValidation()
+ {
+ var connectionsPage = new UI.Forms.OptionsPages.UpdatesPage();
+
+ UpdateChannel.SetValidation(new string[] {
+ UpdateChannelInfo.STABLE,
+ UpdateChannelInfo.PREVIEW,
+ UpdateChannelInfo.NIGHTLY
+ });
+
+
+ int proxyPortMin = (int)connectionsPage.numProxyPort.Minimum;
+ int proxyPortMax = (int)connectionsPage.numProxyPort.Maximum;
+ ProxyPort.SetValidation(proxyPortMin, proxyPortMax);
+ }
+
+ ///
+ /// Applies registry settings and overrides various properties.
+ ///
+ private void Apply()
+ {
+ // Common settings were applied, all update settings are disabled.
+ if (ApplyCommonUpdateCheckSettings())
+ return;
+
+ ApplyAllowPromptForUpdatesPreference();
+ ApplyCheckForUpdatesOnStartup();
+ ApplyCheckForUpdatesFrequencyDays();
+ ApplyUpdateChannel();
+ ApplyProxyForUpdates();
+ ApplyAuthentication();
+ }
+
+ private static bool ApplyCommonUpdateCheckSettings()
+ {
+ bool updatesNotAllowed =
+ !CommonRegistrySettings.AllowCheckForUpdates
+ || (!CommonRegistrySettings.AllowCheckForUpdatesAutomatical
+ && !CommonRegistrySettings.AllowCheckForUpdatesManual);
+
+ if (updatesNotAllowed)
+ {
+ Properties.OptionsUpdatesPage.Default.CheckForUpdatesAsked = true;
+
+ Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup = false;
+ Properties.OptionsUpdatesPage.Default.CheckForUpdatesFrequencyDays = 14;
+
+
+ Properties.OptionsUpdatesPage.Default.UpdateUseProxy = false;
+ Properties.OptionsUpdatesPage.Default.UpdateProxyAddress = "";
+ Properties.OptionsUpdatesPage.Default.UpdateProxyPort = 80;
+
+ Properties.OptionsUpdatesPage.Default.UpdateProxyUseAuthentication = false;
+ Properties.OptionsUpdatesPage.Default.UpdateProxyAuthUser = "";
+ Properties.OptionsUpdatesPage.Default.UpdateProxyAuthPass = "";
+ }
+
+ return updatesNotAllowed;
+ }
+
+ private void ApplyAllowPromptForUpdatesPreference()
+ {
+ if (DisallowPromptForUpdatesPreference.IsSet && DisallowPromptForUpdatesPreference.Value == true)
+ Properties.OptionsUpdatesPage.Default.CheckForUpdatesAsked = true;
+ }
+
+ private void ApplyCheckForUpdatesOnStartup()
+ {
+ if (!CommonRegistrySettings.AllowCheckForUpdatesAutomatical)
+ Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup = false;
+ }
+
+ private void ApplyCheckForUpdatesFrequencyDays()
+ {
+ if (CommonRegistrySettings.AllowCheckForUpdatesAutomatical && CheckForUpdatesFrequencyDays.IsSet)
+ {
+ if (CheckForUpdatesFrequencyDays.Value < 0)
+ {
+ Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup = false;
+ }
+ else if (CheckForUpdatesFrequencyDays.IsValid)
+ {
+ Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup = true;
+ Properties.OptionsUpdatesPage.Default.CheckForUpdatesFrequencyDays = CheckForUpdatesFrequencyDays.Value;
+ }
+ }
+ }
+
+ private void ApplyUpdateChannel()
+ {
+ if (UpdateChannel.IsValid)
+ Properties.OptionsUpdatesPage.Default.UpdateChannel = UpdateChannel.Value;
+ }
+
+ private void ApplyProxyForUpdates()
+ {
+ if (UseProxyForUpdates.IsSet)
+ {
+ Properties.OptionsUpdatesPage.Default.UpdateUseProxy = UseProxyForUpdates.Value;
+
+ if (!UseProxyForUpdates.Value)
+ {
+ Properties.OptionsUpdatesPage.Default.UpdateProxyAddress = "";
+ Properties.OptionsUpdatesPage.Default.UpdateProxyPort = 80;
+ Properties.OptionsUpdatesPage.Default.UpdateProxyUseAuthentication = false;
+ }
+
+ if (ProxyAddress.IsSet && UseProxyForUpdates.Value)
+ {
+ Properties.OptionsUpdatesPage.Default.UpdateProxyAddress = ProxyAddress.Value;
+ }
+
+ if (ProxyPort.IsValid && UseProxyForUpdates.Value)
+ {
+ Properties.OptionsUpdatesPage.Default.UpdateProxyPort = ProxyPort.Value;
+ }
+ }
+ }
+
+ private void ApplyAuthentication()
+ {
+ if (UseProxyForUpdates.Value && UseProxyAuthentication.IsSet)
+ {
+ Properties.OptionsUpdatesPage.Default.UpdateProxyUseAuthentication = UseProxyAuthentication.Value;
+
+ if (!UseProxyAuthentication.Value)
+ {
+ Properties.OptionsUpdatesPage.Default.UpdateProxyAuthUser = "";
+ Properties.OptionsUpdatesPage.Default.UpdateProxyAuthPass = "";
+ }
+
+ if (ProxyAuthUser.IsSet && UseProxyAuthentication.Value)
+ {
+ Properties.OptionsUpdatesPage.Default.UpdateProxyAuthUser = ProxyAuthUser.Value;
+ }
+
+ if (ProxyAuthPass.IsSet && UseProxyAuthentication.Value)
+ {
+ try
+ {
+ LegacyRijndaelCryptographyProvider cryptographyProvider = new();
+ string decryptedPassword;
+ string proxyAuthPass = ProxyAuthPass.Value;
+ decryptedPassword = cryptographyProvider.Decrypt(proxyAuthPass, Runtime.EncryptionKey);
+
+ Properties.OptionsUpdatesPage.Default.UpdateProxyAuthPass = decryptedPassword;
+ }
+ catch
+ {
+ // The password in the registry is not encrypted.
+ }
+ }
+ }
}
}
}
\ No newline at end of file
diff --git a/mRemoteNG/UI/Forms/OptionsPages/CredentialsPage.cs b/mRemoteNG/UI/Forms/OptionsPages/CredentialsPage.cs
index 2cadfb12f..4d7054f52 100644
--- a/mRemoteNG/UI/Forms/OptionsPages/CredentialsPage.cs
+++ b/mRemoteNG/UI/Forms/OptionsPages/CredentialsPage.cs
@@ -5,17 +5,13 @@
using mRemoteNG.Resources.Language;
using System.Runtime.Versioning;
using mRemoteNG.Config.Settings.Registry;
-using System.DirectoryServices;
namespace mRemoteNG.UI.Forms.OptionsPages
{
[SupportedOSPlatform("windows")]
public sealed partial class CredentialsPage : OptionsPage
{
- #region Private Fields
- private readonly OptRegistryCredentialsPage _RegistrySettings = new();
- #endregion
-
+ private OptRegistryCredentialsPage pageRegSettingsInstance;
public CredentialsPage()
{
InitializeComponent();
@@ -44,9 +40,6 @@ public override void ApplyLanguage()
public override void LoadSettings()
{
- if (!_RegistrySettings.CredentialPageEnabled)
- return;
-
// ReSharper disable once SwitchStatementMissingSomeCases
switch (Properties.OptionsCredentialsPage.Default.EmptyCredentials)
{
@@ -92,156 +85,101 @@ public override void SaveSettings()
public override void LoadRegistrySettings()
{
- // CredentialPageEnabled reg setting: enabled/default: true; Disabled: false.
- if (!_RegistrySettings.CredentialPageEnabled)
- {
- DisablePage();
+ Type settingsType = typeof(OptRegistryCredentialsPage);
+ RegistryLoader.RegistrySettings.TryGetValue(settingsType, out var settings);
+ pageRegSettingsInstance = settings as OptRegistryCredentialsPage;
+
+ RegistryLoader.Cleanup(settingsType);
+
+ // Show registry settings info if any common setting is used.
+ lblRegistrySettingsUsedInfo.Visible = CommonRegistrySettingsUsed();
+
+ // UseCredentials reg setting must be set (and valid).
+ if (!pageRegSettingsInstance.UseCredentials.IsValid)
return;
- }
- // UseCredentials reg setting with validation:
- // 1. Is not set or valid, stop processing.
- // 2. Set the 'EmptyCredentials' option based on value
- // 3. Only proceed when "custom"
- if (!_RegistrySettings.UseCredentials.IsValid) { return; }
- else if (_RegistrySettings.UseCredentials.IsValid)
- {
- Properties.OptionsCredentialsPage.Default.EmptyCredentials = _RegistrySettings.UseCredentials.Value;
+ lblRegistrySettingsUsedInfo.Visible = true;
- switch (Properties.OptionsCredentialsPage.Default.EmptyCredentials)
- {
- case "noinfo":
- DisableControl(radCredentialsWindows);
- DisableControl(radCredentialsCustom);
- SetVisibilitySettingsUsedInfo();
- return;
- case "windows":
- DisableControl(radCredentialsNoInfo);
- DisableControl(radCredentialsCustom);
- SetVisibilitySettingsUsedInfo();
- return;
- case "custom":
- DisableControl(radCredentialsNoInfo);
- DisableControl(radCredentialsWindows);
- break;
- }
+ // UseCredentials reg setting:
+ // Disable the radio controls based on value.
+ // Only proceed when "custom".
+ switch (pageRegSettingsInstance.UseCredentials.Value)
+ {
+ case "noinfo":
+ DisableControl(radCredentialsWindows);
+ DisableControl(radCredentialsCustom);
+ return;
+ case "windows":
+ DisableControl(radCredentialsNoInfo);
+ DisableControl(radCredentialsCustom);
+ return;
+ case "custom":
+ DisableControl(radCredentialsNoInfo);
+ DisableControl(radCredentialsWindows);
+ break;
+ default:
+ return;
}
// ***
// The following is only used when set to custom!
-
- // DefaultUsername reg setting: set DefaultUsername option based on value
- if (_RegistrySettings.DefaultUsername.IsSet)
- {
- Properties.OptionsCredentialsPage.Default.DefaultUsername = _RegistrySettings.DefaultUsername.Value;
+ // Disable controls based on the registry settings.
+ //
+ if (pageRegSettingsInstance.DefaultUsername.IsSet)
DisableControl(txtCredentialsUsername);
- }
-
- // DefaultPassword reg setting:
- // 1. Test decription works to prevents potential issues
- // 2. Set DefaultPassword option based on value
- // 3. Clears reg setting if fails
- if (_RegistrySettings.DefaultPassword.IsSet)
- {
- try
- {
- LegacyRijndaelCryptographyProvider cryptographyProvider = new();
- string decryptedPassword;
- string defaultPassword = _RegistrySettings.DefaultPassword.Value;
- decryptedPassword = cryptographyProvider.Decrypt(defaultPassword, Runtime.EncryptionKey);
- Properties.OptionsCredentialsPage.Default.DefaultPassword = defaultPassword;
- DisableControl(txtCredentialsPassword);
- }
- catch
- {
- // Fire-and-forget: The DefaultPassword in the registry is not encrypted.
- _RegistrySettings.DefaultPassword.Clear();
- }
- }
+ if (pageRegSettingsInstance.DefaultPassword.IsSet)
+ DisableControl(txtCredentialsPassword);
- // DefaultDomain reg setting: set DefaultDomain option based on value
- if (_RegistrySettings.DefaultDomain.IsSet)
- {
- Properties.OptionsCredentialsPage.Default.DefaultDomain = _RegistrySettings.DefaultDomain.Value;
+ if (pageRegSettingsInstance.DefaultDomain.IsSet)
DisableControl(txtCredentialsDomain);
- }
- // UserViaAPIDefault reg setting: set UserViaAPIDefault option based on value
- if (_RegistrySettings.UserViaAPIDefault.IsSet)
- {
- Properties.OptionsCredentialsPage.Default.UserViaAPIDefault = _RegistrySettings.UserViaAPIDefault.Value;
+ if (pageRegSettingsInstance.UserViaAPIDefault.IsSet)
DisableControl(txtCredentialsUserViaAPI);
- }
-
- SetVisibilitySettingsUsedInfo();
}
///
- /// Checks if any credantil registry settings are being used.
+ /// Checks if any registry common setting is used.
///
- ///
- /// True if any relevant registry settings are used; otherwise, false.
- ///
- public override bool ShowRegistrySettingsUsedInfo()
+ private static bool CommonRegistrySettingsUsed()
{
return !CommonRegistrySettings.AllowExportPasswords
|| !CommonRegistrySettings.AllowExportUsernames
|| !CommonRegistrySettings.AllowSavePasswords
- || !CommonRegistrySettings.AllowSaveUsernames
- || !_RegistrySettings.CredentialPageEnabled
- || _RegistrySettings.UseCredentials.IsValid;
-
- /*
- * Checking these values is unnecessary because UseCredentials must be valid and set to Custom.
- *
- ||_RegistrySettings.DefaultUsername.IsSet
- || _RegistrySettings.DefaultPassword.IsSet
- || _RegistrySettings.DefaultDomain.IsSet
- || _RegistrySettings.UserViaAPIDefault.IsSet;
- */
- }
-
- ///
- /// Disables the page by setting default values and disabling controls.
- ///
- public override void DisablePage()
- {
- Properties.OptionsCredentialsPage.Default.EmptyCredentials = "noinfo";
- radCredentialsWindows.Enabled = false;
- radCredentialsCustom.Enabled = false;
-
- txtCredentialsUsername.Enabled = false;
- txtCredentialsPassword.Enabled = false;
- txtCredentialsDomain.Enabled = false;
- txtCredentialsUserViaAPI.Enabled = false;
-
- SetVisibilitySettingsUsedInfo();
+ || !CommonRegistrySettings.AllowSaveUsernames;
}
#region Event Handlers
+ ///
+ /// Handles the CheckedChanged event for the custom credentials radio button.
+ /// Enables or disables credential input fields based on the state of the radio button
+ /// and the availability of saved settings in the registry.
+ ///
+ /// The source of the event.
+ /// Event data containing information about the event.
private void radCredentialsCustom_CheckedChanged(object sender, EventArgs e)
{
- if (!_RegistrySettings.DefaultUsername.IsSet && CommonRegistrySettings.AllowSaveUsernames)
+ if (!pageRegSettingsInstance.DefaultUsername.IsSet && pageRegSettingsInstance.DefaultUsernameEnabled)
{
lblCredentialsUsername.Enabled = radCredentialsCustom.Checked;
txtCredentialsUsername.Enabled = radCredentialsCustom.Checked;
}
- if (!_RegistrySettings.DefaultPassword.IsSet && CommonRegistrySettings.AllowSavePasswords)
+
+ if (!pageRegSettingsInstance.DefaultPassword.IsSet && pageRegSettingsInstance.DefaultPasswordEnabled)
{
lblCredentialsPassword.Enabled = radCredentialsCustom.Checked;
txtCredentialsPassword.Enabled = radCredentialsCustom.Checked;
}
- if (!_RegistrySettings.DefaultDomain.IsSet)
+ if (!pageRegSettingsInstance.DefaultDomain.IsSet)
{
lblCredentialsDomain.Enabled = radCredentialsCustom.Checked;
txtCredentialsDomain.Enabled = radCredentialsCustom.Checked;
}
- if (!_RegistrySettings.UserViaAPIDefault.IsSet && CommonRegistrySettings.AllowSaveUsernames)
+ if (!pageRegSettingsInstance.UserViaAPIDefault.IsSet && pageRegSettingsInstance.DefaultUserViaAPIEnabled)
{
lblCredentialsUserViaAPI.Enabled = radCredentialsCustom.Checked;
txtCredentialsUserViaAPI.Enabled = radCredentialsCustom.Checked;
@@ -250,16 +188,5 @@ private void radCredentialsCustom_CheckedChanged(object sender, EventArgs e)
#endregion
- #region Private Methods
-
- ///
- /// Updates the visibility of the information label indicating whether registry settings are used.
- ///
- private void SetVisibilitySettingsUsedInfo()
- {
- lblRegistrySettingsUsedInfo.Visible = ShowRegistrySettingsUsedInfo();
- }
-
- #endregion
}
}
\ No newline at end of file
diff --git a/mRemoteNG/UI/Forms/OptionsPages/OptionsPage.cs b/mRemoteNG/UI/Forms/OptionsPages/OptionsPage.cs
index 408b440f6..7ebce5cf8 100644
--- a/mRemoteNG/UI/Forms/OptionsPages/OptionsPage.cs
+++ b/mRemoteNG/UI/Forms/OptionsPages/OptionsPage.cs
@@ -45,29 +45,13 @@ public virtual void RevertSettings()
}
///
- /// Loads registry settings related to update options and proxy configurations.
- /// This method retrieves values from the registry and initializes the corresponding controls
- /// on the page with these values. It also updates internal flags and properties accordingly.
+ /// Checks if registry settings were applied and disables the corresponding UI controls.
+ /// If any settings are applied, it also displays an information label.
///
public virtual void LoadRegistrySettings()
{
}
- ///
- /// Determines if any registry settings are being used.
- ///
- ///
- /// A boolean value indicating whether registry settings are used, as determined by the configuration on the options page.
- ///
- public virtual bool ShowRegistrySettingsUsedInfo()
- {
- return false;
- }
-
- public virtual void DisablePage()
- {
- }
-
#endregion
protected virtual void ApplyTheme()
diff --git a/mRemoteNG/UI/Forms/OptionsPages/UpdatesPage.cs b/mRemoteNG/UI/Forms/OptionsPages/UpdatesPage.cs
index d4c8966df..875480855 100644
--- a/mRemoteNG/UI/Forms/OptionsPages/UpdatesPage.cs
+++ b/mRemoteNG/UI/Forms/OptionsPages/UpdatesPage.cs
@@ -1,5 +1,4 @@
using System;
-using System.ComponentModel;
using System.Windows.Forms;
using mRemoteNG.App;
using mRemoteNG.App.Info;
@@ -20,7 +19,7 @@ public sealed partial class UpdatesPage
#region Private Fields
private AppUpdater _appUpdate;
- private readonly OptRegistryUpdatesPage _RegistrySettings = new();
+ private OptRegistryUpdatesPage pageRegSettingsInstance;
#endregion
@@ -66,18 +65,15 @@ public override void ApplyLanguage()
public override void LoadSettings()
{
- // Checks the combination of the following registry settings:
- // 1. AllowCheckForUpdates is false.
- // 2. AllowCheckForUpdatesAutomatical and AllowCheckForUpdatesManual are false.
- // 3. Disable page and stop processing at this point.
+ InitialiseCheckForUpdatesOnStartupComboBox();
+ InitialiseReleaseChannelComboBox();
+
+ // Checks updates are generaly disallowed
if (UpdatesForbidden())
- return;
+ return; // not required to continue
chkCheckForUpdatesOnStartup.Checked = Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup;
- InitialiseCheckForUpdatesOnStartupComboBox();
- InitialiseReleaseChannelComboBox();
-
chkUseProxyForAutomaticUpdates.Checked = Properties.OptionsUpdatesPage.Default.UpdateUseProxy;
tblProxyBasic.Enabled = Properties.OptionsUpdatesPage.Default.UpdateUseProxy;
txtProxyAddress.Text = Properties.OptionsUpdatesPage.Default.UpdateProxyAddress;
@@ -97,12 +93,9 @@ public override void SaveSettings()
{
base.SaveSettings();
- // Checks the combination of the following registry settings:
- // 1. AllowCheckForUpdates is false.
- // 2. AllowCheckForUpdatesAutomatical and AllowCheckForUpdatesManual are false.
- // 3. Disable page and stop processing at this point.
+ // Checks updates are generaly disallowed
if (UpdatesForbidden())
- return;
+ return; // not required to continue
Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup = chkCheckForUpdatesOnStartup.Checked;
@@ -138,160 +131,85 @@ public override void SaveSettings()
public override void LoadRegistrySettings()
{
- // Checks the combination of the following registry settings:
- // 1. AllowCheckForUpdates is false.
- // 2. AllowCheckForUpdatesAutomatical and AllowCheckForUpdatesManual are false.
- // 3. Disable page and stop processing at this point.
- if (UpdatesForbidden())
- return;
+ Type settingsType = typeof(OptRegistryUpdatesPage);
+ RegistryLoader.RegistrySettings.TryGetValue(settingsType, out var settings);
+ pageRegSettingsInstance = settings as OptRegistryUpdatesPage;
- // AllowCheckForUpdatesAutomatical reg setting:
- // 1. Allowed/default: true; Disabled: false.
- // 2. Disable the option "check for updates on startup".
- if (!CommonRegistrySettings.AllowCheckForUpdatesAutomatical)
+ RegistryLoader.Cleanup(settingsType);
+
+ // Checks updates are generaly disallowed.
+ if (UpdatesForbidden())
{
- Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup = false;
DisableControl(chkCheckForUpdatesOnStartup);
DisableControl(cboUpdateCheckFrequency);
+ DisableControl(btnUpdateCheckNow);
+ DisableControl(cboReleaseChannel);
+ DisableControl(chkUseProxyForAutomaticUpdates);
+ DisableControl(tblProxyBasic);
+ DisableControl(txtProxyAddress);
+ DisableControl(numProxyPort);
+ DisableControl(chkUseProxyAuthentication);
+ DisableControl(tblProxyAuthentication);
+ DisableControl(txtProxyUsername);
+ DisableControl(txtProxyPassword);
+ DisableControl(btnTestProxy);
+
+ lblRegistrySettingsUsedInfo.Visible = true;
+ return; // not required to continue
}
- // CheckForUpdatesFrequencyDays reg setting:
- // 1. Is 0 or less, than CheckForUpdatesOnStartup will be disabled.
- // 2. Is Valid than set CheckForUpdatesFrequencyDays option based on value.
- if (CommonRegistrySettings.AllowCheckForUpdatesAutomatical && _RegistrySettings.CheckForUpdatesFrequencyDays.IsSet)
+ // Disable the option "check for updates on startup" if auto updates is disallowed.
+ if (!CommonRegistrySettings.AllowCheckForUpdatesAutomatical)
{
- if (_RegistrySettings.CheckForUpdatesFrequencyDays.Value < 0)
- {
- Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup = false;
- DisableControl(chkCheckForUpdatesOnStartup);
- }
- else if (_RegistrySettings.CheckForUpdatesFrequencyDays.IsValid)
- {
- Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup = true;
- DisableControl(chkCheckForUpdatesOnStartup);
-
- Properties.OptionsUpdatesPage.Default.CheckForUpdatesFrequencyDays = _RegistrySettings.CheckForUpdatesFrequencyDays.Value;
- DisableControl(cboUpdateCheckFrequency);
- }
+ DisableControl(chkCheckForUpdatesOnStartup);
+ DisableControl(cboUpdateCheckFrequency);
}
- // Enable or disable the "Update Check" button if allowed or not.
+ // Set Update Check button state based on manual update allow state.
btnUpdateCheckNow.Enabled = CommonRegistrySettings.AllowCheckForUpdatesManual;
- // UpdateChannel reg setting: set UpdateChannel option based on value
- if (_RegistrySettings.UpdateChannel.IsValid)
+ // Disable "CheckForUpdatesFrequencyDays" based on auto update allow state.
+ if (pageRegSettingsInstance.CheckForUpdatesFrequencyDays.IsSet && CommonRegistrySettings.AllowCheckForUpdatesAutomatical)
{
- Properties.OptionsUpdatesPage.Default.UpdateChannel = _RegistrySettings.UpdateChannel.Value;
- DisableControl(cboReleaseChannel);
+ DisableControl(chkCheckForUpdatesOnStartup);
+ DisableControl(cboUpdateCheckFrequency);
}
- // UseProxyForUpdates reg setting: set UseProxyForUpdates option based on value
- // 1. Continues with the options checks for "ProxyAddress" and "ProxyPort"
- // 2. Moved on to the "UseProxyAuthentication" options if true
- if (_RegistrySettings.UseProxyForUpdates.IsSet)
- {
- bool UseProxy = _RegistrySettings.UseProxyForUpdates.Value;
- Properties.OptionsUpdatesPage.Default.UpdateUseProxy = UseProxy;
- DisableControl(chkUseProxyForAutomaticUpdates);
+ // ***
+ // Disable controls based on the registry settings.
+ //
+ if (pageRegSettingsInstance.UpdateChannel.IsSet)
+ DisableControl(cboReleaseChannel);
- // If the proxy is not used, reset the proxy address, port, and authentication settings to defaults.
- if (!UseProxy)
- {
- Properties.OptionsUpdatesPage.Default.UpdateProxyAddress = "";
- Properties.OptionsUpdatesPage.Default.UpdateProxyPort = 80;
- Properties.OptionsUpdatesPage.Default.UpdateProxyUseAuthentication = false;
- }
+ if (pageRegSettingsInstance.UseProxyForUpdates.IsSet)
+ DisableControl(chkUseProxyForAutomaticUpdates);
- // ProxyAddress reg setting: set ProxyAddress option based on value
- if (_RegistrySettings.ProxyAddress.IsSet && UseProxy)
- {
- Properties.OptionsUpdatesPage.Default.UpdateProxyAddress = _RegistrySettings.ProxyAddress.Value;
- DisableControl(txtProxyAddress);
- }
+ if (pageRegSettingsInstance.ProxyAddress.IsSet)
+ DisableControl(txtProxyAddress);
- // ProxyPort reg setting: set ProxyPort option based on value
- if (_RegistrySettings.ProxyPort.IsSet && UseProxy)
- {
- _RegistrySettings.ProxyPort.SetValidation((int)numProxyPort.Minimum, (int)numProxyPort.Maximum);
- if (_RegistrySettings.ProxyPort.IsValid)
- {
- Properties.OptionsUpdatesPage.Default.UpdateProxyPort = _RegistrySettings.ProxyPort.Value;
- DisableControl(numProxyPort);
- }
- }
- }
+ if (pageRegSettingsInstance.ProxyPort.IsSet)
+ DisableControl(numProxyPort);
- // UseProxyAuthentication reg setting: set UseProxyAuthentication option based on value
- // 1. Only applied when UpdateUseProxy is true
- // 2. Continues with the options checks for "ProxyAuthUser" and "ProxyAuthPass"
- if (Properties.OptionsUpdatesPage.Default.UpdateUseProxy && _RegistrySettings.UseProxyAuthentication.IsSet)
- {
- bool UseProxyAuth = _RegistrySettings.UseProxyAuthentication.Value;
- Properties.OptionsUpdatesPage.Default.UpdateProxyUseAuthentication = UseProxyAuth;
+ if (pageRegSettingsInstance.UseProxyAuthentication.IsSet)
DisableControl(chkUseProxyAuthentication);
- // If proxy authentication is not used, reset the proxy authentication username and password to defaults.
- if (!UseProxyAuth)
- {
- Properties.OptionsUpdatesPage.Default.UpdateProxyAuthUser = "";
- Properties.OptionsUpdatesPage.Default.UpdateProxyAuthPass = "";
- }
-
- // ProxyAuthUser reg setting: set ProxyAuthUser option based on value
- if (_RegistrySettings.ProxyAuthUser.IsSet && UseProxyAuth)
- {
- Properties.OptionsUpdatesPage.Default.UpdateProxyAuthUser = _RegistrySettings.ProxyAuthUser.Value;
- DisableControl(txtProxyUsername);
- }
+ if (pageRegSettingsInstance.ProxyAuthUser.IsSet)
+ DisableControl(txtProxyUsername);
- // ProxyAuthPass reg setting:
- // 1. Test decription works to prevents potential issues
- // 2. Set ProxyAuthPass option based on value
- if (_RegistrySettings.ProxyAuthPass.IsSet && UseProxyAuth)
- {
- // Prevents potential issues when using UpdateProxyAuthPass later.
- try
- {
- LegacyRijndaelCryptographyProvider cryptographyProvider = new();
- string decryptedPassword;
- string ProxyAuthPass = _RegistrySettings.ProxyAuthPass.Value;
- decryptedPassword = cryptographyProvider.Decrypt(ProxyAuthPass, Runtime.EncryptionKey);
-
- Properties.OptionsUpdatesPage.Default.UpdateProxyAuthPass = ProxyAuthPass;
- DisableControl(txtProxyPassword);
- }
- catch
- {
- // Fire-and-forget: The password in the registry is not encrypted.
- }
- }
- }
+ if (pageRegSettingsInstance.ProxyAuthPass.IsSet)
+ DisableControl(txtProxyPassword);
// Updates the visibility of the information label indicating whether registry settings are used.
lblRegistrySettingsUsedInfo.Visible = ShowRegistrySettingsUsedInfo();
}
- public override bool ShowRegistrySettingsUsedInfo()
- {
- return !CommonRegistrySettings.AllowCheckForUpdatesAutomatical
- || !CommonRegistrySettings.AllowCheckForUpdatesManual
- || _RegistrySettings.CheckForUpdatesFrequencyDays.IsSet
- || _RegistrySettings.UpdateChannel.IsValid
- || _RegistrySettings.UseProxyForUpdates.IsSet
- || _RegistrySettings.ProxyAddress.IsSet
- || _RegistrySettings.ProxyPort.IsValid
- || _RegistrySettings.UseProxyAuthentication.IsSet
- || _RegistrySettings.ProxyAuthUser.IsSet
- || _RegistrySettings.ProxyAuthPass.IsSet;
- }
-
#endregion
#region Event Handlers
private void chkCheckForUpdatesOnStartup_CheckedChanged(object sender, EventArgs e)
{
- if (!_RegistrySettings.CheckForUpdatesFrequencyDays.IsValid)
+ if (pageRegSettingsInstance?.CheckForUpdatesFrequencyDays?.IsSet == false)
cboUpdateCheckFrequency.Enabled = chkCheckForUpdatesOnStartup.Checked;
InitialiseCheckForUpdatesOnStartupComboBox();
@@ -311,7 +229,7 @@ private void chkUseProxyForAutomaticUpdates_CheckedChanged(object sender, EventA
// Enables/disables proxy authentication controls
bool useProxyAuth = chkUseProxyAuthentication.Checked;
- bool useProxyAuthRegIsSet = _RegistrySettings.UseProxyAuthentication.IsSet;
+ bool useProxyAuthRegIsSet = pageRegSettingsInstance.UseProxyAuthentication?.IsSet ?? false;
chkUseProxyAuthentication.Enabled = useProxy && !useProxyAuthRegIsSet;
tblProxyAuthentication.Enabled = useProxy && useProxyAuth && !useProxyAuthRegIsSet;
}
@@ -436,65 +354,30 @@ private void InitialiseReleaseChannelComboBox()
}
///
- /// Determines if updates are forbidden based on registry settings.
+ /// Checks if updates are forbidden based on registry settings.
///
- ///
- /// True if updates are forbidden; otherwise, false.
- ///
- private bool UpdatesForbidden()
+ private static bool UpdatesForbidden()
{
- bool disablePage = !CommonRegistrySettings.AllowCheckForUpdates
+ return !CommonRegistrySettings.AllowCheckForUpdates
|| (!CommonRegistrySettings.AllowCheckForUpdatesAutomatical
&& !CommonRegistrySettings.AllowCheckForUpdatesManual);
-
- if (disablePage)
- {
- DisablePage();
-
- // Ensure the UI (CheckFrequency ComboBox) appears correct when disabled
- cboUpdateCheckFrequency.Items.Clear();
- int nNever = cboUpdateCheckFrequency.Items.Add(Language.Never);
- cboUpdateCheckFrequency.SelectedIndex = nNever;
-
- // Ensure the UI (ReleaseChannel ComboBox) appears correct when disabled
- cboReleaseChannel.Items.Clear();
- int stable = cboReleaseChannel.Items.Add(UpdateChannelInfo.STABLE);
- cboReleaseChannel.SelectedIndex = stable;
- }
-
- return disablePage;
}
///
- /// Disables all controls on the page related to update settings and proxy configurations.
+ /// Checks if specific registry settings related to updates page are used.
///
- public override void DisablePage()
+ private bool ShowRegistrySettingsUsedInfo()
{
- chkCheckForUpdatesOnStartup.Checked = false;
- chkCheckForUpdatesOnStartup.Enabled = false;
- cboUpdateCheckFrequency.Enabled = false;
- btnUpdateCheckNow.Enabled = false;
- cboReleaseChannel.Enabled = false;
-
- chkUseProxyForAutomaticUpdates.Checked = false;
- chkUseProxyForAutomaticUpdates.Enabled = false;
-
- tblProxyBasic.Enabled = false;
- txtProxyAddress.Enabled = false;
- txtProxyAddress.ReadOnly = true;
- numProxyPort.Enabled = false;
-
- chkUseProxyAuthentication.Checked = false;
- chkUseProxyAuthentication.Enabled = false;
-
- tblProxyAuthentication.Enabled = false;
- txtProxyUsername.Enabled = false;
- txtProxyUsername.ReadOnly = true;
- txtProxyPassword.Enabled = false;
- txtProxyPassword.ReadOnly = true;
- btnTestProxy.Enabled = false;
-
- lblRegistrySettingsUsedInfo.Visible = true;
+ return !CommonRegistrySettings.AllowCheckForUpdatesAutomatical
+ || !CommonRegistrySettings.AllowCheckForUpdatesManual
+ || pageRegSettingsInstance.CheckForUpdatesFrequencyDays.IsSet
+ || pageRegSettingsInstance.UpdateChannel.IsSet
+ || pageRegSettingsInstance.UseProxyForUpdates.IsSet
+ || pageRegSettingsInstance.ProxyAddress.IsSet
+ || pageRegSettingsInstance.ProxyPort.IsSet
+ || pageRegSettingsInstance.UseProxyAuthentication.IsSet
+ || pageRegSettingsInstance.ProxyAuthUser.IsSet
+ || pageRegSettingsInstance.ProxyAuthPass.IsSet;
}
#endregion
diff --git a/mRemoteNG/UI/Forms/frmMain.cs b/mRemoteNG/UI/Forms/frmMain.cs
index a897ccc7d..fad016e58 100644
--- a/mRemoteNG/UI/Forms/frmMain.cs
+++ b/mRemoteNG/UI/Forms/frmMain.cs
@@ -348,7 +348,6 @@ private void PromptForUpdatesPreference()
{
if (!CommonRegistrySettings.AllowCheckForUpdates) return;
if (!CommonRegistrySettings.AllowCheckForUpdatesAutomatical) return;
- if (!CommonRegistrySettings.AllowPromptForUpdatesPreference) return;
if (Properties.OptionsUpdatesPage.Default.CheckForUpdatesAsked) return;
string[] commandButtons =
diff --git a/mRemoteNGDocumentation/index.rst b/mRemoteNGDocumentation/index.rst
index e7b865f39..a3b37e3e1 100644
--- a/mRemoteNGDocumentation/index.rst
+++ b/mRemoteNGDocumentation/index.rst
@@ -11,7 +11,6 @@ Welcome to mRemoteNG's documentation!
protocols.rst
keyboard_shortcuts.rst
sql_configuration.rst
- registry_settings_information.rst
registry_settings_guide.rst
command_line_switches.rst
themes.rst
diff --git a/mRemoteNGDocumentation/registry/credential_settings.rst b/mRemoteNGDocumentation/registry/credential_settings.rst
index 67f4e46db..17a26d059 100644
--- a/mRemoteNGDocumentation/registry/credential_settings.rst
+++ b/mRemoteNGDocumentation/registry/credential_settings.rst
@@ -1,5 +1,3 @@
-.. _credential_settings:
-
*********************
Credential Settings
*********************
@@ -8,178 +6,209 @@ Credential Settings
.. warning::
Before proceeding with any changes to the Windows Registry, it is imperative that you carefully read and comprehend the
**Modifying the Registry**, **Restricted Registry Settings** and **Disclaimer**
- on :doc:`Registry Settings Infromation `.
+ on :doc:`Registry Settings Infromation `.
-Common settings
-===============
-These settings are defined for global configuration.
+Common
+======
+- Registry Hive: ``HKEY_LOCAL_MACHINE``
+- Registry Path: ``SOFTWARE\mRemoteNG\Credentials``
-AllowExportUsernames
---------------------
+
+Allow Export Usernames
+----------------------
Determines whether exporting usernames is allowed.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials
-- **Value Name:** AllowExportUsernames
-- **Value Type:** REG_SZ
+- **Value Name:** ``AllowExportUsernames``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
- **Values:**
-
- - **Enable (default):** true
- - **Disable:** false
+ - Disallow: ``false``
-AllowExportPasswords
---------------------
+
+Allow Export Passwords
+----------------------
Determines whether exporting passwords is allowed.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials
-- **Value Name:** AllowExportPasswords
-- **Value Type:** REG_SZ
+- **Value Name:** ``AllowExportPasswords``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
- **Values:**
-
- - **Enable (default):** true
- - **Disable:** false
+
+ - Disallow: ``false``
-AllowSaveUsernames
-------------------
+Allow Save Usernames
+--------------------
Determines whether saving usernames is allowed.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials
-- **Value Name:** AllowSaveUsernames
-- **Value Type:** REG_SZ
+- **Value Name:** ``AllowSaveUsernames``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
- **Values:**
-
- - **Enable (default):** true
- - **Disable:** false
+
+ - Disallow: ``false``
+
.. note::
- If 'AllowSaveUsernames' is set to false, stored user names in the connection persist until the connection goes through modification or usage.
+ If **AllowSaveUsernames** is set to ``false``,
+ stored user names in the connection persist until the connection goes through modification or usage.
Subsequently, stored user names are removed.
Additionally, new connections will not be able to store usernames.
-AllowSavePasswords
-------------------
+Allow Save Passwords
+--------------------
Determines whether saving passwords is allowed.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials
-- **Value Name:** AllowSavePasswords
-- **Value Type:** REG_SZ
+- **Value Name:** ``AllowSavePasswords``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
- **Values:**
-
- - **Enable (default):** true
- - **Disable:** false
+
+ - Disallow: ``false``
+
.. note::
- If 'AllowSavePasswords' is set to false, stored passwords in the connection persist until the connection goes through modification or usage.
+ If **AllowSavePasswords** is set to ``false``,
+ stored passwords in the connection persist until the connection goes through modification or usage.
Subsequently, stored passwords are removed.
Additionally, new connections will not be able to store passwords.
-AllowModifyCredentialSettings
------------------------------
-Specifies if the 'Credentials' option page is configurable.
+Options
+=======
+Configure the options page to modify functionalities as described.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials
-- **Value Name:** AllowModifyCredentialSettings
-- **Value Type:** REG_SZ
-- **Values:**
-
- - **Enable (default):** true
- - **Disable:** false
+- **Registry Hive:** ``HKEY_LOCAL_MACHINE``
+- **Registry Path:** ``SOFTWARE\mRemoteNG\Credentials\Options``
-.. note::
- If 'AllowModifyCredentialSettings' is set to false, 'UseCredentials' is automatically set to 'None' (noinfo).
+Use Credentials
+---------------
+Specifies the radio button state on the credentials page to prefill empty credential fields:
+(1) "None" is selected to leave the fields unfilled.
+(2) "Windows Logon Information" is chosen to autofill with Single Sign-On (SSO) data.
+(3) "Custom" is opted for utilizing the defined information.
-Option Page Settings
-====================
-Configure the options page to modify functionalities as described.
-UseCredentials
---------------
-Specifies the radio button state on the credentials page to prefill empty credential fields:
-- "None" is selected to leave the fields unfilled.
-- "Windows Logon Information" is chosen to autofill with Single Sign-On (SSO) data.
-- "Custom" is opted for utilizing the defined information.
-
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials\\Options
-- **Value Name:** UseCredentials
-- **Value Type:** REG_SZ
+- **Value Name:** ``UseCredentials``
+- **Value Type:** ``REG_SZ``
- **Values:**
-
- - Radio (1) None: `noinfo`
- - Radio (2) Windows Logon: `windows`
- - Radio (3) Custom: `custom`
+ - (1): ``noinfo``
+ - (2): ``windows``
+ - (3): ``custom``
-UserViaAPIDefault
------------------
+
+User Via API Default
+--------------------
Specifies the user set via API as the default username.
-Important: only used when "UseCredentials" is set to "Custom".
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials\\Options
-- **Value Name:** UserViaAPIDefault
-- **Value Type:** REG_SZ
+- **Value Name:** ``UserViaAPIDefault``
+- **Value Type:** ``REG_SZ``
.. note::
- Only takes effect if 'UseCredentials' is set to custom.
+ Only takes effect if *UseCredentials* is set to ``custom`` or *DefaultUserViaAPIEnabled* is set to ``false``.
-DefaultUsername
----------------
+Default Username
+----------------
Specifies the default username.
-Important: only used when "UseCredentials" is set to "Custom".
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials\\Options
-- **Value Name:** DefaultUsername
-- **Value Type:** REG_SZ
+- **Value Name:** ``DefaultUsername``
+- **Value Type:** ``REG_SZ``
.. note::
- Only takes effect if 'UseCredentials' is set to custom.
+ Only takes effect if *UseCredentials* is set to ``custom`` or *DefaultUsernameEnabled* is set to ``false``.
-DefaultPassword
----------------
-(currently not supported)
-
+Default Password
+----------------
Specifies the default password.
-.. warning::
-
- Do not store decrypted passwords in the registry!
+- **Value Name:** ``DefaultPassword``
+- **Value Type:** ``REG_SZ``
- Storing decrypted passwords in the registry poses a significant security risk and is strongly discouraged. It can expose sensitive information, compromise user credentials, and lead to unauthorized access. Always follow best security practices and avoid storing plaintext passwords in any form, including the registry.
+.. warning::
+ Plain-text passwords are not supported.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials\\Options
-- **Value Name:** DefaultPassword
-- **Value Type:** REG_SZ
.. note::
- Only takes effect if 'UseCredentials' is set to custom.
+ Only takes effect if *UseCredentials* is set to ``custom`` or *DefaultPasswordEnabled* is set to ``false``.
-DefaultDomain
--------------
+Default Domain
+--------------
Specifies the default domain.
-Important: only used when "UseCredentials" is set to "Custom".
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Credentials\\Options
-- **Value Name:** DefaultDomain
-- **Value Type:** REG_SZ
+- **Value Name:** ``DefaultDomain``
+- **Value Type:** ``REG_SZ``
.. note::
- Only takes effect if 'UseCredentials' is set to custom.
\ No newline at end of file
+ Only takes effect if *UseCredentials* is set to ``custom``.
+
+
+Default Username Enabled
+------------------------
+Specifies that entering the custom default username field is enabled.
+
+- **Value Name:** ``DefaultUsernameEnabled``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
+- **Values:**
+
+ - to disable: ``false``
+
+
+Default Password Enabled
+------------------------
+Specifies that entering the custom default password field is enabled.
+
+- **Value Name:** ``DefaultPasswordEnabled``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
+- **Values:**
+
+ - to disable: ``false``
+
+
+Default User Via API Enabled
+----------------------------
+Specifies that entering the custom default api user field is enabled.
+
+- **Value Name:** ``DefaultUserViaAPIEnabled``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
+- **Values:**
+
+ - to disable: ``false``
+
+
+Registry Template
+=================
+
+.. code::
+
+ Windows Registry Editor Version 5.00
+
+ [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\Credentials]
+ "AllowExportPasswords"="false"
+ "AllowExportUsernames"="false"
+ "AllowSavePasswords"="false"
+ "AllowSaveUsernames"="false"
+
+ [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\Credentials\Options]
+ "UseCredentials"="custom"
+ "UserViaAPIDefault"=""
+ "DefaultUsername"=""
+ "DefaultPassword"=""
+ "DefaultDomain"=""
+
+ "DefaultUsernameEnabled"="false"
+ "DefaultPasswordEnabled"="false"
+ "DefaultUserViaAPIEnabled"="false"
+
diff --git a/mRemoteNGDocumentation/registry_settings_information.rst b/mRemoteNGDocumentation/registry/registry_settings_information.rst
similarity index 99%
rename from mRemoteNGDocumentation/registry_settings_information.rst
rename to mRemoteNGDocumentation/registry/registry_settings_information.rst
index c891c9af7..8354bf041 100644
--- a/mRemoteNGDocumentation/registry_settings_information.rst
+++ b/mRemoteNGDocumentation/registry/registry_settings_information.rst
@@ -1,3 +1,4 @@
+
.. _registry_settings_information:
*****************************
diff --git a/mRemoteNGDocumentation/registry/updates_settings.rst b/mRemoteNGDocumentation/registry/updates_settings.rst
index 1dc81cd97..62f3cd049 100644
--- a/mRemoteNGDocumentation/registry/updates_settings.rst
+++ b/mRemoteNGDocumentation/registry/updates_settings.rst
@@ -1,5 +1,3 @@
-.. _updates_settings:
-
******************
Updates Settings
******************
@@ -8,199 +6,202 @@ Updates Settings
.. warning::
Before proceeding with any changes to the Windows Registry, it is imperative that you carefully read and comprehend the
**Modifying the Registry**, **Restricted Registry Settings** and **Disclaimer**
- on :doc:`Registry Settings Infromation `.
+ on :doc:`Registry Settings Infromation `.
-Common settings
-===============
-These settings are defined for global configuration.
+Common
+======
+
+- Registry Hive: ``HKEY_LOCAL_MACHINE``
+- Registry Path: ``SOFTWARE\mRemoteNG\Updates``
-AllowCheckForUpdates
---------------------
+Allow Check For Updates
+-----------------------
Allows or disallows checking for updates.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates
-- **Value Name:** AllowCheckForUpdates
-- **Value Type:** REG_SZ
+- **Value Name:** ``AllowCheckForUpdates``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
- **Values:**
-
- - **Enable (default):** true
- - **Disable:** false
+ - Disallow: ``false``
-AllowCheckForUpdatesAutomatical
--------------------------------
+
+Allow Check For Updates Automatical
+-----------------------------------
Allows or disallows automatic search for updates.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates
-- **Value Name:** AllowCheckForUpdatesAutomatical
-- **Value Type:** REG_SZ
+- **Value Name:** ``AllowCheckForUpdatesAutomatical``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
- **Values:**
-
- - **Enable (default):** true
- - **Disable:** false
+
+ - Disallow: ``false``
+
.. note::
- If "AllowCheckForUpdates" is set to false, the automatic update check is already disabled.
+ If **AllowCheckForUpdates** is set to ``false``, the automatic update check is already disabled.
-AllowCheckForUpdatesManual
---------------------------
+Allow Check For Updates Manual
+------------------------------
Allows or disallows manual search for updates.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates
-- **Value Name:** AllowCheckForUpdatesManual
-- **Value Type:** REG_SZ
+- **Value Name:** ``AllowCheckForUpdatesManual``
+- **Value Type:** ``REG_SZ``
+- **Default value:** ``true``
- **Values:**
-
- - **Enable (default):** true
- - **Disable:** false
+
+ - Disallow: ``false``
+
.. note::
- If "AllowCheckForUpdates" is set to false, the automatic update check is already disabled.
+ If **AllowCheckForUpdates** is set to ``false``, the automatic update check is already disabled.
-AllowPromptForUpdatesPreference
--------------------------------
-Controls whether a prompt for checking the updates preferences is displayed at startup.
+Options
+=======
+Configure the options page to modify functionalities as described.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates
-- **Value Name:** AllowPromptForUpdatesPreference
-- **Value Type:** REG_SZ
-- **Values:**
-
- - **Enable:** true
- - **Disable:** false
+- **Registry Hive:** ``HKEY_LOCAL_MACHINE``
+- **Registry Path:** ``SOFTWARE\mRemoteNG\Updates\Options``
-Option Page Settings
-====================
-Configure the options page to modify functionalities as described.
+Disallow Prompt For Updates Preference
+--------------------------------------
+Specifies whether a popup is shown to configure update preferences at startup.
+- **Value Name:** ``DisallowPromptForUpdatesPreference``
+- **Value Type:** ``REG_SZ``
+- **Values:**
+
+ - to disable promt: ``true``
-CheckForUpdatesFrequencyDays
-----------------------------
+
+Check For Updates Frequency Days
+--------------------------------
Specifies the number of days between automatic update checks.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates\\Options
-- **Value Name:** CheckForUpdatesFrequencyDays
-- **Value Type:** REG_DWORD
+- **Value Name:** ``CheckForUpdatesFrequencyDays``
+- **Value Type:** ``REG_DWORD``
.. note::
- If 'AllowCheckForUpdates' is set to false, the automatic update check is already disabled, and 'CheckForUpdatesFrequencyDays' does not take effect.
+ If **AllowCheckForUpdates** is set to ``false``, the automatic update check is already disabled, and **CheckForUpdatesFrequencyDays** does not take effect.
-UpdateChannel
--------------
-Specifies the preferred update channel. Important note: Values are case-sensitive!
+Update Channel
+--------------
+Specifies the preferred update channel.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates\\Options
-- **Value Name:** UpdateChannel
-- **Value Type:** REG_SZ
+- **Value Name:** ``UpdateChannel``
+- **Value Type:** ``REG_SZ``
- **Values:**
- - Channel: Stable
- - Channel: Nightly
- - Channel: Preview
+ - Channel: ``Stable``
+ - Channel: ``Nightly``
+ - Channel: ``Preview``
-UseProxyForUpdates
-------------------
+Use Proxy For Updates
+---------------------
Indicates whether proxy usage for updates is enabled.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates\\Options
-- **Value Name:** UseProxyForUpdates
-- **Value Type:** REG_SZ
+- **Value Name:** ``UseProxyForUpdates``
+- **Value Type:** ``REG_SZ``
- **Values:**
-
- - Enable: true
- - Disable: false
+
+ - Enable: ``true``
+ - Disable: ``false``
-ProxyAddress
-------------
+Proxy Address
+-------------
Specifies the address of the proxy for updates.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates\\Options
-- **Value Name:** ProxyAddress
-- **Value Type:** REG_SZ
+- **Value Name:** ``ProxyAddress``
+- **Value Type:** ``REG_SZ``
.. note::
- If 'UseProxyForUpdates' is disabled, these settings do not take effect.
+ If **UseProxyForUpdates** is ``false``, these settings do not take effect.
-ProxyPort
----------
+Proxy Port
+----------
Specifies the port used for proxy connections during updates.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates\\Options
-- **Value Name:** ProxyPort
-- **Value Type:** REG_DWORD
+- **Value Name:** ``ProxyPort``
+- **Value Type:** ``REG_DWORD``
.. note::
- If 'UseProxyForUpdates' is disabled, these settings do not take effect.
+ If **UseProxyForUpdates** is ``false``, these settings do not take effect.
-UseProxyAuthentication
-----------------------
+Use Proxy Authentication
+------------------------
Indicates whether proxy authentication is enabled.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates\\Options
-- **Value Name:** UseProxyAuthentication
-- **Value Type:** REG_SZ
+- **Value Name:** ``UseProxyAuthentication``
+- **Value Type:** ``REG_SZ``
- **Values:**
- - Enable Value: true
- - Disable Value: false
+
+ - Enable: ``true``
+ - Disable: ``false``
.. note::
- If 'UseProxyForUpdates' is disabled, these settings do not take effect.
+ If **UseProxyForUpdates** is ``false``, these settings do not take effect.
-ProxyAuthUser
--------------
+Proxy Auth User
+---------------
Specifies the authentication username for the proxy.
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates\\Options
-- **Value Name:** ProxyAuthUser
-- **Value Type:** REG_SZ
+- **Value Name:** ``ProxyAuthUser``
+- **Value Type:** ``REG_SZ``
.. note::
- If 'UseProxyForUpdates' is disabled, these settings do not take effect.
+ If **UseProxyForUpdates** and **ProxyAuthUser** is ``false``, these settings do not take effect.
-.. note::
- If 'ProxyAuthUser' is disabled, these settings do not take effect.
-ProxyAuthPass
--------------
-(currently not supported)
+Proxy Auth Pass
+---------------
+**(currently not supported)**
+
Represents the authentication password for the proxy.
+- **Value Name:** ``ProxyAuthPass``
+- **Value Type:** ``REG_DWORD``
+
+.. note::
+ If **UseProxyForUpdates** and **ProxyAuthUser** is ``false``, these settings do not take effect.
+
+
.. warning::
+ Plain-text passwords are not supported.
- Do not store decrypted passwords in the registry!
- Storing decrypted passwords in the registry poses a significant security risk and is strongly discouraged. It can expose sensitive information, compromise user credentials, and lead to unauthorized access. Always follow best security practices and avoid storing plaintext passwords in any form, including the registry.
+Registry Template
+=================
+.. code::
-- **Registry Hive:** HKEY_LOCAL_MACHINE
-- **Registry Path:** SOFTWARE\\mRemoteNG\\Updates\\Options
-- **Value Name:** ProxyAuthPass
-- **Value Type:** REG_DWORD
+ Windows Registry Editor Version 5.00
-.. note::
- If 'UseProxyForUpdates' is disabled, these settings do not take effect.
+ [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\Updates]
+ "AllowCheckForUpdates"="false"
+ "AllowCheckForUpdatesAutomatical"="false"
+ "AllowCheckForUpdatesManual"="false"
+
-.. note::
- If 'ProxyAuthUser' is disabled, these settings do not take effect.
\ No newline at end of file
+ [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\Updates\Options]
+ "DisallowPromptForUpdatesPreference"="true"
+ "CheckForUpdatesFrequencyDays"=dword:00000014
+ "UpdateChannel"="Stable"
+
+ "UseProxyForUpdates"="false"
+ "ProxyAddress"=""
+ "ProxyPort"=dword:00000050
+
+ "UseProxyAuthentication"="false"
+ "ProxyAuthUser"=""
+ "ProxyAuthPass"=""
diff --git a/mRemoteNGDocumentation/registry_settings_guide.rst b/mRemoteNGDocumentation/registry_settings_guide.rst
index 9e929714f..797d59259 100644
--- a/mRemoteNGDocumentation/registry_settings_guide.rst
+++ b/mRemoteNGDocumentation/registry_settings_guide.rst
@@ -1,21 +1,27 @@
.. _registry_settings_guide:
-****************************
+***********************
Registry Settings Guide
-****************************
+***********************
.. warning::
Before proceeding with any changes to the Windows Registry, it is imperative that you carefully read and comprehend the
**Modifying the Registry**, **Restricted Registry Settings** and **Disclaimer**
- on :doc:`Registry Settings Infromation `.
+ on :doc:`Registry Settings Infromation `.
The following registry settings are used by mRemoteNG to configure various options and behavior.
Please note that incorrect modifications to these settings can impact the functionality of mRemoteNG.
Make changes with caution and ensure that you have backups before making any adjustments.
+.. toctree::
+ :maxdepth: 2
+
+ registry/registry_settings_information.rst
+
.. toctree::
:maxdepth: 4
registry/credential_settings
- registry/updates_settings
\ No newline at end of file
+ registry/credential_settings.rst
+ registry/updates_settings.rst
\ No newline at end of file