Merge pull request #2395 from integratorbit/v1.77.3-dev

Improve Disk Drive Redirection
This commit is contained in:
Dimitrij
2023-03-21 20:33:33 +00:00
committed by GitHub
25 changed files with 1695 additions and 888 deletions

View File

@@ -83,7 +83,7 @@ namespace mRemoteNG.App
case SaveFormat.mRXML:
var cryptographyProvider = new CryptoProviderFactoryFromSettings().Build();
var rootNode = exportTarget.GetRootParent() as RootNodeInfo;
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
var connectionNodeSerializer = new XmlConnectionNodeSerializer28(
cryptographyProvider,
rootNode?.PasswordString
.ConvertToSecureString() ??

View File

@@ -350,7 +350,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
if (headers.Contains("RedirectDiskDrives"))
{
if (bool.TryParse(connectionCsv[headers.IndexOf("RedirectDiskDrives")], out bool value))
if (Enum.TryParse(connectionCsv[headers.IndexOf("RedirectDiskDrives")], out RDPDiskDrives value))
connectionRecord.RedirectDiskDrives = value;
}
@@ -611,6 +611,12 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
if (bool.TryParse(connectionCsv[headers.IndexOf("InheritRedirectDiskDrives")], out bool value))
connectionRecord.Inheritance.RedirectDiskDrives = value;
}
if (headers.Contains("InheritRedirectDiskDrivesCustom"))
{
if (bool.TryParse(connectionCsv[headers.IndexOf("InheritRedirectDiskDrivesCustom")], out bool value))
connectionRecord.Inheritance.RedirectDiskDrivesCustom = value;
}
if (headers.Contains("InheritRedirectKeys"))
{

View File

@@ -18,7 +18,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
private readonly SaveFilter _saveFilter;
private readonly ICredentialRepositoryList _credentialRepositoryList;
public Version Version { get; } = new Version(2, 7);
public Version Version { get; } = new Version(2, 8);
public CsvConnectionsSerializerMremotengFormat(SaveFilter saveFilter,
ICredentialRepositoryList credentialRepositoryList)
@@ -60,7 +60,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
sb.Append("Hostname;Port;VmId;Protocol;SSHTunnelConnectionName;OpeningCommand;SSHOptions;PuttySession;ConnectToConsole;UseCredSsp;UseRestrictedAdmin;UseRCG;UseVmId;UseEnhancedMode;RenderingEngine;RDPAuthenticationLevel;" +
"LoadBalanceInfo;Colors;Resolution;AutomaticResize;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;DisableFullWindowDrag;DisableMenuAnimations;DisableCursorShadow;DisableCursorBlinking;" +
"CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;" +
"CacheBitmaps;RedirectDiskDrives;RedirectDiskDrivesCustomRedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;" +
"PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;Favorite;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;" +
"VNCProxyPort;VNCProxyUsername;VNCProxyPassword;VNCColors;VNCSmartSizeMode;VNCViewOnly;RDGatewayUsageMethod;RDGatewayHostname;" +
"RDGatewayUseConnectionCredentials;RDGatewayUsername;RDGatewayPassword;RDGatewayDomain;RDGatewayExternalCredentialProvider;RDGatewayUserViaAPI;RedirectAudioCapture;RdpVersion;RDPStartProgram;RDPStartProgramWorkDir;UserViaAPI;EC2InstanceId;EC2Region;ExternalCredentialProvider;ExternalAddressProvider;");
@@ -68,7 +68,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
if (_saveFilter.SaveInheritance)
sb.Append("InheritCacheBitmaps;InheritColors;InheritDescription;InheritDisplayThemes;InheritDisplayWallpaper;" +
"InheritEnableFontSmoothing;InheritEnableDesktopComposition;InheritDisableFullWindowDrag;InheritDisableMenuAnimations;InheritDisableCursorShadow;InheritDisableCursorBlinking;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;" +
"InheritProtocol;InheritSSHTunnelConnectionName;InheritOpeningCommand;InheritSSHOptions;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;" +
"InheritProtocol;InheritSSHTunnelConnectionName;InheritOpeningCommand;InheritSSHOptions;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectDiskDrivesCustom;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;" +
"InheritRedirectClipboard;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritAutomaticResize;" +
"InheritUseConsoleSession;InheritUseCredSsp;InheritUseRestrictedAdmin;InheritUseRCG;InheritUseVmId;InheritUseEnhancedMode;InheritVmId;InheritRenderingEngine;InheritUsername;" +
"InheritRDPAuthenticationLevel;InheritLoadBalanceInfo;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;" +
@@ -147,6 +147,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
.Append(FormatForCsv(con.DisableCursorBlinking))
.Append(FormatForCsv(con.CacheBitmaps))
.Append(FormatForCsv(con.RedirectDiskDrives))
.Append(FormatForCsv(con.RedirectDiskDrivesCustom))
.Append(FormatForCsv(con.RedirectPorts))
.Append(FormatForCsv(con.RedirectPrinters))
.Append(FormatForCsv(con.RedirectClipboard))
@@ -215,6 +216,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
.Append(FormatForCsv(con.Inheritance.SSHOptions))
.Append(FormatForCsv(con.Inheritance.PuttySession))
.Append(FormatForCsv(con.Inheritance.RedirectDiskDrives))
.Append(FormatForCsv(con.Inheritance.RedirectDiskDrivesCustom))
.Append(FormatForCsv(con.Inheritance.RedirectKeys))
.Append(FormatForCsv(con.Inheritance.RedirectPorts))
.Append(FormatForCsv(con.Inheritance.RedirectPrinters))

View File

@@ -124,7 +124,8 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql
connectionInfo.DisableCursorShadow = (bool)dataRow["DisableCursorShadow"];
connectionInfo.DisableCursorBlinking = (bool)dataRow["DisableCursorBlinking"];
connectionInfo.CacheBitmaps = (bool)dataRow["CacheBitmaps"];
connectionInfo.RedirectDiskDrives = (bool)dataRow["RedirectDiskDrives"];
connectionInfo.RedirectDiskDrives = (RDPDiskDrives)Enum.Parse(typeof(RDPDiskDrives), (string)dataRow["RedirectDiskDrives"]);
connectionInfo.RedirectDiskDrivesCustom = (string)dataRow["RedirectDiskDrivesCustom"];
connectionInfo.RedirectPorts = (bool)dataRow["RedirectPorts"];
connectionInfo.RedirectPrinters = (bool)dataRow["RedirectPrinters"];
connectionInfo.RedirectClipboard = (bool)dataRow["RedirectClipboard"];
@@ -189,6 +190,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql
connectionInfo.Inheritance.SSHOptions = (bool)dataRow["InheritSSHOptions"];
connectionInfo.Inheritance.PuttySession = (bool)dataRow["InheritPuttySession"];
connectionInfo.Inheritance.RedirectDiskDrives = (bool)dataRow["InheritRedirectDiskDrives"];
connectionInfo.Inheritance.RedirectDiskDrivesCustom = (bool)dataRow["InheritRedirectDiskDrivesCustom"];
connectionInfo.Inheritance.RedirectKeys = (bool)dataRow["InheritRedirectKeys"];
connectionInfo.Inheritance.RedirectPorts = (bool)dataRow["InheritRedirectPorts"];
connectionInfo.Inheritance.RedirectPrinters = (bool)dataRow["InheritRedirectPrinters"];

View File

@@ -0,0 +1,327 @@
using System;
using System.Runtime.Versioning;
using System.Security;
using System.Xml.Linq;
using mRemoteNG.App;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Security;
namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
{
// ReSharper disable once InconsistentNaming
[SupportedOSPlatform("windows")]
public class XmlConnectionNodeSerializer28 : ISerializer<ConnectionInfo, XElement>
{
private readonly ICryptographyProvider _cryptographyProvider;
private readonly SecureString _encryptionKey;
private readonly SaveFilter _saveFilter;
public Version Version { get; } = new Version(2, 8);
public XmlConnectionNodeSerializer28(ICryptographyProvider cryptographyProvider,
SecureString encryptionKey,
SaveFilter saveFilter)
{
if (cryptographyProvider == null)
throw new ArgumentNullException(nameof(cryptographyProvider));
if (encryptionKey == null)
throw new ArgumentNullException(nameof(encryptionKey));
if (saveFilter == null)
throw new ArgumentNullException(nameof(saveFilter));
_cryptographyProvider = cryptographyProvider;
_encryptionKey = encryptionKey;
_saveFilter = saveFilter;
}
public XElement Serialize(ConnectionInfo connectionInfo)
{
var element = new XElement(XName.Get("Node", ""));
SetElementAttributes(element, connectionInfo);
SetInheritanceAttributes(element, connectionInfo);
return element;
}
private void SetElementAttributes(XContainer element, ConnectionInfo connectionInfo)
{
var nodeAsContainer = connectionInfo as ContainerInfo;
element.Add(new XAttribute("Name", connectionInfo.Name));
element.Add(new XAttribute("VmId", connectionInfo.VmId));
element.Add(new XAttribute("UseVmId", connectionInfo.UseVmId));
element.Add(new XAttribute("UseEnhancedMode", connectionInfo.UseVmId));
element.Add(new XAttribute("Type", connectionInfo.GetTreeNodeType().ToString()));
if (nodeAsContainer != null)
element.Add(new XAttribute("Expanded", nodeAsContainer.IsExpanded.ToString().ToLowerInvariant()));
element.Add(new XAttribute("Descr", connectionInfo.Description));
element.Add(new XAttribute("Icon", connectionInfo.Icon));
element.Add(new XAttribute("Panel", connectionInfo.Panel));
element.Add(new XAttribute("Id", connectionInfo.ConstantID));
if (!Runtime.UseCredentialManager)
{
element.Add(_saveFilter.SaveUsername
? new XAttribute("Username", connectionInfo.Username)
: new XAttribute("Username", ""));
element.Add(_saveFilter.SaveDomain
? new XAttribute("Domain", connectionInfo.Domain)
: new XAttribute("Domain", ""));
if (_saveFilter.SavePassword && !connectionInfo.Inheritance.Password)
element.Add(new XAttribute("Password", _cryptographyProvider.Encrypt(connectionInfo.Password, _encryptionKey)));
else
element.Add(new XAttribute("Password", ""));
}
element.Add(new XAttribute("Hostname", connectionInfo.Hostname));
element.Add(new XAttribute("Protocol", connectionInfo.Protocol));
element.Add(new XAttribute("RdpVersion", connectionInfo.RdpVersion.ToString().ToLowerInvariant()));
element.Add(new XAttribute("SSHTunnelConnectionName", connectionInfo.SSHTunnelConnectionName));
element.Add(new XAttribute("OpeningCommand", connectionInfo.OpeningCommand));
element.Add(new XAttribute("SSHOptions", connectionInfo.SSHOptions));
element.Add(new XAttribute("PuttySession", connectionInfo.PuttySession));
element.Add(new XAttribute("Port", connectionInfo.Port));
element.Add(new XAttribute("ConnectToConsole", connectionInfo.UseConsoleSession.ToString().ToLowerInvariant()));
element.Add(new XAttribute("UseCredSsp", connectionInfo.UseCredSsp.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RenderingEngine", connectionInfo.RenderingEngine));
element.Add(new XAttribute("RDPAuthenticationLevel", connectionInfo.RDPAuthenticationLevel));
element.Add(new XAttribute("RDPMinutesToIdleTimeout", connectionInfo.RDPMinutesToIdleTimeout));
element.Add(new XAttribute("RDPAlertIdleTimeout", connectionInfo.RDPAlertIdleTimeout.ToString().ToLowerInvariant()));
element.Add(new XAttribute("LoadBalanceInfo", connectionInfo.LoadBalanceInfo));
element.Add(new XAttribute("Colors", connectionInfo.Colors));
element.Add(new XAttribute("Resolution", connectionInfo.Resolution));
element.Add(new XAttribute("AutomaticResize", connectionInfo.AutomaticResize.ToString().ToLowerInvariant()));
element.Add(new XAttribute("DisplayWallpaper", connectionInfo.DisplayWallpaper.ToString().ToLowerInvariant()));
element.Add(new XAttribute("DisplayThemes", connectionInfo.DisplayThemes.ToString().ToLowerInvariant()));
element.Add(new XAttribute("EnableFontSmoothing", connectionInfo.EnableFontSmoothing.ToString().ToLowerInvariant()));
element.Add(new XAttribute("EnableDesktopComposition", connectionInfo.EnableDesktopComposition.ToString().ToLowerInvariant()));
element.Add(new XAttribute("DisableFullWindowDrag", connectionInfo.DisableFullWindowDrag.ToString().ToLowerInvariant()));
element.Add(new XAttribute("DisableMenuAnimations", connectionInfo.DisableMenuAnimations.ToString().ToLowerInvariant()));
element.Add(new XAttribute("DisableCursorShadow", connectionInfo.DisableCursorShadow.ToString().ToLowerInvariant()));
element.Add(new XAttribute("DisableCursorBlinking", connectionInfo.DisableCursorBlinking.ToString().ToLowerInvariant()));
element.Add(new XAttribute("CacheBitmaps", connectionInfo.CacheBitmaps.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectDiskDrives", connectionInfo.RedirectDiskDrives));
element.Add(new XAttribute("RedirectDiskDrivesCustom", connectionInfo.RedirectDiskDrivesCustom));
element.Add(new XAttribute("RedirectPorts", connectionInfo.RedirectPorts.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectPrinters", connectionInfo.RedirectPrinters.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectClipboard", connectionInfo.RedirectClipboard.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectSmartCards", connectionInfo.RedirectSmartCards.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectSound", connectionInfo.RedirectSound.ToString()));
element.Add(new XAttribute("SoundQuality", connectionInfo.SoundQuality.ToString()));
element.Add(new XAttribute("RedirectAudioCapture", connectionInfo.RedirectAudioCapture.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectKeys", connectionInfo.RedirectKeys.ToString().ToLowerInvariant()));
element.Add(new XAttribute("Connected", (connectionInfo.OpenConnections.Count > 0).ToString().ToLowerInvariant()));
element.Add(new XAttribute("PreExtApp", connectionInfo.PreExtApp));
element.Add(new XAttribute("PostExtApp", connectionInfo.PostExtApp));
element.Add(new XAttribute("MacAddress", connectionInfo.MacAddress));
element.Add(new XAttribute("UserField", connectionInfo.UserField));
element.Add(new XAttribute("Favorite", connectionInfo.Favorite));
element.Add(new XAttribute("ExtApp", connectionInfo.ExtApp));
element.Add(new XAttribute("StartProgram", connectionInfo.RDPStartProgram));
element.Add(new XAttribute("StartProgramWorkDir", connectionInfo.RDPStartProgramWorkDir));
element.Add(new XAttribute("VNCCompression", connectionInfo.VNCCompression));
element.Add(new XAttribute("VNCEncoding", connectionInfo.VNCEncoding));
element.Add(new XAttribute("VNCAuthMode", connectionInfo.VNCAuthMode));
element.Add(new XAttribute("VNCProxyType", connectionInfo.VNCProxyType));
element.Add(new XAttribute("VNCProxyIP", connectionInfo.VNCProxyIP));
element.Add(new XAttribute("VNCProxyPort", connectionInfo.VNCProxyPort));
element.Add(_saveFilter.SaveUsername
? new XAttribute("VNCProxyUsername", connectionInfo.VNCProxyUsername)
: new XAttribute("VNCProxyUsername", ""));
element.Add(_saveFilter.SavePassword
? new XAttribute("VNCProxyPassword", _cryptographyProvider.Encrypt(connectionInfo.VNCProxyPassword, _encryptionKey))
: new XAttribute("VNCProxyPassword", ""));
element.Add(new XAttribute("VNCColors", connectionInfo.VNCColors));
element.Add(new XAttribute("VNCSmartSizeMode", connectionInfo.VNCSmartSizeMode));
element.Add(new XAttribute("VNCViewOnly", connectionInfo.VNCViewOnly.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RDGatewayUsageMethod", connectionInfo.RDGatewayUsageMethod));
element.Add(new XAttribute("RDGatewayHostname", connectionInfo.RDGatewayHostname));
element.Add(new XAttribute("RDGatewayUseConnectionCredentials", connectionInfo.RDGatewayUseConnectionCredentials));
element.Add(new XAttribute("RDGatewayExternalCredentialProvider", connectionInfo.RDGatewayExternalCredentialProvider));
element.Add(new XAttribute("RDGatewayUserViaAPI", connectionInfo.RDGatewayUserViaAPI));
element.Add(_saveFilter.SaveUsername
? new XAttribute("RDGatewayUsername", connectionInfo.RDGatewayUsername)
: new XAttribute("RDGatewayUsername", ""));
element.Add(_saveFilter.SavePassword
? new XAttribute("RDGatewayPassword", _cryptographyProvider.Encrypt(connectionInfo.RDGatewayPassword, _encryptionKey))
: new XAttribute("RDGatewayPassword", ""));
element.Add(_saveFilter.SaveDomain
? new XAttribute("RDGatewayDomain", connectionInfo.RDGatewayDomain)
: new XAttribute("RDGatewayDomain", ""));
element.Add(new XAttribute("UseRCG", connectionInfo.UseRCG));
element.Add(new XAttribute("UseRestrictedAdmin", connectionInfo.UseRestrictedAdmin));
element.Add(new XAttribute("UserViaAPI", connectionInfo.UserViaAPI));
element.Add(new XAttribute("EC2InstanceId", connectionInfo.EC2InstanceId));
element.Add(new XAttribute("EC2Region", connectionInfo.EC2Region));
element.Add(new XAttribute("ExternalCredentialProvider", connectionInfo.ExternalCredentialProvider));
element.Add(new XAttribute("ExternalAddressProvider", connectionInfo.ExternalAddressProvider));
}
private void SetInheritanceAttributes(XContainer element, IInheritable connectionInfo)
{
if (_saveFilter.SaveInheritance)
{
var inheritance = connectionInfo.Inheritance;
if (inheritance.CacheBitmaps)
element.Add(new XAttribute("InheritCacheBitmaps", inheritance.CacheBitmaps.ToString().ToLowerInvariant()));
if (inheritance.Colors)
element.Add(new XAttribute("InheritColors", inheritance.Colors.ToString().ToLowerInvariant()));
if (inheritance.Description)
element.Add(new XAttribute("InheritDescription", inheritance.Description.ToString().ToLowerInvariant()));
if (inheritance.DisplayThemes)
element.Add(new XAttribute("InheritDisplayThemes", inheritance.DisplayThemes.ToString().ToLowerInvariant()));
if (inheritance.DisplayWallpaper)
element.Add(new XAttribute("InheritDisplayWallpaper", inheritance.DisplayWallpaper.ToString().ToLowerInvariant()));
if (inheritance.EnableFontSmoothing)
element.Add(new XAttribute("InheritEnableFontSmoothing", inheritance.EnableFontSmoothing.ToString().ToLowerInvariant()));
if (inheritance.EnableDesktopComposition)
element.Add(new XAttribute("InheritEnableDesktopComposition", inheritance.EnableDesktopComposition.ToString().ToLowerInvariant()));
if (inheritance.DisableFullWindowDrag)
element.Add(new XAttribute("InheritDisableFullWindowDrag", inheritance.DisableFullWindowDrag.ToString().ToLowerInvariant()));
if (inheritance.DisableMenuAnimations)
element.Add(new XAttribute("InheritDisableMenuAnimations", inheritance.DisableMenuAnimations.ToString().ToLowerInvariant()));
if (inheritance.DisableCursorShadow)
element.Add(new XAttribute("InheritDisableCursorShadow", inheritance.DisableCursorShadow.ToString().ToLowerInvariant()));
if (inheritance.DisableCursorBlinking)
element.Add(new XAttribute("InheritDisableCursorBlinking", inheritance.DisableCursorBlinking.ToString().ToLowerInvariant()));
if (inheritance.Domain)
element.Add(new XAttribute("InheritDomain", inheritance.Domain.ToString().ToLowerInvariant()));
if (inheritance.Icon)
element.Add(new XAttribute("InheritIcon", inheritance.Icon.ToString().ToLowerInvariant()));
if (inheritance.Panel)
element.Add(new XAttribute("InheritPanel", inheritance.Panel.ToString().ToLowerInvariant()));
if (inheritance.Password)
element.Add(new XAttribute("InheritPassword", inheritance.Password.ToString().ToLowerInvariant()));
if (inheritance.Port)
element.Add(new XAttribute("InheritPort", inheritance.Port.ToString().ToLowerInvariant()));
if (inheritance.Protocol)
element.Add(new XAttribute("InheritProtocol", inheritance.Protocol.ToString().ToLowerInvariant()));
if (inheritance.RdpVersion)
element.Add(new XAttribute("InheritRdpVersion", inheritance.RdpVersion.ToString().ToLowerInvariant()));
if (inheritance.SSHTunnelConnectionName)
element.Add(new XAttribute("InheritSSHTunnelConnectionName", inheritance.SSHTunnelConnectionName.ToString().ToLowerInvariant()));
if (inheritance.OpeningCommand)
element.Add(new XAttribute("InheritOpeningCommand", inheritance.OpeningCommand.ToString().ToLowerInvariant()));
if (inheritance.SSHOptions)
element.Add(new XAttribute("InheritSSHOptions", inheritance.SSHOptions.ToString().ToLowerInvariant()));
if (inheritance.PuttySession)
element.Add(new XAttribute("InheritPuttySession", inheritance.PuttySession.ToString().ToLowerInvariant()));
if (inheritance.RedirectDiskDrives)
element.Add(new XAttribute("InheritRedirectDiskDrives", inheritance.RedirectDiskDrives.ToString().ToLowerInvariant()));
if (inheritance.RedirectDiskDrivesCustom)
element.Add(new XAttribute("InheritRedirectDiskDrivesCustom", inheritance.RedirectDiskDrivesCustom.ToString().ToLowerInvariant()));
if (inheritance.RedirectKeys)
element.Add(new XAttribute("InheritRedirectKeys", inheritance.RedirectKeys.ToString().ToLowerInvariant()));
if (inheritance.RedirectPorts)
element.Add(new XAttribute("InheritRedirectPorts", inheritance.RedirectPorts.ToString().ToLowerInvariant()));
if (inheritance.RedirectPrinters)
element.Add(new XAttribute("InheritRedirectPrinters", inheritance.RedirectPrinters.ToString().ToLowerInvariant()));
if (inheritance.RedirectClipboard)
element.Add(new XAttribute("InheritRedirectClipboard", inheritance.RedirectClipboard.ToString().ToLowerInvariant()));
if (inheritance.RedirectSmartCards)
element.Add(new XAttribute("InheritRedirectSmartCards", inheritance.RedirectSmartCards.ToString().ToLowerInvariant()));
if (inheritance.RedirectSound)
element.Add(new XAttribute("InheritRedirectSound", inheritance.RedirectSound.ToString().ToLowerInvariant()));
if (inheritance.SoundQuality)
element.Add(new XAttribute("InheritSoundQuality", inheritance.SoundQuality.ToString().ToLowerInvariant()));
if (inheritance.RedirectAudioCapture)
element.Add(new XAttribute("InheritRedirectAudioCapture", inheritance.RedirectAudioCapture.ToString().ToLowerInvariant()));
if (inheritance.Resolution)
element.Add(new XAttribute("InheritResolution", inheritance.Resolution.ToString().ToLowerInvariant()));
if (inheritance.AutomaticResize)
element.Add(new XAttribute("InheritAutomaticResize", inheritance.AutomaticResize.ToString().ToLowerInvariant()));
if (inheritance.UseConsoleSession)
element.Add(new XAttribute("InheritUseConsoleSession", inheritance.UseConsoleSession.ToString().ToLowerInvariant()));
if (inheritance.UseCredSsp)
element.Add(new XAttribute("InheritUseCredSsp", inheritance.UseCredSsp.ToString().ToLowerInvariant()));
if (inheritance.RenderingEngine)
element.Add(new XAttribute("InheritRenderingEngine", inheritance.RenderingEngine.ToString().ToLowerInvariant()));
if (inheritance.Username)
element.Add(new XAttribute("InheritUsername", inheritance.Username.ToString().ToLowerInvariant()));
if (inheritance.RDPAuthenticationLevel)
element.Add(new XAttribute("InheritRDPAuthenticationLevel", inheritance.RDPAuthenticationLevel.ToString().ToLowerInvariant()));
if (inheritance.RDPMinutesToIdleTimeout)
element.Add(new XAttribute("InheritRDPMinutesToIdleTimeout", inheritance.RDPMinutesToIdleTimeout.ToString().ToLowerInvariant()));
if (inheritance.RDPAlertIdleTimeout)
element.Add(new XAttribute("InheritRDPAlertIdleTimeout", inheritance.RDPAlertIdleTimeout.ToString().ToLowerInvariant()));
if (inheritance.LoadBalanceInfo)
element.Add(new XAttribute("InheritLoadBalanceInfo", inheritance.LoadBalanceInfo.ToString().ToLowerInvariant()));
if (inheritance.PreExtApp)
element.Add(new XAttribute("InheritPreExtApp", inheritance.PreExtApp.ToString().ToLowerInvariant()));
if (inheritance.PostExtApp)
element.Add(new XAttribute("InheritPostExtApp", inheritance.PostExtApp.ToString().ToLowerInvariant()));
if (inheritance.MacAddress)
element.Add(new XAttribute("InheritMacAddress", inheritance.MacAddress.ToString().ToLowerInvariant()));
if (inheritance.UserField)
element.Add(new XAttribute("InheritUserField", inheritance.UserField.ToString().ToLowerInvariant()));
if (inheritance.Favorite)
element.Add(new XAttribute("InheritFavorite", inheritance.Favorite.ToString().ToLowerInvariant()));
if (inheritance.ExtApp)
element.Add(new XAttribute("InheritExtApp", inheritance.ExtApp.ToString().ToLowerInvariant()));
if (inheritance.VNCCompression)
element.Add(new XAttribute("InheritVNCCompression", inheritance.VNCCompression.ToString().ToLowerInvariant()));
if (inheritance.VNCEncoding)
element.Add(new XAttribute("InheritVNCEncoding", inheritance.VNCEncoding.ToString().ToLowerInvariant()));
if (inheritance.VNCAuthMode)
element.Add(new XAttribute("InheritVNCAuthMode", inheritance.VNCAuthMode.ToString().ToLowerInvariant()));
if (inheritance.VNCProxyType)
element.Add(new XAttribute("InheritVNCProxyType", inheritance.VNCProxyType.ToString().ToLowerInvariant()));
if (inheritance.VNCProxyIP)
element.Add(new XAttribute("InheritVNCProxyIP", inheritance.VNCProxyIP.ToString().ToLowerInvariant()));
if (inheritance.VNCProxyPort)
element.Add(new XAttribute("InheritVNCProxyPort", inheritance.VNCProxyPort.ToString().ToLowerInvariant()));
if (inheritance.VNCProxyUsername)
element.Add(new XAttribute("InheritVNCProxyUsername", inheritance.VNCProxyUsername.ToString().ToLowerInvariant()));
if (inheritance.VNCProxyPassword)
element.Add(new XAttribute("InheritVNCProxyPassword", inheritance.VNCProxyPassword.ToString().ToLowerInvariant()));
if (inheritance.VNCColors)
element.Add(new XAttribute("InheritVNCColors", inheritance.VNCColors.ToString().ToLowerInvariant()));
if (inheritance.VNCSmartSizeMode)
element.Add(new XAttribute("InheritVNCSmartSizeMode", inheritance.VNCSmartSizeMode.ToString().ToLowerInvariant()));
if (inheritance.VNCViewOnly)
element.Add(new XAttribute("InheritVNCViewOnly", inheritance.VNCViewOnly.ToString().ToLowerInvariant()));
if (inheritance.RDGatewayUsageMethod)
element.Add(new XAttribute("InheritRDGatewayUsageMethod", inheritance.RDGatewayUsageMethod.ToString().ToLowerInvariant()));
if (inheritance.RDGatewayHostname)
element.Add(new XAttribute("InheritRDGatewayHostname", inheritance.RDGatewayHostname.ToString().ToLowerInvariant()));
if (inheritance.RDGatewayUseConnectionCredentials)
element.Add(new XAttribute("InheritRDGatewayUseConnectionCredentials", inheritance.RDGatewayUseConnectionCredentials.ToString().ToLowerInvariant()));
if (inheritance.RDGatewayUsername)
element.Add(new XAttribute("InheritRDGatewayUsername", inheritance.RDGatewayUsername.ToString().ToLowerInvariant()));
if (inheritance.RDGatewayPassword)
element.Add(new XAttribute("InheritRDGatewayPassword", inheritance.RDGatewayPassword.ToString().ToLowerInvariant()));
if (inheritance.RDGatewayDomain)
element.Add(new XAttribute("InheritRDGatewayDomain", inheritance.RDGatewayDomain.ToString().ToLowerInvariant()));
if (inheritance.RDGatewayExternalCredentialProvider)
element.Add(new XAttribute("InheritRDGatewayExternalCredentialProvider", inheritance.RDGatewayExternalCredentialProvider.ToString().ToLowerInvariant()));
if (inheritance.RDGatewayUserViaAPI)
element.Add(new XAttribute("InheritRDGatewayUserViaAPI", inheritance.RDGatewayUserViaAPI.ToString().ToLowerInvariant()));
if (inheritance.VmId)
element.Add(new XAttribute("InheritVmId", inheritance.VmId.ToString().ToLowerInvariant()));
if (inheritance.UseVmId)
element.Add(new XAttribute("InheritUseVmId", inheritance.UseVmId.ToString().ToLowerInvariant()));
if (inheritance.UseEnhancedMode)
element.Add(new XAttribute("InheritUseEnhancedMode", inheritance.UseEnhancedMode.ToString().ToLowerInvariant()));
if (inheritance.ExternalCredentialProvider)
element.Add(new XAttribute("InheritExternalCredentialProvider", inheritance.ExternalCredentialProvider.ToString().ToLowerInvariant()));
if (inheritance.UserViaAPI)
element.Add(new XAttribute("InheritUserViaAPI", inheritance.UserViaAPI.ToString().ToLowerInvariant()));
if (inheritance.UseRCG)
element.Add(new XAttribute("InheritUseRCG", inheritance.UseRCG.ToString().ToLowerInvariant()));
if (inheritance.UseRestrictedAdmin)
element.Add(new XAttribute("InheritUseRestrictedAdmin", inheritance.UseRestrictedAdmin.ToString().ToLowerInvariant()));
}
}
}
}

View File

@@ -291,14 +291,13 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
if (_confVersion >= 0.5)
{
connectionInfo.RedirectDiskDrives = xmlnode.GetAttributeAsBool("RedirectDiskDrives");
connectionInfo.RedirectPrinters = xmlnode.GetAttributeAsBool("RedirectPrinters");
connectionInfo.RedirectPorts = xmlnode.GetAttributeAsBool("RedirectPorts");
connectionInfo.RedirectSmartCards = xmlnode.GetAttributeAsBool("RedirectSmartCards");
}
else
{
connectionInfo.RedirectDiskDrives = false;
connectionInfo.RedirectDiskDrives = RDPDiskDrives.None;
connectionInfo.RedirectPrinters = false;
connectionInfo.RedirectPorts = false;
connectionInfo.RedirectSmartCards = false;
@@ -570,6 +569,21 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
connectionInfo.Inheritance.RDGatewayExternalCredentialProvider = xmlnode.GetAttributeAsBool("InheritRDGatewayExternalCredentialProvider");
connectionInfo.Inheritance.RDGatewayUserViaAPI = xmlnode.GetAttributeAsBool("InheritRDGatewayUserViaAPI");
}
if (_confVersion >= 2.8)
{
connectionInfo.RedirectDiskDrives = xmlnode.GetAttributeAsEnum<RDPDiskDrives>("RedirectDiskDrives");
connectionInfo.RedirectDiskDrivesCustom = xmlnode.GetAttributeAsString("RedirectDiskDrivesCustom");
connectionInfo.Inheritance.RedirectDiskDrivesCustom = xmlnode.GetAttributeAsBool("InheritRedirectDiskDrivesCustom");
}
else if (_confVersion >= 0.5)
{
// used to be boolean
bool tmpRedirect = xmlnode.GetAttributeAsBool("RedirectDiskDrives");
if (tmpRedirect)
connectionInfo.RedirectDiskDrives = RDPDiskDrives.Local;
else
connectionInfo.RedirectDiskDrives = RDPDiskDrives.None;
}
}
catch (Exception ex)
{

View File

@@ -105,7 +105,7 @@ namespace mRemoteNG.Config.Serializers.MiscSerializers
connectionInfo.RedirectSmartCards = value == "1";
break;
case "redirectdrives":
connectionInfo.RedirectDiskDrives = value == "1";
connectionInfo.RedirectDiskDrives = (value == "1" ? RDPDiskDrives.Local : RDPDiskDrives.None);
break;
case "redirectcomports":
connectionInfo.RedirectPorts = value == "1";

View File

@@ -294,7 +294,7 @@ namespace mRemoteNG.Config.Serializers.MiscSerializers
// ./redirectClipboard
if (bool.TryParse(localResourcesNode?.SelectSingleNode("./redirectDrives")?.InnerText, out var redirectDisks))
connectionInfo.RedirectDiskDrives = redirectDisks;
connectionInfo.RedirectDiskDrives = redirectDisks ? RDPDiskDrives.Local : RDPDiskDrives.None;
if (bool.TryParse(localResourcesNode?.SelectSingleNode("./redirectPorts")?.InnerText, out var redirectPorts))
connectionInfo.RedirectPorts = redirectPorts;

View File

@@ -44,6 +44,7 @@ namespace mRemoteNG.Config.Serializers.Versioning
new SqlVersion26To27Upgrader(_databaseConnector),
new SqlVersion27To28Upgrader(_databaseConnector),
new SqlVersion28To29Upgrader(_databaseConnector),
new SqlVersion29To30Upgrader(_databaseConnector),
};
foreach (var upgrader in dbUpgraders)

View File

@@ -0,0 +1,88 @@
using mRemoteNG.App;
using mRemoteNG.Config.DatabaseConnectors;
using mRemoteNG.Messages;
using System;
using System.Data.Common;
using System.Runtime.Versioning;
namespace mRemoteNG.Config.Serializers.Versioning
{
[SupportedOSPlatform("windows")]
public class SqlVersion29To30Upgrader : IVersionUpgrader
{
private readonly Version version = new Version(3, 0);
private readonly IDatabaseConnector _databaseConnector;
public SqlVersion29To30Upgrader(IDatabaseConnector databaseConnector)
{
_databaseConnector = databaseConnector ?? throw new ArgumentNullException(nameof(databaseConnector));
}
public bool CanUpgrade(Version currentVersion)
{
return currentVersion == new Version(2, 9) ||
// Support upgrading during dev revisions, 2.9.1, 2.9.2, etc...
(currentVersion <= new Version(3, 0) &&
currentVersion < version);
}
public Version Upgrade()
{
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
$"Upgrading database to version {version}.");
// MYSQL
const string mySqlAlter = @"
ALTER TABLE tblCons ALTER COLUMN `RedirectDiskDrives` varchar(32) DEFAULT NULL;
ALTER TABLE tblCons ADD COLUMN `RedirectDiskDrivesCustom` varchar(32) DEFAULT NULL;
ALTER TABLE tblCons ADD COLUMN `InheritRedirectDiskDrivesCustom` tinyint(1) NOT NULL;
";
const string mySqlUpdate = @"UPDATE tblRoot SET ConfVersion=?;";
// MS-SQL
const string msSqlAlter = @"
ALTER TABLE tblCons ALTER COLUMN RedirectDiskDrives varchar(32) DEFAULT NULL;
ALTER TABLE tblCons ADD RedirectDiskDrivesCustom varchar(32) DEFAULT NULL;
ALTER TABLE tblCons ADD InheritRedirectDiskDrivesCustom bit NOT NULL;
";
const string msSqlUpdate = @"UPDATE tblRoot SET ConfVersion=@confVersion;";
using (var sqlTran = _databaseConnector.DbConnection().BeginTransaction(System.Data.IsolationLevel.Serializable))
{
DbCommand dbCommand;
if (_databaseConnector.GetType() == typeof(MSSqlDatabaseConnector))
{
dbCommand = _databaseConnector.DbCommand(msSqlAlter);
dbCommand.Transaction = sqlTran;
dbCommand.ExecuteNonQuery();
dbCommand = _databaseConnector.DbCommand(msSqlUpdate);
dbCommand.Transaction = sqlTran;
}
else if (_databaseConnector.GetType() == typeof(MySqlDatabaseConnector))
{
dbCommand = _databaseConnector.DbCommand(mySqlAlter);
dbCommand.Transaction = sqlTran;
dbCommand.ExecuteNonQuery();
dbCommand = _databaseConnector.DbCommand(mySqlUpdate);
dbCommand.Transaction = sqlTran;
}
else
{
throw new Exception("Unknown database back-end");
}
var pConfVersion = dbCommand.CreateParameter();
pConfVersion.ParameterName = "confVersion";
pConfVersion.Value = version.ToString();
pConfVersion.DbType = System.Data.DbType.String;
pConfVersion.Direction = System.Data.ParameterDirection.Input;
dbCommand.Parameters.Add(pConfVersion);
dbCommand.ExecuteNonQuery();
sqlTran.Commit();
}
return version;
}
}
}

View File

@@ -76,7 +76,8 @@ namespace mRemoteNG.Connection
private bool _disableCursorBlinking;
private bool _redirectKeys;
private bool _redirectDiskDrives;
private RDPDiskDrives _redirectDiskDrives;
private string _redirectDiskDrivesCustom;
private bool _redirectPrinters;
private bool _redirectClipboard;
private bool _redirectPorts;
@@ -713,14 +714,24 @@ namespace mRemoteNG.Connection
[LocalizedAttributes.LocalizedCategory(nameof(Language.Redirect), 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.DiskDrives)),
LocalizedAttributes.LocalizedDescription(nameof(Language.PropertyDescriptionRedirectDrives)),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
TypeConverter(typeof(MiscTools.EnumTypeConverter)),
AttributeUsedInProtocol(ProtocolType.RDP)]
public bool RedirectDiskDrives
public RDPDiskDrives RedirectDiskDrives
{
get => GetPropertyValue("RedirectDiskDrives", _redirectDiskDrives);
set => SetField(ref _redirectDiskDrives, value, "RedirectDiskDrives");
}
[LocalizedAttributes.LocalizedCategory(nameof(Language.Redirect), 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.RedirectDiskDrivesCustom)),
LocalizedAttributes.LocalizedDescription(nameof(Language.PropertyDescriptionRedirectDiskDrivesCustom)),
AttributeUsedInProtocol(ProtocolType.RDP)]
public string RedirectDiskDrivesCustom
{
get => GetPropertyValue("RedirectDiskDrivesCustom", _redirectDiskDrivesCustom);
set => SetField(ref _redirectDiskDrivesCustom, value, "RedirectDiskDrivesCustom");
}
[LocalizedAttributes.LocalizedCategory(nameof(Language.Redirect), 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.Printers)),
LocalizedAttributes.LocalizedDescription(nameof(Language.PropertyDescriptionRedirectPrinters)),

View File

@@ -356,7 +356,8 @@ namespace mRemoteNG.Connection
private void SetRedirectDefaults()
{
RedirectKeys = Settings.Default.ConDefaultRedirectKeys;
RedirectDiskDrives = Settings.Default.ConDefaultRedirectDiskDrives;
RedirectDiskDrives = (RDPDiskDrives)Enum.Parse(typeof(RDPDiskDrives), Settings.Default.ConDefaultRedirectDiskDrives);
RedirectDiskDrivesCustom = Settings.Default.ConDefaultRedirectDiskDrivesCustom;
RedirectPrinters = Settings.Default.ConDefaultRedirectPrinters;
RedirectClipboard = Settings.Default.ConDefaultRedirectClipboard;
RedirectPorts = Settings.Default.ConDefaultRedirectPorts;

View File

@@ -363,6 +363,12 @@ namespace mRemoteNG.Connection
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectDiskDrives { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.Redirect), 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.RedirectDiskDrivesCustom)),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.PropertyDescriptionRedirectDiskDrivesCustom)),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectDiskDrivesCustom { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.Redirect), 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.Printers)),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.PropertyDescriptionRedirectPrinters)),

View File

@@ -0,0 +1,20 @@
using mRemoteNG.Tools;
using mRemoteNG.Resources.Language;
namespace mRemoteNG.Connection.Protocol.RDP
{
public enum RDPDiskDrives
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.RdpDrivesNone))]
None,
[LocalizedAttributes.LocalizedDescription(nameof(Language.RdpDrivesLocal))]
Local,
[LocalizedAttributes.LocalizedDescription(nameof(Language.RdpDrivesAll))]
All,
[LocalizedAttributes.LocalizedDescription(nameof(Language.RdpDrivesCustom))]
Custom
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -4126,6 +4126,15 @@ namespace mRemoteNG.Resources.Language {
}
/// <summary>
/// Looks up a localized string similar to Enter custom drives to redirect: C,D,X.
/// </summary>
internal static string PropertyDescriptionRedirectDiskDrivesCustom {
get {
return ResourceManager.GetString("PropertyDescriptionRedirectDiskDrivesCustom", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select whether local disk drives should be shown on the remote host..
/// </summary>
internal static string PropertyDescriptionRedirectDrives {
@@ -4756,6 +4765,42 @@ namespace mRemoteNG.Resources.Language {
}
}
/// <summary>
/// Looks up a localized string similar to All.
/// </summary>
internal static string RdpDrivesAll {
get {
return ResourceManager.GetString("RdpDrivesAll", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Custom.
/// </summary>
internal static string RdpDrivesCustom {
get {
return ResourceManager.GetString("RdpDrivesCustom", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Local.
/// </summary>
internal static string RdpDrivesLocal {
get {
return ResourceManager.GetString("RdpDrivesLocal", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to None.
/// </summary>
internal static string RdpDrivesNone {
get {
return ResourceManager.GetString("RdpDrivesNone", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Internal error code 1..
/// </summary>
@@ -5179,6 +5224,15 @@ namespace mRemoteNG.Resources.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Custom Drives.
/// </summary>
internal static string RedirectDiskDrivesCustom {
get {
return ResourceManager.GetString("RedirectDiskDrivesCustom", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disk Drives.
/// </summary>

View File

@@ -2316,4 +2316,22 @@ Nightly Channel includes Alphas, Betas &amp; Release Candidates.</value>
<data name="CheckboxNoReconnect" xml:space="preserve">
<value>Automatically try to reconnect when disconnected from server (RDP &amp;&amp; ICA only)</value>
</data>
<data name="PropertyDescriptionRedirectDiskDrivesCustom" xml:space="preserve">
<value>Enter custom drives to redirect: C,D,X</value>
</data>
<data name="RdpDrivesAll" xml:space="preserve">
<value>All</value>
</data>
<data name="RdpDrivesCustom" xml:space="preserve">
<value>Custom</value>
</data>
<data name="RdpDrivesLocal" xml:space="preserve">
<value>Local</value>
</data>
<data name="RdpDrivesNone" xml:space="preserve">
<value>None</value>
</data>
<data name="RedirectDiskDrivesCustom" xml:space="preserve">
<value>Custom Drives</value>
</data>
</root>

View File

@@ -169,16 +169,31 @@ namespace mRemoteNG.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool ConDefaultRedirectDiskDrives {
[global::System.Configuration.DefaultSettingValueAttribute("Local")]
public string ConDefaultRedirectDiskDrives {
get {
return ((bool)(this["ConDefaultRedirectDiskDrives"]));
return ((string)(this["ConDefaultRedirectDiskDrives"]));
}
set {
this["ConDefaultRedirectDiskDrives"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string ConDefaultRedirectDiskDrivesCustom
{
get
{
return ((string)(this["ConDefaultRedirectDiskDrivesCustom"]));
}
set
{
this["ConDefaultRedirectDiskDrivesCustom"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]

View File

@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="mremoteng_confcons_v2_8"
targetNamespace="http://mremoteng.org"
elementFormDefault="unqualified"
xmlns="http://mremoteng.org"
xmlns:mrng="http://mremoteng.org"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Connections">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Node" type="mrng:connectioninfo" />
</xs:sequence>
<xs:attribute name="Name" type="xs:string" use="required" />
<xs:attribute name="Export" type="xs:boolean" use="required" />
<xs:attribute name="EncryptionEngine" type="xs:string" use="required" />
<xs:attribute name="BlockCipherMode" type="xs:string" use="required" />
<xs:attribute name="KdfIterations" type="xs:int" use="optional" />
<xs:attribute name="FullFileEncryption" type="xs:boolean" use="required" />
<xs:attribute name="Protected" type="xs:string" use="required" />
<xs:attribute name="ConfVersion" type="xs:float" use="required" />
</xs:complexType>
</xs:element>
<xs:complexType name="connectioninfo">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Node" type="mrng:connectioninfo" />
</xs:sequence>
<xs:attribute name="Name" type="xs:string" use="required" />
<xs:attribute name="Id" type="xs:string" use="required" />
<xs:attribute name="Type" type="xs:string" use="required" />
<xs:attribute name="Expanded" type="xs:boolean" use="optional" />
<xs:attribute name="Descr" type="xs:string" use="required" />
<xs:attribute name="Icon" type="xs:string" use="required" />
<xs:attribute name="Panel" type="xs:string" use="required" />
<xs:attribute name="Username" type="xs:string" use="required" />
<xs:attribute name="Domain" type="xs:string" use="required" />
<xs:attribute name="Password" type="xs:string" use="required" />
<xs:attribute name="Hostname" type="xs:string" use="required" />
<xs:attribute name="Protocol" type="xs:string" use="required" />
<xs:attribute name="RdpVersion" type="xs:string" use="required" />
<xs:attribute name="VmId" type="xs:string" use="required" />
<xs:attribute name="UseVmId" type="xs:boolean" use="required" />
<xs:attribute name="UseEnhancedMode" type="xs:boolean" use="required" />
<xs:attribute name="SSHTunnelConnectionName" type="xs:string" use="optional" />
<xs:attribute name="SSHOptions" type="xs:string" use="optional" />
<xs:attribute name="PuttySession" type="xs:string" use="required" />
<xs:attribute name="Port" type="xs:int" use="required" />
<xs:attribute name="ConnectToConsole" type="xs:boolean" use="required" />
<xs:attribute name="UseCredSsp" type="xs:boolean" use="required" />
<xs:attribute name="RenderingEngine" type="xs:string" use="required" />
<xs:attribute name="RDPAuthenticationLevel" type="xs:string" use="required" />
<xs:attribute name="RDPMinutesToIdleTimeout" type="xs:int" use="required" />
<xs:attribute name="RDPAlertIdleTimeout" type="xs:boolean" use="required" />
<xs:attribute name="LoadBalanceInfo" type="xs:string" use="required" />
<xs:attribute name="Colors" type="xs:string" use="required" />
<xs:attribute name="Resolution" type="xs:string" use="required" />
<xs:attribute name="AutomaticResize" type="xs:boolean" use="required" />
<xs:attribute name="DisplayWallpaper" type="xs:boolean" use="required" />
<xs:attribute name="DisplayThemes" type="xs:boolean" use="required" />
<xs:attribute name="EnableFontSmoothing" type="xs:boolean" use="required" />
<xs:attribute name="EnableDesktopComposition" type="xs:boolean" use="required" />
<xs:attribute name="DisableFullWindowDrag" type="xs:boolean" use="required" />
<xs:attribute name="DisableMenuAnimations" type="xs:boolean" use="required" />
<xs:attribute name="DisableCursorShadow" type="xs:boolean" use="required" />
<xs:attribute name="DisableCursorBlinking" type="xs:boolean" use="required" />
<xs:attribute name="CacheBitmaps" type="xs:boolean" use="required" />
<xs:attribute name="RedirectDiskDrives" type="xs:string" use="required" />
<xs:attribute name="RedirectDiskDrivesCustom" type="xs:string" use="required" />
<xs:attribute name="RedirectPorts" type="xs:boolean" use="required" />
<xs:attribute name="RedirectPrinters" type="xs:boolean" use="required" />
<xs:attribute name="RedirectClipboard" type="xs:boolean" use="required" />
<xs:attribute name="RedirectSmartCards" type="xs:boolean" use="required" />
<xs:attribute name="RedirectSound" type="xs:string" use="required" />
<xs:attribute name="SoundQuality" type="xs:string" use="required" />
<xs:attribute name="RedirectAudioCapture" type="xs:boolean" use="required" />
<xs:attribute name="RedirectKeys" type="xs:boolean" use="required" />
<xs:attribute name="Connected" type="xs:boolean" use="required" />
<xs:attribute name="PreExtApp" type="xs:string" use="required" />
<xs:attribute name="PostExtApp" type="xs:string" use="required" />
<xs:attribute name="MacAddress" type="xs:string" use="required" />
<xs:attribute name="UserField" type="xs:string" use="required" />
<xs:attribute name="ExtApp" type="xs:string" use="required" />
<xs:attribute name="Favorite" type="xs:string" use="required" />
<xs:attribute name="VNCCompression" type="xs:string" use="required" />
<xs:attribute name="VNCEncoding" type="xs:string" use="required" />
<xs:attribute name="VNCAuthMode" type="xs:string" use="required" />
<xs:attribute name="VNCProxyType" type="xs:string" use="required" />
<xs:attribute name="VNCProxyIP" type="xs:string" use="required" />
<xs:attribute name="VNCProxyPort" type="xs:int" use="required" />
<xs:attribute name="VNCProxyUsername" type="xs:string" use="required" />
<xs:attribute name="VNCProxyPassword" type="xs:string" use="required" />
<xs:attribute name="VNCColors" type="xs:string" use="required" />
<xs:attribute name="VNCSmartSizeMode" type="xs:string" use="required" />
<xs:attribute name="VNCViewOnly" type="xs:boolean" use="required" />
<xs:attribute name="RDGatewayUsageMethod" type="xs:string" use="required" />
<xs:attribute name="RDGatewayHostname" type="xs:string" use="required" />
<xs:attribute name="RDGatewayUseConnectionCredentials" type="xs:string" use="required" />
<xs:attribute name="RDGatewayUsername" type="xs:string" use="required" />
<xs:attribute name="RDGatewayPassword" type="xs:string" use="required" />
<xs:attribute name="RDGatewayDomain" type="xs:string" use="required" />
<xs:attribute name="RDGatewayExternalCredentialProvider" type="xs:string" use="required" />
<xs:attribute name="RDGatewayUserViaAPI" type="xs:string" use="required" />
<xs:attribute name="InheritCredentialRecord" type="xs:boolean" use="optional" />
<xs:attribute name="InheritCacheBitmaps" type="xs:boolean" use="optional" />
<xs:attribute name="InheritColors" type="xs:boolean" use="optional" />
<xs:attribute name="InheritDescription" type="xs:boolean" use="optional" />
<xs:attribute name="InheritDisplayThemes" type="xs:boolean" use="optional" />
<xs:attribute name="InheritDisplayWallpaper" type="xs:boolean" use="optional" />
<xs:attribute name="InheritEnableFontSmoothing" type="xs:boolean" use="optional" />
<xs:attribute name="InheritEnableDesktopComposition" type="xs:boolean" use="optional" />
<xs:attribute name="InheritDisableFullWindowDrag" type="xs:boolean" use="optional" />
<xs:attribute name="InheritDisableMenuAnimations" type="xs:boolean" use="optional" />
<xs:attribute name="InheritDisableCursorShadow" type="xs:boolean" use="optional" />
<xs:attribute name="InheritDisableCursorBlinking" type="xs:boolean" use="optional" />
<xs:attribute name="InheritDomain" type="xs:boolean" use="optional" />
<xs:attribute name="InheritIcon" type="xs:boolean" use="optional" />
<xs:attribute name="InheritPanel" type="xs:boolean" use="optional" />
<xs:attribute name="InheritPassword" type="xs:boolean" use="optional" />
<xs:attribute name="InheritPort" type="xs:boolean" use="optional" />
<xs:attribute name="InheritProtocol" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRdpVersion" type="xs:boolean" use="optional" />
<xs:attribute name="InheritSSHTunnelConnectionName" type="xs:boolean" use="optional" />
<xs:attribute name="InheritSSHOptions" type="xs:boolean" use="optional" />
<xs:attribute name="InheritPuttySession" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRedirectDiskDrives" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRedirectDiskDrivesCustom" type="xs:string" use="optional" />
<xs:attribute name="InheritRedirectKeys" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRedirectPorts" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRedirectPrinters" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRedirectClipboard" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRedirectSmartCards" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRedirectSound" type="xs:boolean" use="optional" />
<xs:attribute name="InheritSoundQuality" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRedirectAudioCapture" type="xs:boolean" use="optional" />
<xs:attribute name="InheritResolution" type="xs:boolean" use="optional" />
<xs:attribute name="InheritAutomaticResize" type="xs:boolean" use="optional" />
<xs:attribute name="InheritUseConsoleSession" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRenderingEngine" type="xs:boolean" use="optional" />
<xs:attribute name="InheritUsername" type="xs:boolean" use="optional" />
<xs:attribute name="InheritICAEncryptionStrength" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDPAuthenticationLevel" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDPMinutesToIdleTimeout" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDPAlertIdleTimeout" type="xs:boolean" use="optional" />
<xs:attribute name="InheritLoadBalanceInfo" type="xs:boolean" use="optional" />
<xs:attribute name="InheritPreExtApp" type="xs:boolean" use="optional" />
<xs:attribute name="InheritPostExtApp" type="xs:boolean" use="optional" />
<xs:attribute name="InheritMacAddress" type="xs:boolean" use="optional" />
<xs:attribute name="InheritUseCredSsp" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVmId" type="xs:boolean" use="optional" />
<xs:attribute name="InheritUseVmId" type="xs:boolean" use="optional" />
<xs:attribute name="InheritUseEnhancedMode" type="xs:boolean" use="optional" />
<xs:attribute name="InheritUserField" type="xs:boolean" use="optional" />
<xs:attribute name="InheritExtApp" type="xs:boolean" use="optional" />
<xs:attribute name="InheritFavorite" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCCompression" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCEncoding" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCAuthMode" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCProxyType" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCProxyIP" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCProxyPort" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCProxyUsername" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCProxyPassword" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCColors" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCSmartSizeMode" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCViewOnly" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDGatewayUsageMethod" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDGatewayHostname" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDGatewayUseConnectionCredentials" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDGatewayUsername" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDGatewayPassword" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDGatewayDomain" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDGatewayExternalCredentialProvider" type="xs:boolean" use="optional" />
<xs:attribute name="InheritRDGatewayUserViaAPI" type="xs:boolean" use="optional" />
<xs:attribute name="StartProgram" type="xs:string" use="optional" />
<xs:attribute name="StartProgramWorkDir" type="xs:string" use="optional" />
<xs:attribute name="OpeningCommand" type="xs:string" use="optional" />
<xs:attribute name="ExternalCredentialProvider" type="xs:string" use="optional" />
<xs:attribute name="InheritExternalCredentialProvider" type="xs:boolean" use="optional" />
<xs:attribute name="UserViaAPI" type="xs:string" use="optional" />
<xs:attribute name="ExternalAddressProvider" type="xs:string" use="optional" />
<xs:attribute name="EC2InstanceId" type="xs:string" use="optional" />
<xs:attribute name="EC2Region" type="xs:string" use="optional" />
<xs:attribute name="UseRCG" type="xs:boolean" use="optional" />
<xs:attribute name="UseRestrictedAdmin" type="xs:boolean" use="optional" />
<xs:attribute name="InheritUseRCG" type="xs:boolean" use="optional" />
<xs:attribute name="InheritUseRestrictedAdmin" type="xs:boolean" use="optional" />
</xs:complexType>
</xs:schema>

View File

@@ -290,6 +290,11 @@ namespace mRemoteNG.UI.Controls.ConnectionInfoPropertyGrid
strHide.Add(nameof(AbstractConnectionRecord.AutomaticResize));
}
if (SelectedConnectionInfo.RedirectDiskDrives != RDPDiskDrives.Custom)
{
strHide.Add(nameof(AbstractConnectionRecord.RedirectDiskDrivesCustom));
}
if (SelectedConnectionInfo.RedirectSound != RDPSounds.BringToThisComputer)
{
strHide.Add(nameof(AbstractConnectionRecord.SoundQuality));

View File

@@ -447,6 +447,9 @@
<None Update="Schemas\mremoteng_confcons_v2_6.xsd">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Schemas\mremoteng_confcons_v2_8.xsd">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Schemas\mremoteng_confcons_v2_7.xsd">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>

View File

@@ -27,7 +27,7 @@ namespace mRemoteNGTests.Config.Serializers.MiscSerializers
private const bool ExpectedFontSmoothing = true;
private const bool ExpectedDesktopComposition = true;
private const bool ExpectedSmartcardRedirection = true;
private const bool ExpectedDriveRedirection = true;
private const RDPDiskDrives ExpectedDriveRedirection = RDPDiskDrives.Local;
private const bool ExpectedPortRedirection = true;
private const bool ExpectedPrinterRedirection = true;
private const RDPSounds ExpectedSoundRedirection = RDPSounds.BringToThisComputer;

View File

@@ -35,7 +35,7 @@ namespace mRemoteNGTests.Config.Serializers.MiscSerializers
private const RDPSounds ExpectedAudioRedirection = RDPSounds.DoNotPlay;
private const bool ExpectedKeyRedirection = true;
private const bool ExpectedSmartcardRedirection = true;
private const bool ExpectedDriveRedirection = true;
private const RDPDiskDrives ExpectedDriveRedirection = RDPDiskDrives.Local;
private const bool ExpectedPortRedirection = true;
private const bool ExpectedPrinterRedirection = true;
private const AuthenticationLevel ExpectedAuthLevel = AuthenticationLevel.WarnOnFailedAuth;

View File

@@ -33,7 +33,7 @@ namespace mRemoteNGTests.Config.Serializers.MiscSerializers
private const RDPSounds ExpectedAudioRedirection = RDPSounds.DoNotPlay;
private const bool ExpectedKeyRedirection = true;
private const bool ExpectedSmartcardRedirection = true;
private const bool ExpectedDriveRedirection = true;
private const RDPDiskDrives ExpectedDriveRedirection = RDPDiskDrives.Local;
private const bool ExpectedPortRedirection = true;
private const bool ExpectedPrinterRedirection = true;
private const AuthenticationLevel ExpectedAuthLevel = AuthenticationLevel.AuthRequired;

View File

@@ -344,7 +344,7 @@ namespace mRemoteNGTests.Connection
{
var wasCalled = false;
_testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true;
_testAbstractConnectionInfoData.RedirectDiskDrives = true;
_testAbstractConnectionInfoData.RedirectDiskDrives = RDPDiskDrives.Local;
Assert.That(wasCalled, Is.True);
}