mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Compare commits
96 Commits
v1.75Aplha
...
v1.75Alpha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43100930cd | ||
|
|
aac7e4cc53 | ||
|
|
1c8f3e2328 | ||
|
|
a54f0a2e89 | ||
|
|
fdb3cecf8e | ||
|
|
8762c39dd5 | ||
|
|
fc56c56883 | ||
|
|
ae950ac075 | ||
|
|
e6532dc155 | ||
|
|
ee6af8c187 | ||
|
|
bc1a0725df | ||
|
|
8163e7273e | ||
|
|
58fdba1d89 | ||
|
|
649f864236 | ||
|
|
292f3b03cc | ||
|
|
ec8fe3c343 | ||
|
|
823b0518ae | ||
|
|
c48caf5bdc | ||
|
|
20bc6d079f | ||
|
|
dccd318f60 | ||
|
|
2b0f670fb7 | ||
|
|
b5c431dca8 | ||
|
|
57dd93f136 | ||
|
|
976e02effb | ||
|
|
396387340a | ||
|
|
d9bf021597 | ||
|
|
b4e26f513b | ||
|
|
2eef31f74d | ||
|
|
cc96e2b3eb | ||
|
|
4526a0b875 | ||
|
|
4568bcc0ae | ||
|
|
cf3af14c6a | ||
|
|
d320c84bc8 | ||
|
|
8eff262e8f | ||
|
|
8c7d90f0c4 | ||
|
|
0e189551dd | ||
|
|
981acd6510 | ||
|
|
404aae6bf3 | ||
|
|
57cc9b8de4 | ||
|
|
d2def0a34d | ||
|
|
f1a5e1c029 | ||
|
|
19ae192887 | ||
|
|
cc87227559 | ||
|
|
9ad0c74a56 | ||
|
|
55a8b743c8 | ||
|
|
7adb150d1c | ||
|
|
afdb392289 | ||
|
|
1c8e24a117 | ||
|
|
266e79a2c3 | ||
|
|
6c5d629a88 | ||
|
|
84ed778b67 | ||
|
|
c1d41847a2 | ||
|
|
73c50837d8 | ||
|
|
89075aa3e9 | ||
|
|
bffe4454ba | ||
|
|
69a8f50b58 | ||
|
|
8c6f6534b6 | ||
|
|
791a78154d | ||
|
|
f08ce0acd5 | ||
|
|
757b195d5c | ||
|
|
c6a39a9220 | ||
|
|
a2054b458b | ||
|
|
6ee12d447f | ||
|
|
f95e3fb719 | ||
|
|
aa9141505f | ||
|
|
b4f0d2f2ae | ||
|
|
5bc67ab796 | ||
|
|
4f86e0da62 | ||
|
|
12165ac9a6 | ||
|
|
dd783c2dc0 | ||
|
|
4b65086622 | ||
|
|
de2542c172 | ||
|
|
973de3507e | ||
|
|
1945d5ac6b | ||
|
|
cb3614d54c | ||
|
|
4375f2d5d1 | ||
|
|
92b6cf201e | ||
|
|
b2b53561ba | ||
|
|
73a1923db6 | ||
|
|
76e290f6b7 | ||
|
|
be02814021 | ||
|
|
d60c007ac6 | ||
|
|
e92c1eaa9d | ||
|
|
8d638602b9 | ||
|
|
48161aca47 | ||
|
|
11314972fa | ||
|
|
83ac202a6b | ||
|
|
02c601fd3a | ||
|
|
86f6f85142 | ||
|
|
ca4cb433a9 | ||
|
|
e5bed0afcb | ||
|
|
11cf85f771 | ||
|
|
18d7a9cfe9 | ||
|
|
b3bac32441 | ||
|
|
0b9fb06c08 | ||
|
|
c6219ff315 |
@@ -1,3 +1,23 @@
|
||||
1.75 Alpha 2 (2016-08-03):
|
||||
|
||||
General Changes:
|
||||
----------------
|
||||
Updated GeckoFx pacakge
|
||||
Updated DockPanelSuite library to 2.10 Final
|
||||
Japanese translation updated
|
||||
MR-942: Refactored code relating to loading the connections file
|
||||
|
||||
Features/Enhancements:
|
||||
----------------------
|
||||
PR-133: Option to reconnect all currently opened connection tabs
|
||||
MR-917: Improved cryptographic support
|
||||
|
||||
Fixes:
|
||||
------
|
||||
MR-910: Fixes to support Remote Desktop Gateways
|
||||
|
||||
|
||||
|
||||
1.75 Alpha 1 (2016-07-08):
|
||||
|
||||
General Changes:
|
||||
|
||||
@@ -5,26 +5,10 @@ namespace CustomActions
|
||||
public class CustomActions
|
||||
{
|
||||
[CustomAction]
|
||||
public static ActionResult IsKBInstalled(Session session)
|
||||
public static ActionResult IsMinimumRdpVersionInstalled(Session session)
|
||||
{
|
||||
session.Log("Begin IsKBInstalled");
|
||||
string kb = session["KB"];
|
||||
session.Log("Checking if '{0}' is installed", kb);
|
||||
InstalledWindowsUpdateGatherer updateGatherer = new InstalledWindowsUpdateGatherer();
|
||||
bool isUpdateInstalled = updateGatherer.IsUpdateInstalled(kb);
|
||||
session.Log("KB is installed = '{0}'", isUpdateInstalled);
|
||||
if (isUpdateInstalled)
|
||||
{
|
||||
session[kb] = "1";
|
||||
session.Log("Set property '{0}' to '1'", kb);
|
||||
}
|
||||
else
|
||||
{
|
||||
session[kb] = "0";
|
||||
session.Log("Set property '{0}' to '0'", kb);
|
||||
}
|
||||
|
||||
session.Log("End IsKBInstalled");
|
||||
var rdpVersionChecker = new RdpVersionChecker(session);
|
||||
rdpVersionChecker.Execute();
|
||||
return ActionResult.Success;
|
||||
}
|
||||
|
||||
@@ -32,8 +16,8 @@ namespace CustomActions
|
||||
public static ActionResult IsLegacyVersionInstalled(Session session)
|
||||
{
|
||||
session.Log("Begin IsLegacyVersionInstalled");
|
||||
UninstallNSISVersions uninstaller = new UninstallNSISVersions();
|
||||
if (uninstaller.IsLegacymRemoteNGInstalled())
|
||||
var uninstaller = new UninstallNsisVersions();
|
||||
if (uninstaller.IsLegacymRemoteNgInstalled())
|
||||
{
|
||||
session["LEGACYVERSIONINSTALLED"] = "1";
|
||||
}
|
||||
@@ -50,8 +34,8 @@ namespace CustomActions
|
||||
public static ActionResult UninstallLegacyVersion(Session session)
|
||||
{
|
||||
session.Log("Begin UninstallLegacyVersion");
|
||||
UninstallNSISVersions uninstaller = new UninstallNSISVersions();
|
||||
string uninstallString = uninstaller.GetLegacyUninstallString();
|
||||
var uninstaller = new UninstallNsisVersions();
|
||||
uninstaller.GetLegacyUninstallString();
|
||||
uninstaller.UninstallLegacyVersion(true);
|
||||
session.Log("End UninstallLegacyVersion");
|
||||
return ActionResult.Success;
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
<Compile Include="CustomActions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="InstalledWindowsUpdateGatherer.cs" />
|
||||
<Compile Include="UninstallNSISVersions.cs" />
|
||||
<Compile Include="RdpVersionChecker.cs" />
|
||||
<Compile Include="UninstallNsisVersions.cs" />
|
||||
<Content Include="CustomAction.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
@@ -6,13 +6,11 @@ namespace CustomActions
|
||||
{
|
||||
public class InstalledWindowsUpdateGatherer
|
||||
{
|
||||
private ManagementScope _managementScope;
|
||||
private ManagementClass _managementClass;
|
||||
private readonly ManagementScope _managementScope;
|
||||
|
||||
public InstalledWindowsUpdateGatherer()
|
||||
{
|
||||
_managementScope = Connect();
|
||||
_managementClass = new ManagementClass("Win32_QuickFixEngineering");
|
||||
}
|
||||
|
||||
|
||||
@@ -24,28 +22,29 @@ namespace CustomActions
|
||||
}
|
||||
catch (ManagementException e)
|
||||
{
|
||||
Console.WriteLine("Failed to connect", e.Message);
|
||||
Console.WriteLine($"Failed to connect: {e.Message}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList GetInstalledUpdates()
|
||||
{
|
||||
string query = "SELECT * FROM Win32_QuickFixEngineering";
|
||||
ArrayList installedUpdates = new ArrayList();
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher(_managementScope, new ObjectQuery(query));
|
||||
foreach(ManagementObject queryObj in searcher.Get())
|
||||
const string query = "SELECT * FROM Win32_QuickFixEngineering";
|
||||
var installedUpdates = new ArrayList();
|
||||
var searcher = new ManagementObjectSearcher(_managementScope, new ObjectQuery(query));
|
||||
foreach(var o in searcher.Get())
|
||||
{
|
||||
var queryObj = (ManagementObject) o;
|
||||
installedUpdates.Add(queryObj["HotFixID"]);
|
||||
}
|
||||
return installedUpdates;
|
||||
}
|
||||
|
||||
public bool IsUpdateInstalled(string KB)
|
||||
public bool IsUpdateInstalled(string kb)
|
||||
{
|
||||
bool updateIsInstalled = false;
|
||||
string query = string.Format("SELECT HotFixID FROM Win32_QuickFixEngineering WHERE HotFixID='{0}'", KB);
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher(_managementScope, new ObjectQuery(query));
|
||||
var updateIsInstalled = false;
|
||||
var query = $"SELECT HotFixID FROM Win32_QuickFixEngineering WHERE HotFixID='{kb}'";
|
||||
var searcher = new ManagementObjectSearcher(_managementScope, new ObjectQuery(query));
|
||||
if (searcher.Get().Count > 0)
|
||||
updateIsInstalled = true;
|
||||
return updateIsInstalled;
|
||||
|
||||
42
InstallerProjects/CustomActions/RdpVersionChecker.cs
Normal file
42
InstallerProjects/CustomActions/RdpVersionChecker.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Microsoft.Deployment.WindowsInstaller;
|
||||
|
||||
namespace CustomActions
|
||||
{
|
||||
public class RdpVersionChecker
|
||||
{
|
||||
private readonly Session _session;
|
||||
private const string MinimumVersionInstalledReturnVar = "MINIMUM_RDP_VERSION_INSTALLED";
|
||||
private const string MinimumRdpKbVariable = "MINIMUM_RDP_KB";
|
||||
|
||||
public RdpVersionChecker(Session session)
|
||||
{
|
||||
_session = session;
|
||||
}
|
||||
|
||||
public bool Execute()
|
||||
{
|
||||
_session.Log("Begin IsMinimumRdpVersionInstalled");
|
||||
var minimumKb = _session[MinimumRdpKbVariable];
|
||||
var isUpdateInstalled = IsUpdateInstalled(minimumKb);
|
||||
SetReturnValue(isUpdateInstalled);
|
||||
_session.Log("End IsMinimumRdpVersionInstalled");
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsUpdateInstalled(string minimumKb)
|
||||
{
|
||||
_session.Log("Checking if '{0}' is installed", minimumKb);
|
||||
var updateGatherer = new InstalledWindowsUpdateGatherer();
|
||||
var isUpdateInstalled = updateGatherer.IsUpdateInstalled(minimumKb);
|
||||
_session.Log("KB is installed = '{0}'", isUpdateInstalled);
|
||||
return isUpdateInstalled;
|
||||
}
|
||||
|
||||
private void SetReturnValue(bool isUpdateInstalled)
|
||||
{
|
||||
var updateInstalledVal = isUpdateInstalled ? "1" : "0";
|
||||
_session[MinimumVersionInstalledReturnVar] = updateInstalledVal;
|
||||
_session.Log($"Set property '{MinimumVersionInstalledReturnVar}' to '{updateInstalledVal}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.Win32;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
|
||||
namespace CustomActions
|
||||
{
|
||||
public class UninstallNSISVersions
|
||||
public class UninstallNsisVersions
|
||||
{
|
||||
private const string REGISTRY_PATH = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\mRemoteNG";
|
||||
private const string REGISTRY_PATH_Wow6432 = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\mRemoteNG";
|
||||
private const string RegistryPath = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\mRemoteNG";
|
||||
private const string RegistryPathWow6432 = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\mRemoteNG";
|
||||
private RegistryKey _activeRegistryPath;
|
||||
|
||||
|
||||
public UninstallNSISVersions()
|
||||
public UninstallNsisVersions()
|
||||
{
|
||||
GetLegacymRemoteNGRegistryKeyPath();
|
||||
GetLegacymRemoteNgRegistryKeyPath();
|
||||
}
|
||||
|
||||
public void UninstallLegacyVersion(bool Silent = false)
|
||||
public void UninstallLegacyVersion(bool silent = false)
|
||||
{
|
||||
if (!IsLegacymRemoteNGInstalled())
|
||||
if (!IsLegacymRemoteNgInstalled())
|
||||
return;
|
||||
string uninstallString = GetLegacyUninstallString();
|
||||
string forceNonTempUninstaller = string.Format("_?={0}", uninstallString.Replace("Uninstall.exe", "").Replace(@"""", ""));
|
||||
string silentUninstall = "";
|
||||
if (Silent)
|
||||
var uninstallString = GetLegacyUninstallString();
|
||||
var forceNonTempUninstaller = $"_?={uninstallString.Replace("Uninstall.exe", "").Replace(@"""", "")}";
|
||||
var silentUninstall = "";
|
||||
if (silent)
|
||||
{
|
||||
silentUninstall = "/S";
|
||||
}
|
||||
ProcessStartInfo processStartInfo = new ProcessStartInfo(uninstallString);
|
||||
processStartInfo.UseShellExecute = true;
|
||||
processStartInfo.Arguments = string.Format("{0} {1}", forceNonTempUninstaller, silentUninstall);
|
||||
Process uninstallProcess = Process.Start(processStartInfo);
|
||||
while (uninstallProcess.HasExited == false)
|
||||
var processStartInfo = new ProcessStartInfo(uninstallString)
|
||||
{
|
||||
UseShellExecute = true,
|
||||
Arguments = $"{forceNonTempUninstaller} {silentUninstall}"
|
||||
};
|
||||
var uninstallProcess = Process.Start(processStartInfo);
|
||||
while (uninstallProcess != null && uninstallProcess.HasExited == false)
|
||||
{
|
||||
Debug.WriteLine("Waiting for uninstaller to exit");
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLegacymRemoteNGInstalled()
|
||||
public bool IsLegacymRemoteNgInstalled()
|
||||
{
|
||||
return (_activeRegistryPath != null);
|
||||
}
|
||||
|
||||
public string GetLegacyUninstallString()
|
||||
{
|
||||
if (IsLegacymRemoteNGInstalled())
|
||||
return _activeRegistryPath.GetValue("UninstallString").ToString();
|
||||
return "";
|
||||
return IsLegacymRemoteNgInstalled() ? _activeRegistryPath.GetValue("UninstallString").ToString() : "";
|
||||
}
|
||||
|
||||
private void GetLegacymRemoteNGRegistryKeyPath()
|
||||
private void GetLegacymRemoteNgRegistryKeyPath()
|
||||
{
|
||||
GetUninstallKeyPath();
|
||||
GetUninstallKeyPath6432();
|
||||
@@ -62,20 +60,24 @@ namespace CustomActions
|
||||
{
|
||||
try
|
||||
{
|
||||
_activeRegistryPath = Registry.LocalMachine.OpenSubKey(REGISTRY_PATH);
|
||||
_activeRegistryPath = Registry.LocalMachine.OpenSubKey(RegistryPath);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
catch (Exception ex)
|
||||
{ }
|
||||
}
|
||||
|
||||
private void GetUninstallKeyPath6432()
|
||||
{
|
||||
try
|
||||
{
|
||||
_activeRegistryPath = Registry.LocalMachine.OpenSubKey(REGISTRY_PATH_Wow6432);
|
||||
_activeRegistryPath = Registry.LocalMachine.OpenSubKey(RegistryPathWow6432);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
catch (Exception ex)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,6 @@
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<?include $(sys.CURRENTDIR)Includes\Config.wxi?>
|
||||
<Fragment>
|
||||
<CustomAction Id="SetRDP80KBValue" Return="check" Execute="immediate" Property="KB" Value="$(var.RDP80KB)" />
|
||||
<CustomAction Id="CheckIfRDP80Installed" Return="check" Execute="immediate" BinaryKey="CustomActions.CA.dll" DllEntry="IsKBInstalled" />
|
||||
</Fragment>
|
||||
<Fragment>
|
||||
<CustomAction Id="SetRDP81KBValue" Return="check" Execute="immediate" Property="KB" Value="$(var.RDP81KB)" />
|
||||
<CustomAction Id="CheckIfRDP81Installed" Return="check" Execute="immediate" BinaryKey="CustomActions.CA.dll" DllEntry="IsKBInstalled" />
|
||||
<CustomAction Id="CheckIfMinimumRdpInstalled" Return="check" Execute="immediate" BinaryKey="CustomActions.CA.dll" DllEntry="IsMinimumRdpVersionInstalled" />
|
||||
</Fragment>
|
||||
</Wix>
|
||||
@@ -16,8 +16,9 @@
|
||||
<?define RequiredDotNetFrameworkMinorVersion = "0" ?>
|
||||
<?define RequiredDotNetFrameworkServicePackLevel = "" ?>
|
||||
<?define RequiredDotNetFrameworkVersion = "$(var.RequiredDotNetFrameworkMajorVersion).$(var.RequiredDotNetFrameworkMinorVersion)" ?>
|
||||
<?define RDP80KB = "KB2592687" ?>
|
||||
<?define RDP81KB = "KB2923545" ?>
|
||||
<?define Rdp80Kb = "KB2592687" ?>
|
||||
<?define Rdp81Kb = "KB2923545" ?>
|
||||
<?define MinimumRdpKb = $(var.Rdp80Kb) ?>
|
||||
<?define IGNOREPREREQUISITES = 0 ?>
|
||||
|
||||
<?if $(var.Platform) = x64 ?>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
<Property Id="APPLICATIONROOTDIRECTORY">
|
||||
<RegistrySearch Id='mRemoteNGRegistry' Type='raw' Root='HKLM' Key='Software\mRemoteNG' Name='InstallDir' />
|
||||
</Property>
|
||||
<Property Id='MINIMUM_RDP_KB' Value='$(var.MinimumRdpKb)' />
|
||||
<Property Id='MINIMUM_RDP_VERSION_INSTALLED' Value='0' Secure='yes' />
|
||||
<Property Id='REQUIREDDOTNETFRAMEWORKVERSION' Value='$(var.RequiredDotNetFrameworkVersion)' />
|
||||
<Property Id='LEGACYVERSIONINSTALLED' Value='0' />
|
||||
<PropertyRef Id="NETFRAMEWORK40FULL" />
|
||||
@@ -24,8 +26,7 @@
|
||||
|
||||
|
||||
<InstallUISequence>
|
||||
<Custom Action="SetRDP80KBValue" After="AppSearch" />
|
||||
<Custom Action="CheckIfRDP80Installed" After="SetRDP80KBValue">(NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601)</Custom>
|
||||
<Custom Action="CheckIfMinimumRdpInstalled" After="AppSearch">(NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601)</Custom>
|
||||
<LaunchConditions After="SetWIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED" />
|
||||
<Custom Action="CheckIfLegacyVersionInstalled" After="LaunchConditions" />
|
||||
<Custom Action="UninstallLegacyVersion" After="CheckIfLegacyVersionInstalled">(NOT Installed) AND (LEGACYVERSIONINSTALLED = 1)</Custom>
|
||||
@@ -50,7 +51,7 @@
|
||||
</Condition>
|
||||
<!-- If Win7, require RDP 8.0 update (KB2592687) -->
|
||||
<Condition Message="!(loc.Install_RDP80Requirement)">
|
||||
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) ]]>AND ($(var.RDP80KB) = 1 OR $(var.RDP81KB) = 1))
|
||||
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND (MINIMUM_RDP_VERSION_INSTALLED = 1))]]>
|
||||
</Condition>
|
||||
|
||||
|
||||
|
||||
32
Jenkinsfile
vendored
32
Jenkinsfile
vendored
@@ -5,10 +5,11 @@ node('windows') {
|
||||
def vsExtensionsDir = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow"
|
||||
|
||||
stage 'Checkout Branch'
|
||||
def gitUrl = "https://github.com/mRemoteNG/mRemoteNG.git"
|
||||
def branchName = GetBranchName()
|
||||
echo "BranchName: ${branchName}"
|
||||
git([url: gitUrl, branch: branchName])
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
branches: scm.branches,
|
||||
userRemoteConfigs: scm.userRemoteConfigs
|
||||
])
|
||||
|
||||
stage 'Restore NuGet Packages'
|
||||
def nugetPath = "C:\\nuget.exe"
|
||||
@@ -24,26 +25,3 @@ node('windows') {
|
||||
def nunitTestAdapterPath = "C:\\Users\\Administrator\\AppData\\Local\\Microsoft\\VisualStudio\\14.0\\Extensions"
|
||||
bat "\"${vsToolsDir}\\VsDevCmd.bat\" && VSTest.Console.exe /TestAdapterPath:${nunitTestAdapterPath} \"${jobDir}\\mRemoteNGTests\\bin\\debug\\mRemoteNGTests.dll\""
|
||||
}
|
||||
def GetBranchName() {
|
||||
def jobDir = pwd()
|
||||
echo "JobDir: ${jobDir}"
|
||||
def patternToUse = GetPatternToMatchBranchNameFromDirectory()
|
||||
echo "PatternToUse: ${patternToUse}"
|
||||
java.util.regex.Matcher matcher = jobDir =~ patternToUse
|
||||
echo "Ran the matcher"
|
||||
matcher ? matcher[0][1] : null
|
||||
}
|
||||
def GetPatternToMatchBranchNameFromDirectory() {
|
||||
def patternToUse = ""
|
||||
def folderSeparator = ""
|
||||
def branchNamePattern = "[a-zA-Z0-9\\-_.]*"
|
||||
def jenkinsJobInfoTag = "@*[0-9]*"
|
||||
echo "isUnix: ${isUnix()}"
|
||||
if (isUnix()) {
|
||||
folderSeparator = "/"
|
||||
} else {
|
||||
folderSeparator = "\\\\"
|
||||
}
|
||||
patternToUse = "${folderSeparator}(${branchNamePattern})(${jenkinsJobInfoTag})\$"
|
||||
patternToUse
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,296 +0,0 @@
|
||||
; ---------------------
|
||||
; DotNetVer.nsh
|
||||
; Written by: David Grinberg
|
||||
; Homepage: http://ontheperiphery.veraida.com/
|
||||
; Updated By: Brandon Hansen (http://www.remotehams.com/)
|
||||
; ---------------------
|
||||
;
|
||||
; LogicLib extensions for checking Microsoft .NET Framework versions and service packs.
|
||||
;
|
||||
; Latests Updates by Brandon Hansen, KG6YPI (RemoteHams.com)
|
||||
; Dec 26, 2011 - .NET Framework 4.0 detection fixes - client profile not being found
|
||||
; Dec 07, 2010 - .NET Framework 4.0 detection added by Brandon Hansen (KG6YPI)
|
||||
;
|
||||
; Usage examples:
|
||||
;
|
||||
; ${If} ${HasDotNet4.0}
|
||||
; DetailPrint "Microsoft .NET Framework 4.0 installed."
|
||||
; ${If} ${DOTNETVER_4_0} AtLeastDotNetServicePack 1
|
||||
; DetailPrint "Microsoft .NET Framework 4.0 is at least SP1."
|
||||
; ${Else}
|
||||
; DetailPrint "Microsoft .NET Framework 4.0 SP1 not installed."
|
||||
; ${EndIf}
|
||||
; ${If} ${DOTNETVER_4_0} HasDotNetClientProfile 1
|
||||
; DetailPrint "Microsoft .NET Framework 4.0 (Client Profile) available."
|
||||
; ${EndIf}
|
||||
; ${If} ${DOTNETVER_4_0} HasDotNetFullProfile 1
|
||||
; DetailPrint "Microsoft .NET Framework 4.0 (Full Profile) available."
|
||||
; ${EndIf}
|
||||
; ${If} ${DOTNETVER_4_0} HasDotNetFullProfile 0
|
||||
; DetailPrint "Microsoft .NET Framework 4.0 (Full Profile) not available."
|
||||
; ${EndIf}
|
||||
; ${EndIf}
|
||||
|
||||
|
||||
!verbose push
|
||||
!verbose 3
|
||||
|
||||
!ifndef ___DOTNETVER__NSH___
|
||||
!define ___DOTNETVER__NSH___
|
||||
|
||||
!include LogicLib.nsh
|
||||
!include Util.nsh
|
||||
|
||||
# constants
|
||||
|
||||
!define DOTNETVER_1_0 "1.0"
|
||||
!define DOTNETVER_1_1 "1.1"
|
||||
!define DOTNETVER_2_0 "2.0"
|
||||
!define DOTNETVER_3_0 "3.0"
|
||||
!define DOTNETVER_3_5 "3.5"
|
||||
!define DOTNETVER_4_0 "4.0"
|
||||
|
||||
# variable declaration
|
||||
|
||||
Var /GLOBAL __DONTNET_FOUNDVER
|
||||
|
||||
!macro __DotNetVer_DeclareVars
|
||||
!ifndef __DOTNETVER_VARS_DECLARED
|
||||
!define __DOTNETVER_VARS_DECLARED
|
||||
Var /GLOBAL __DOTNET_1.0
|
||||
Var /GLOBAL __DOTNET_1.1
|
||||
Var /GLOBAL __DOTNET_2.0
|
||||
Var /GLOBAL __DOTNET_3.0
|
||||
Var /GLOBAL __DOTNET_3.5
|
||||
Var /GLOBAL __DOTNET_4.0
|
||||
|
||||
Var /GLOBAL __DOTNETVER_1.0_SP
|
||||
Var /GLOBAL __DOTNETVER_1.1_SP
|
||||
Var /GLOBAL __DOTNETVER_2.0_SP
|
||||
Var /GLOBAL __DOTNETVER_3.0_SP
|
||||
Var /GLOBAL __DOTNETVER_3.5_SP
|
||||
Var /GLOBAL __DOTNETVER_4.0_SP
|
||||
|
||||
Var /GLOBAL __DOTNET_1.0_CLIENT
|
||||
Var /GLOBAL __DOTNET_1.1_CLIENT
|
||||
Var /GLOBAL __DOTNET_2.0_CLIENT
|
||||
Var /GLOBAL __DOTNET_3.0_CLIENT
|
||||
Var /GLOBAL __DOTNET_3.5_CLIENT
|
||||
Var /GLOBAL __DOTNET_4.0_CLIENT
|
||||
|
||||
Var /GLOBAL __DOTNET_1.0_FULL
|
||||
Var /GLOBAL __DOTNET_1.1_FULL
|
||||
Var /GLOBAL __DOTNET_2.0_FULL
|
||||
Var /GLOBAL __DOTNET_3.0_FULL
|
||||
Var /GLOBAL __DOTNET_3.5_FULL
|
||||
Var /GLOBAL __DOTNET_4.0_FULL
|
||||
|
||||
StrCpy $__DOTNET_1.0 0
|
||||
StrCpy $__DOTNET_1.1 0
|
||||
StrCpy $__DOTNET_2.0 0
|
||||
StrCpy $__DOTNET_3.0 0
|
||||
StrCpy $__DOTNET_3.5 0
|
||||
StrCpy $__DOTNET_4.0 0
|
||||
|
||||
StrCpy $__DOTNETVER_1.0_SP 0
|
||||
StrCpy $__DOTNETVER_1.1_SP 0
|
||||
StrCpy $__DOTNETVER_2.0_SP 0
|
||||
StrCpy $__DOTNETVER_3.0_SP 0
|
||||
StrCpy $__DOTNETVER_3.5_SP 0
|
||||
StrCpy $__DOTNETVER_4.0_SP 0
|
||||
|
||||
StrCpy $__DOTNET_1.0_CLIENT 0
|
||||
StrCpy $__DOTNET_1.1_CLIENT 0
|
||||
StrCpy $__DOTNET_2.0_CLIENT 0
|
||||
StrCpy $__DOTNET_3.0_CLIENT 0
|
||||
StrCpy $__DOTNET_3.5_CLIENT 0
|
||||
StrCpy $__DOTNET_4.0_CLIENT 0
|
||||
|
||||
StrCpy $__DOTNET_1.0_FULL 0
|
||||
StrCpy $__DOTNET_1.1_FULL 0
|
||||
StrCpy $__DOTNET_2.0_FULL 0
|
||||
StrCpy $__DOTNET_3.0_FULL 0
|
||||
StrCpy $__DOTNET_3.5_FULL 0
|
||||
StrCpy $__DOTNET_4.0_FULL 0
|
||||
|
||||
!endif
|
||||
!macroend
|
||||
|
||||
|
||||
# lazy initialization macro
|
||||
|
||||
!macro __DotNetVer_InitVars
|
||||
# only calculate version once
|
||||
StrCmp $__DONTNET_FOUNDVER "" dotnetver.noveryet
|
||||
Return
|
||||
|
||||
dotnetver.noveryet:
|
||||
!insertmacro __DotNetVer_DeclareVars
|
||||
|
||||
Push $0 ;registry count
|
||||
Push $1 ;registry key
|
||||
Push $2 ;version number
|
||||
Push $3 ;installed
|
||||
Push $4 ;service pack number
|
||||
Push $8 ;strLen helper var
|
||||
|
||||
StrCpy $0 0
|
||||
|
||||
dotnetver.startenum:
|
||||
|
||||
EnumRegKey $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP" $0
|
||||
StrCmp $1 "" dotnetver.done
|
||||
|
||||
IntOp $0 $0 + 1
|
||||
|
||||
StrCpy $2 $1 1 0
|
||||
StrCmp $2 "v" +1 dotnetver.startenum
|
||||
StrCpy $2 $1 3 1
|
||||
|
||||
; Check for .NET 1.0 to 3.5
|
||||
ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\$1" "Install"
|
||||
ReadRegDWORD $4 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\$1" "SP"
|
||||
IntCmp $3 1 dotnetcheck.skipalt
|
||||
; Alternate check for versions that don't set the Install key
|
||||
ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\$1\Setup" "InstallSuccess"
|
||||
dotnetcheck.skipalt:
|
||||
; This is a sanity check that works on .NET 1.0 to 3.5
|
||||
; if it fails check for dotnet 4
|
||||
IntCmp $3 0 dotnetcheck.40
|
||||
StrCmp $2 ${DOTNETVER_1_0} dotnetver.10
|
||||
StrCmp $2 ${DOTNETVER_1_1} dotnetver.11
|
||||
StrCmp $2 ${DOTNETVER_2_0} dotnetver.20
|
||||
StrCmp $2 ${DOTNETVER_3_0} dotnetver.30
|
||||
StrCmp $2 ${DOTNETVER_3_5} dotnetver.35
|
||||
dotnetcheck.40:
|
||||
StrCmp $2 ${DOTNETVER_4_0} dotnetver.40
|
||||
StrCmp $2 "4" dotnetver.40
|
||||
|
||||
Goto dotnetver.startenum
|
||||
|
||||
dotnetver.10:
|
||||
StrCpy $__DOTNET_1.0 1
|
||||
StrCpy $__DOTNETVER_1.0_SP $4
|
||||
StrCpy $__DOTNET_1.0_FULL 1
|
||||
Goto dotnetver.startenum
|
||||
dotnetver.11:
|
||||
StrCpy $__DOTNET_1.1 1
|
||||
StrCpy $__DOTNETVER_1.1_SP $4
|
||||
StrCpy $__DOTNET_1.1_FULL 1
|
||||
Goto dotnetver.startenum
|
||||
dotnetver.20:
|
||||
StrCpy $__DOTNET_2.0 1
|
||||
StrCpy $__DOTNETVER_2.0_SP $4
|
||||
StrCpy $__DOTNET_2.0_FULL 1
|
||||
Goto dotnetver.startenum
|
||||
dotnetver.30:
|
||||
StrCpy $__DOTNET_3.0 1
|
||||
StrCpy $__DOTNETVER_3.0_SP $4
|
||||
StrCpy $__DOTNET_3.0_FULL 1
|
||||
Goto dotnetver.startenum
|
||||
dotnetver.35:
|
||||
StrCpy $__DOTNET_3.5 1
|
||||
StrCpy $__DOTNETVER_3.5_SP $4
|
||||
StrCpy $__DOTNET_3.5_FULL 1
|
||||
Goto dotnetver.startenum
|
||||
dotnetver.40:
|
||||
; Check for .NET 4.0 (Full Profile)
|
||||
ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Install"
|
||||
ReadRegDWORD $4 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "SP"
|
||||
StrLen $8 $3
|
||||
IntCmp $8 0 dotnetcheck.40c
|
||||
IntCmp $3 0 dotnetcheck.40c
|
||||
StrCmp $2 ${DOTNETVER_4_0} dotnetver.40_Full
|
||||
StrCmp $2 "4" dotnetver.40_Full
|
||||
dotnetcheck.40c:
|
||||
; Check for .NET 4.0 (Client Profile)
|
||||
ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" "Install"
|
||||
ReadRegDWORD $4 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" "SP"
|
||||
StrLen $8 $3
|
||||
IntCmp $8 0 dotnetver.startenum
|
||||
IntCmp $3 0 dotnetver.startenum
|
||||
StrCmp $2 ${DOTNETVER_4_0} dotnetver.40_Client
|
||||
StrCmp $2 "4" dotnetver.40_Client
|
||||
Goto dotnetver.startenum
|
||||
dotnetver.40_Full:
|
||||
StrCpy $__DOTNET_4.0 1
|
||||
StrCpy $__DOTNETVER_4.0_SP $4
|
||||
StrCpy $__DOTNET_4.0_FULL 1
|
||||
Goto dotnetcheck.40c ; continue looking for other profiles
|
||||
dotnetver.40_Client:
|
||||
StrCpy $__DOTNET_4.0 1
|
||||
StrCpy $__DOTNETVER_4.0_SP $4
|
||||
StrCpy $__DOTNET_4.0_CLIENT 1
|
||||
Goto dotnetver.startenum
|
||||
|
||||
dotnetver.done:
|
||||
|
||||
StrCpy $__DONTNET_FOUNDVER "1"
|
||||
|
||||
Pop $8
|
||||
Pop $4
|
||||
Pop $3
|
||||
Pop $2
|
||||
Pop $1
|
||||
Pop $0
|
||||
!macroend
|
||||
|
||||
!macro _HasDotNet _a _b _t _f
|
||||
${CallArtificialFunction} __DotNetVer_InitVars
|
||||
|
||||
!insertmacro _= `$__DOTNET_${_b}` `1` `${_t}` `${_f}`
|
||||
!macroend
|
||||
|
||||
!macro __DotNetVer_DefineTest Ver
|
||||
!define HasDotNet${Ver} `"" HasDotNet ${Ver}`
|
||||
!macroend
|
||||
|
||||
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_1_0}
|
||||
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_1_1}
|
||||
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_2_0}
|
||||
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_3_0}
|
||||
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_3_5}
|
||||
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_4_0}
|
||||
|
||||
!macro _AtLeastDotNetServicePack _a _b _t _f
|
||||
${CallArtificialFunction} __DotNetVer_InitVars
|
||||
|
||||
!insertmacro _>= `$__DOTNETVER_${_a}_SP` `${_b}` `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define AtLeastDotNetServicePack `AtLeastDotNetServicePack`
|
||||
|
||||
|
||||
!macro _AtMostDotNetServicePack _a _b _t _f
|
||||
${CallArtificialFunction} __DotNetVer_InitVars
|
||||
|
||||
!insertmacro _<= `$__DOTNETVER_${_a}_SP` `${_b}` `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define AtMostDotNetServicePack `AtMostDotNetServicePack`
|
||||
|
||||
|
||||
!macro _IsDotNetServicePack _a _b _t _f
|
||||
${CallArtificialFunction} __DotNetVer_InitVars
|
||||
|
||||
!insertmacro _= `$__DOTNETVER_${_a}_SP` `${_b}` `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define IsDotNetServicePack `IsDotNetServicePack`
|
||||
|
||||
!macro _HasDotNetClientProfile _a _b _t _f
|
||||
${CallArtificialFunction} __DotNetVer_InitVars
|
||||
|
||||
!insertmacro _= `$__DOTNET_${_a}_CLIENT` `${_b}` `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define HasDotNetClientProfile `HasDotNetClientProfile`
|
||||
|
||||
!macro _HasDotNetFullProfile _a _b _t _f
|
||||
${CallArtificialFunction} __DotNetVer_InitVars
|
||||
|
||||
!insertmacro _= `$__DOTNET_${_a}_FULL` `${_b}` `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define HasDotNetFullProfile `HasDotNetFullProfile`
|
||||
|
||||
# done
|
||||
|
||||
!endif # !___DOTNETVER__NSH___
|
||||
|
||||
!verbose pop
|
||||
@@ -1,22 +0,0 @@
|
||||
; Czech installer translation
|
||||
|
||||
; Start mRemoteNG after installation
|
||||
LangString LaunchMremoteNow ${LANG_CZECH} "mRemoteNG run CZECH message"
|
||||
|
||||
; Installer Language
|
||||
LangString InstallerLanguage ${LANG_CZECH} "Installer Language"
|
||||
|
||||
; Select installer Language
|
||||
LangString SelectInstallerLanguage ${LANG_CZECH} "Please select the language of the installer"
|
||||
|
||||
; Requires .NET Framework
|
||||
LangString RequiresNetFramework ${LANG_CZECH} "mRemoteNG requires Microsoft .NET Framework 3.0."
|
||||
|
||||
; User needs to be Admin
|
||||
LangString RequiresAdminUser ${LANG_CZECH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
|
||||
|
||||
; Start Menu items
|
||||
LangString CreditsLinkName ${LANG_CZECH} "Credits"
|
||||
LangString CopyingLinkName ${LANG_CZECH} "License"
|
||||
LangString UninstallLinkName ${LANG_CZECH} "Uninstall"
|
||||
LangString ChangeLogLinkName ${LANG_CZECH} "Version History"
|
||||
@@ -1,22 +0,0 @@
|
||||
; Dutch installer translation
|
||||
|
||||
; Start mRemoteNG after installation
|
||||
LangString LaunchMremoteNow ${LANG_DUTCH} "mRemoteNG run DUTCH message"
|
||||
|
||||
; Installer Language
|
||||
LangString InstallerLanguage ${LANG_DUTCH} "Installer Language"
|
||||
|
||||
; Select installer Language
|
||||
LangString SelectInstallerLanguage ${LANG_DUTCH} "Please select the language of the installer"
|
||||
|
||||
; Requires .NET Framework
|
||||
LangString RequiresNetFramework ${LANG_DUTCH} "mRemoteNG requires Microsoft .NET Framework 3.0."
|
||||
|
||||
; User needs to be Admin
|
||||
LangString RequiresAdminUser ${LANG_DUTCH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
|
||||
|
||||
; Start Menu items
|
||||
LangString CreditsLinkName ${LANG_DUTCH} "Credits"
|
||||
LangString CopyingLinkName ${LANG_DUTCH} "License"
|
||||
LangString UninstallLinkName ${LANG_DUTCH} "Uninstall"
|
||||
LangString ChangeLogLinkName ${LANG_DUTCH} "Version History"
|
||||
@@ -1,22 +0,0 @@
|
||||
; English installer translation
|
||||
|
||||
; Start mRemoteNG after installation
|
||||
LangString LaunchMremoteNow ${LANG_ENGLISH} "Launch mRemoteNG Now"
|
||||
|
||||
; Installer Language
|
||||
LangString InstallerLanguage ${LANG_ENGLISH} "Installer Language"
|
||||
|
||||
; Select installer Language
|
||||
LangString SelectInstallerLanguage ${LANG_ENGLISH} "Please select the language of the installer"
|
||||
|
||||
; Requires .NET Framework
|
||||
LangString RequiresNetFramework ${LANG_ENGLISH} "mRemoteNG requires Microsoft .NET Framework 3.0."
|
||||
|
||||
; User needs to be Admin
|
||||
LangString RequiresAdminUser ${LANG_ENGLISH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
|
||||
|
||||
; Start Menu items
|
||||
LangString CreditsLinkName ${LANG_ENGLISH} "Credits"
|
||||
LangString CopyingLinkName ${LANG_ENGLISH} "License"
|
||||
LangString UninstallLinkName ${LANG_ENGLISH} "Uninstall"
|
||||
LangString ChangeLogLinkName ${LANG_ENGLISH} "Version History"
|
||||
@@ -1,22 +0,0 @@
|
||||
; French installer translation
|
||||
|
||||
; Start mRemoteNG after installation
|
||||
LangString LaunchMremoteNow ${LANG_FRENCH} "mRemoteNG run FRENCH message"
|
||||
|
||||
; Installer Language
|
||||
LangString InstallerLanguage ${LANG_FRENCH} "Installer Language"
|
||||
|
||||
; Select installer Language
|
||||
LangString SelectInstallerLanguage ${LANG_FRENCH} "Please select the language of the installer"
|
||||
|
||||
; Requires .NET Framework
|
||||
LangString RequiresNetFramework ${LANG_FRENCH} "mRemoteNG requires Microsoft .NET Framework 3.0."
|
||||
|
||||
; User needs to be Admin
|
||||
LangString RequiresAdminUser ${LANG_FRENCH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
|
||||
|
||||
; Start Menu items
|
||||
LangString CreditsLinkName ${LANG_FRENCH} "Credits"
|
||||
LangString CopyingLinkName ${LANG_FRENCH} "License"
|
||||
LangString UninstallLinkName ${LANG_FRENCH} "Uninstall"
|
||||
LangString ChangeLogLinkName ${LANG_FRENCH} "Version History"
|
||||
@@ -1,22 +0,0 @@
|
||||
; German installer translation
|
||||
|
||||
; Start mRemoteNG after installation
|
||||
LangString LaunchMremoteNow ${LANG_GERMAN} "mRemoteNG jetzt Starten"
|
||||
|
||||
; Installer Language
|
||||
LangString InstallerLanguage ${LANG_GERMAN} "Installationsprogamm Sprache"
|
||||
|
||||
; Select installer Language
|
||||
LangString SelectInstallerLanguage ${LANG_GERMAN} "Bitte w<>hlen Sie die Sprache f<>r das Installationsprogramm"
|
||||
|
||||
; Requires .NET Framework
|
||||
LangString RequiresNetFramework ${LANG_GERMAN} "mRemoteNG ben<65>tigt das Microsoft .NET Framework 3.0."
|
||||
|
||||
; User needs to be Admin
|
||||
LangString RequiresAdminUser ${LANG_GERMAN} "Sie m<>ssen Mitglied der Grupper 'Power Users' or 'Administratoren' sein, damit Sie mRemoteNG installieren k<>nnen."
|
||||
|
||||
; Start Menu items
|
||||
LangString CreditsLinkName ${LANG_GERMAN} "Credits"
|
||||
LangString CopyingLinkName ${LANG_GERMAN} "License"
|
||||
LangString UninstallLinkName ${LANG_GERMAN} "Uninstall"
|
||||
LangString ChangeLogLinkName ${LANG_GERMAN} "Version History"
|
||||
@@ -1,31 +0,0 @@
|
||||
!define LanguageNameEnglish "English"
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!include "Language\english.nsi"
|
||||
|
||||
!define LanguageNameCzech "Čeština"
|
||||
!insertmacro MUI_LANGUAGE "Czech"
|
||||
!include "Language\czech.nsi"
|
||||
|
||||
!define LanguageNameGerman "Deutsch"
|
||||
!insertmacro MUI_LANGUAGE "German"
|
||||
!include "Language\german.nsi"
|
||||
|
||||
!define LanguageNameSpanish "Español"
|
||||
!insertmacro MUI_LANGUAGE "Spanish"
|
||||
!include "Language\spanish.nsi"
|
||||
|
||||
!define LanguageNameFrench "Français"
|
||||
!insertmacro MUI_LANGUAGE "French"
|
||||
!include "Language\french.nsi"
|
||||
|
||||
!define LanguageNameDutch "Nederlands"
|
||||
!insertmacro MUI_LANGUAGE "Dutch"
|
||||
!include "Language\dutch.nsi"
|
||||
|
||||
!define LanguageNamePolish "Polski"
|
||||
!insertmacro MUI_LANGUAGE "Polish"
|
||||
!include "Language\polish.nsi"
|
||||
|
||||
!define LanguageNameThai "ภาษาไทย"
|
||||
!insertmacro MUI_LANGUAGE "Thai"
|
||||
!include "Language\thai.nsi"
|
||||
@@ -1,22 +0,0 @@
|
||||
; Polish installer translation
|
||||
|
||||
; Start mRemoteNG after installation
|
||||
LangString LaunchMremoteNow ${LANG_POLISH} "mRemoteNG run POLISH message"
|
||||
|
||||
; Installer Language
|
||||
LangString InstallerLanguage ${LANG_POLISH} "Installer Language"
|
||||
|
||||
; Select installer Language
|
||||
LangString SelectInstallerLanguage ${LANG_POLISH} "Please select the language of the installer"
|
||||
|
||||
; Requires .NET Framework
|
||||
LangString RequiresNetFramework ${LANG_POLISH} "mRemoteNG requires Microsoft .NET Framework 3.0."
|
||||
|
||||
; User needs to be Admin
|
||||
LangString RequiresAdminUser ${LANG_POLISH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
|
||||
|
||||
; Start Menu items
|
||||
LangString CreditsLinkName ${LANG_POLISH} "Credits"
|
||||
LangString CopyingLinkName ${LANG_POLISH} "License"
|
||||
LangString UninstallLinkName ${LANG_POLISH} "Uninstall"
|
||||
LangString ChangeLogLinkName ${LANG_POLISH} "Version History"
|
||||
@@ -1,22 +0,0 @@
|
||||
; Spanish installer translation
|
||||
|
||||
; Start mRemoteNG after installation
|
||||
LangString LaunchMremoteNow ${LANG_SPANISH} "Iniciando de mRemoteNG"
|
||||
|
||||
; Installer Language
|
||||
LangString InstallerLanguage ${LANG_SPANISH} "Lenguaje de Instalación"
|
||||
|
||||
; Select installer Language
|
||||
LangString SelectInstallerLanguage ${LANG_SPANISH} "Seleccione el lenguaje de instalación"
|
||||
|
||||
; Requires .NET Framework
|
||||
LangString RequiresNetFramework ${LANG_SPANISH} "mRemoteNG requiere Microsoft .NET Framework 3.0."
|
||||
|
||||
; User needs to be Admin
|
||||
LangString RequiresAdminUser ${LANG_SPANISH} "Debe ser miembro del grupo 'Administradores' para poder instalar mRemoteNG."
|
||||
|
||||
; Start Menu items
|
||||
LangString CreditsLinkName ${LANG_SPANISH} "Créditos"
|
||||
LangString CopyingLinkName ${LANG_SPANISH} "Licencia"
|
||||
LangString UninstallLinkName ${LANG_SPANISH} "Desinstalar"
|
||||
LangString ChangeLogLinkName ${LANG_SPANISH} "Historial de Versiones"
|
||||
@@ -1,23 +0,0 @@
|
||||
; Thai installer translation
|
||||
; Contributed by Apisitt Rattana
|
||||
|
||||
; Start mRemoteNG after installation
|
||||
LangString LaunchMremoteNow ${LANG_THAI} "ขณะนี้กำลังติดตั้ง mRemoteNG"
|
||||
|
||||
; Installer Language
|
||||
LangString InstallerLanguage ${LANG_THAI} "ภาษาสำหรับการติดตั้ง"
|
||||
|
||||
; Select installer Language
|
||||
LangString SelectInstallerLanguage ${LANG_THAI} "กรุณาเลือกภาษาสำหรับการติดตั้ง"
|
||||
|
||||
; Requires .NET Framework
|
||||
LangString RequiresNetFramework ${LANG_THAI} "mRemoteNG มีความต้องการ Microsoft .NET Framework 3.0. เป็นพื้นฐาน"
|
||||
|
||||
; User needs to be Admin
|
||||
LangString RequiresAdminUser ${LANG_THAI} "คุณต้องเป็นสมาชิกในกลุ่มของ 'Power Users' หรือ 'Administrators' เพื่อการติดตั้ง mRemoteNG"
|
||||
|
||||
; Start Menu items
|
||||
LangString CreditsLinkName ${LANG_THAI} "Credits"
|
||||
LangString CopyingLinkName ${LANG_THAI} "License"
|
||||
LangString UninstallLinkName ${LANG_THAI} "Uninstall"
|
||||
LangString ChangeLogLinkName ${LANG_THAI} "Version History"
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 83 KiB |
@@ -1,197 +0,0 @@
|
||||
!include "MUI.nsh"
|
||||
!include "WordFunc.nsh"
|
||||
!insertmacro VersionCompare
|
||||
|
||||
!include "DotNetVer.nsh"
|
||||
!include "..\Release\Version.nsh"
|
||||
|
||||
; This will be passed in using the /D switch by BUILD.CMD
|
||||
!ifdef PRODUCT_VERSION_TAG
|
||||
!define PRODUCT_VERSION_FRIENDLY "${PRODUCT_VERSION_SHORT}"
|
||||
!define PRODUCT_VERSION_TAGGED "${PRODUCT_VERSION_SHORT}-${PRODUCT_VERSION_TAG}"
|
||||
!else
|
||||
!define PRODUCT_VERSION_FRIENDLY "${PRODUCT_VERSION_SHORT}"
|
||||
!define PRODUCT_VERSION_TAGGED "${PRODUCT_VERSION_SHORT}"
|
||||
!endif
|
||||
|
||||
; Basic Config
|
||||
Name "mRemoteNG ${PRODUCT_VERSION_FRIENDLY}"
|
||||
OutFile "..\Release\mRemoteNG-Installer-${PRODUCT_VERSION_TAGGED}.exe"
|
||||
SetCompressor /SOLID lzma
|
||||
InstallDir "$PROGRAMFILES\mRemoteNG"
|
||||
InstallDirRegKey HKLM "Software\mRemoteNG" "InstallPath"
|
||||
RequestExecutionLevel admin
|
||||
|
||||
; Version Information
|
||||
VIProductVersion ${PRODUCT_VERSION}
|
||||
VIAddVersionKey "CompanyName" "Next Generation Software"
|
||||
VIAddVersionKey "ProductName" "mRemoteNG"
|
||||
VIAddVersionKey "ProductVersion" ${PRODUCT_VERSION}
|
||||
VIAddVersionKey "LegalCopyright" "Copyright © 2007-2009 Felix Deimel, 2010-2013 Riley McArdle"
|
||||
VIAddVersionKey "FileDescription" "mRemoteNG ${PRODUCT_VERSION_FRIENDLY} Installer"
|
||||
VIAddVersionKey "FileVersion" ${PRODUCT_VERSION}
|
||||
|
||||
; Design
|
||||
!define MUI_ICON "Setup_Install.ico"
|
||||
!define MUI_UNICON "RecycleBin.ico"
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_HEADERIMAGE_BITMAP "header.bmp" ; optional
|
||||
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
|
||||
!define MUI_HEADERIMAGE_UNBITMAP "header.bmp" ; optional
|
||||
!define MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH
|
||||
!define MUI_HEADER_TRANSPARENT_TEXT
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcomefinish.bmp"
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "welcomefinish.bmp"
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH
|
||||
|
||||
; Install Pages
|
||||
!insertmacro MUI_PAGE_LICENSE "..\COPYING.TXT"
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
||||
|
||||
; Finish Page
|
||||
!define MUI_FINISHPAGE_RUN_NOTCHECKED
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\mRemoteNG.exe"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
; Uninstall Pages
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
; Get Languages
|
||||
!include "Language\languages.nsi"
|
||||
|
||||
; Set finish page text
|
||||
!define MUI_FINISHPAGE_RUN_Text "$(LaunchMremoteNow)"
|
||||
|
||||
Function .onInit
|
||||
ClearErrors
|
||||
UserInfo::GetName
|
||||
IfErrors Win9x
|
||||
Pop $0
|
||||
UserInfo::GetAccountType
|
||||
Pop $1
|
||||
# GetOriginalAccountType will check the tokens of the original user of the
|
||||
# current thread/process. If the user tokens were elevated or limited for
|
||||
# this process, GetOriginalAccountType will return the non-restricted
|
||||
# account type.
|
||||
# On Vista with UAC, for example, this is not the same value when running
|
||||
# with `RequestExecutionLevel user`. GetOriginalAccountType will return
|
||||
# "admin" while GetAccountType will return "user".
|
||||
StrCmp $1 "Admin" 0 +3
|
||||
Goto doit
|
||||
StrCmp $1 "Power" 0 +3
|
||||
Goto doit
|
||||
StrCmp $1 "User" 0 +3
|
||||
Goto noop
|
||||
StrCmp $1 "Guest" 0 +3
|
||||
Goto noop
|
||||
MessageBox MB_OK "Unknown error"
|
||||
Goto doit
|
||||
|
||||
Win9x:
|
||||
doit:
|
||||
# We can install
|
||||
IfSilent +2
|
||||
Call SelectLanguage
|
||||
Goto end
|
||||
noop:
|
||||
MessageBox MB_OK "$(RequiresAdminUser)"
|
||||
Quit
|
||||
end:
|
||||
FunctionEnd
|
||||
|
||||
Function SelectLanguage
|
||||
;Language selection dialog
|
||||
Push ""
|
||||
Push ${LANG_ENGLISH}
|
||||
Push ${LanguageNameEnglish}
|
||||
Push ${LANG_GERMAN}
|
||||
Push ${LanguageNameGerman}
|
||||
Push ${LANG_DUTCH}
|
||||
Push ${LanguageNameDutch}
|
||||
Push ${LANG_FRENCH}
|
||||
Push ${LanguageNameFrench}
|
||||
Push ${LANG_POLISH}
|
||||
Push ${LanguageNamePolish}
|
||||
Push ${LANG_SPANISH}
|
||||
Push ${LanguageNameSpanish}
|
||||
Push ${LANG_CZECH}
|
||||
Push ${LanguageNameCzech}
|
||||
Push ${LANG_THAI}
|
||||
Push ${LanguageNameThai}
|
||||
Push A ; A means auto count languages
|
||||
; for the auto count to work the first empty push (Push "") must remain
|
||||
LangDLL::LangDialog "$(InstallerLanguage)" "$(SelectInstallerLanguage)"
|
||||
|
||||
Pop $LANGUAGE
|
||||
StrCmp $LANGUAGE "cancel" 0 +2
|
||||
Abort
|
||||
|
||||
; Check .NET version
|
||||
${IfNot} ${HasDotNet3.0}
|
||||
MessageBox MB_OK|MB_ICONEXCLAMATION "$(RequiresNetFramework)"
|
||||
Quit
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
Section "" ; Install
|
||||
SetOutPath $INSTDIR
|
||||
SetShellVarContext all
|
||||
|
||||
; AddFiles
|
||||
File /r /x "mRemoteNG.vshost.*" "..\mRemoteV1\bin\Release\*.*"
|
||||
File /r "Dependencies\*.*"
|
||||
File "..\*.txt"
|
||||
|
||||
; Uninstaller
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
|
||||
; Register ActiveX components
|
||||
RegDLL "$INSTDIR\eolwtscom.dll"
|
||||
|
||||
; Start Menu
|
||||
CreateDirectory "$SMPROGRAMS\mRemoteNG"
|
||||
CreateShortCut "$SMPROGRAMS\mRemoteNG\$(CreditsLinkName).lnk" "$INSTDIR\CREDITS.TXT"
|
||||
CreateShortCut "$SMPROGRAMS\mRemoteNG\$(CopyingLinkName).lnk" "$INSTDIR\COPYING.TXT"
|
||||
CreateShortCut "$SMPROGRAMS\mRemoteNG\mRemoteNG.lnk" "$INSTDIR\mRemoteNG.exe"
|
||||
CreateShortCut "$SMPROGRAMS\mRemoteNG\$(UninstallLinkName).lnk" "$INSTDIR\Uninstall.exe"
|
||||
CreateShortCut "$SMPROGRAMS\mRemoteNG\$(ChangeLogLinkName).lnk" "$INSTDIR\CHANGELOG.TXT"
|
||||
|
||||
; Registry
|
||||
WriteRegStr HKLM "Software\mRemoteNG" "InstallPath" $INSTDIR
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "DisplayName" "mRemoteNG"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "Publisher" "Next Generation Software"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "DisplayIcon" "$INSTDIR\mRemoteNG.exe"
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "EstimatedSize" 7080
|
||||
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "DisplayVersion" ${PRODUCT_VERSION}
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "VersionMajor" ${PRODUCT_VERSION_MAJOR}
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "VersionMinor" ${PRODUCT_VERSION_MINOR}
|
||||
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "UninstallString" '"$INSTDIR\Uninstall.exe"'
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "NoModify" 1
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "NoRepair" 1
|
||||
SectionEnd
|
||||
|
||||
Section "un.Uninstall"
|
||||
; Unregister ActiveX components
|
||||
UnregDLL "$INSTDIR\eolwtscom.dll"
|
||||
|
||||
; Delete Files
|
||||
RMDIR /r $INSTDIR
|
||||
|
||||
; Start Menu
|
||||
SetShellVarContext all
|
||||
RMDir /r "$SMPROGRAMS\mRemoteNG"
|
||||
SetShellVarContext current
|
||||
RMDir /r "$SMPROGRAMS\mRemoteNG"
|
||||
|
||||
; Registry
|
||||
DeleteRegValue HKLM "Software\mRemoteNG" "InstallPath"
|
||||
DeleteRegKey /ifempty HKLM "Software\mRemoteNG"
|
||||
DeleteRegKey /ifempty HKCU "Software\mRemoteNG"
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG"
|
||||
SectionEnd
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 151 KiB |
@@ -1,5 +1,8 @@
|
||||
[](https://twitter.com/intent/follow?screen_name=mRemoteNG)
|
||||
|
||||
|
||||
[](https://gitter.im/mRemoteNG/PublicChat)
|
||||
|
||||
[](http://ec2-52-39-111-114.us-west-2.compute.amazonaws.com:8080/job/mRemoteNG/job/mRemoteNG/job/develop/)
|
||||
[](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.74)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace mRemoteNGTests
|
||||
Assert.That(IsLargeAware(exePath), Is.True);
|
||||
}
|
||||
|
||||
static string GetTargetPath()
|
||||
static string GetTargetPath([System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "")
|
||||
{
|
||||
string debugOrRelease = "";
|
||||
string normalOrPortable = "";
|
||||
@@ -27,8 +27,9 @@ namespace mRemoteNGTests
|
||||
#else
|
||||
normalOrPortable = "";
|
||||
#endif
|
||||
string path = string.Format(".\\mRemoteV1\\bin\\{0}{1}\\mRemoteNG.exe", debugOrRelease, normalOrPortable);
|
||||
return path;
|
||||
var path = Path.GetDirectoryName(sourceFilePath);
|
||||
string FilePath = $"{path}\\..\\mRemoteV1\\bin\\{debugOrRelease}{normalOrPortable}\\mRemoteNG.exe";
|
||||
return FilePath;
|
||||
}
|
||||
|
||||
static bool IsLargeAware(string file)
|
||||
|
||||
58
mRemoteNGTests/Security/AeadCryptographyProviderTests.cs
Normal file
58
mRemoteNGTests/Security/AeadCryptographyProviderTests.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System.Security;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using NUnit.Framework;
|
||||
|
||||
|
||||
namespace mRemoteNGTests.Security
|
||||
{
|
||||
public class AeadCryptographyProviderTests
|
||||
{
|
||||
private ICryptographyProvider _cryptographyProvider;
|
||||
private SecureString _encryptionKey;
|
||||
private string _plainText;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_cryptographyProvider = new AeadCryptographyProvider();
|
||||
_encryptionKey = "mypassword111111".ConvertToSecureString();
|
||||
_plainText = "MySecret!";
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
_cryptographyProvider = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetBlockSizeReturnsProperValueForAes()
|
||||
{
|
||||
Assert.That(_cryptographyProvider.BlockSizeInBytes, Is.EqualTo(16));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EncryptionOutputsBase64String()
|
||||
{
|
||||
var cipherText = _cryptographyProvider.Encrypt(_plainText, _encryptionKey);
|
||||
Assert.That(cipherText.IsBase64String, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DecryptedTextIsEqualToOriginalPlainText()
|
||||
{
|
||||
var cipherText = _cryptographyProvider.Encrypt(_plainText, _encryptionKey);
|
||||
var decryptedCipherText = _cryptographyProvider.Decrypt(cipherText, _encryptionKey);
|
||||
Assert.That(decryptedCipherText, Is.EqualTo(_plainText));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EncryptingTheSameValueReturnsNewCipherTextEachTime()
|
||||
{
|
||||
var cipherText1 = _cryptographyProvider.Encrypt(_plainText, _encryptionKey);
|
||||
var cipherText2 = _cryptographyProvider.Encrypt(_plainText, _encryptionKey);
|
||||
Assert.That(cipherText1, Is.Not.EqualTo(cipherText2));
|
||||
}
|
||||
}
|
||||
}
|
||||
112
mRemoteNGTests/Security/CryptographyProviderFactoryTests.cs
Normal file
112
mRemoteNGTests/Security/CryptographyProviderFactoryTests.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using mRemoteNG.Security;
|
||||
using NUnit.Framework;
|
||||
|
||||
|
||||
namespace mRemoteNGTests.Security
|
||||
{
|
||||
[TestFixture]
|
||||
public class CryptographyProviderFactoryTests
|
||||
{
|
||||
private CryptographyProviderFactory _cryptographyProviderFactory;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
_cryptographyProviderFactory = new CryptographyProviderFactory();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
_cryptographyProviderFactory = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateAesGcm()
|
||||
{
|
||||
var engine = BlockCipherEngines.AES;
|
||||
var mode = BlockCipherModes.GCM;
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateAesCcm()
|
||||
{
|
||||
var engine = BlockCipherEngines.AES;
|
||||
var mode = BlockCipherModes.CCM;
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateAesEax()
|
||||
{
|
||||
var engine = BlockCipherEngines.AES;
|
||||
var mode = BlockCipherModes.EAX;
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateSerpentGcm()
|
||||
{
|
||||
var engine = BlockCipherEngines.Serpent;
|
||||
var mode = BlockCipherModes.GCM;
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateSerpentCcm()
|
||||
{
|
||||
var engine = BlockCipherEngines.Serpent;
|
||||
var mode = BlockCipherModes.CCM;
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateSerpentEax()
|
||||
{
|
||||
var engine = BlockCipherEngines.Serpent;
|
||||
var mode = BlockCipherModes.EAX;
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateTwofishCcm()
|
||||
{
|
||||
var engine = BlockCipherEngines.Twofish;
|
||||
var mode = BlockCipherModes.CCM;
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateTwofishEax()
|
||||
{
|
||||
var engine = BlockCipherEngines.Twofish;
|
||||
var mode = BlockCipherModes.EAX;
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateTwofishGcm()
|
||||
{
|
||||
var engine = BlockCipherEngines.Twofish;
|
||||
var mode = BlockCipherModes.GCM;
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateLegacyRijndael()
|
||||
{
|
||||
var cryptoProvider = _cryptographyProviderFactory.CreateLegacyRijndaelCryptographyProvider();
|
||||
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo("Rijndael"));
|
||||
}
|
||||
}
|
||||
}
|
||||
45
mRemoteNGTests/Security/EncryptedSecureStringTests.cs
Normal file
45
mRemoteNGTests/Security/EncryptedSecureStringTests.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using mRemoteNG.Security;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace mRemoteNGTests.Security
|
||||
{
|
||||
[TestFixture()]
|
||||
public class EncryptedSecureStringTests
|
||||
{
|
||||
private readonly string _clearTextData = "MySecureData";
|
||||
|
||||
[Test]
|
||||
public void CanCreateEncryptedSecureString()
|
||||
{
|
||||
Assert.That(new EncryptedSecureString(), Is.InstanceOf<EncryptedSecureString>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanAssignStringValue()
|
||||
{
|
||||
var encryptedSecString = new EncryptedSecureString();
|
||||
TestDelegate testDelegate = () => encryptedSecString.SetValue(_clearTextData);
|
||||
Assert.DoesNotThrow(testDelegate);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EncryptedValueIsSameAsOriginalValue()
|
||||
{
|
||||
var encryptedSecString = new EncryptedSecureString();
|
||||
encryptedSecString.SetValue(_clearTextData);
|
||||
var decryptedData = encryptedSecString.GetClearTextValue();
|
||||
Assert.That(decryptedData, Is.EqualTo(_clearTextData));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CreatingMultipleEncryptedSecureStrings()
|
||||
{
|
||||
var encString1 = new EncryptedSecureString();
|
||||
encString1.SetValue(_clearTextData);
|
||||
var encString2 = new EncryptedSecureString();
|
||||
encString2.SetValue("somevalue");
|
||||
var decryptedString = encString1.GetClearTextValue();
|
||||
Assert.That(decryptedString, Is.EqualTo(_clearTextData));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System.Security;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using NUnit.Framework;
|
||||
|
||||
|
||||
namespace mRemoteNGTests.Security
|
||||
{
|
||||
[TestFixture()]
|
||||
public class LegacyRijndaelCryptographyProviderTests
|
||||
{
|
||||
private ICryptographyProvider _rijndaelCryptographyProvider;
|
||||
private SecureString _encryptionKey;
|
||||
private string _plainText;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
_rijndaelCryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
_encryptionKey = "mR3m".ConvertToSecureString();
|
||||
_plainText = "MySecret!";
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Teardown()
|
||||
{
|
||||
_rijndaelCryptographyProvider = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetBlockSizeReturnsProperValueForRijndael()
|
||||
{
|
||||
Assert.That(_rijndaelCryptographyProvider.BlockSizeInBytes, Is.EqualTo(16));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EncryptionOutputsBase64String()
|
||||
{
|
||||
var cipherText = _rijndaelCryptographyProvider.Encrypt(_plainText, _encryptionKey);
|
||||
Assert.That(cipherText.IsBase64String, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DecryptedTextIsEqualToOriginalPlainText()
|
||||
{
|
||||
var cipherText = _rijndaelCryptographyProvider.Encrypt(_plainText, _encryptionKey);
|
||||
var decryptedCipherText = _rijndaelCryptographyProvider.Decrypt(cipherText, _encryptionKey);
|
||||
Assert.That(decryptedCipherText, Is.EqualTo(_plainText));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EncryptingTheSameValueReturnsNewCipherTextEachTime()
|
||||
{
|
||||
var cipherText1 = _rijndaelCryptographyProvider.Encrypt(_plainText, _encryptionKey);
|
||||
var cipherText2 = _rijndaelCryptographyProvider.Encrypt(_plainText, _encryptionKey);
|
||||
Assert.That(cipherText1, Is.Not.EqualTo(cipherText2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,10 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
|
||||
<HintPath>..\packages\BouncyCastle.1.8.1\lib\BouncyCastle.Crypto.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\mRemoteV1\References\log4net.dll</HintPath>
|
||||
@@ -62,8 +66,8 @@
|
||||
<HintPath>..\packages\NSubstitute.1.10.0.0\lib\net45\NSubstitute.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="NUnitForms">
|
||||
@@ -74,9 +78,13 @@
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=2.5.0.15095, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\mRemoteV1\References\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
|
||||
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=2.9.0.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DockPanelSuite.2.10.0\lib\net40\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="WeifenLuo.WinFormsUI.Docking.ThemeVS2012Light, Version=2.9.0.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DockPanelSuite.ThemeVS2012Light.2.10.0\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2012Light.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
@@ -100,6 +108,10 @@
|
||||
<Compile Include="Config\Connections\SqlUpdateQueryBuilderTest.cs" />
|
||||
<Compile Include="Config\Connections\SqlUpdateTimerTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Security\AeadCryptographyProviderTests.cs" />
|
||||
<Compile Include="Security\CryptographyProviderFactoryTests.cs" />
|
||||
<Compile Include="Security\EncryptedSecureStringTests.cs" />
|
||||
<Compile Include="Security\LegacyRijndaelCryptographyProviderTests.cs" />
|
||||
<Compile Include="UI\Controls\CustomListViewTests.cs" />
|
||||
<Compile Include="UI\Controls\TestForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="BouncyCastle" version="1.8.1" targetFramework="net45" />
|
||||
<package id="DockPanelSuite" version="2.10.0" targetFramework="net45" />
|
||||
<package id="DockPanelSuite.ThemeVS2012Light" version="2.10.0" targetFramework="net45" />
|
||||
<package id="NSubstitute" version="1.10.0.0" targetFramework="net45" />
|
||||
<package id="NUnit" version="3.2.0" targetFramework="net45" />
|
||||
<package id="NUnit" version="3.4.1" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -2,8 +2,10 @@ using System.Collections.Generic;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Security;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.Security;
|
||||
using static System.Environment;
|
||||
|
||||
|
||||
@@ -19,7 +21,7 @@ namespace mRemoteNG.App.Info
|
||||
public static readonly string ProdName = Application.ProductName;
|
||||
public static readonly string copyright = ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute), false)).Copyright;
|
||||
public static readonly string HomePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
public static readonly string EncryptionKey = "mR3m";
|
||||
public static readonly SecureString EncryptionKey = "mR3m".ConvertToSecureString();
|
||||
public static string ReportingFilePath = "";
|
||||
public static readonly string PuttyPath = HomePath + "\\PuTTYNG.exe";
|
||||
public static string UserAgent
|
||||
|
||||
@@ -17,6 +17,8 @@ using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.UI.Forms.Input;
|
||||
using mRemoteNG.UI.TaskDialog;
|
||||
@@ -411,12 +413,12 @@ namespace mRemoteNG.App
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoadConnectionsBG(bool WithDialog = false, bool Update = false)
|
||||
public static void LoadConnectionsBG(bool withDialog = false, bool update = false)
|
||||
{
|
||||
_withDialog = false;
|
||||
_loadUpdate = true;
|
||||
|
||||
Thread t = new Thread(LoadConnectionsBGd);
|
||||
var t = new Thread(LoadConnectionsBGd);
|
||||
t.SetApartmentState(ApartmentState.STA);
|
||||
t.Start();
|
||||
}
|
||||
@@ -430,12 +432,11 @@ namespace mRemoteNG.App
|
||||
|
||||
public static void LoadConnections(bool withDialog = false, bool update = false)
|
||||
{
|
||||
ConnectionsLoader connectionsLoader = new ConnectionsLoader();
|
||||
var connectionsLoader = new ConnectionsLoader();
|
||||
try
|
||||
{
|
||||
// disable sql update checking while we are loading updates
|
||||
if (SQLConnProvider != null)
|
||||
SQLConnProvider.Disable();
|
||||
SQLConnProvider?.Disable();
|
||||
|
||||
if (ConnectionList != null && ContainerList != null)
|
||||
{
|
||||
@@ -450,15 +451,9 @@ namespace mRemoteNG.App
|
||||
{
|
||||
if (withDialog)
|
||||
{
|
||||
OpenFileDialog loadDialog = Tools.Controls.ConnectionsLoadDialog();
|
||||
if (loadDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
connectionsLoader.ConnectionFileName = loadDialog.FileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
var loadDialog = Tools.Controls.ConnectionsLoadDialog();
|
||||
if (loadDialog.ShowDialog() != DialogResult.OK) return;
|
||||
connectionsLoader.ConnectionFileName = loadDialog.FileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -485,12 +480,13 @@ namespace mRemoteNG.App
|
||||
ConnectionTree.ResetTree();
|
||||
|
||||
connectionsLoader.RootTreeNode = Windows.treeForm.tvConnections.Nodes[0];
|
||||
connectionsLoader.UseSQL = Settings.Default.UseSQLServer;
|
||||
connectionsLoader.SQLHost = Settings.Default.SQLHost;
|
||||
connectionsLoader.SQLDatabaseName = Settings.Default.SQLDatabaseName;
|
||||
connectionsLoader.SQLUsername = Settings.Default.SQLUser;
|
||||
connectionsLoader.SQLPassword = Security.Crypt.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
|
||||
connectionsLoader.SQLUpdate = update;
|
||||
connectionsLoader.UseDatabase = Settings.Default.UseSQLServer;
|
||||
connectionsLoader.DatabaseHost = Settings.Default.SQLHost;
|
||||
connectionsLoader.DatabaseName = Settings.Default.SQLDatabaseName;
|
||||
connectionsLoader.DatabaseUsername = Settings.Default.SQLUser;
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
connectionsLoader.DatabasePassword = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
|
||||
connectionsLoader.DatabaseUpdate = update;
|
||||
connectionsLoader.LoadConnections(false);
|
||||
|
||||
if (Settings.Default.UseSQLServer)
|
||||
@@ -511,17 +507,14 @@ namespace mRemoteNG.App
|
||||
}
|
||||
|
||||
// re-enable sql update checking after updates are loaded
|
||||
if (Settings.Default.UseSQLServer && SQLConnProvider != null)
|
||||
{
|
||||
SQLConnProvider.Enable();
|
||||
}
|
||||
SQLConnProvider?.Enable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (Settings.Default.UseSQLServer)
|
||||
{
|
||||
MessageCollector.AddExceptionMessage(Language.strLoadFromSqlFailed, ex);
|
||||
string commandButtons = string.Join("|", new[] { Language.strCommandTryAgain, Language.strCommandOpenConnectionFile, string.Format(Language.strCommandExitProgram, Application.ProductName) });
|
||||
var commandButtons = string.Join("|", Language.strCommandTryAgain, Language.strCommandOpenConnectionFile, string.Format(Language.strCommandExitProgram, Application.ProductName));
|
||||
CTaskDialog.ShowCommandBox(Application.ProductName, Language.strLoadFromSqlFailed, Language.strLoadFromSqlFailedContent, MiscTools.GetExceptionMessageRecursive(ex), "", "", commandButtons, false, ESysIcons.Error, ESysIcons.Error);
|
||||
switch (CTaskDialog.CommandButtonResult)
|
||||
{
|
||||
@@ -537,29 +530,24 @@ namespace mRemoteNG.App
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (ex is FileNotFoundException && !withDialog)
|
||||
{
|
||||
MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoadedNew, connectionsLoader.ConnectionFileName), ex, MessageClass.InformationMsg);
|
||||
NewConnections(Convert.ToString(connectionsLoader.ConnectionFileName));
|
||||
return;
|
||||
}
|
||||
|
||||
MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoaded, connectionsLoader.ConnectionFileName), ex);
|
||||
if (connectionsLoader.ConnectionFileName != GetStartupConnectionFileName())
|
||||
{
|
||||
LoadConnections(withDialog, update);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ex is FileNotFoundException && !withDialog)
|
||||
{
|
||||
MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoadedNew, connectionsLoader.ConnectionFileName), ex, MessageClass.InformationMsg);
|
||||
NewConnections(Convert.ToString(connectionsLoader.ConnectionFileName));
|
||||
return;
|
||||
}
|
||||
|
||||
MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoaded, connectionsLoader.ConnectionFileName), ex);
|
||||
if (connectionsLoader.ConnectionFileName != GetStartupConnectionFileName())
|
||||
{
|
||||
LoadConnections(withDialog, update);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(frmMain.Default,
|
||||
string.Format(Language.strErrorStartupConnectionFileLoad, Environment.NewLine, Application.ProductName, GetStartupConnectionFileName(), MiscTools.GetExceptionMessageRecursive(ex)),
|
||||
"Could not load startup file.", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
return;
|
||||
}
|
||||
MessageBox.Show(frmMain.Default,
|
||||
string.Format(Language.strErrorStartupConnectionFileLoad, Environment.NewLine, Application.ProductName, GetStartupConnectionFileName(), MiscTools.GetExceptionMessageRecursive(ex)),
|
||||
"Could not load startup file.", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -692,7 +680,8 @@ namespace mRemoteNG.App
|
||||
conS.SQLHost = Convert.ToString(Settings.Default.SQLHost);
|
||||
conS.SQLDatabaseName = Convert.ToString(Settings.Default.SQLDatabaseName);
|
||||
conS.SQLUsername = Convert.ToString(Settings.Default.SQLUser);
|
||||
conS.SQLPassword = Security.Crypt.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
conS.SQLPassword = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
|
||||
}
|
||||
|
||||
conS.SaveConnections();
|
||||
|
||||
@@ -6,6 +6,8 @@ using System.Threading;
|
||||
using mRemoteNG.Tools;
|
||||
using System.Reflection;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
|
||||
|
||||
namespace mRemoteNG.App.Update
|
||||
@@ -107,7 +109,15 @@ namespace mRemoteNG.App.Update
|
||||
|
||||
public void SetProxySettings()
|
||||
{
|
||||
SetProxySettings(Convert.ToBoolean(Settings.Default.UpdateUseProxy), Convert.ToString(Settings.Default.UpdateProxyAddress), Convert.ToInt32(Settings.Default.UpdateProxyPort), Convert.ToBoolean(Settings.Default.UpdateProxyUseAuthentication), Convert.ToString(Settings.Default.UpdateProxyAuthUser), Security.Crypt.Decrypt(Convert.ToString(Settings.Default.UpdateProxyAuthPass), GeneralAppInfo.EncryptionKey));
|
||||
var shouldWeUseProxy = Settings.Default.UpdateUseProxy;
|
||||
var proxyAddress = Settings.Default.UpdateProxyAddress;
|
||||
var port = Settings.Default.UpdateProxyPort;
|
||||
var useAuthentication = Settings.Default.UpdateProxyUseAuthentication;
|
||||
var username = Settings.Default.UpdateProxyAuthUser;
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
var password = cryptographyProvider.Decrypt(Settings.Default.UpdateProxyAuthPass, GeneralAppInfo.EncryptionKey);
|
||||
|
||||
SetProxySettings(shouldWeUseProxy, proxyAddress, port, useAuthentication, username, password);
|
||||
}
|
||||
|
||||
public void SetProxySettings(bool useProxy, string address, int port, bool useAuthentication, string username, string password)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@ using System.Data.SqlClient;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
@@ -14,6 +15,7 @@ using mRemoteNG.Connection.Protocol.RDP;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tree;
|
||||
using mRemoteNG.Tree.Root;
|
||||
@@ -37,7 +39,7 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
#region Private Properties
|
||||
private XmlTextWriter _xmlTextWriter;
|
||||
private string _password = "mR3m";
|
||||
private SecureString _password = GeneralAppInfo.EncryptionKey;
|
||||
|
||||
private SqlConnection _sqlConnection;
|
||||
private SqlCommand _sqlQuery;
|
||||
@@ -99,8 +101,7 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
bool isVerified = false;
|
||||
SqlDataReader sqlDataReader = null;
|
||||
Version databaseVersion = null;
|
||||
try
|
||||
try
|
||||
{
|
||||
SqlCommand sqlCommand = new SqlCommand("SELECT * FROM tblRoot", sqlConnection);
|
||||
sqlDataReader = sqlCommand.ExecuteReader();
|
||||
@@ -110,7 +111,7 @@ namespace mRemoteNG.Config.Connections
|
||||
}
|
||||
sqlDataReader.Read();
|
||||
|
||||
databaseVersion = new Version(Convert.ToString(sqlDataReader["confVersion"], CultureInfo.InvariantCulture));
|
||||
var databaseVersion = new Version(Convert.ToString(sqlDataReader["confVersion"], CultureInfo.InvariantCulture));
|
||||
|
||||
sqlDataReader.Close();
|
||||
|
||||
@@ -175,8 +176,9 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
_sqlConnection = new SqlConnection("Data Source=" + SQLHost + ";Initial Catalog=" + SQLDatabaseName + ";Integrated Security=True");
|
||||
}
|
||||
|
||||
_sqlConnection.Open();
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
|
||||
_sqlConnection.Open();
|
||||
|
||||
if (!VerifyDatabaseVersion(_sqlConnection))
|
||||
{
|
||||
@@ -191,17 +193,17 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
if (((RootNodeInfo) tN.Tag).Password)
|
||||
{
|
||||
_password = Convert.ToString(((RootNodeInfo) tN.Tag).PasswordString);
|
||||
strProtected = Crypt.Encrypt("ThisIsProtected", _password);
|
||||
_password = Convert.ToString(((RootNodeInfo) tN.Tag).PasswordString).ConvertToSecureString();
|
||||
strProtected = cryptographyProvider.Encrypt("ThisIsProtected", _password);
|
||||
}
|
||||
else
|
||||
{
|
||||
strProtected = Crypt.Encrypt("ThisIsNotProtected", _password);
|
||||
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", _password);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strProtected = Crypt.Encrypt("ThisIsNotProtected", _password);
|
||||
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", _password);
|
||||
}
|
||||
|
||||
_sqlQuery = new SqlCommand("DELETE FROM tblRoot", _sqlConnection);
|
||||
@@ -231,7 +233,7 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
_currentNodeIndex++;
|
||||
|
||||
ConnectionInfo curConI = default(ConnectionInfo);
|
||||
ConnectionInfo curConI;
|
||||
_sqlQuery = new SqlCommand("INSERT INTO tblCons (Name, Type, Expanded, Description, Icon, Panel, Username, " + "DomainName, Password, Hostname, Protocol, PuttySession, " + "Port, ConnectToConsole, RenderingEngine, ICAEncryptionStrength, RDPAuthenticationLevel, LoadBalanceInfo, Colors, Resolution, AutomaticResize, DisplayWallpaper, " + "DisplayThemes, EnableFontSmoothing, EnableDesktopComposition, CacheBitmaps, RedirectDiskDrives, RedirectPorts, " + "RedirectPrinters, RedirectSmartCards, RedirectSound, RedirectKeys, " + "Connected, PreExtApp, PostExtApp, MacAddress, UserField, ExtApp, VNCCompression, VNCEncoding, VNCAuthMode, " + "VNCProxyType, VNCProxyIP, VNCProxyPort, VNCProxyUsername, VNCProxyPassword, " + "VNCColors, VNCSmartSizeMode, VNCViewOnly, " + "RDGatewayUsageMethod, RDGatewayHostname, RDGatewayUseConnectionCredentials, RDGatewayUsername, RDGatewayPassword, RDGatewayDomain, " + "UseCredSsp, " + "InheritCacheBitmaps, InheritColors, " + "InheritDescription, InheritDisplayThemes, InheritDisplayWallpaper, InheritEnableFontSmoothing, InheritEnableDesktopComposition, InheritDomain, " + "InheritIcon, InheritPanel, InheritPassword, InheritPort, " + "InheritProtocol, InheritPuttySession, InheritRedirectDiskDrives, " + "InheritRedirectKeys, InheritRedirectPorts, InheritRedirectPrinters, " + "InheritRedirectSmartCards, InheritRedirectSound, InheritResolution, InheritAutomaticResize, " + "InheritUseConsoleSession, InheritRenderingEngine, InheritUsername, InheritICAEncryptionStrength, InheritRDPAuthenticationLevel, InheritLoadBalanceInfo, " + "InheritPreExtApp, InheritPostExtApp, InheritMacAddress, InheritUserField, InheritExtApp, InheritVNCCompression, InheritVNCEncoding, " + "InheritVNCAuthMode, InheritVNCProxyType, InheritVNCProxyIP, InheritVNCProxyPort, " + "InheritVNCProxyUsername, InheritVNCProxyPassword, InheritVNCColors, " + "InheritVNCSmartSizeMode, InheritVNCViewOnly, " + "InheritRDGatewayUsageMethod, InheritRDGatewayHostname, InheritRDGatewayUseConnectionCredentials, InheritRDGatewayUsername, InheritRDGatewayPassword, InheritRDGatewayDomain, "
|
||||
+ "InheritUseCredSsp, " + "PositionID, ParentID, ConstantID, LastChange)" + "VALUES (", _sqlConnection
|
||||
);
|
||||
@@ -272,7 +274,8 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
private void SaveConnectionFieldsSQL(ConnectionInfo curConI)
|
||||
{
|
||||
ConnectionInfo with_1 = curConI;
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
ConnectionInfo with_1 = curConI;
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.Description) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.Icon) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.Panel) + "\',";
|
||||
@@ -297,7 +300,7 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
if (SaveSecurity.Password)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(Crypt.Encrypt(with_1.Password, _password)) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(cryptographyProvider.Encrypt(with_1.Password, _password)) + "\',";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -350,7 +353,7 @@ namespace mRemoteNG.Config.Connections
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCProxyIP + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.VNCProxyPort) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCProxyUsername + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Crypt.Encrypt(with_1.VNCProxyPassword, _password) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + cryptographyProvider.Encrypt(with_1.VNCProxyPassword, _password) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCColors + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCSmartSizeMode + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.VNCViewOnly) + "\',";
|
||||
@@ -370,7 +373,7 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
if (SaveSecurity.Password)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + Crypt.Encrypt(with_1.RDGatewayPassword, _password) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + cryptographyProvider.Encrypt(with_1.RDGatewayPassword, _password) + "\',";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -536,15 +539,16 @@ namespace mRemoteNG.Config.Connections
|
||||
private void EncryptCompleteFile()
|
||||
{
|
||||
StreamReader streamReader = new StreamReader(ConnectionFileName);
|
||||
|
||||
string fileContents;
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
|
||||
string fileContents;
|
||||
fileContents = streamReader.ReadToEnd();
|
||||
streamReader.Close();
|
||||
|
||||
if (!string.IsNullOrEmpty(fileContents))
|
||||
{
|
||||
StreamWriter streamWriter = new StreamWriter(ConnectionFileName);
|
||||
streamWriter.Write(Crypt.Encrypt(fileContents, _password));
|
||||
streamWriter.Write(cryptographyProvider.Encrypt(fileContents, _password));
|
||||
streamWriter.Close();
|
||||
}
|
||||
}
|
||||
@@ -557,8 +561,8 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TreeNode treeNode = default(TreeNode);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
TreeNode treeNode;
|
||||
|
||||
if (ConnectionTreeNode.GetNodeType(RootTreeNode) == TreeNodeType.Root)
|
||||
{
|
||||
@@ -584,25 +588,24 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
if (Export)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", Crypt.Encrypt("ThisIsNotProtected", _password));
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", cryptographyProvider.Encrypt("ThisIsNotProtected", _password));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((RootNodeInfo) treeNode.Tag).Password)
|
||||
{
|
||||
_password = Convert.ToString(((RootNodeInfo) treeNode.Tag).PasswordString);
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", Crypt.Encrypt("ThisIsProtected", _password));
|
||||
_password = Convert.ToString(((RootNodeInfo) treeNode.Tag).PasswordString).ConvertToSecureString();
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", cryptographyProvider.Encrypt("ThisIsProtected", _password));
|
||||
}
|
||||
else
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", Crypt.Encrypt("ThisIsNotProtected", _password));
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", cryptographyProvider.Encrypt("ThisIsNotProtected", _password));
|
||||
}
|
||||
}
|
||||
|
||||
_xmlTextWriter.WriteAttributeString("ConfVersion", "", ConnectionsFileInfo.ConnectionFileVersion.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
TreeNodeCollection treeNodeCollection = default(TreeNodeCollection);
|
||||
treeNodeCollection = treeNode.Nodes;
|
||||
|
||||
var treeNodeCollection = treeNode.Nodes;
|
||||
|
||||
SaveNode(treeNodeCollection);
|
||||
|
||||
@@ -626,8 +629,9 @@ namespace mRemoteNG.Config.Connections
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SaveToXml failed" + Environment.NewLine + ex.Message, false);
|
||||
}
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SaveToXml failed" + Environment.NewLine + ex.Message);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SaveToXml failed" + Environment.NewLine + ex.StackTrace, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveNode(TreeNodeCollection tNC)
|
||||
@@ -636,7 +640,7 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
foreach (TreeNode node in tNC)
|
||||
{
|
||||
ConnectionInfo curConI = default(ConnectionInfo);
|
||||
ConnectionInfo curConI;
|
||||
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection | ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container)
|
||||
{
|
||||
@@ -672,7 +676,8 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
try
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Descr", "", curConI.Description);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
_xmlTextWriter.WriteAttributeString("Descr", "", curConI.Description);
|
||||
|
||||
_xmlTextWriter.WriteAttributeString("Icon", "", curConI.Icon);
|
||||
|
||||
@@ -698,7 +703,7 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
if (SaveSecurity.Password)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Password", "", Crypt.Encrypt(curConI.Password, _password));
|
||||
_xmlTextWriter.WriteAttributeString("Password", "", cryptographyProvider.Encrypt(curConI.Password, _password));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -775,7 +780,7 @@ namespace mRemoteNG.Config.Connections
|
||||
_xmlTextWriter.WriteAttributeString("VNCProxyIP", "", curConI.VNCProxyIP);
|
||||
_xmlTextWriter.WriteAttributeString("VNCProxyPort", "", Convert.ToString(curConI.VNCProxyPort));
|
||||
_xmlTextWriter.WriteAttributeString("VNCProxyUsername", "", curConI.VNCProxyUsername);
|
||||
_xmlTextWriter.WriteAttributeString("VNCProxyPassword", "", Crypt.Encrypt(curConI.VNCProxyPassword, _password));
|
||||
_xmlTextWriter.WriteAttributeString("VNCProxyPassword", "", cryptographyProvider.Encrypt(curConI.VNCProxyPassword, _password));
|
||||
_xmlTextWriter.WriteAttributeString("VNCColors", "", curConI.VNCColors.ToString());
|
||||
_xmlTextWriter.WriteAttributeString("VNCSmartSizeMode", "", curConI.VNCSmartSizeMode.ToString());
|
||||
_xmlTextWriter.WriteAttributeString("VNCViewOnly", "", Convert.ToString(curConI.VNCViewOnly));
|
||||
@@ -796,7 +801,7 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
if (SaveSecurity.Password)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayPassword", "", Crypt.Encrypt(curConI.RDGatewayPassword, _password));
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayPassword", "", cryptographyProvider.Encrypt(curConI.RDGatewayPassword, _password));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -936,12 +941,10 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TreeNode tN = default(TreeNode);
|
||||
tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
TreeNodeCollection tNC = default(TreeNodeCollection);
|
||||
tNC = tN.Nodes;
|
||||
|
||||
var tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
var tNC = tN.Nodes;
|
||||
|
||||
csvWr = new StreamWriter(ConnectionFileName);
|
||||
|
||||
@@ -1000,9 +1003,9 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
string nodePath = con.TreeNode.FullPath;
|
||||
|
||||
int firstSlash = nodePath.IndexOf("\\");
|
||||
int firstSlash = nodePath.IndexOf("\\", StringComparison.Ordinal);
|
||||
nodePath = nodePath.Remove(0, firstSlash + 1);
|
||||
int lastSlash = nodePath.LastIndexOf("\\");
|
||||
int lastSlash = nodePath.LastIndexOf("\\", StringComparison.Ordinal);
|
||||
|
||||
if (lastSlash > 0)
|
||||
{
|
||||
@@ -1051,12 +1054,10 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TreeNode tN = default(TreeNode);
|
||||
tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
TreeNodeCollection tNC = default(TreeNodeCollection);
|
||||
tNC = tN.Nodes;
|
||||
|
||||
var tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
var tNC = tN.Nodes;
|
||||
|
||||
csvWr = new StreamWriter(ConnectionFileName);
|
||||
|
||||
@@ -1089,9 +1090,9 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
string nodePath = con.TreeNode.FullPath;
|
||||
|
||||
int firstSlash = nodePath.IndexOf("\\");
|
||||
int firstSlash = nodePath.IndexOf("\\", StringComparison.Ordinal);
|
||||
nodePath = nodePath.Remove(0, firstSlash + 1);
|
||||
int lastSlash = nodePath.LastIndexOf("\\");
|
||||
int lastSlash = nodePath.LastIndexOf("\\", StringComparison.Ordinal);
|
||||
|
||||
if (lastSlash > 0)
|
||||
{
|
||||
@@ -1113,12 +1114,10 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TreeNode tN = default(TreeNode);
|
||||
tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
TreeNodeCollection tNC = default(TreeNodeCollection);
|
||||
tNC = tN.Nodes;
|
||||
|
||||
var tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
var tNC = tN.Nodes;
|
||||
|
||||
_xmlTextWriter = new XmlTextWriter(ConnectionFileName, Encoding.UTF8);
|
||||
_xmlTextWriter.Formatting = Formatting.Indented;
|
||||
|
||||
510
mRemoteV1/Config/Connections/SqlConnectionsLoader.cs
Normal file
510
mRemoteV1/Config/Connections/SqlConnectionsLoader.cs
Normal file
@@ -0,0 +1,510 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Globalization;
|
||||
using System.Security;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Connection.Protocol;
|
||||
using mRemoteNG.Connection.Protocol.Http;
|
||||
using mRemoteNG.Connection.Protocol.ICA;
|
||||
using mRemoteNG.Connection.Protocol.RDP;
|
||||
using mRemoteNG.Connection.Protocol.VNC;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.Tree;
|
||||
using mRemoteNG.Tree.Root;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.UI.TaskDialog;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class SqlConnectionsLoader
|
||||
{
|
||||
private SqlConnection _sqlConnection;
|
||||
private SqlCommand _sqlQuery;
|
||||
private SqlDataReader _sqlDataReader;
|
||||
private TreeNode _selectedTreeNode;
|
||||
private double _confVersion;
|
||||
private SecureString _pW = GeneralAppInfo.EncryptionKey;
|
||||
|
||||
|
||||
public string DatabaseHost { get; set; }
|
||||
public string DatabaseName { get; set; }
|
||||
public string DatabaseUsername { get; set; }
|
||||
public string DatabasePassword { get; set; }
|
||||
public bool DatabaseUpdate { get; set; }
|
||||
public string PreviousSelected { get; set; }
|
||||
public TreeNode RootTreeNode { get; set; }
|
||||
public ConnectionList ConnectionList { get; set; }
|
||||
public ContainerList ContainerList { get; set; }
|
||||
public ConnectionList PreviousConnectionList { get; set; }
|
||||
public ContainerList PreviousContainerList { get; set; }
|
||||
|
||||
|
||||
private delegate void LoadFromSqlDelegate();
|
||||
public void LoadFromSql()
|
||||
{
|
||||
if (Windows.treeForm == null || Windows.treeForm.tvConnections == null)
|
||||
return;
|
||||
if (Windows.treeForm.tvConnections.InvokeRequired)
|
||||
{
|
||||
Windows.treeForm.tvConnections.Invoke(new LoadFromSqlDelegate(LoadFromSql));
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Runtime.IsConnectionsFileLoaded = false;
|
||||
_sqlConnection = !string.IsNullOrEmpty(DatabaseUsername) ? new SqlConnection("Data Source=" + DatabaseHost + ";Initial Catalog=" + DatabaseName + ";User Id=" + DatabaseUsername + ";Password=" + DatabasePassword) : new SqlConnection("Data Source=" + DatabaseHost + ";Initial Catalog=" + DatabaseName + ";Integrated Security=True");
|
||||
|
||||
_sqlConnection.Open();
|
||||
_sqlQuery = new SqlCommand("SELECT * FROM tblRoot", _sqlConnection);
|
||||
_sqlDataReader = _sqlQuery.ExecuteReader(CommandBehavior.CloseConnection);
|
||||
_sqlDataReader.Read();
|
||||
|
||||
if (_sqlDataReader.HasRows == false)
|
||||
{
|
||||
Runtime.SaveConnections();
|
||||
_sqlQuery = new SqlCommand("SELECT * FROM tblRoot", _sqlConnection);
|
||||
_sqlDataReader = _sqlQuery.ExecuteReader(CommandBehavior.CloseConnection);
|
||||
_sqlDataReader.Read();
|
||||
}
|
||||
|
||||
_confVersion = Convert.ToDouble(_sqlDataReader["confVersion"], CultureInfo.InvariantCulture);
|
||||
const double maxSupportedSchemaVersion = 2.5;
|
||||
if (_confVersion > maxSupportedSchemaVersion)
|
||||
{
|
||||
CTaskDialog.ShowTaskDialogBox(
|
||||
frmMain.Default,
|
||||
Application.ProductName,
|
||||
"Incompatible database schema",
|
||||
$"The database schema on the server is not supported. Please upgrade to a newer version of {Application.ProductName}.",
|
||||
string.Format("Schema Version: {1}{0}Highest Supported Version: {2}", Environment.NewLine, _confVersion, maxSupportedSchemaVersion),
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
ETaskDialogButtons.Ok,
|
||||
ESysIcons.Error,
|
||||
ESysIcons.Error
|
||||
);
|
||||
throw (new Exception($"Incompatible database schema (schema version {_confVersion})."));
|
||||
}
|
||||
|
||||
RootTreeNode.Name = Convert.ToString(_sqlDataReader["Name"]);
|
||||
|
||||
var rootInfo = new RootNodeInfo(RootNodeType.Connection)
|
||||
{
|
||||
Name = RootTreeNode.Name,
|
||||
TreeNode = RootTreeNode
|
||||
};
|
||||
|
||||
RootTreeNode.Tag = rootInfo;
|
||||
RootTreeNode.ImageIndex = (int)TreeImageType.Root;
|
||||
RootTreeNode.SelectedImageIndex = (int)TreeImageType.Root;
|
||||
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
if (cryptographyProvider.Decrypt(Convert.ToString(_sqlDataReader["Protected"]), _pW) != "ThisIsNotProtected")
|
||||
{
|
||||
if (Authenticate(Convert.ToString(_sqlDataReader["Protected"]), false, rootInfo) == false)
|
||||
{
|
||||
mRemoteNG.Settings.Default.LoadConsFromCustomLocation = false;
|
||||
mRemoteNG.Settings.Default.CustomConsPath = "";
|
||||
RootTreeNode.Remove();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_sqlDataReader.Close();
|
||||
Windows.treeForm.tvConnections.BeginUpdate();
|
||||
|
||||
// SECTION 3. Populate the TreeView with the DOM nodes.
|
||||
AddNodesFromSql(RootTreeNode);
|
||||
RootTreeNode.Expand();
|
||||
|
||||
//expand containers
|
||||
foreach (ContainerInfo contI in ContainerList)
|
||||
{
|
||||
if (contI.IsExpanded)
|
||||
contI.TreeNode.Expand();
|
||||
}
|
||||
|
||||
Windows.treeForm.tvConnections.EndUpdate();
|
||||
|
||||
//open connections from last mremote session
|
||||
if (mRemoteNG.Settings.Default.OpenConsFromLastSession && !mRemoteNG.Settings.Default.NoReconnect)
|
||||
{
|
||||
foreach (ConnectionInfo conI in ConnectionList)
|
||||
{
|
||||
if (conI.PleaseConnect)
|
||||
Runtime.OpenConnection(conI);
|
||||
}
|
||||
}
|
||||
|
||||
Runtime.IsConnectionsFileLoaded = true;
|
||||
Windows.treeForm.InitialRefresh();
|
||||
SetSelectedNode(_selectedTreeNode);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_sqlConnection?.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void AddNodesFromSql(TreeNode baseNode)
|
||||
{
|
||||
try
|
||||
{
|
||||
_sqlConnection.Open();
|
||||
_sqlQuery = new SqlCommand("SELECT * FROM tblCons ORDER BY PositionID ASC", _sqlConnection);
|
||||
_sqlDataReader = _sqlQuery.ExecuteReader(CommandBehavior.CloseConnection);
|
||||
|
||||
if (_sqlDataReader.HasRows == false)
|
||||
return;
|
||||
|
||||
while (_sqlDataReader.Read())
|
||||
{
|
||||
var tNode = new TreeNode(Convert.ToString(_sqlDataReader["Name"]));
|
||||
var nodeType = ConnectionTreeNode.GetNodeTypeFromString(Convert.ToString(_sqlDataReader["Type"]));
|
||||
|
||||
if (nodeType == TreeNodeType.Connection)
|
||||
AddConnectionToList(tNode);
|
||||
else if (nodeType == TreeNodeType.Container)
|
||||
AddContainerToList(tNode);
|
||||
|
||||
var parentId = Convert.ToString(_sqlDataReader["ParentID"].ToString().Trim());
|
||||
if (string.IsNullOrEmpty(parentId) || parentId == "0")
|
||||
{
|
||||
baseNode.Nodes.Add(tNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
var pNode = ConnectionTreeNode.GetNodeFromConstantID(Convert.ToString(_sqlDataReader["ParentID"]));
|
||||
if (pNode != null)
|
||||
{
|
||||
pNode.Nodes.Add(tNode);
|
||||
|
||||
switch (ConnectionTreeNode.GetNodeType(tNode))
|
||||
{
|
||||
case TreeNodeType.Connection:
|
||||
((ConnectionInfo) tNode.Tag).Parent = (ContainerInfo)pNode.Tag;
|
||||
break;
|
||||
case TreeNodeType.Container:
|
||||
((ContainerInfo) tNode.Tag).Parent = (ContainerInfo)pNode.Tag;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
baseNode.Nodes.Add(tNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strAddNodesFromSqlFailed + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddConnectionToList(TreeNode tNode)
|
||||
{
|
||||
var conI = GetConnectionInfoFromSql();
|
||||
conI.TreeNode = tNode;
|
||||
ConnectionList.Add(conI);
|
||||
tNode.Tag = conI;
|
||||
|
||||
if (DatabaseUpdate)
|
||||
{
|
||||
var prevCon = PreviousConnectionList.FindByConstantID(conI.ConstantID);
|
||||
if (prevCon != null)
|
||||
{
|
||||
foreach (ProtocolBase prot in prevCon.OpenConnections)
|
||||
{
|
||||
prot.InterfaceControl.Info = conI;
|
||||
conI.OpenConnections.Add(prot);
|
||||
}
|
||||
|
||||
if (conI.OpenConnections.Count > 0)
|
||||
{
|
||||
tNode.ImageIndex = (int) TreeImageType.ConnectionOpen;
|
||||
tNode.SelectedImageIndex = (int) TreeImageType.ConnectionOpen;
|
||||
}
|
||||
else
|
||||
{
|
||||
tNode.ImageIndex = (int) TreeImageType.ConnectionClosed;
|
||||
tNode.SelectedImageIndex = (int) TreeImageType.ConnectionClosed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tNode.ImageIndex = (int) TreeImageType.ConnectionClosed;
|
||||
tNode.SelectedImageIndex = (int) TreeImageType.ConnectionClosed;
|
||||
}
|
||||
|
||||
if (conI.ConstantID == PreviousSelected)
|
||||
_selectedTreeNode = tNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
tNode.ImageIndex = (int) TreeImageType.ConnectionClosed;
|
||||
tNode.SelectedImageIndex = (int) TreeImageType.ConnectionClosed;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddContainerToList(TreeNode tNode)
|
||||
{
|
||||
var contI = new ContainerInfo
|
||||
{
|
||||
TreeNode = tNode,
|
||||
Name = Convert.ToString(_sqlDataReader["Name"])
|
||||
};
|
||||
|
||||
var conI = GetConnectionInfoFromSql();
|
||||
conI.Parent = contI;
|
||||
conI.IsContainer = true;
|
||||
contI.ConnectionInfo = conI;
|
||||
|
||||
if (DatabaseUpdate)
|
||||
{
|
||||
var prevCont = PreviousContainerList.FindByConstantID(conI.ConstantID);
|
||||
if (prevCont != null)
|
||||
contI.IsExpanded = prevCont.IsExpanded;
|
||||
|
||||
if (conI.ConstantID == PreviousSelected)
|
||||
_selectedTreeNode = tNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
contI.IsExpanded = Convert.ToBoolean(_sqlDataReader["Expanded"]);
|
||||
}
|
||||
|
||||
ContainerList.Add(contI);
|
||||
ConnectionList.Add(conI);
|
||||
tNode.Tag = contI;
|
||||
tNode.ImageIndex = (int)TreeImageType.Container;
|
||||
tNode.SelectedImageIndex = (int)TreeImageType.Container;
|
||||
}
|
||||
|
||||
private ConnectionInfo GetConnectionInfoFromSql()
|
||||
{
|
||||
try
|
||||
{
|
||||
var connectionInfo = new ConnectionInfo
|
||||
{
|
||||
PositionID = Convert.ToInt32(_sqlDataReader["PositionID"]),
|
||||
ConstantID = Convert.ToString(_sqlDataReader["ConstantID"]),
|
||||
Name = Convert.ToString(_sqlDataReader["Name"]),
|
||||
Description = Convert.ToString(_sqlDataReader["Description"]),
|
||||
Hostname = Convert.ToString(_sqlDataReader["Hostname"]),
|
||||
Username = Convert.ToString(_sqlDataReader["Username"])
|
||||
};
|
||||
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
connectionInfo.Password = cryptographyProvider.Decrypt(Convert.ToString(_sqlDataReader["Password"]), _pW);
|
||||
connectionInfo.Domain = Convert.ToString(_sqlDataReader["DomainName"]);
|
||||
connectionInfo.DisplayWallpaper = Convert.ToBoolean(_sqlDataReader["DisplayWallpaper"]);
|
||||
connectionInfo.DisplayThemes = Convert.ToBoolean(_sqlDataReader["DisplayThemes"]);
|
||||
connectionInfo.CacheBitmaps = Convert.ToBoolean(_sqlDataReader["CacheBitmaps"]);
|
||||
connectionInfo.UseConsoleSession = Convert.ToBoolean(_sqlDataReader["ConnectToConsole"]);
|
||||
connectionInfo.RedirectDiskDrives = Convert.ToBoolean(_sqlDataReader["RedirectDiskDrives"]);
|
||||
connectionInfo.RedirectPrinters = Convert.ToBoolean(_sqlDataReader["RedirectPrinters"]);
|
||||
connectionInfo.RedirectPorts = Convert.ToBoolean(_sqlDataReader["RedirectPorts"]);
|
||||
connectionInfo.RedirectSmartCards = Convert.ToBoolean(_sqlDataReader["RedirectSmartCards"]);
|
||||
connectionInfo.RedirectKeys = Convert.ToBoolean(_sqlDataReader["RedirectKeys"]);
|
||||
connectionInfo.RedirectSound = (ProtocolRDP.RDPSounds)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPSounds), Convert.ToString(_sqlDataReader["RedirectSound"]));
|
||||
connectionInfo.Protocol = (ProtocolType)Tools.MiscTools.StringToEnum(typeof(ProtocolType), Convert.ToString(_sqlDataReader["Protocol"]));
|
||||
connectionInfo.Port = Convert.ToInt32(_sqlDataReader["Port"]);
|
||||
connectionInfo.PuttySession = Convert.ToString(_sqlDataReader["PuttySession"]);
|
||||
connectionInfo.Colors = (ProtocolRDP.RDPColors)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPColors), Convert.ToString(_sqlDataReader["Colors"]));
|
||||
connectionInfo.Resolution = (ProtocolRDP.RDPResolutions)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPResolutions), Convert.ToString(_sqlDataReader["Resolution"]));
|
||||
connectionInfo.Icon = Convert.ToString(_sqlDataReader["Icon"]);
|
||||
connectionInfo.Panel = Convert.ToString(_sqlDataReader["Panel"]);
|
||||
connectionInfo.Inheritance = new ConnectionInfoInheritance(connectionInfo)
|
||||
{
|
||||
CacheBitmaps = Convert.ToBoolean(_sqlDataReader["InheritCacheBitmaps"]),
|
||||
Colors = Convert.ToBoolean(_sqlDataReader["InheritColors"]),
|
||||
Description = Convert.ToBoolean(_sqlDataReader["InheritDescription"]),
|
||||
DisplayThemes = Convert.ToBoolean(_sqlDataReader["InheritDisplayThemes"]),
|
||||
DisplayWallpaper = Convert.ToBoolean(_sqlDataReader["InheritDisplayWallpaper"]),
|
||||
Domain = Convert.ToBoolean(_sqlDataReader["InheritDomain"]),
|
||||
Icon = Convert.ToBoolean(_sqlDataReader["InheritIcon"]),
|
||||
Panel = Convert.ToBoolean(_sqlDataReader["InheritPanel"]),
|
||||
Password = Convert.ToBoolean(_sqlDataReader["InheritPassword"]),
|
||||
Port = Convert.ToBoolean(_sqlDataReader["InheritPort"]),
|
||||
Protocol = Convert.ToBoolean(_sqlDataReader["InheritProtocol"]),
|
||||
PuttySession = Convert.ToBoolean(_sqlDataReader["InheritPuttySession"]),
|
||||
RedirectDiskDrives = Convert.ToBoolean(_sqlDataReader["InheritRedirectDiskDrives"]),
|
||||
RedirectKeys = Convert.ToBoolean(_sqlDataReader["InheritRedirectKeys"]),
|
||||
RedirectPorts = Convert.ToBoolean(_sqlDataReader["InheritRedirectPorts"]),
|
||||
RedirectPrinters = Convert.ToBoolean(_sqlDataReader["InheritRedirectPrinters"]),
|
||||
RedirectSmartCards = Convert.ToBoolean(_sqlDataReader["InheritRedirectSmartCards"]),
|
||||
RedirectSound = Convert.ToBoolean(_sqlDataReader["InheritRedirectSound"]),
|
||||
Resolution = Convert.ToBoolean(_sqlDataReader["InheritResolution"]),
|
||||
UseConsoleSession = Convert.ToBoolean(_sqlDataReader["InheritUseConsoleSession"]),
|
||||
Username = Convert.ToBoolean(_sqlDataReader["InheritUsername"])
|
||||
};
|
||||
|
||||
if (_confVersion > 1.5) //1.6
|
||||
{
|
||||
connectionInfo.ICAEncryption = (ProtocolICA.EncryptionStrength)Tools.MiscTools.StringToEnum(typeof(ProtocolICA.EncryptionStrength), Convert.ToString(_sqlDataReader["ICAEncryptionStrength"]));
|
||||
connectionInfo.Inheritance.ICAEncryption = Convert.ToBoolean(_sqlDataReader["InheritICAEncryptionStrength"]);
|
||||
connectionInfo.PreExtApp = Convert.ToString(_sqlDataReader["PreExtApp"]);
|
||||
connectionInfo.PostExtApp = Convert.ToString(_sqlDataReader["PostExtApp"]);
|
||||
connectionInfo.Inheritance.PreExtApp = Convert.ToBoolean(_sqlDataReader["InheritPreExtApp"]);
|
||||
connectionInfo.Inheritance.PostExtApp = Convert.ToBoolean(_sqlDataReader["InheritPostExtApp"]);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.6) //1.7
|
||||
{
|
||||
connectionInfo.VNCCompression = (ProtocolVNC.Compression)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Compression), Convert.ToString(_sqlDataReader["VNCCompression"]));
|
||||
connectionInfo.VNCEncoding = (ProtocolVNC.Encoding)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Encoding), Convert.ToString(_sqlDataReader["VNCEncoding"]));
|
||||
connectionInfo.VNCAuthMode = (ProtocolVNC.AuthMode)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.AuthMode), Convert.ToString(_sqlDataReader["VNCAuthMode"]));
|
||||
connectionInfo.VNCProxyType = (ProtocolVNC.ProxyType)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.ProxyType), Convert.ToString(_sqlDataReader["VNCProxyType"]));
|
||||
connectionInfo.VNCProxyIP = Convert.ToString(_sqlDataReader["VNCProxyIP"]);
|
||||
connectionInfo.VNCProxyPort = Convert.ToInt32(_sqlDataReader["VNCProxyPort"]);
|
||||
connectionInfo.VNCProxyUsername = Convert.ToString(_sqlDataReader["VNCProxyUsername"]);
|
||||
connectionInfo.VNCProxyPassword = cryptographyProvider.Decrypt(Convert.ToString(_sqlDataReader["VNCProxyPassword"]), _pW);
|
||||
connectionInfo.VNCColors = (ProtocolVNC.Colors)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Colors), Convert.ToString(_sqlDataReader["VNCColors"]));
|
||||
connectionInfo.VNCSmartSizeMode = (ProtocolVNC.SmartSizeMode)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.SmartSizeMode), Convert.ToString(_sqlDataReader["VNCSmartSizeMode"]));
|
||||
connectionInfo.VNCViewOnly = Convert.ToBoolean(_sqlDataReader["VNCViewOnly"]);
|
||||
connectionInfo.Inheritance.VNCCompression = Convert.ToBoolean(_sqlDataReader["InheritVNCCompression"]);
|
||||
connectionInfo.Inheritance.VNCEncoding = Convert.ToBoolean(_sqlDataReader["InheritVNCEncoding"]);
|
||||
connectionInfo.Inheritance.VNCAuthMode = Convert.ToBoolean(_sqlDataReader["InheritVNCAuthMode"]);
|
||||
connectionInfo.Inheritance.VNCProxyType = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyType"]);
|
||||
connectionInfo.Inheritance.VNCProxyIP = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyIP"]);
|
||||
connectionInfo.Inheritance.VNCProxyPort = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyPort"]);
|
||||
connectionInfo.Inheritance.VNCProxyUsername = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyUsername"]);
|
||||
connectionInfo.Inheritance.VNCProxyPassword = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyPassword"]);
|
||||
connectionInfo.Inheritance.VNCColors = Convert.ToBoolean(_sqlDataReader["InheritVNCColors"]);
|
||||
connectionInfo.Inheritance.VNCSmartSizeMode = Convert.ToBoolean(_sqlDataReader["InheritVNCSmartSizeMode"]);
|
||||
connectionInfo.Inheritance.VNCViewOnly = Convert.ToBoolean(_sqlDataReader["InheritVNCViewOnly"]);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.7) //1.8
|
||||
{
|
||||
connectionInfo.RDPAuthenticationLevel = (ProtocolRDP.AuthenticationLevel)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.AuthenticationLevel), Convert.ToString(_sqlDataReader["RDPAuthenticationLevel"]));
|
||||
connectionInfo.Inheritance.RDPAuthenticationLevel = Convert.ToBoolean(_sqlDataReader["InheritRDPAuthenticationLevel"]);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.8) //1.9
|
||||
{
|
||||
connectionInfo.RenderingEngine = (HTTPBase.RenderingEngine)Tools.MiscTools.StringToEnum(typeof(HTTPBase.RenderingEngine), Convert.ToString(_sqlDataReader["RenderingEngine"]));
|
||||
connectionInfo.MacAddress = Convert.ToString(_sqlDataReader["MacAddress"]);
|
||||
connectionInfo.Inheritance.RenderingEngine = Convert.ToBoolean(_sqlDataReader["InheritRenderingEngine"]);
|
||||
connectionInfo.Inheritance.MacAddress = Convert.ToBoolean(_sqlDataReader["InheritMacAddress"]);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.9) //2.0
|
||||
{
|
||||
connectionInfo.UserField = Convert.ToString(_sqlDataReader["UserField"]);
|
||||
connectionInfo.Inheritance.UserField = Convert.ToBoolean(_sqlDataReader["InheritUserField"]);
|
||||
}
|
||||
|
||||
if (_confVersion > 2.0) //2.1
|
||||
{
|
||||
connectionInfo.ExtApp = Convert.ToString(_sqlDataReader["ExtApp"]);
|
||||
connectionInfo.Inheritance.ExtApp = Convert.ToBoolean(_sqlDataReader["InheritExtApp"]);
|
||||
}
|
||||
|
||||
if (_confVersion >= 2.2)
|
||||
{
|
||||
connectionInfo.RDGatewayUsageMethod = (ProtocolRDP.RDGatewayUsageMethod)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDGatewayUsageMethod), Convert.ToString(_sqlDataReader["RDGatewayUsageMethod"]));
|
||||
connectionInfo.RDGatewayHostname = Convert.ToString(_sqlDataReader["RDGatewayHostname"]);
|
||||
connectionInfo.RDGatewayUseConnectionCredentials = (ProtocolRDP.RDGatewayUseConnectionCredentials)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDGatewayUseConnectionCredentials), Convert.ToString(_sqlDataReader["RDGatewayUseConnectionCredentials"]));
|
||||
connectionInfo.RDGatewayUsername = Convert.ToString(_sqlDataReader["RDGatewayUsername"]);
|
||||
connectionInfo.RDGatewayPassword = cryptographyProvider.Decrypt(Convert.ToString(_sqlDataReader["RDGatewayPassword"]), _pW);
|
||||
connectionInfo.RDGatewayDomain = Convert.ToString(_sqlDataReader["RDGatewayDomain"]);
|
||||
connectionInfo.Inheritance.RDGatewayUsageMethod = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayUsageMethod"]);
|
||||
connectionInfo.Inheritance.RDGatewayHostname = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayHostname"]);
|
||||
connectionInfo.Inheritance.RDGatewayUsername = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayUsername"]);
|
||||
connectionInfo.Inheritance.RDGatewayPassword = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayPassword"]);
|
||||
connectionInfo.Inheritance.RDGatewayDomain = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayDomain"]);
|
||||
}
|
||||
|
||||
if (_confVersion >= 2.3)
|
||||
{
|
||||
connectionInfo.EnableFontSmoothing = Convert.ToBoolean(_sqlDataReader["EnableFontSmoothing"]);
|
||||
connectionInfo.EnableDesktopComposition = Convert.ToBoolean(_sqlDataReader["EnableDesktopComposition"]);
|
||||
connectionInfo.Inheritance.EnableFontSmoothing = Convert.ToBoolean(_sqlDataReader["InheritEnableFontSmoothing"]);
|
||||
connectionInfo.Inheritance.EnableDesktopComposition = Convert.ToBoolean(_sqlDataReader["InheritEnableDesktopComposition"]);
|
||||
}
|
||||
|
||||
if (_confVersion >= 2.4)
|
||||
{
|
||||
connectionInfo.UseCredSsp = Convert.ToBoolean(_sqlDataReader["UseCredSsp"]);
|
||||
connectionInfo.Inheritance.UseCredSsp = Convert.ToBoolean(_sqlDataReader["InheritUseCredSsp"]);
|
||||
}
|
||||
|
||||
if (_confVersion >= 2.5)
|
||||
{
|
||||
connectionInfo.LoadBalanceInfo = Convert.ToString(_sqlDataReader["LoadBalanceInfo"]);
|
||||
connectionInfo.AutomaticResize = Convert.ToBoolean(_sqlDataReader["AutomaticResize"]);
|
||||
connectionInfo.Inheritance.LoadBalanceInfo = Convert.ToBoolean(_sqlDataReader["InheritLoadBalanceInfo"]);
|
||||
connectionInfo.Inheritance.AutomaticResize = Convert.ToBoolean(_sqlDataReader["InheritAutomaticResize"]);
|
||||
}
|
||||
|
||||
if (DatabaseUpdate)
|
||||
connectionInfo.PleaseConnect = Convert.ToBoolean(_sqlDataReader["Connected"]);
|
||||
|
||||
return connectionInfo;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strGetConnectionInfoFromSqlFailed + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private delegate void SetSelectedNodeDelegate(TreeNode treeNode);
|
||||
private static void SetSelectedNode(TreeNode treeNode)
|
||||
{
|
||||
if (ConnectionTree.TreeView != null && ConnectionTree.TreeView.InvokeRequired)
|
||||
{
|
||||
Windows.treeForm.Invoke(new SetSelectedNodeDelegate(SetSelectedNode), treeNode);
|
||||
return;
|
||||
}
|
||||
Windows.treeForm.tvConnections.SelectedNode = treeNode;
|
||||
}
|
||||
|
||||
private bool Authenticate(string value, bool compareToOriginalValue, RootNodeInfo rootInfo = null)
|
||||
{
|
||||
var passwordName = "";
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
passwordName = Language.strSQLServer.TrimEnd(':');
|
||||
|
||||
|
||||
if (compareToOriginalValue)
|
||||
{
|
||||
while (cryptographyProvider.Decrypt(value, _pW) == value)
|
||||
{
|
||||
_pW = Tools.MiscTools.PasswordDialog(passwordName, false);
|
||||
if (_pW.Length == 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (cryptographyProvider.Decrypt(value, _pW) != "ThisIsProtected")
|
||||
{
|
||||
_pW = Tools.MiscTools.PasswordDialog(passwordName, false);
|
||||
if (_pW.Length == 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rootInfo == null) return true;
|
||||
rootInfo.Password = true;
|
||||
rootInfo.PasswordString = _pW.ConvertToUnsecureString();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
648
mRemoteV1/Config/Connections/XmlConnectionsLoader.cs
Normal file
648
mRemoteV1/Config/Connections/XmlConnectionsLoader.cs
Normal file
@@ -0,0 +1,648 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Connection.Protocol;
|
||||
using mRemoteNG.Connection.Protocol.Http;
|
||||
using mRemoteNG.Connection.Protocol.ICA;
|
||||
using mRemoteNG.Connection.Protocol.RDP;
|
||||
using mRemoteNG.Connection.Protocol.VNC;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.Tree;
|
||||
using mRemoteNG.Tree.Root;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.UI.TaskDialog;
|
||||
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class XmlConnectionsLoader
|
||||
{
|
||||
private XmlDocument _xmlDocument;
|
||||
private double _confVersion;
|
||||
private SecureString _pW = GeneralAppInfo.EncryptionKey;
|
||||
private ContainerInfo _previousContainer;
|
||||
|
||||
|
||||
|
||||
public string ConnectionFileName { get; set; }
|
||||
public TreeNode RootTreeNode { get; set; }
|
||||
public ConnectionList ConnectionList { get; set; }
|
||||
public ContainerList ContainerList { get; set; }
|
||||
|
||||
|
||||
public void LoadFromXml(bool import)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!import)
|
||||
Runtime.IsConnectionsFileLoaded = false;
|
||||
|
||||
|
||||
// SECTION 1. Create a DOM Document and load the XML data into it.
|
||||
LoadXmlConnectionData();
|
||||
ValidateConnectionFileVersion();
|
||||
|
||||
// SECTION 2. Initialize the treeview control.
|
||||
var rootInfo = InitializeRootNode();
|
||||
|
||||
if (!ConnectionsFileIsAuthentic(rootInfo)) return;
|
||||
|
||||
if (import && !IsExportFile())
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strCannotImportNormalSessionFile);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsExportFile())
|
||||
{
|
||||
RootTreeNode.ImageIndex = (int)TreeImageType.Root;
|
||||
RootTreeNode.SelectedImageIndex = (int)TreeImageType.Root;
|
||||
}
|
||||
|
||||
// SECTION 3. Populate the TreeView with the DOM nodes.
|
||||
PopulateTreeview();
|
||||
RootTreeNode.EnsureVisible();
|
||||
Windows.treeForm.InitialRefresh();
|
||||
SetSelectedNode(RootTreeNode);
|
||||
|
||||
//open connections from last mremote session
|
||||
OpenConnectionsFromLastSession();
|
||||
|
||||
|
||||
if (!import)
|
||||
Runtime.IsConnectionsFileLoaded = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.IsConnectionsFileLoaded = false;
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strLoadFromXmlFailed + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace, true);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private bool ConnectionsFileIsAuthentic(RootNodeInfo rootInfo)
|
||||
{
|
||||
if (!(_confVersion > 1.3)) return true;
|
||||
var protectedString = _xmlDocument.DocumentElement.Attributes["Protected"].Value;
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
var connectionsFileIsNotEncrypted = cryptographyProvider.Decrypt(protectedString, _pW) == "ThisIsNotProtected";
|
||||
if (connectionsFileIsNotEncrypted) return true;
|
||||
if (Authenticate(protectedString, false, rootInfo)) return true;
|
||||
mRemoteNG.Settings.Default.LoadConsFromCustomLocation = false;
|
||||
mRemoteNG.Settings.Default.CustomConsPath = "";
|
||||
RootTreeNode.Remove();
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OpenConnectionsFromLastSession()
|
||||
{
|
||||
if (!mRemoteNG.Settings.Default.OpenConsFromLastSession || mRemoteNG.Settings.Default.NoReconnect) return;
|
||||
foreach (ConnectionInfo conI in ConnectionList)
|
||||
{
|
||||
if (conI.PleaseConnect)
|
||||
Runtime.OpenConnection(conI);
|
||||
}
|
||||
}
|
||||
|
||||
private void PopulateTreeview()
|
||||
{
|
||||
Windows.treeForm.tvConnections.BeginUpdate();
|
||||
AddNodeFromXml(_xmlDocument.DocumentElement, RootTreeNode);
|
||||
RootTreeNode.Expand();
|
||||
ExpandPreviouslyOpenedFolders();
|
||||
Windows.treeForm.tvConnections.EndUpdate();
|
||||
}
|
||||
|
||||
private void AddNodeFromXml(XmlNode parentXmlNode, TreeNode parentTreeNode)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Loop through the XML nodes until the leaf is reached.
|
||||
// Add the nodes to the TreeView during the looping process.
|
||||
if (parentXmlNode.HasChildNodes)
|
||||
{
|
||||
foreach (XmlNode xmlNode in parentXmlNode.ChildNodes)
|
||||
{
|
||||
var treeNode = new TreeNode(xmlNode.Attributes?["Name"].Value);
|
||||
parentTreeNode.Nodes.Add(treeNode);
|
||||
var nodeType = ConnectionTreeNode.GetNodeTypeFromString(xmlNode.Attributes?["Type"].Value);
|
||||
|
||||
if (nodeType == TreeNodeType.Connection)
|
||||
AddConnectionToList(xmlNode, treeNode);
|
||||
else if (nodeType == TreeNodeType.Container)
|
||||
AddContainerToList(xmlNode, treeNode);
|
||||
|
||||
AddNodeFromXml(xmlNode, treeNode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var nameAttribute = parentXmlNode.Attributes?["Name"];
|
||||
var nodeName = nameAttribute?.Value.Trim();
|
||||
parentTreeNode.Text = !string.IsNullOrEmpty(nodeName) ? nodeName : parentXmlNode.Name;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strAddNodeFromXmlFailed + Environment.NewLine + ex.Message + ex.StackTrace, true);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddConnectionToList(XmlNode xmlNode, TreeNode treeNode)
|
||||
{
|
||||
var connectionInfo = GetConnectionInfoFromXml(xmlNode);
|
||||
connectionInfo.TreeNode = treeNode;
|
||||
connectionInfo.Parent = _previousContainer; //NEW
|
||||
ConnectionList.Add(connectionInfo);
|
||||
treeNode.Tag = connectionInfo;
|
||||
treeNode.ImageIndex = (int)TreeImageType.ConnectionClosed;
|
||||
treeNode.SelectedImageIndex = (int)TreeImageType.ConnectionClosed;
|
||||
}
|
||||
|
||||
private void AddContainerToList(XmlNode xmlNode, TreeNode treeNode)
|
||||
{
|
||||
var containerInfo = new ContainerInfo();
|
||||
if (treeNode.Parent != null)
|
||||
{
|
||||
if (ConnectionTreeNode.GetNodeType(treeNode.Parent) == TreeNodeType.Container)
|
||||
containerInfo.Parent = (ContainerInfo) treeNode.Parent.Tag;
|
||||
}
|
||||
_previousContainer = containerInfo; //NEW
|
||||
containerInfo.TreeNode = treeNode;
|
||||
containerInfo.Name = xmlNode.Attributes["Name"].Value;
|
||||
|
||||
if (_confVersion >= 0.8)
|
||||
{
|
||||
containerInfo.IsExpanded = xmlNode.Attributes["Expanded"].Value == "True";
|
||||
}
|
||||
|
||||
var connectionInfo = _confVersion >= 0.9 ? GetConnectionInfoFromXml(xmlNode) : new ConnectionInfo();
|
||||
connectionInfo.Parent = containerInfo;
|
||||
connectionInfo.IsContainer = true;
|
||||
containerInfo.ConnectionInfo = connectionInfo;
|
||||
ContainerList.Add(containerInfo);
|
||||
treeNode.Tag = containerInfo;
|
||||
treeNode.ImageIndex = (int) TreeImageType.Container;
|
||||
treeNode.SelectedImageIndex = (int) TreeImageType.Container;
|
||||
}
|
||||
|
||||
private ConnectionInfo GetConnectionInfoFromXml(XmlNode xxNode)
|
||||
{
|
||||
var connectionInfo = new ConnectionInfo();
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
try
|
||||
{
|
||||
var xmlnode = xxNode;
|
||||
if (_confVersion > 0.1) //0.2
|
||||
{
|
||||
connectionInfo.Name = xmlnode.Attributes["Name"].Value;
|
||||
connectionInfo.Description = xmlnode.Attributes["Descr"].Value;
|
||||
connectionInfo.Hostname = xmlnode.Attributes["Hostname"].Value;
|
||||
connectionInfo.Username = xmlnode.Attributes["Username"].Value;
|
||||
connectionInfo.Password = cryptographyProvider.Decrypt(xmlnode.Attributes["Password"].Value, _pW);
|
||||
connectionInfo.Domain = xmlnode.Attributes["Domain"].Value;
|
||||
connectionInfo.DisplayWallpaper = bool.Parse(xmlnode.Attributes["DisplayWallpaper"].Value);
|
||||
connectionInfo.DisplayThemes = bool.Parse(xmlnode.Attributes["DisplayThemes"].Value);
|
||||
connectionInfo.CacheBitmaps = bool.Parse(xmlnode.Attributes["CacheBitmaps"].Value);
|
||||
|
||||
if (_confVersion < 1.1) //1.0 - 0.1
|
||||
{
|
||||
connectionInfo.Resolution = Convert.ToBoolean(xmlnode.Attributes["Fullscreen"].Value) ? ProtocolRDP.RDPResolutions.Fullscreen : ProtocolRDP.RDPResolutions.FitToWindow;
|
||||
}
|
||||
}
|
||||
|
||||
if (_confVersion > 0.2) //0.3
|
||||
{
|
||||
if (_confVersion < 0.7)
|
||||
{
|
||||
if (Convert.ToBoolean(xmlnode.Attributes["UseVNC"].Value))
|
||||
{
|
||||
connectionInfo.Protocol = ProtocolType.VNC;
|
||||
connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["VNCPort"].Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionInfo.Protocol = ProtocolType.RDP;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionInfo.Port = (int)ProtocolRDP.Defaults.Port;
|
||||
connectionInfo.Protocol = ProtocolType.RDP;
|
||||
}
|
||||
|
||||
if (_confVersion > 0.3) //0.4
|
||||
{
|
||||
if (_confVersion < 0.7)
|
||||
{
|
||||
if (Convert.ToBoolean(xmlnode.Attributes["UseVNC"].Value))
|
||||
connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["VNCPort"].Value);
|
||||
else
|
||||
connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["RDPPort"].Value);
|
||||
}
|
||||
|
||||
connectionInfo.UseConsoleSession = bool.Parse(xmlnode.Attributes["ConnectToConsole"].Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_confVersion < 0.7)
|
||||
{
|
||||
if (Convert.ToBoolean(xmlnode.Attributes["UseVNC"].Value))
|
||||
connectionInfo.Port = (int)ProtocolVNC.Defaults.Port;
|
||||
else
|
||||
connectionInfo.Port = (int)ProtocolRDP.Defaults.Port;
|
||||
}
|
||||
connectionInfo.UseConsoleSession = false;
|
||||
}
|
||||
|
||||
if (_confVersion > 0.4) //0.5 and 0.6
|
||||
{
|
||||
connectionInfo.RedirectDiskDrives = bool.Parse(xmlnode.Attributes["RedirectDiskDrives"].Value);
|
||||
connectionInfo.RedirectPrinters = bool.Parse(xmlnode.Attributes["RedirectPrinters"].Value);
|
||||
connectionInfo.RedirectPorts = bool.Parse(xmlnode.Attributes["RedirectPorts"].Value);
|
||||
connectionInfo.RedirectSmartCards = bool.Parse(xmlnode.Attributes["RedirectSmartCards"].Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionInfo.RedirectDiskDrives = false;
|
||||
connectionInfo.RedirectPrinters = false;
|
||||
connectionInfo.RedirectPorts = false;
|
||||
connectionInfo.RedirectSmartCards = false;
|
||||
}
|
||||
|
||||
if (_confVersion > 0.6) //0.7
|
||||
{
|
||||
connectionInfo.Protocol = (ProtocolType)Tools.MiscTools.StringToEnum(typeof(ProtocolType), xmlnode.Attributes["Protocol"].Value);
|
||||
connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["Port"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 0.9) //1.0
|
||||
{
|
||||
connectionInfo.RedirectKeys = bool.Parse(xmlnode.Attributes["RedirectKeys"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.1) //1.2
|
||||
{
|
||||
connectionInfo.PuttySession = xmlnode.Attributes["PuttySession"].Value;
|
||||
}
|
||||
|
||||
if (_confVersion > 1.2) //1.3
|
||||
{
|
||||
connectionInfo.Colors = (ProtocolRDP.RDPColors)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPColors), xmlnode.Attributes["Colors"].Value);
|
||||
connectionInfo.Resolution = (ProtocolRDP.RDPResolutions)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPResolutions), Convert.ToString(xmlnode.Attributes["Resolution"].Value));
|
||||
connectionInfo.RedirectSound = (ProtocolRDP.RDPSounds)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPSounds), Convert.ToString(xmlnode.Attributes["RedirectSound"].Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Convert.ToInt32(xmlnode.Attributes["Colors"].Value))
|
||||
{
|
||||
case 0:
|
||||
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors256;
|
||||
break;
|
||||
case 1:
|
||||
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors16Bit;
|
||||
break;
|
||||
case 2:
|
||||
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors24Bit;
|
||||
break;
|
||||
case 3:
|
||||
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors32Bit;
|
||||
break;
|
||||
case 4:
|
||||
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors15Bit;
|
||||
break;
|
||||
}
|
||||
|
||||
connectionInfo.RedirectSound = (ProtocolRDP.RDPSounds)Convert.ToInt32(xmlnode.Attributes["RedirectSound"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.2) //1.3
|
||||
{
|
||||
connectionInfo.Inheritance = new ConnectionInfoInheritance(connectionInfo)
|
||||
{
|
||||
CacheBitmaps = bool.Parse(xmlnode.Attributes["InheritCacheBitmaps"].Value),
|
||||
Colors = bool.Parse(xmlnode.Attributes["InheritColors"].Value),
|
||||
Description = bool.Parse(xmlnode.Attributes["InheritDescription"].Value),
|
||||
DisplayThemes = bool.Parse(xmlnode.Attributes["InheritDisplayThemes"].Value),
|
||||
DisplayWallpaper = bool.Parse(xmlnode.Attributes["InheritDisplayWallpaper"].Value),
|
||||
Domain = bool.Parse(xmlnode.Attributes["InheritDomain"].Value),
|
||||
Icon = bool.Parse(xmlnode.Attributes["InheritIcon"].Value),
|
||||
Panel = bool.Parse(xmlnode.Attributes["InheritPanel"].Value),
|
||||
Password = bool.Parse(xmlnode.Attributes["InheritPassword"].Value),
|
||||
Port = bool.Parse(xmlnode.Attributes["InheritPort"].Value),
|
||||
Protocol = bool.Parse(xmlnode.Attributes["InheritProtocol"].Value),
|
||||
PuttySession = bool.Parse(xmlnode.Attributes["InheritPuttySession"].Value),
|
||||
RedirectDiskDrives = bool.Parse(xmlnode.Attributes["InheritRedirectDiskDrives"].Value),
|
||||
RedirectKeys = bool.Parse(xmlnode.Attributes["InheritRedirectKeys"].Value),
|
||||
RedirectPorts = bool.Parse(xmlnode.Attributes["InheritRedirectPorts"].Value),
|
||||
RedirectPrinters = bool.Parse(xmlnode.Attributes["InheritRedirectPrinters"].Value),
|
||||
RedirectSmartCards = bool.Parse(xmlnode.Attributes["InheritRedirectSmartCards"].Value),
|
||||
RedirectSound = bool.Parse(xmlnode.Attributes["InheritRedirectSound"].Value),
|
||||
Resolution = bool.Parse(xmlnode.Attributes["InheritResolution"].Value),
|
||||
UseConsoleSession = bool.Parse(xmlnode.Attributes["InheritUseConsoleSession"].Value),
|
||||
Username = bool.Parse(xmlnode.Attributes["InheritUsername"].Value)
|
||||
};
|
||||
connectionInfo.Icon = xmlnode.Attributes["Icon"].Value;
|
||||
connectionInfo.Panel = xmlnode.Attributes["Panel"].Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionInfo.Inheritance = new ConnectionInfoInheritance(connectionInfo, Convert.ToBoolean(xmlnode.Attributes["Inherit"].Value));
|
||||
connectionInfo.Icon = Convert.ToString(xmlnode.Attributes["Icon"].Value.Replace(".ico", ""));
|
||||
connectionInfo.Panel = Language.strGeneral;
|
||||
}
|
||||
|
||||
if (_confVersion > 1.4) //1.5
|
||||
{
|
||||
connectionInfo.PleaseConnect = bool.Parse(xmlnode.Attributes["Connected"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.5) //1.6
|
||||
{
|
||||
connectionInfo.ICAEncryption = (ProtocolICA.EncryptionStrength)Tools.MiscTools.StringToEnum(typeof(ProtocolICA.EncryptionStrength), xmlnode.Attributes["ICAEncryptionStrength"].Value);
|
||||
connectionInfo.Inheritance.ICAEncryption = bool.Parse(xmlnode.Attributes["InheritICAEncryptionStrength"].Value);
|
||||
connectionInfo.PreExtApp = xmlnode.Attributes["PreExtApp"].Value;
|
||||
connectionInfo.PostExtApp = xmlnode.Attributes["PostExtApp"].Value;
|
||||
connectionInfo.Inheritance.PreExtApp = bool.Parse(xmlnode.Attributes["InheritPreExtApp"].Value);
|
||||
connectionInfo.Inheritance.PostExtApp = bool.Parse(xmlnode.Attributes["InheritPostExtApp"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.6) //1.7
|
||||
{
|
||||
connectionInfo.VNCCompression = (ProtocolVNC.Compression)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Compression), xmlnode.Attributes["VNCCompression"].Value);
|
||||
connectionInfo.VNCEncoding = (ProtocolVNC.Encoding)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Encoding), Convert.ToString(xmlnode.Attributes["VNCEncoding"].Value));
|
||||
connectionInfo.VNCAuthMode = (ProtocolVNC.AuthMode)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.AuthMode), xmlnode.Attributes["VNCAuthMode"].Value);
|
||||
connectionInfo.VNCProxyType = (ProtocolVNC.ProxyType)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.ProxyType), xmlnode.Attributes["VNCProxyType"].Value);
|
||||
connectionInfo.VNCProxyIP = xmlnode.Attributes["VNCProxyIP"].Value;
|
||||
connectionInfo.VNCProxyPort = Convert.ToInt32(xmlnode.Attributes["VNCProxyPort"].Value);
|
||||
connectionInfo.VNCProxyUsername = xmlnode.Attributes["VNCProxyUsername"].Value;
|
||||
connectionInfo.VNCProxyPassword = cryptographyProvider.Decrypt(xmlnode.Attributes["VNCProxyPassword"].Value, _pW);
|
||||
connectionInfo.VNCColors = (ProtocolVNC.Colors)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Colors), xmlnode.Attributes["VNCColors"].Value);
|
||||
connectionInfo.VNCSmartSizeMode = (ProtocolVNC.SmartSizeMode)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.SmartSizeMode), xmlnode.Attributes["VNCSmartSizeMode"].Value);
|
||||
connectionInfo.VNCViewOnly = bool.Parse(xmlnode.Attributes["VNCViewOnly"].Value);
|
||||
connectionInfo.Inheritance.VNCCompression = bool.Parse(xmlnode.Attributes["InheritVNCCompression"].Value);
|
||||
connectionInfo.Inheritance.VNCEncoding = bool.Parse(xmlnode.Attributes["InheritVNCEncoding"].Value);
|
||||
connectionInfo.Inheritance.VNCAuthMode = bool.Parse(xmlnode.Attributes["InheritVNCAuthMode"].Value);
|
||||
connectionInfo.Inheritance.VNCProxyType = bool.Parse(xmlnode.Attributes["InheritVNCProxyType"].Value);
|
||||
connectionInfo.Inheritance.VNCProxyIP = bool.Parse(xmlnode.Attributes["InheritVNCProxyIP"].Value);
|
||||
connectionInfo.Inheritance.VNCProxyPort = bool.Parse(xmlnode.Attributes["InheritVNCProxyPort"].Value);
|
||||
connectionInfo.Inheritance.VNCProxyUsername = bool.Parse(xmlnode.Attributes["InheritVNCProxyUsername"].Value);
|
||||
connectionInfo.Inheritance.VNCProxyPassword = bool.Parse(xmlnode.Attributes["InheritVNCProxyPassword"].Value);
|
||||
connectionInfo.Inheritance.VNCColors = bool.Parse(xmlnode.Attributes["InheritVNCColors"].Value);
|
||||
connectionInfo.Inheritance.VNCSmartSizeMode = bool.Parse(xmlnode.Attributes["InheritVNCSmartSizeMode"].Value);
|
||||
connectionInfo.Inheritance.VNCViewOnly = bool.Parse(xmlnode.Attributes["InheritVNCViewOnly"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.7) //1.8
|
||||
{
|
||||
connectionInfo.RDPAuthenticationLevel = (ProtocolRDP.AuthenticationLevel)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.AuthenticationLevel), xmlnode.Attributes["RDPAuthenticationLevel"].Value);
|
||||
connectionInfo.Inheritance.RDPAuthenticationLevel = bool.Parse(xmlnode.Attributes["InheritRDPAuthenticationLevel"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.8) //1.9
|
||||
{
|
||||
connectionInfo.RenderingEngine = (HTTPBase.RenderingEngine)Tools.MiscTools.StringToEnum(typeof(HTTPBase.RenderingEngine), xmlnode.Attributes["RenderingEngine"].Value);
|
||||
connectionInfo.MacAddress = xmlnode.Attributes["MacAddress"].Value;
|
||||
connectionInfo.Inheritance.RenderingEngine = bool.Parse(xmlnode.Attributes["InheritRenderingEngine"].Value);
|
||||
connectionInfo.Inheritance.MacAddress = bool.Parse(xmlnode.Attributes["InheritMacAddress"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 1.9) //2.0
|
||||
{
|
||||
connectionInfo.UserField = xmlnode.Attributes["UserField"].Value;
|
||||
connectionInfo.Inheritance.UserField = bool.Parse(xmlnode.Attributes["InheritUserField"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 2.0) //2.1
|
||||
{
|
||||
connectionInfo.ExtApp = xmlnode.Attributes["ExtApp"].Value;
|
||||
connectionInfo.Inheritance.ExtApp = bool.Parse(xmlnode.Attributes["InheritExtApp"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 2.1) //2.2
|
||||
{
|
||||
// Get settings
|
||||
connectionInfo.RDGatewayUsageMethod = (ProtocolRDP.RDGatewayUsageMethod)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDGatewayUsageMethod), Convert.ToString(xmlnode.Attributes["RDGatewayUsageMethod"].Value));
|
||||
connectionInfo.RDGatewayHostname = xmlnode.Attributes["RDGatewayHostname"].Value;
|
||||
connectionInfo.RDGatewayUseConnectionCredentials = (ProtocolRDP.RDGatewayUseConnectionCredentials)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDGatewayUseConnectionCredentials), Convert.ToString(xmlnode.Attributes["RDGatewayUseConnectionCredentials"].Value));
|
||||
connectionInfo.RDGatewayUsername = xmlnode.Attributes["RDGatewayUsername"].Value;
|
||||
connectionInfo.RDGatewayPassword = cryptographyProvider.Decrypt(Convert.ToString(xmlnode.Attributes["RDGatewayPassword"].Value), _pW);
|
||||
connectionInfo.RDGatewayDomain = xmlnode.Attributes["RDGatewayDomain"].Value;
|
||||
|
||||
// Get inheritance settings
|
||||
connectionInfo.Inheritance.RDGatewayUsageMethod = bool.Parse(xmlnode.Attributes["InheritRDGatewayUsageMethod"].Value);
|
||||
connectionInfo.Inheritance.RDGatewayHostname = bool.Parse(xmlnode.Attributes["InheritRDGatewayHostname"].Value);
|
||||
connectionInfo.Inheritance.RDGatewayUseConnectionCredentials = bool.Parse(xmlnode.Attributes["InheritRDGatewayUseConnectionCredentials"].Value);
|
||||
connectionInfo.Inheritance.RDGatewayUsername = bool.Parse(xmlnode.Attributes["InheritRDGatewayUsername"].Value);
|
||||
connectionInfo.Inheritance.RDGatewayPassword = bool.Parse(xmlnode.Attributes["InheritRDGatewayPassword"].Value);
|
||||
connectionInfo.Inheritance.RDGatewayDomain = bool.Parse(xmlnode.Attributes["InheritRDGatewayDomain"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion > 2.2) //2.3
|
||||
{
|
||||
// Get settings
|
||||
connectionInfo.EnableFontSmoothing = bool.Parse(xmlnode.Attributes["EnableFontSmoothing"].Value);
|
||||
connectionInfo.EnableDesktopComposition = bool.Parse(xmlnode.Attributes["EnableDesktopComposition"].Value);
|
||||
|
||||
// Get inheritance settings
|
||||
connectionInfo.Inheritance.EnableFontSmoothing = bool.Parse(xmlnode.Attributes["InheritEnableFontSmoothing"].Value);
|
||||
connectionInfo.Inheritance.EnableDesktopComposition = bool.Parse(xmlnode.Attributes["InheritEnableDesktopComposition"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion >= 2.4)
|
||||
{
|
||||
connectionInfo.UseCredSsp = bool.Parse(xmlnode.Attributes["UseCredSsp"].Value);
|
||||
connectionInfo.Inheritance.UseCredSsp = bool.Parse(xmlnode.Attributes["InheritUseCredSsp"].Value);
|
||||
}
|
||||
|
||||
if (_confVersion >= 2.5)
|
||||
{
|
||||
connectionInfo.LoadBalanceInfo = xmlnode.Attributes["LoadBalanceInfo"].Value;
|
||||
connectionInfo.AutomaticResize = bool.Parse(xmlnode.Attributes["AutomaticResize"].Value);
|
||||
connectionInfo.Inheritance.LoadBalanceInfo = bool.Parse(xmlnode.Attributes["InheritLoadBalanceInfo"].Value);
|
||||
connectionInfo.Inheritance.AutomaticResize = bool.Parse(xmlnode.Attributes["InheritAutomaticResize"].Value);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, string.Format(Language.strGetConnectionInfoFromXmlFailed, connectionInfo.Name, ConnectionFileName, ex.Message));
|
||||
}
|
||||
return connectionInfo;
|
||||
}
|
||||
|
||||
|
||||
private void ExpandPreviouslyOpenedFolders()
|
||||
{
|
||||
foreach (ContainerInfo contI in ContainerList)
|
||||
{
|
||||
if (contI.IsExpanded)
|
||||
contI.TreeNode.Expand();
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsExportFile()
|
||||
{
|
||||
var isExportFile = false;
|
||||
if (!(_confVersion >= 1.0)) return isExportFile;
|
||||
if (Convert.ToBoolean(_xmlDocument.DocumentElement.Attributes["Export"].Value))
|
||||
isExportFile = true;
|
||||
return isExportFile;
|
||||
}
|
||||
|
||||
private RootNodeInfo InitializeRootNode()
|
||||
{
|
||||
var rootNodeName = "";
|
||||
if (_xmlDocument.DocumentElement.HasAttribute("Name"))
|
||||
rootNodeName = Convert.ToString(_xmlDocument.DocumentElement.Attributes["Name"].Value.Trim());
|
||||
RootTreeNode.Name = !string.IsNullOrEmpty(rootNodeName) ? rootNodeName : _xmlDocument.DocumentElement.Name;
|
||||
RootTreeNode.Text = RootTreeNode.Name;
|
||||
|
||||
var rootInfo = new RootNodeInfo(RootNodeType.Connection)
|
||||
{
|
||||
Name = RootTreeNode.Name,
|
||||
TreeNode = RootTreeNode
|
||||
};
|
||||
RootTreeNode.Tag = rootInfo;
|
||||
return rootInfo;
|
||||
}
|
||||
|
||||
private void LoadXmlConnectionData()
|
||||
{
|
||||
var connections = DecryptCompleteFile();
|
||||
_xmlDocument = new XmlDocument();
|
||||
if (connections != "")
|
||||
_xmlDocument.LoadXml(connections);
|
||||
else
|
||||
_xmlDocument.Load(ConnectionFileName);
|
||||
}
|
||||
|
||||
private void ValidateConnectionFileVersion()
|
||||
{
|
||||
if (_xmlDocument.DocumentElement.HasAttribute("ConfVersion"))
|
||||
_confVersion = Convert.ToDouble(_xmlDocument.DocumentElement.Attributes["ConfVersion"].Value.Replace(",", "."),
|
||||
CultureInfo.InvariantCulture);
|
||||
else
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, Language.strOldConffile);
|
||||
|
||||
const double maxSupportedConfVersion = 2.5;
|
||||
if (!(_confVersion > maxSupportedConfVersion)) return;
|
||||
CTaskDialog.ShowTaskDialogBox(
|
||||
frmMain.Default,
|
||||
Application.ProductName,
|
||||
"Incompatible connection file format",
|
||||
$"The format of this connection file is not supported. Please upgrade to a newer version of {Application.ProductName}.",
|
||||
string.Format("{1}{0}File Format Version: {2}{0}Highest Supported Version: {3}", Environment.NewLine,
|
||||
ConnectionFileName, _confVersion, maxSupportedConfVersion),
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
ETaskDialogButtons.Ok,
|
||||
ESysIcons.Error,
|
||||
ESysIcons.Error
|
||||
);
|
||||
throw (new Exception($"Incompatible connection file format (file format version {_confVersion})."));
|
||||
}
|
||||
|
||||
private delegate void SetSelectedNodeDelegate(TreeNode treeNode);
|
||||
private static void SetSelectedNode(TreeNode treeNode)
|
||||
{
|
||||
if (ConnectionTree.TreeView != null && ConnectionTree.TreeView.InvokeRequired)
|
||||
{
|
||||
Windows.treeForm.Invoke(new SetSelectedNodeDelegate(SetSelectedNode), treeNode);
|
||||
return;
|
||||
}
|
||||
Windows.treeForm.tvConnections.SelectedNode = treeNode;
|
||||
}
|
||||
|
||||
private string DecryptCompleteFile()
|
||||
{
|
||||
var sRd = new StreamReader(ConnectionFileName);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
var strCons = "";
|
||||
strCons = sRd.ReadToEnd();
|
||||
sRd.Close();
|
||||
|
||||
if (string.IsNullOrEmpty(strCons)) return "";
|
||||
var strDecr = "";
|
||||
bool notDecr;
|
||||
|
||||
if (strCons.Contains("<?xml version=\"1.0\" encoding=\"utf-8\"?>"))
|
||||
{
|
||||
strDecr = strCons;
|
||||
return strDecr;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
strDecr = cryptographyProvider.Decrypt(strCons, _pW);
|
||||
notDecr = strDecr == strCons;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
notDecr = true;
|
||||
}
|
||||
|
||||
if (notDecr)
|
||||
{
|
||||
if (Authenticate(strCons, true))
|
||||
{
|
||||
strDecr = cryptographyProvider.Decrypt(strCons, _pW);
|
||||
notDecr = false;
|
||||
}
|
||||
|
||||
if (notDecr == false)
|
||||
return strDecr;
|
||||
}
|
||||
else
|
||||
{
|
||||
return strDecr;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
private bool Authenticate(string value, bool compareToOriginalValue, RootNodeInfo rootInfo = null)
|
||||
{
|
||||
var passwordName = "";
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
passwordName = Path.GetFileName(ConnectionFileName);
|
||||
|
||||
if (compareToOriginalValue)
|
||||
{
|
||||
while (cryptographyProvider.Decrypt(value, _pW) == value)
|
||||
{
|
||||
_pW = Tools.MiscTools.PasswordDialog(passwordName, false);
|
||||
if (_pW.Length == 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (cryptographyProvider.Decrypt(value, _pW) != "ThisIsProtected")
|
||||
{
|
||||
_pW = Tools.MiscTools.PasswordDialog(passwordName, false);
|
||||
if (_pW.Length == 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rootInfo == null) return true;
|
||||
rootInfo.Password = true;
|
||||
rootInfo.PasswordString = _pW.ConvertToUnsecureString();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ using System.Globalization;
|
||||
using mRemoteNG.Themes;
|
||||
using mRemoteNG.Connection.Protocol;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
|
||||
@@ -67,7 +69,8 @@ namespace mRemoteNG.Config.Settings
|
||||
|
||||
private static void SetConDefaultPassword()
|
||||
{
|
||||
mRemoteNG.Settings.Default.ConDefaultPassword = Security.Crypt.Decrypt(mRemoteNG.Settings.Default.ConDefaultPassword, GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
mRemoteNG.Settings.Default.ConDefaultPassword = cryptographyProvider.Decrypt(mRemoteNG.Settings.Default.ConDefaultPassword, GeneralAppInfo.EncryptionKey);
|
||||
}
|
||||
|
||||
private static void SetAlwaysShowPanelTabs()
|
||||
|
||||
@@ -7,6 +7,7 @@ using mRemoteNG.App;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
@@ -62,8 +63,9 @@ namespace mRemoteNG.Config.Settings
|
||||
}
|
||||
mRemoteNG.Settings.Default.QuickyTBVisible = with1.tsQuickConnect.Visible;
|
||||
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
mRemoteNG.Settings.Default.ConDefaultPassword =
|
||||
Crypt.Encrypt(Convert.ToString(mRemoteNG.Settings.Default.ConDefaultPassword), GeneralAppInfo.EncryptionKey);
|
||||
cryptographyProvider.Encrypt(Convert.ToString(mRemoteNG.Settings.Default.ConDefaultPassword), GeneralAppInfo.EncryptionKey);
|
||||
|
||||
mRemoteNG.Settings.Default.Save();
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using mRemoteNG.App.Info;
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
|
||||
namespace mRemoteNG.Config
|
||||
{
|
||||
@@ -54,7 +56,8 @@ namespace mRemoteNG.Config
|
||||
_sqlHost = mRemoteNG.Settings.Default.SQLHost;
|
||||
_sqlCatalog = mRemoteNG.Settings.Default.SQLDatabaseName;
|
||||
_sqlUsername = mRemoteNG.Settings.Default.SQLUser;
|
||||
_sqlPassword = Security.Crypt.Decrypt(mRemoteNG.Settings.Default.SQLPass, GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
_sqlPassword = cryptographyProvider.Decrypt(mRemoteNG.Settings.Default.SQLPass, GeneralAppInfo.EncryptionKey);
|
||||
}
|
||||
|
||||
public void Connect()
|
||||
|
||||
@@ -4,8 +4,11 @@ using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.App;
|
||||
using System.Threading;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Connection.Protocol.RDP;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
|
||||
@@ -172,7 +175,8 @@ namespace mRemoteNG.Connection.Protocol.ICA
|
||||
{
|
||||
if (mRemoteNG.Settings.Default.DefaultPassword != "")
|
||||
{
|
||||
_ICAClient.SetProp("ClearPassword", Security.Crypt.Decrypt(Convert.ToString(mRemoteNG.Settings.Default.DefaultPassword), App.Info.GeneralAppInfo.EncryptionKey));
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
_ICAClient.SetProp("ClearPassword", cryptographyProvider.Decrypt(Settings.Default.DefaultPassword, GeneralAppInfo.EncryptionKey));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Connection;
|
||||
|
||||
|
||||
namespace mRemoteNG.Connection.Protocol
|
||||
@@ -10,12 +9,10 @@ namespace mRemoteNG.Connection.Protocol
|
||||
public abstract class ProtocolBase
|
||||
{
|
||||
#region Private Variables
|
||||
private string _Name;
|
||||
private UI.Window.ConnectionWindow _connectionWindow;
|
||||
|
||||
private UI.Window.ConnectionWindow _connectionWindow;
|
||||
private InterfaceControl _interfaceControl;
|
||||
private Control _Control;
|
||||
private ConnectionInfo.Force _Force;
|
||||
private ConnectingEventHandler ConnectingEvent;
|
||||
private ConnectingEventHandler ConnectingEvent;
|
||||
private ConnectedEventHandler ConnectedEvent;
|
||||
private DisconnectedEventHandler DisconnectedEvent;
|
||||
private ErrorOccuredEventHandler ErrorOccuredEvent;
|
||||
@@ -25,13 +22,9 @@ namespace mRemoteNG.Connection.Protocol
|
||||
|
||||
#region Public Properties
|
||||
#region Control
|
||||
public string Name
|
||||
{
|
||||
get { return this._Name; }
|
||||
set { this._Name = value; }
|
||||
}
|
||||
|
||||
public UI.Window.ConnectionWindow ConnectionWindow
|
||||
public string Name { get; set; }
|
||||
|
||||
protected UI.Window.ConnectionWindow ConnectionWindow
|
||||
{
|
||||
get { return _connectionWindow; }
|
||||
set
|
||||
@@ -52,22 +45,15 @@ namespace mRemoteNG.Connection.Protocol
|
||||
ConnectionWindow = _interfaceControl.GetContainerControl() as UI.Window.ConnectionWindow;
|
||||
}
|
||||
}
|
||||
|
||||
public Control Control
|
||||
{
|
||||
get { return this._Control; }
|
||||
set { this._Control = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
public ConnectionInfo.Force Force
|
||||
{
|
||||
get { return this._Force; }
|
||||
set { this._Force = value; }
|
||||
}
|
||||
|
||||
public System.Timers.Timer tmrReconnect = new System.Timers.Timer(2000);
|
||||
public ReconnectGroup ReconnectGroup;
|
||||
|
||||
protected Control Control { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public ConnectionInfo.Force Force { get; set; }
|
||||
|
||||
public readonly System.Timers.Timer tmrReconnect = new System.Timers.Timer(2000);
|
||||
protected ReconnectGroup ReconnectGroup;
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
@@ -77,23 +63,23 @@ namespace mRemoteNG.Connection.Protocol
|
||||
{
|
||||
try
|
||||
{
|
||||
this._Control.Focus();
|
||||
Control.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "Couldn\'t focus Control (Connection.Protocol.Base)" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ResizeBegin(System.Object sender, EventArgs e)
|
||||
|
||||
public virtual void ResizeBegin(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Resize(System.Object sender, EventArgs e)
|
||||
|
||||
public virtual void Resize(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void ResizeEnd(System.Object sender, EventArgs e)
|
||||
|
||||
public virtual void ResizeEnd(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -101,19 +87,17 @@ namespace mRemoteNG.Connection.Protocol
|
||||
{
|
||||
try
|
||||
{
|
||||
this._interfaceControl.Parent.Tag = this._interfaceControl;
|
||||
this._interfaceControl.Show();
|
||||
|
||||
if (this._Control != null)
|
||||
{
|
||||
this._Control.Name = this._Name;
|
||||
this._Control.Parent = this._interfaceControl;
|
||||
this._Control.Location = this._interfaceControl.Location;
|
||||
this._Control.Size = this.InterfaceControl.Size;
|
||||
this._Control.Anchor = this._interfaceControl.Anchor;
|
||||
}
|
||||
|
||||
return true;
|
||||
_interfaceControl.Parent.Tag = _interfaceControl;
|
||||
_interfaceControl.Show();
|
||||
|
||||
if (Control == null) return true;
|
||||
Control.Name = Name;
|
||||
Control.Parent = _interfaceControl;
|
||||
Control.Location = _interfaceControl.Location;
|
||||
Control.Size = InterfaceControl.Size;
|
||||
Control.Anchor = _interfaceControl.Anchor;
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -124,45 +108,37 @@ namespace mRemoteNG.Connection.Protocol
|
||||
|
||||
public virtual bool Connect()
|
||||
{
|
||||
if (InterfaceControl.Info.Protocol != ProtocolType.RDP)
|
||||
{
|
||||
if (ConnectedEvent != null)
|
||||
{
|
||||
ConnectedEvent(this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
if (InterfaceControl.Info.Protocol == ProtocolType.RDP) return false;
|
||||
if (ConnectedEvent == null) return false;
|
||||
ConnectedEvent(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void Disconnect()
|
||||
{
|
||||
this.Close();
|
||||
Close();
|
||||
}
|
||||
|
||||
public virtual void Close()
|
||||
{
|
||||
Thread t = new Thread(new System.Threading.ThreadStart(CloseBG));
|
||||
t.SetApartmentState(System.Threading.ApartmentState.STA);
|
||||
Thread t = new Thread(CloseBG);
|
||||
t.SetApartmentState(ApartmentState.STA);
|
||||
t.IsBackground = true;
|
||||
t.Start();
|
||||
}
|
||||
|
||||
private void CloseBG()
|
||||
{
|
||||
if (ClosedEvent != null)
|
||||
{
|
||||
ClosedEvent(this);
|
||||
}
|
||||
try
|
||||
ClosedEvent?.Invoke(this);
|
||||
try
|
||||
{
|
||||
tmrReconnect.Enabled = false;
|
||||
|
||||
if (this._Control != null)
|
||||
if (Control != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.DisposeControl();
|
||||
DisposeControl();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -170,19 +146,17 @@ namespace mRemoteNG.Connection.Protocol
|
||||
}
|
||||
}
|
||||
|
||||
if (this._interfaceControl != null)
|
||||
if (_interfaceControl != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this._interfaceControl.Parent != null)
|
||||
{
|
||||
if (this._interfaceControl.Parent.Tag != null)
|
||||
{
|
||||
this.SetTagToNothing();
|
||||
}
|
||||
if (_interfaceControl.Parent == null) return;
|
||||
if (_interfaceControl.Parent.Tag != null)
|
||||
{
|
||||
SetTagToNothing();
|
||||
}
|
||||
|
||||
this.DisposeInterface();
|
||||
}
|
||||
DisposeInterface();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -199,42 +173,42 @@ namespace mRemoteNG.Connection.Protocol
|
||||
private delegate void DisposeInterfaceCB();
|
||||
private void DisposeInterface()
|
||||
{
|
||||
if (this._interfaceControl.InvokeRequired)
|
||||
if (_interfaceControl.InvokeRequired)
|
||||
{
|
||||
DisposeInterfaceCB s = new DisposeInterfaceCB(DisposeInterface);
|
||||
this._interfaceControl.Invoke(s);
|
||||
_interfaceControl.Invoke(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._interfaceControl.Dispose();
|
||||
_interfaceControl.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private delegate void SetTagToNothingCB();
|
||||
private void SetTagToNothing()
|
||||
{
|
||||
if (this._interfaceControl.Parent.InvokeRequired)
|
||||
if (_interfaceControl.Parent.InvokeRequired)
|
||||
{
|
||||
SetTagToNothingCB s = new SetTagToNothingCB(SetTagToNothing);
|
||||
this._interfaceControl.Parent.Invoke(s);
|
||||
_interfaceControl.Parent.Invoke(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._interfaceControl.Parent.Tag = null;
|
||||
_interfaceControl.Parent.Tag = null;
|
||||
}
|
||||
}
|
||||
|
||||
private delegate void DisposeControlCB();
|
||||
private void DisposeControl()
|
||||
{
|
||||
if (this._Control.InvokeRequired)
|
||||
if (Control.InvokeRequired)
|
||||
{
|
||||
DisposeControlCB s = new DisposeControlCB(DisposeControl);
|
||||
this._Control.Invoke(s);
|
||||
Control.Invoke(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._Control.Dispose();
|
||||
Control.Dispose();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -243,83 +217,77 @@ namespace mRemoteNG.Connection.Protocol
|
||||
public delegate void ConnectingEventHandler(object sender);
|
||||
public event ConnectingEventHandler Connecting
|
||||
{
|
||||
add { ConnectingEvent = (ConnectingEventHandler) System.Delegate.Combine(ConnectingEvent, value); }
|
||||
remove { ConnectingEvent = (ConnectingEventHandler) System.Delegate.Remove(ConnectingEvent, value); }
|
||||
add { ConnectingEvent = (ConnectingEventHandler) Delegate.Combine(ConnectingEvent, value); }
|
||||
remove { ConnectingEvent = (ConnectingEventHandler) Delegate.Remove(ConnectingEvent, value); }
|
||||
}
|
||||
|
||||
public delegate void ConnectedEventHandler(object sender);
|
||||
public event ConnectedEventHandler Connected
|
||||
{
|
||||
add { ConnectedEvent = (ConnectedEventHandler) System.Delegate.Combine(ConnectedEvent, value); }
|
||||
remove { ConnectedEvent = (ConnectedEventHandler) System.Delegate.Remove(ConnectedEvent, value); }
|
||||
add { ConnectedEvent = (ConnectedEventHandler) Delegate.Combine(ConnectedEvent, value); }
|
||||
remove { ConnectedEvent = (ConnectedEventHandler) Delegate.Remove(ConnectedEvent, value); }
|
||||
}
|
||||
|
||||
public delegate void DisconnectedEventHandler(object sender, string DisconnectedMessage);
|
||||
public event DisconnectedEventHandler Disconnected
|
||||
{
|
||||
add { DisconnectedEvent = (DisconnectedEventHandler) System.Delegate.Combine(DisconnectedEvent, value); }
|
||||
remove { DisconnectedEvent = (DisconnectedEventHandler) System.Delegate.Remove(DisconnectedEvent, value); }
|
||||
add { DisconnectedEvent = (DisconnectedEventHandler) Delegate.Combine(DisconnectedEvent, value); }
|
||||
remove { DisconnectedEvent = (DisconnectedEventHandler) Delegate.Remove(DisconnectedEvent, value); }
|
||||
}
|
||||
|
||||
public delegate void ErrorOccuredEventHandler(object sender, string ErrorMessage);
|
||||
public event ErrorOccuredEventHandler ErrorOccured
|
||||
{
|
||||
add { ErrorOccuredEvent = (ErrorOccuredEventHandler) System.Delegate.Combine(ErrorOccuredEvent, value); }
|
||||
remove { ErrorOccuredEvent = (ErrorOccuredEventHandler) System.Delegate.Remove(ErrorOccuredEvent, value); }
|
||||
add { ErrorOccuredEvent = (ErrorOccuredEventHandler) Delegate.Combine(ErrorOccuredEvent, value); }
|
||||
remove { ErrorOccuredEvent = (ErrorOccuredEventHandler) Delegate.Remove(ErrorOccuredEvent, value); }
|
||||
}
|
||||
|
||||
public delegate void ClosingEventHandler(object sender);
|
||||
public event ClosingEventHandler Closing
|
||||
{
|
||||
add { ClosingEvent = (ClosingEventHandler) System.Delegate.Combine(ClosingEvent, value); }
|
||||
remove { ClosingEvent = (ClosingEventHandler) System.Delegate.Remove(ClosingEvent, value); }
|
||||
add { ClosingEvent = (ClosingEventHandler) Delegate.Combine(ClosingEvent, value); }
|
||||
remove { ClosingEvent = (ClosingEventHandler) Delegate.Remove(ClosingEvent, value); }
|
||||
}
|
||||
|
||||
public delegate void ClosedEventHandler(object sender);
|
||||
public event ClosedEventHandler Closed
|
||||
{
|
||||
add { ClosedEvent = (ClosedEventHandler) System.Delegate.Combine(ClosedEvent, value); }
|
||||
remove { ClosedEvent = (ClosedEventHandler) System.Delegate.Remove(ClosedEvent, value); }
|
||||
add { ClosedEvent = (ClosedEventHandler) Delegate.Combine(ClosedEvent, value); }
|
||||
remove { ClosedEvent = (ClosedEventHandler) Delegate.Remove(ClosedEvent, value); }
|
||||
}
|
||||
|
||||
|
||||
public void Event_Closing(object sender)
|
||||
{
|
||||
if (ClosingEvent != null)
|
||||
ClosingEvent(sender);
|
||||
ClosingEvent?.Invoke(sender);
|
||||
}
|
||||
|
||||
public void Event_Closed(object sender)
|
||||
{
|
||||
if (ClosedEvent != null)
|
||||
ClosedEvent(sender);
|
||||
}
|
||||
|
||||
public void Event_Connecting(object sender)
|
||||
{
|
||||
if (ConnectingEvent != null)
|
||||
ConnectingEvent(sender);
|
||||
}
|
||||
|
||||
public void Event_Connected(object sender)
|
||||
{
|
||||
if (ConnectedEvent != null)
|
||||
ConnectedEvent(sender);
|
||||
}
|
||||
|
||||
public void Event_Disconnected(object sender, string DisconnectedMessage)
|
||||
{
|
||||
if (DisconnectedEvent != null)
|
||||
DisconnectedEvent(sender, DisconnectedMessage);
|
||||
}
|
||||
|
||||
public void Event_ErrorOccured(object sender, string ErrorMsg)
|
||||
{
|
||||
if (ErrorOccuredEvent != null)
|
||||
ErrorOccuredEvent(sender, ErrorMsg);
|
||||
}
|
||||
|
||||
public void Event_ReconnectGroupCloseClicked()
|
||||
|
||||
protected void Event_Closed(object sender)
|
||||
{
|
||||
ClosedEvent?.Invoke(sender);
|
||||
}
|
||||
|
||||
protected void Event_Connecting(object sender)
|
||||
{
|
||||
ConnectingEvent?.Invoke(sender);
|
||||
}
|
||||
|
||||
protected void Event_Connected(object sender)
|
||||
{
|
||||
ConnectedEvent?.Invoke(sender);
|
||||
}
|
||||
|
||||
protected void Event_Disconnected(object sender, string DisconnectedMessage)
|
||||
{
|
||||
DisconnectedEvent?.Invoke(sender, DisconnectedMessage);
|
||||
}
|
||||
|
||||
protected void Event_ErrorOccured(object sender, string ErrorMsg)
|
||||
{
|
||||
ErrorOccuredEvent?.Invoke(sender, ErrorMsg);
|
||||
}
|
||||
|
||||
protected void Event_ReconnectGroupCloseClicked()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
|
||||
|
||||
namespace mRemoteNG.Connection.Protocol
|
||||
@@ -98,7 +101,8 @@ namespace mRemoteNG.Connection.Protocol
|
||||
{
|
||||
if (Settings.Default.EmptyCredentials == "custom")
|
||||
{
|
||||
password = Security.Crypt.Decrypt(Convert.ToString(Settings.Default.DefaultPassword), App.Info.GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
password = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.DefaultPassword), GeneralAppInfo.EncryptionKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ using System.Threading;
|
||||
using System.ComponentModel;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using MSTSCLib;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.UI.Forms;
|
||||
@@ -341,21 +343,21 @@ namespace mRemoteNG.Connection.Protocol.RDP
|
||||
{
|
||||
if (_connectionInfo.RDGatewayUseConnectionCredentials == RDGatewayUseConnectionCredentials.Yes)
|
||||
{
|
||||
//_rdpClient.TransportSettings2.GatewayUsername = _connectionInfo.Username;
|
||||
//_rdpClient.TransportSettings2.GatewayPassword = _connectionInfo.Password;
|
||||
//_rdpClient.TransportSettings2.GatewayDomain = _connectionInfo.Domain;
|
||||
_rdpClient.TransportSettings2.GatewayUsername = _connectionInfo.Username;
|
||||
_rdpClient.TransportSettings2.GatewayPassword = _connectionInfo.Password;
|
||||
_rdpClient.TransportSettings2.GatewayDomain = _connectionInfo.Domain;
|
||||
}
|
||||
else if (_connectionInfo.RDGatewayUseConnectionCredentials == RDGatewayUseConnectionCredentials.SmartCard)
|
||||
{
|
||||
//_rdpClient.TransportSettings2.GatewayCredSharing = 0;
|
||||
_rdpClient.TransportSettings2.GatewayCredSharing = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//_rdpClient.TransportSettings2.GatewayUsername = _connectionInfo.RDGatewayUsername;
|
||||
//_rdpClient.TransportSettings2.GatewayPassword = _connectionInfo.RDGatewayPassword;
|
||||
//_rdpClient.TransportSettings2.GatewayDomain = _connectionInfo.RDGatewayDomain;
|
||||
//_rdpClient.TransportSettings2.GatewayCredSharing = 0;
|
||||
}
|
||||
_rdpClient.TransportSettings2.GatewayUsername = _connectionInfo.RDGatewayUsername;
|
||||
_rdpClient.TransportSettings2.GatewayPassword = _connectionInfo.RDGatewayPassword;
|
||||
_rdpClient.TransportSettings2.GatewayDomain = _connectionInfo.RDGatewayDomain;
|
||||
_rdpClient.TransportSettings2.GatewayCredSharing = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -438,7 +440,8 @@ namespace mRemoteNG.Connection.Protocol.RDP
|
||||
{
|
||||
if (Settings.Default.DefaultPassword != "")
|
||||
{
|
||||
_rdpClient.AdvancedSettings2.ClearTextPassword = Security.Crypt.Decrypt(Convert.ToString(Settings.Default.DefaultPassword), App.Info.GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
_rdpClient.AdvancedSettings2.ClearTextPassword = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.DefaultPassword), App.Info.GeneralAppInfo.EncryptionKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -882,4 +885,4 @@ namespace mRemoteNG.Connection.Protocol.RDP
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3107,6 +3107,15 @@ namespace mRemoteNG {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Reconnect All Open Connections.
|
||||
/// </summary>
|
||||
internal static string strMenuReconnectAll {
|
||||
get {
|
||||
return ResourceManager.GetString("strMenuReconnectAll", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Refresh Screen (VNC).
|
||||
/// </summary>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
@@ -105,17 +105,17 @@
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="strAbout" xml:space="preserve">
|
||||
<value>Über</value>
|
||||
@@ -2191,4 +2191,7 @@ mRemoteNG wird nun geschlossen und die Installation gestartet.</value>
|
||||
<data name="strYes" xml:space="preserve">
|
||||
<value>Ja</value>
|
||||
</data>
|
||||
<data name="strMenuReconnectAll" xml:space="preserve">
|
||||
<value>Wiederverbinden von allen offenen Verbindungen</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -179,7 +179,7 @@
|
||||
<value>Aspect</value>
|
||||
</data>
|
||||
<data name="strAutomaticallyGetSessionInfo" xml:space="preserve">
|
||||
<value>Automatically get session information</value>
|
||||
<value>セッション情報を自動的に取得する</value>
|
||||
</data>
|
||||
<data name="strAutoSaveEvery" xml:space="preserve">
|
||||
<value>自動保存の間隔:</value>
|
||||
@@ -206,7 +206,7 @@
|
||||
<value>Default Inheritance</value>
|
||||
</data>
|
||||
<data name="strButtonDefaultProperties" xml:space="preserve">
|
||||
<value>Default Properties</value>
|
||||
<value>デフォルトのプロパティ</value>
|
||||
</data>
|
||||
<data name="strButtonDisconnect" xml:space="preserve">
|
||||
<value>切断</value>
|
||||
@@ -286,7 +286,7 @@ Please use File - Load Connections for normal connection files!</value>
|
||||
<value>更新</value>
|
||||
</data>
|
||||
<data name="strCcCheckFailed" xml:space="preserve">
|
||||
<value>Check failed!</value>
|
||||
<value>確認に失敗しました</value>
|
||||
</data>
|
||||
<data name="strCcCheckSucceeded" xml:space="preserve">
|
||||
<value>Check succeeded!</value>
|
||||
@@ -451,38 +451,39 @@ VncSharpNG Control Version {0}</value>
|
||||
<value>btnIcon_Clickがエラーを発生しました</value>
|
||||
</data>
|
||||
<data name="strConfigPropertyGridHideItemsFailed" xml:space="preserve">
|
||||
<value>ShowHideGridItems failed!</value>
|
||||
<value>ShowHideGridItemsがエラーを発生しました</value>
|
||||
</data>
|
||||
<data name="strConfigPropertyGridMenuClickFailed" xml:space="preserve">
|
||||
<value>IconMenu_Click failed!</value>
|
||||
<value>IconMenu_Clickがエラーを発生しました</value>
|
||||
</data>
|
||||
<data name="strConfigPropertyGridObjectFailed" xml:space="preserve">
|
||||
<value>Property Grid object failed!</value>
|
||||
<value>プロパティを表示するグリッドがエラーを発生しました</value>
|
||||
</data>
|
||||
<data name="strConfigPropertyGridSetHostStatusFailed" xml:space="preserve">
|
||||
<value>SetHostStatus failed!</value>
|
||||
<value>SetHostStatusがエラーを発生しました</value>
|
||||
</data>
|
||||
<data name="strConfigPropertyGridValueFailed" xml:space="preserve">
|
||||
<value>pGrid_PopertyValueChanged failed!</value>
|
||||
<value>pGrid_PopertyValueChangedがエラーを発生しました</value>
|
||||
</data>
|
||||
<data name="strConfigUiLoadFailed" xml:space="preserve">
|
||||
<value>Config UI load failed!</value>
|
||||
<value>Config UI loadがエラーを発生しました</value>
|
||||
</data>
|
||||
<data name="strConfirmCloseConnectionMainInstruction" xml:space="preserve">
|
||||
<value>接続「{0}」を切断しますか?</value>
|
||||
<comment>Do you want to close the connection, "{0}"?</comment>
|
||||
</data>
|
||||
<data name="strConfirmCloseConnectionPanelMainInstruction" xml:space="preserve">
|
||||
<value>Are you sure you want to close the panel, "{0}"? Any connections that it contains will also be closed.</value>
|
||||
<value>パネル内で開いている接続も全て切断されますが、パネル「{0}」を閉じますか?</value>
|
||||
</data>
|
||||
<data name="strConfirmDeleteExternalTool" xml:space="preserve">
|
||||
<value>Are you sure you want to delete the external tool, "{0}"?</value>
|
||||
<value>外部ツール「{0}」を削除してもよろしいですか?</value>
|
||||
</data>
|
||||
<data name="strConfirmDeleteExternalToolMultiple" xml:space="preserve">
|
||||
<value>Are you sure you want to delete the {0} selected external tools?</value>
|
||||
<value>選択された外部ツール「{0}」を削除してもよろしいですか?</value>
|
||||
</data>
|
||||
<data name="strConfirmDeleteNodeConnection" xml:space="preserve">
|
||||
<value>Are you sure you want to delete the connection, "{0}"?</value>
|
||||
<value>接続「{0}」を削除してもよろしいですか?</value>
|
||||
<comment>Are you sure you want to delete the connection, "{0}"?</comment>
|
||||
</data>
|
||||
<data name="strConfirmDeleteNodeFolder" xml:space="preserve">
|
||||
<value>空のフォルダ「{0}」削除してもよろしいですか?</value>
|
||||
@@ -573,7 +574,8 @@ Starting with new connections file.</value>
|
||||
<value>接続イベントに失敗しました</value>
|
||||
</data>
|
||||
<data name="strConnenctionCloseEventFailed" xml:space="preserve">
|
||||
<value>Connection Event Closed failed!</value>
|
||||
<value />
|
||||
<comment>Connection Event Closed failed!</comment>
|
||||
</data>
|
||||
<data name="strCouldNotCreateNewConnectionsFile" xml:space="preserve">
|
||||
<value>Couldn't create new connections file!</value>
|
||||
@@ -630,10 +632,10 @@ Starting with new connections file.</value>
|
||||
<value>接続設定ファイルをすべて暗号化する</value>
|
||||
</data>
|
||||
<data name="strEndIP" xml:space="preserve">
|
||||
<value>End IP</value>
|
||||
<value>最終IPアドレス</value>
|
||||
</data>
|
||||
<data name="strEndPort" xml:space="preserve">
|
||||
<value>End Port</value>
|
||||
<value>最終ポート</value>
|
||||
</data>
|
||||
<data name="strErrorAddExternalToolsToToolBarFailed" xml:space="preserve">
|
||||
<value>AddExternalToolsToToolBar (frmMain) failed. {0}</value>
|
||||
@@ -651,7 +653,7 @@ Starting with new connections file.</value>
|
||||
<value>エラーコード:{0}</value>
|
||||
</data>
|
||||
<data name="strErrorConnectionListSaveFailed" xml:space="preserve">
|
||||
<value>The connection list could not be saved.</value>
|
||||
<value>接続リストが保存できませんでした</value>
|
||||
</data>
|
||||
<data name="strErrorCouldNotLaunchPutty" xml:space="preserve">
|
||||
<value>PuTTYの実行に失敗しました</value>
|
||||
@@ -700,7 +702,7 @@ See the Microsoft Support article at http://support.microsoft.com/kb/811833 for
|
||||
<value>Export mRemote/mRemoteNG XML</value>
|
||||
</data>
|
||||
<data name="strExportProperties" xml:space="preserve">
|
||||
<value>Export Properties</value>
|
||||
<value>プロパティのエクスポート</value>
|
||||
</data>
|
||||
<data name="strExportSelectedConnection" xml:space="preserve">
|
||||
<value>Export the currently selected connection</value>
|
||||
@@ -2033,16 +2035,20 @@ Message:
|
||||
<comment>Show full connections file path in window title</comment>
|
||||
</data>
|
||||
<data name="strShowLogonInfoOnTabs" xml:space="preserve">
|
||||
<value>Show logon information on tab names</value>
|
||||
<value>タブ名と一緒にログオン情報を表示する</value>
|
||||
<comment>Show logon information on tab names</comment>
|
||||
</data>
|
||||
<data name="strShowProtocolOnTabs" xml:space="preserve">
|
||||
<value>Show protocols on tab names</value>
|
||||
<value>タブ名と一緒にプロトコルを表示する</value>
|
||||
<comment>Show protocols on tab names</comment>
|
||||
</data>
|
||||
<data name="strSingleClickOnConnectionOpensIt" xml:space="preserve">
|
||||
<value>Single click on connection opens it</value>
|
||||
<value>ワンクリックで接続を開始する</value>
|
||||
<comment>Single click on connection opens it</comment>
|
||||
</data>
|
||||
<data name="strSingleClickOnOpenConnectionSwitchesToIt" xml:space="preserve">
|
||||
<value>Single click on opened connection switches to it</value>
|
||||
<value />
|
||||
<comment>Single click on opened connection switches to it</comment>
|
||||
</data>
|
||||
<data name="strSmartSizeModeAspect" xml:space="preserve">
|
||||
<value>Aspect</value>
|
||||
@@ -2343,10 +2349,11 @@ mRemoteNGを終了してインストールを開始します</value>
|
||||
<value>Use a smart card</value>
|
||||
</data>
|
||||
<data name="strUseSQLServer" xml:space="preserve">
|
||||
<value>Use SQL Server to load && save connections</value>
|
||||
<value>接続設定の保存にSQLサーバーを使用する</value>
|
||||
<comment>Use SQL Server to load && save connections</comment>
|
||||
</data>
|
||||
<data name="strVersion" xml:space="preserve">
|
||||
<value>Version</value>
|
||||
<value>バージョン</value>
|
||||
</data>
|
||||
<data name="strVisionAppRemoteDesktopCsv" xml:space="preserve">
|
||||
<value>visionapp Remote Desktop 2008 CSV</value>
|
||||
@@ -2355,13 +2362,13 @@ mRemoteNGを終了してインストールを開始します</value>
|
||||
<value>VNC</value>
|
||||
</data>
|
||||
<data name="strVncConnectionDisconnectFailed" xml:space="preserve">
|
||||
<value>VNC disconnect failed!</value>
|
||||
<value>VNCの切断に失敗しました</value>
|
||||
</data>
|
||||
<data name="strVncConnectionOpenFailed" xml:space="preserve">
|
||||
<value>Opening connection failed!</value>
|
||||
<value>接続に失敗しました</value>
|
||||
</data>
|
||||
<data name="strVncRefreshFailed" xml:space="preserve">
|
||||
<value>VNC Refresh Screen Failed!</value>
|
||||
<value>VNCのスクリーンの更新に失敗しました</value>
|
||||
</data>
|
||||
<data name="strVncSendSpecialKeysFailed" xml:space="preserve">
|
||||
<value>VNC SendSpecialKeys failed!</value>
|
||||
@@ -2382,7 +2389,7 @@ mRemoteNGを終了してインストールを開始します</value>
|
||||
<value>VNC Toggle ViewOnly Failed!</value>
|
||||
</data>
|
||||
<data name="strWarnIfAuthFails" xml:space="preserve">
|
||||
<value>Warn me if authentication fails</value>
|
||||
<value>認証に失敗した場合は警告する</value>
|
||||
</data>
|
||||
<data name="strWarnings" xml:space="preserve">
|
||||
<value>警告</value>
|
||||
|
||||
@@ -105,17 +105,17 @@
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="strAbout" xml:space="preserve">
|
||||
<value>About</value>
|
||||
@@ -2378,4 +2378,7 @@ mRemoteNG will now quit and begin with the installation.</value>
|
||||
<data name="strYes" xml:space="preserve">
|
||||
<value>Yes</value>
|
||||
</data>
|
||||
<data name="strMenuReconnectAll" xml:space="preserve">
|
||||
<value>Reconnect All Open Connections</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -59,7 +59,7 @@
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
@@ -105,17 +105,17 @@
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="strAbout" xml:space="preserve">
|
||||
<value>О программе</value>
|
||||
@@ -2199,4 +2199,7 @@ mRemoteNG сейчас прекратит работу и начнет проц
|
||||
<data name="strYes" xml:space="preserve">
|
||||
<value>Да</value>
|
||||
</data>
|
||||
<data name="strMenuReconnectAll" xml:space="preserve">
|
||||
<value>Переподключить все открытые соединения</value>
|
||||
</data>
|
||||
</root>
|
||||
10
mRemoteV1/Security/BlockCipherEngines.cs
Normal file
10
mRemoteV1/Security/BlockCipherEngines.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
namespace mRemoteNG.Security
|
||||
{
|
||||
public enum BlockCipherEngines
|
||||
{
|
||||
AES,
|
||||
Twofish,
|
||||
Serpent
|
||||
}
|
||||
}
|
||||
10
mRemoteV1/Security/BlockCipherModes.cs
Normal file
10
mRemoteV1/Security/BlockCipherModes.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
namespace mRemoteNG.Security
|
||||
{
|
||||
public enum BlockCipherModes
|
||||
{
|
||||
GCM,
|
||||
CCM,
|
||||
EAX
|
||||
}
|
||||
}
|
||||
53
mRemoteV1/Security/CryptographyProviderFactory.cs
Normal file
53
mRemoteV1/Security/CryptographyProviderFactory.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using Org.BouncyCastle.Crypto.Engines;
|
||||
using Org.BouncyCastle.Crypto.Modes;
|
||||
|
||||
namespace mRemoteNG.Security
|
||||
{
|
||||
public class CryptographyProviderFactory
|
||||
{
|
||||
public ICryptographyProvider CreateAeadCryptographyProvider(BlockCipherEngines engine, BlockCipherModes mode)
|
||||
{
|
||||
var cipherEngine = ChooseBlockCipherEngine(engine);
|
||||
var cipher = ChooseBlockCipherMode(mode, cipherEngine);
|
||||
return new AeadCryptographyProvider(cipher);
|
||||
}
|
||||
|
||||
public ICryptographyProvider CreateLegacyRijndaelCryptographyProvider()
|
||||
{
|
||||
return new LegacyRijndaelCryptographyProvider();
|
||||
}
|
||||
|
||||
private IBlockCipher ChooseBlockCipherEngine(BlockCipherEngines engine)
|
||||
{
|
||||
switch (engine)
|
||||
{
|
||||
case BlockCipherEngines.AES:
|
||||
return new AesEngine();
|
||||
case BlockCipherEngines.Twofish:
|
||||
return new TwofishEngine();
|
||||
case BlockCipherEngines.Serpent:
|
||||
return new SerpentEngine();
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(engine), engine, null);
|
||||
}
|
||||
}
|
||||
|
||||
private IAeadBlockCipher ChooseBlockCipherMode(BlockCipherModes mode, IBlockCipher blockCipher)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case BlockCipherModes.GCM:
|
||||
return new GcmBlockCipher(blockCipher);
|
||||
case BlockCipherModes.CCM:
|
||||
return new CcmBlockCipher(blockCipher);
|
||||
case BlockCipherModes.EAX:
|
||||
return new EaxBlockCipher(blockCipher);
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
54
mRemoteV1/Security/EncryptedSecureString.cs
Normal file
54
mRemoteV1/Security/EncryptedSecureString.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using Org.BouncyCastle.Security;
|
||||
|
||||
namespace mRemoteNG.Security
|
||||
{
|
||||
public class EncryptedSecureString
|
||||
{
|
||||
private static SecureString _machineKey;
|
||||
private SecureString _secureString;
|
||||
private readonly ICryptographyProvider _cryptographyProvider;
|
||||
|
||||
private static SecureString MachineKey => _machineKey ?? (_machineKey = GenerateNewMachineKey(32));
|
||||
|
||||
public EncryptedSecureString()
|
||||
{
|
||||
_secureString = new SecureString();
|
||||
_cryptographyProvider = new AeadCryptographyProvider();
|
||||
}
|
||||
|
||||
public EncryptedSecureString(ICryptographyProvider cryptographyProvider)
|
||||
{
|
||||
_secureString = new SecureString();
|
||||
_cryptographyProvider = cryptographyProvider;
|
||||
}
|
||||
|
||||
public string GetClearTextValue()
|
||||
{
|
||||
var encryptedText = _secureString.ConvertToUnsecureString();
|
||||
var clearText = _cryptographyProvider.Decrypt(encryptedText, MachineKey);
|
||||
return clearText;
|
||||
}
|
||||
|
||||
public void SetValue(string value)
|
||||
{
|
||||
var cipherText = _cryptographyProvider.Encrypt(value, MachineKey);
|
||||
_secureString = cipherText.ConvertToSecureString();
|
||||
}
|
||||
|
||||
private static SecureString GenerateNewMachineKey(int keySize)
|
||||
{
|
||||
var random = new SecureRandom();
|
||||
random.SetSeed(random.GenerateSeed(128));
|
||||
|
||||
var machineKeyString = "";
|
||||
for (var x = 0; x < keySize; x++)
|
||||
{
|
||||
machineKeyString += (char)random.Next(33, 126);
|
||||
}
|
||||
|
||||
return machineKeyString.ConvertToSecureString();
|
||||
}
|
||||
}
|
||||
}
|
||||
15
mRemoteV1/Security/ICryptographyProvider.cs
Normal file
15
mRemoteV1/Security/ICryptographyProvider.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Security;
|
||||
|
||||
namespace mRemoteNG.Security
|
||||
{
|
||||
public interface ICryptographyProvider
|
||||
{
|
||||
int BlockSizeInBytes { get; }
|
||||
|
||||
string CipherEngine { get; }
|
||||
|
||||
string Encrypt(string plainText, SecureString encryptionKey);
|
||||
|
||||
string Decrypt(string cipherText, SecureString decryptionKey);
|
||||
}
|
||||
}
|
||||
64
mRemoteV1/Security/SecureStringExtensions.cs
Normal file
64
mRemoteV1/Security/SecureStringExtensions.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace mRemoteNG.Security
|
||||
{
|
||||
public static class SecureStringExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Method to marshall a SecureString out of protected memory into a standard String object that is required by most other functions.
|
||||
/// Code initially taken from Fabio Pintos
|
||||
/// Source: https://blogs.msdn.microsoft.com/fpintos/2009/06/12/how-to-properly-convert-securestring-to-string/
|
||||
/// </summary>
|
||||
/// <param name="securePassword"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertToUnsecureString(this SecureString securePassword)
|
||||
{
|
||||
if (securePassword == null)
|
||||
throw new ArgumentNullException(nameof(securePassword));
|
||||
|
||||
var unmanagedString = IntPtr.Zero;
|
||||
try
|
||||
{
|
||||
unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(securePassword);
|
||||
return Marshal.PtrToStringUni(unmanagedString);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.ZeroFreeGlobalAllocUnicode(unmanagedString);
|
||||
}
|
||||
}
|
||||
|
||||
public static string ConvertToEncryptedString(this SecureString secureString)
|
||||
{
|
||||
return "TEST ENCRYPTION";
|
||||
}
|
||||
|
||||
public static SecureString ConvertFromEncryptedString(this SecureString secureString, string encryptedString)
|
||||
{
|
||||
var unencryptedString = encryptedString;
|
||||
return unencryptedString.ConvertToSecureString();
|
||||
}
|
||||
|
||||
public static SecureString ConvertToSecureString(this string unsecuredPassword)
|
||||
{
|
||||
if (unsecuredPassword == null)
|
||||
throw new ArgumentNullException(nameof(unsecuredPassword));
|
||||
|
||||
var secureString = new SecureString();
|
||||
foreach (var character in unsecuredPassword.ToCharArray())
|
||||
secureString.AppendChar(character);
|
||||
// ReSharper disable once RedundantAssignment
|
||||
unsecuredPassword = null;
|
||||
return secureString;
|
||||
}
|
||||
|
||||
public static bool IsBase64String(this string s)
|
||||
{
|
||||
s = s.Trim();
|
||||
return (s.Length % 4 == 0) && Regex.IsMatch(s, @"^[a-zA-Z0-9\+/]*={0,3}$", RegexOptions.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.My;
|
||||
|
||||
|
||||
namespace mRemoteNG.Security
|
||||
{
|
||||
public class Crypt
|
||||
{
|
||||
public static string Encrypt(string StrToEncrypt, string StrSecret)
|
||||
{
|
||||
if (StrToEncrypt == "" || StrSecret == "")
|
||||
{
|
||||
return StrToEncrypt;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
RijndaelManaged rd = new RijndaelManaged();
|
||||
|
||||
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
|
||||
byte[] key = md5.ComputeHash(Encoding.UTF8.GetBytes(StrSecret));
|
||||
|
||||
md5.Clear();
|
||||
rd.Key = key;
|
||||
rd.GenerateIV();
|
||||
|
||||
byte[] iv = rd.IV;
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
||||
ms.Write(iv, 0, iv.Length);
|
||||
|
||||
CryptoStream cs = new CryptoStream(ms, rd.CreateEncryptor(), CryptoStreamMode.Write);
|
||||
byte[] data = System.Text.Encoding.UTF8.GetBytes(StrToEncrypt);
|
||||
|
||||
cs.Write(data, 0, data.Length);
|
||||
cs.FlushFinalBlock();
|
||||
|
||||
byte[] encdata = ms.ToArray();
|
||||
cs.Close();
|
||||
rd.Clear();
|
||||
|
||||
return Convert.ToBase64String(encdata);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, string.Format(Language.strErrorEncryptionFailed, ex.Message));
|
||||
}
|
||||
|
||||
return StrToEncrypt;
|
||||
}
|
||||
|
||||
public static string Decrypt(string ciphertextBase64, string password)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ciphertextBase64) || string.IsNullOrEmpty(password))
|
||||
{
|
||||
return ciphertextBase64;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string plaintext = "";
|
||||
|
||||
using (RijndaelManaged rijndaelManaged = new RijndaelManaged())
|
||||
{
|
||||
using (MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider())
|
||||
{
|
||||
byte[] key = md5.ComputeHash(Encoding.UTF8.GetBytes(password));
|
||||
rijndaelManaged.Key = key;
|
||||
}
|
||||
|
||||
|
||||
byte[] ciphertext = Convert.FromBase64String(ciphertextBase64);
|
||||
|
||||
using (MemoryStream memoryStream = new MemoryStream(ciphertext))
|
||||
{
|
||||
const int ivLength = 16;
|
||||
byte[] iv = new byte[ivLength - 1 + 1];
|
||||
memoryStream.Read(iv, 0, ivLength);
|
||||
rijndaelManaged.IV = iv;
|
||||
|
||||
using (CryptoStream cryptoStream = new CryptoStream(memoryStream, rijndaelManaged.CreateDecryptor(), CryptoStreamMode.Read))
|
||||
{
|
||||
using (StreamReader streamReader = new StreamReader(cryptoStream, System.Text.Encoding.UTF8, true))
|
||||
{
|
||||
plaintext = streamReader.ReadToEnd();
|
||||
}
|
||||
|
||||
rijndaelManaged.Clear();
|
||||
} // cryptoStream
|
||||
|
||||
} // memoryStream
|
||||
|
||||
} // rijndaelManaged
|
||||
|
||||
|
||||
return plaintext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Ignore CryptographicException "Padding is invalid and cannot be removed." when password is incorrect.
|
||||
if (!(ex is CryptographicException))
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, string.Format(Language.strErrorDecryptionFailed, ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
return ciphertextBase64;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
* Initial work:
|
||||
* This work (Modern Encryption of a String C#, by James Tuley),
|
||||
* identified by James Tuley, is free of known copyright restrictions.
|
||||
* https://gist.github.com/4336842
|
||||
* http://creativecommons.org/publicdomain/mark/1.0/
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using Org.BouncyCastle.Crypto.Engines;
|
||||
using Org.BouncyCastle.Crypto.Generators;
|
||||
using Org.BouncyCastle.Crypto.Modes;
|
||||
using Org.BouncyCastle.Crypto.Parameters;
|
||||
using Org.BouncyCastle.Security;
|
||||
|
||||
namespace mRemoteNG.Security.SymmetricEncryption
|
||||
{
|
||||
public class AeadCryptographyProvider : ICryptographyProvider
|
||||
{
|
||||
private readonly IAeadBlockCipher _aeadBlockCipher;
|
||||
private readonly Encoding _encoding;
|
||||
private readonly SecureRandom _random = new SecureRandom();
|
||||
|
||||
//Preconfigured Encryption Parameters
|
||||
private readonly int NonceBitSize = 128;
|
||||
private readonly int MacBitSize = 128;
|
||||
private readonly int KeyBitSize = 256;
|
||||
|
||||
//Preconfigured Password Key Derivation Parameters
|
||||
private readonly int SaltBitSize = 128;
|
||||
private readonly int Iterations = 10000;
|
||||
private readonly int MinPasswordLength = 12;
|
||||
|
||||
public int BlockSizeInBytes => _aeadBlockCipher.GetBlockSize();
|
||||
|
||||
public string CipherEngine => _aeadBlockCipher.AlgorithmName;
|
||||
|
||||
public AeadCryptographyProvider()
|
||||
{
|
||||
_aeadBlockCipher = new GcmBlockCipher(new AesEngine());
|
||||
_encoding = Encoding.UTF8;
|
||||
}
|
||||
|
||||
public AeadCryptographyProvider(Encoding encoding)
|
||||
{
|
||||
_aeadBlockCipher = new GcmBlockCipher(new AesEngine());
|
||||
_encoding = encoding;
|
||||
}
|
||||
|
||||
public AeadCryptographyProvider(IAeadBlockCipher aeadBlockCipher)
|
||||
{
|
||||
_aeadBlockCipher = aeadBlockCipher;
|
||||
_encoding = Encoding.UTF8;
|
||||
}
|
||||
|
||||
public AeadCryptographyProvider(IAeadBlockCipher aeadBlockCipher, Encoding encoding)
|
||||
{
|
||||
_aeadBlockCipher = aeadBlockCipher;
|
||||
_encoding = encoding;
|
||||
}
|
||||
|
||||
|
||||
public string Encrypt(string plainText, SecureString encryptionKey)
|
||||
{
|
||||
var encryptedText = SimpleEncryptWithPassword(plainText, encryptionKey.ConvertToUnsecureString());
|
||||
return encryptedText;
|
||||
}
|
||||
|
||||
private string SimpleEncryptWithPassword(string secretMessage, string password, byte[] nonSecretPayload = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(secretMessage))
|
||||
throw new ArgumentException(@"Secret Message Required!", nameof(secretMessage));
|
||||
|
||||
var plainText = _encoding.GetBytes(secretMessage);
|
||||
var cipherText = SimpleEncryptWithPassword(plainText, password, nonSecretPayload);
|
||||
return Convert.ToBase64String(cipherText);
|
||||
}
|
||||
|
||||
private byte[] SimpleEncryptWithPassword(byte[] secretMessage, string password, byte[] nonSecretPayload = null)
|
||||
{
|
||||
nonSecretPayload = nonSecretPayload ?? new byte[] { };
|
||||
|
||||
//User Error Checks
|
||||
if (string.IsNullOrWhiteSpace(password) || password.Length < MinPasswordLength)
|
||||
throw new ArgumentException($"Must have a password of at least {MinPasswordLength} characters!", nameof(password));
|
||||
|
||||
if (secretMessage == null || secretMessage.Length == 0)
|
||||
throw new ArgumentException(@"Secret Message Required!", nameof(secretMessage));
|
||||
|
||||
var generator = new Pkcs5S2ParametersGenerator();
|
||||
|
||||
//Use Random Salt to minimize pre-generated weak password attacks.
|
||||
var salt = new byte[SaltBitSize / 8];
|
||||
_random.NextBytes(salt);
|
||||
|
||||
generator.Init(
|
||||
PbeParametersGenerator.Pkcs5PasswordToBytes(password.ToCharArray()),
|
||||
salt,
|
||||
Iterations);
|
||||
|
||||
//Generate Key
|
||||
var key = (KeyParameter)generator.GenerateDerivedMacParameters(KeyBitSize);
|
||||
|
||||
//Create Full Non Secret Payload
|
||||
var payload = new byte[salt.Length + nonSecretPayload.Length];
|
||||
Array.Copy(nonSecretPayload, payload, nonSecretPayload.Length);
|
||||
Array.Copy(salt, 0, payload, nonSecretPayload.Length, salt.Length);
|
||||
|
||||
return SimpleEncrypt(secretMessage, key.GetKey(), payload);
|
||||
}
|
||||
|
||||
private byte[] SimpleEncrypt(byte[] secretMessage, byte[] key, byte[] nonSecretPayload = null)
|
||||
{
|
||||
//User Error Checks
|
||||
if (key == null || key.Length != KeyBitSize / 8)
|
||||
throw new ArgumentException($"Key needs to be {KeyBitSize} bit!", nameof(key));
|
||||
|
||||
if (secretMessage == null || secretMessage.Length == 0)
|
||||
throw new ArgumentException(@"Secret Message Required!", nameof(secretMessage));
|
||||
|
||||
//Non-secret Payload Optional
|
||||
nonSecretPayload = nonSecretPayload ?? new byte[] { };
|
||||
|
||||
//Using random nonce large enough not to repeat
|
||||
var nonce = new byte[NonceBitSize / 8];
|
||||
_random.NextBytes(nonce, 0, nonce.Length);
|
||||
|
||||
var parameters = new AeadParameters(new KeyParameter(key), MacBitSize, nonce, nonSecretPayload);
|
||||
_aeadBlockCipher.Init(true, parameters);
|
||||
|
||||
//Generate Cipher Text With Auth Tag
|
||||
var cipherText = new byte[_aeadBlockCipher.GetOutputSize(secretMessage.Length)];
|
||||
var len = _aeadBlockCipher.ProcessBytes(secretMessage, 0, secretMessage.Length, cipherText, 0);
|
||||
_aeadBlockCipher.DoFinal(cipherText, len);
|
||||
|
||||
//Assemble Message
|
||||
using (var combinedStream = new MemoryStream())
|
||||
{
|
||||
using (var binaryWriter = new BinaryWriter(combinedStream))
|
||||
{
|
||||
//Prepend Authenticated Payload
|
||||
binaryWriter.Write(nonSecretPayload);
|
||||
//Prepend Nonce
|
||||
binaryWriter.Write(nonce);
|
||||
//Write Cipher Text
|
||||
binaryWriter.Write(cipherText);
|
||||
}
|
||||
return combinedStream.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string Decrypt(string cipherText, SecureString decryptionKey)
|
||||
{
|
||||
var decryptedText = SimpleDecryptWithPassword(cipherText, decryptionKey);
|
||||
return decryptedText;
|
||||
}
|
||||
|
||||
private string SimpleDecryptWithPassword(string encryptedMessage, SecureString decryptionKey, int nonSecretPayloadLength = 0)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(encryptedMessage))
|
||||
throw new ArgumentException(@"Encrypted Message Required!", nameof(encryptedMessage));
|
||||
|
||||
var cipherText = Convert.FromBase64String(encryptedMessage);
|
||||
var plainText = SimpleDecryptWithPassword(cipherText, decryptionKey.ConvertToUnsecureString(), nonSecretPayloadLength);
|
||||
return plainText == null ? null : _encoding.GetString(plainText);
|
||||
}
|
||||
|
||||
private byte[] SimpleDecryptWithPassword(byte[] encryptedMessage, string password, int nonSecretPayloadLength = 0)
|
||||
{
|
||||
//User Error Checks
|
||||
if (string.IsNullOrWhiteSpace(password) || password.Length < MinPasswordLength)
|
||||
throw new ArgumentException($"Must have a password of at least {MinPasswordLength} characters!", nameof(password));
|
||||
|
||||
if (encryptedMessage == null || encryptedMessage.Length == 0)
|
||||
throw new ArgumentException(@"Encrypted Message Required!", nameof(encryptedMessage));
|
||||
|
||||
var generator = new Pkcs5S2ParametersGenerator();
|
||||
|
||||
//Grab Salt from Payload
|
||||
var salt = new byte[SaltBitSize / 8];
|
||||
Array.Copy(encryptedMessage, nonSecretPayloadLength, salt, 0, salt.Length);
|
||||
|
||||
generator.Init(
|
||||
PbeParametersGenerator.Pkcs5PasswordToBytes(password.ToCharArray()),
|
||||
salt,
|
||||
Iterations);
|
||||
|
||||
//Generate Key
|
||||
var key = (KeyParameter)generator.GenerateDerivedMacParameters(KeyBitSize);
|
||||
|
||||
return SimpleDecrypt(encryptedMessage, key.GetKey(), salt.Length + nonSecretPayloadLength);
|
||||
}
|
||||
|
||||
private byte[] SimpleDecrypt(byte[] encryptedMessage, byte[] key, int nonSecretPayloadLength = 0)
|
||||
{
|
||||
//User Error Checks
|
||||
if (key == null || key.Length != KeyBitSize / 8)
|
||||
throw new ArgumentException($"Key needs to be {KeyBitSize} bit!", nameof(key));
|
||||
|
||||
if (encryptedMessage == null || encryptedMessage.Length == 0)
|
||||
throw new ArgumentException(@"Encrypted Message Required!", nameof(encryptedMessage));
|
||||
|
||||
using (var cipherStream = new MemoryStream(encryptedMessage))
|
||||
using (var cipherReader = new BinaryReader(cipherStream))
|
||||
{
|
||||
//Grab Payload
|
||||
var nonSecretPayload = cipherReader.ReadBytes(nonSecretPayloadLength);
|
||||
|
||||
//Grab Nonce
|
||||
var nonce = cipherReader.ReadBytes(NonceBitSize / 8);
|
||||
|
||||
var parameters = new AeadParameters(new KeyParameter(key), MacBitSize, nonce, nonSecretPayload);
|
||||
_aeadBlockCipher.Init(false, parameters);
|
||||
|
||||
//Decrypt Cipher Text
|
||||
var cipherText = cipherReader.ReadBytes(encryptedMessage.Length - nonSecretPayloadLength - nonce.Length);
|
||||
var plainText = new byte[_aeadBlockCipher.GetOutputSize(cipherText.Length)];
|
||||
|
||||
try
|
||||
{
|
||||
var len = _aeadBlockCipher.ProcessBytes(cipherText, 0, cipherText.Length, plainText, 0);
|
||||
_aeadBlockCipher.DoFinal(plainText, len);
|
||||
}
|
||||
catch (InvalidCipherTextException)
|
||||
{
|
||||
//Return null if it doesn't authenticate
|
||||
return null;
|
||||
}
|
||||
|
||||
return plainText;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Messages;
|
||||
|
||||
namespace mRemoteNG.Security.SymmetricEncryption
|
||||
{
|
||||
public class LegacyRijndaelCryptographyProvider : ICryptographyProvider
|
||||
{
|
||||
public int BlockSizeInBytes { get; }
|
||||
|
||||
public string CipherEngine { get; }
|
||||
|
||||
public LegacyRijndaelCryptographyProvider()
|
||||
{
|
||||
CipherEngine = "Rijndael";
|
||||
BlockSizeInBytes = 16;
|
||||
}
|
||||
|
||||
|
||||
public string Encrypt(string strToEncrypt, SecureString strSecret)
|
||||
{
|
||||
if (strToEncrypt == "" || strSecret.Length == 0)
|
||||
return strToEncrypt;
|
||||
|
||||
try
|
||||
{
|
||||
var rd = new RijndaelManaged();
|
||||
|
||||
var md5 = new MD5CryptoServiceProvider();
|
||||
var key = md5.ComputeHash(Encoding.UTF8.GetBytes(strSecret.ConvertToUnsecureString()));
|
||||
|
||||
md5.Clear();
|
||||
rd.Key = key;
|
||||
rd.GenerateIV();
|
||||
|
||||
var iv = rd.IV;
|
||||
var ms = new MemoryStream();
|
||||
|
||||
ms.Write(iv, 0, iv.Length);
|
||||
|
||||
var cs = new CryptoStream(ms, rd.CreateEncryptor(), CryptoStreamMode.Write);
|
||||
var data = Encoding.UTF8.GetBytes(strToEncrypt);
|
||||
|
||||
cs.Write(data, 0, data.Length);
|
||||
cs.FlushFinalBlock();
|
||||
|
||||
var encdata = ms.ToArray();
|
||||
cs.Close();
|
||||
rd.Clear();
|
||||
|
||||
return Convert.ToBase64String(encdata);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, string.Format(Language.strErrorEncryptionFailed, ex.Message));
|
||||
}
|
||||
|
||||
return strToEncrypt;
|
||||
}
|
||||
|
||||
public string Decrypt(string ciphertextBase64, SecureString password)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ciphertextBase64) || password.Length == 0)
|
||||
return ciphertextBase64;
|
||||
|
||||
try
|
||||
{
|
||||
var plaintext = "";
|
||||
|
||||
using (var rijndaelManaged = new RijndaelManaged())
|
||||
{
|
||||
using (var md5 = new MD5CryptoServiceProvider())
|
||||
{
|
||||
var key = md5.ComputeHash(Encoding.UTF8.GetBytes(password.ConvertToUnsecureString()));
|
||||
rijndaelManaged.Key = key;
|
||||
}
|
||||
|
||||
var ciphertext = Convert.FromBase64String(ciphertextBase64);
|
||||
|
||||
using (var memoryStream = new MemoryStream(ciphertext))
|
||||
{
|
||||
var iv = new byte[BlockSizeInBytes];
|
||||
memoryStream.Read(iv, 0, iv.Length);
|
||||
rijndaelManaged.IV = iv;
|
||||
|
||||
using (var cryptoStream = new CryptoStream(memoryStream, rijndaelManaged.CreateDecryptor(), CryptoStreamMode.Read))
|
||||
using (var streamReader = new StreamReader(cryptoStream, Encoding.UTF8, true))
|
||||
{
|
||||
plaintext = streamReader.ReadToEnd();
|
||||
rijndaelManaged.Clear();
|
||||
}
|
||||
} // memoryStream
|
||||
} // rijndaelManaged
|
||||
|
||||
return plaintext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Ignore CryptographicException "Padding is invalid and cannot be removed." when password is incorrect.
|
||||
if (!(ex is CryptographicException))
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, string.Format(Language.strErrorDecryptionFailed, ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
return ciphertextBase64;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,12 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Forms;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.UI.Window;
|
||||
using static System.String;
|
||||
|
||||
@@ -58,11 +60,11 @@ namespace mRemoteNG.Tools
|
||||
|
||||
|
||||
|
||||
public static string PasswordDialog(string passwordName = null, bool verify = true)
|
||||
public static SecureString PasswordDialog(string passwordName = null, bool verify = true)
|
||||
{
|
||||
PasswordForm passwordForm = new PasswordForm(passwordName, verify);
|
||||
|
||||
return passwordForm.ShowDialog() == DialogResult.OK ? passwordForm.Password : "";
|
||||
return passwordForm.ShowDialog() == DialogResult.OK ? passwordForm.Password.ConvertToSecureString() : "".ConvertToSecureString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Config;
|
||||
using mRemoteNG.My;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
|
||||
namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
{
|
||||
@@ -76,8 +77,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
}
|
||||
|
||||
txtCredentialsUsername.Text = Convert.ToString(mRemoteNG.Settings.Default.DefaultUsername);
|
||||
txtCredentialsPassword.Text = Crypt.Decrypt(Convert.ToString(mRemoteNG.Settings.Default.DefaultPassword),
|
||||
GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
txtCredentialsPassword.Text = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.DefaultPassword), GeneralAppInfo.EncryptionKey);
|
||||
txtCredentialsDomain.Text = Convert.ToString(mRemoteNG.Settings.Default.DefaultDomain);
|
||||
|
||||
if (mRemoteNG.Settings.Default.ConfirmCloseConnection == (int) ConfirmCloseEnum.Never)
|
||||
@@ -132,7 +133,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
}
|
||||
|
||||
mRemoteNG.Settings.Default.DefaultUsername = txtCredentialsUsername.Text;
|
||||
mRemoteNG.Settings.Default.DefaultPassword = Crypt.Encrypt(txtCredentialsPassword.Text, GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
mRemoteNG.Settings.Default.DefaultPassword = cryptographyProvider.Encrypt(txtCredentialsPassword.Text, GeneralAppInfo.EncryptionKey);
|
||||
mRemoteNG.Settings.Default.DefaultDomain = txtCredentialsDomain.Text;
|
||||
|
||||
if (radCloseWarnAll.Checked)
|
||||
|
||||
@@ -4,6 +4,7 @@ using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Config.Connections;
|
||||
using mRemoteNG.My;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
|
||||
namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
{
|
||||
@@ -42,7 +43,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
txtSQLServer.Text = mRemoteNG.Settings.Default.SQLHost;
|
||||
txtSQLDatabaseName.Text = mRemoteNG.Settings.Default.SQLDatabaseName;
|
||||
txtSQLUsername.Text = mRemoteNG.Settings.Default.SQLUser;
|
||||
txtSQLPassword.Text = Crypt.Decrypt(mRemoteNG.Settings.Default.SQLPass, GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
txtSQLPassword.Text = cryptographyProvider.Decrypt(Settings.Default.SQLPass, GeneralAppInfo.EncryptionKey);
|
||||
}
|
||||
|
||||
public override void SaveSettings()
|
||||
@@ -53,7 +55,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
mRemoteNG.Settings.Default.SQLHost = txtSQLServer.Text;
|
||||
mRemoteNG.Settings.Default.SQLDatabaseName = txtSQLDatabaseName.Text;
|
||||
mRemoteNG.Settings.Default.SQLUser = txtSQLUsername.Text;
|
||||
mRemoteNG.Settings.Default.SQLPass = Crypt.Encrypt(txtSQLPassword.Text, GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
mRemoteNG.Settings.Default.SQLPass = cryptographyProvider.Encrypt(txtSQLPassword.Text, GeneralAppInfo.EncryptionKey);
|
||||
ReinitializeSqlUpdater();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using mRemoteNG.App.Info;
|
||||
using mRemoteNG.App.Update;
|
||||
using mRemoteNG.My;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.UI.TaskDialog;
|
||||
using mRemoteNG.UI.Window;
|
||||
@@ -100,8 +101,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
chkUseProxyAuthentication.Checked = Convert.ToBoolean(Settings.Default.UpdateProxyUseAuthentication);
|
||||
pnlProxyAuthentication.Enabled = Convert.ToBoolean(Settings.Default.UpdateProxyUseAuthentication);
|
||||
txtProxyUsername.Text = Convert.ToString(Settings.Default.UpdateProxyAuthUser);
|
||||
txtProxyPassword.Text = Crypt.Decrypt(Convert.ToString(Settings.Default.UpdateProxyAuthPass),
|
||||
GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
txtProxyPassword.Text = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.UpdateProxyAuthPass), GeneralAppInfo.EncryptionKey);
|
||||
|
||||
btnTestProxy.Enabled = Convert.ToBoolean(Settings.Default.UpdateUseProxy);
|
||||
|
||||
@@ -140,7 +141,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
|
||||
Settings.Default.UpdateProxyUseAuthentication = chkUseProxyAuthentication.Checked;
|
||||
Settings.Default.UpdateProxyAuthUser = txtProxyUsername.Text;
|
||||
Settings.Default.UpdateProxyAuthPass = Crypt.Encrypt(txtProxyPassword.Text, GeneralAppInfo.EncryptionKey);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
Settings.Default.UpdateProxyAuthPass = cryptographyProvider.Encrypt(txtProxyPassword.Text, GeneralAppInfo.EncryptionKey);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
43
mRemoteV1/UI/Forms/frmMain.Designer.cs
generated
43
mRemoteV1/UI/Forms/frmMain.Designer.cs
generated
@@ -89,7 +89,10 @@ namespace mRemoteNG.UI.Forms
|
||||
this.mMenFileRename.Click += new System.EventHandler(mMenFileRename_Click);
|
||||
this.mMenFileDuplicate = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mMenFileDuplicate.Click += new System.EventHandler(mMenFileDuplicate_Click);
|
||||
this.mMenFileSep4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.mMenFileSep4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.mMenReconnectAll = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mMenReconnectAll.Click += new System.EventHandler(mMenReconnectAll_Click);
|
||||
this.mMenFileSep5 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.mMenFileExit = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mMenFileExit.Click += new System.EventHandler(mMenFileExit_Click);
|
||||
this.mMenView = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -266,7 +269,7 @@ namespace mRemoteNG.UI.Forms
|
||||
//
|
||||
//mMenFile
|
||||
//
|
||||
this.mMenFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {this.mMenFileNewConnection, this.mMenFileNewFolder, this.mMenFileSep1, this.mMenFileNew, this.mMenFileLoad, this.mMenFileSave, this.mMenFileSaveAs, this.mMenFileSep2, this.mMenFileDelete, this.mMenFileRename, this.mMenFileDuplicate, this.mMenFileSep3, this.mMenFileImport, this.mMenFileExport, this.mMenFileSep4, this.mMenFileExit});
|
||||
this.mMenFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {this.mMenFileNewConnection, this.mMenFileNewFolder, this.mMenFileSep1, this.mMenFileNew, this.mMenFileLoad, this.mMenFileSave, this.mMenFileSaveAs, this.mMenFileSep2, this.mMenFileDelete, this.mMenFileRename, this.mMenFileDuplicate, this.mMenFileSep4, this.mMenReconnectAll, this.mMenFileSep3, this.mMenFileImport, this.mMenFileExport, this.mMenFileSep5, this.mMenFileExit});
|
||||
this.mMenFile.Name = "mMenFile";
|
||||
this.mMenFile.Size = new System.Drawing.Size(37, 20);
|
||||
this.mMenFile.Text = "&File";
|
||||
@@ -386,15 +389,27 @@ namespace mRemoteNG.UI.Forms
|
||||
this.mMenFileDuplicate.Name = "mMenFileDuplicate";
|
||||
this.mMenFileDuplicate.Size = new System.Drawing.Size(281, 22);
|
||||
this.mMenFileDuplicate.Text = "Duplicate";
|
||||
//
|
||||
//mMenFileSep4
|
||||
//
|
||||
this.mMenFileSep4.Name = "mMenFileSep4";
|
||||
//
|
||||
//mMenFileReconnectAll
|
||||
//
|
||||
this.mMenReconnectAll.Image = Resources.Refresh;
|
||||
this.mMenReconnectAll.Name = "mMenFileReconnectAll";
|
||||
this.mMenReconnectAll.Size = new System.Drawing.Size(281, 22);
|
||||
this.mMenReconnectAll.Text = "Reconnect All Connections";
|
||||
//
|
||||
//mMenFileSep4
|
||||
//
|
||||
this.mMenFileSep4.Name = "mMenFileSep4";
|
||||
this.mMenFileSep4.Size = new System.Drawing.Size(278, 6);
|
||||
//
|
||||
//mMenFileExit
|
||||
//
|
||||
this.mMenFileExit.Image = Resources.Quit;
|
||||
//
|
||||
//mMenFileSep5
|
||||
//
|
||||
this.mMenFileSep5.Name = "mMenFileSep5";
|
||||
this.mMenFileSep5.Size = new System.Drawing.Size(278, 6);
|
||||
//
|
||||
//mMenFileExit
|
||||
//
|
||||
this.mMenFileExit.Image = Resources.Quit;
|
||||
this.mMenFileExit.Name = "mMenFileExit";
|
||||
this.mMenFileExit.ShortcutKeys = (System.Windows.Forms.Keys) (System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4);
|
||||
this.mMenFileExit.Size = new System.Drawing.Size(281, 22);
|
||||
@@ -933,13 +948,15 @@ namespace mRemoteNG.UI.Forms
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenToolsUpdate;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenViewResetLayout;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenFileDuplicate;
|
||||
internal System.Windows.Forms.ToolStripSeparator mMenFileSep2;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenReconnectAll;
|
||||
internal System.Windows.Forms.ToolStripSeparator mMenFileSep2;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenFileNewConnection;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenFileNewFolder;
|
||||
internal System.Windows.Forms.ToolStripSeparator mMenFileSep3;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenFileDelete;
|
||||
internal System.Windows.Forms.ToolStripSeparator mMenFileSep4;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenFileDelete;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenFileRename;
|
||||
internal System.Windows.Forms.ToolStripSeparator mMenFileSep4;
|
||||
internal System.Windows.Forms.ToolStripSeparator mMenFileSep5;
|
||||
internal System.Windows.Forms.ToolStrip ToolStrip1;
|
||||
internal System.Windows.Forms.ToolStripButton ToolStripButton1;
|
||||
internal System.Windows.Forms.ToolStripButton ToolStripButton2;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Generic;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Config;
|
||||
using mRemoteNG.Config.Settings;
|
||||
@@ -457,10 +458,12 @@ namespace mRemoteNG.UI.Forms
|
||||
mMenFileDelete.Enabled = false;
|
||||
mMenFileRename.Enabled = true;
|
||||
mMenFileDuplicate.Enabled = false;
|
||||
mMenReconnectAll.Enabled = true;
|
||||
mMenFileDelete.Text = Language.strMenuDelete;
|
||||
mMenFileRename.Text = Language.strMenuRenameFolder;
|
||||
mMenFileDuplicate.Text = Language.strMenuDuplicate;
|
||||
}
|
||||
mMenReconnectAll.Text = Language.strMenuReconnectAll;
|
||||
}
|
||||
else if (ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.Container)
|
||||
{
|
||||
mMenFileNewConnection.Enabled = true;
|
||||
@@ -468,10 +471,13 @@ namespace mRemoteNG.UI.Forms
|
||||
mMenFileDelete.Enabled = true;
|
||||
mMenFileRename.Enabled = true;
|
||||
mMenFileDuplicate.Enabled = true;
|
||||
mMenFileDelete.Text = Language.strMenuDeleteFolder;
|
||||
mMenReconnectAll.Enabled = true;
|
||||
mMenFileDelete.Text = Language.strMenuDeleteFolder;
|
||||
mMenFileRename.Text = Language.strMenuRenameFolder;
|
||||
mMenFileDuplicate.Text = Language.strMenuDuplicateFolder;
|
||||
}
|
||||
mMenReconnectAll.Text = Language.strMenuReconnectAll;
|
||||
|
||||
}
|
||||
else if (ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.Connection)
|
||||
{
|
||||
mMenFileNewConnection.Enabled = true;
|
||||
@@ -479,10 +485,12 @@ namespace mRemoteNG.UI.Forms
|
||||
mMenFileDelete.Enabled = true;
|
||||
mMenFileRename.Enabled = true;
|
||||
mMenFileDuplicate.Enabled = true;
|
||||
mMenFileDelete.Text = Language.strMenuDeleteConnection;
|
||||
mMenReconnectAll.Enabled = true;
|
||||
mMenFileDelete.Text = Language.strMenuDeleteConnection;
|
||||
mMenFileRename.Text = Language.strMenuRenameConnection;
|
||||
mMenFileDuplicate.Text = Language.strMenuDuplicateConnection;
|
||||
}
|
||||
mMenReconnectAll.Text = Language.strMenuReconnectAll;
|
||||
}
|
||||
else if ((ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.PuttyRoot) || (ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.PuttySession))
|
||||
{
|
||||
mMenFileNewConnection.Enabled = false;
|
||||
@@ -490,10 +498,12 @@ namespace mRemoteNG.UI.Forms
|
||||
mMenFileDelete.Enabled = false;
|
||||
mMenFileRename.Enabled = false;
|
||||
mMenFileDuplicate.Enabled = false;
|
||||
mMenFileDelete.Text = Language.strMenuDelete;
|
||||
mMenReconnectAll.Enabled = true;
|
||||
mMenFileDelete.Text = Language.strMenuDelete;
|
||||
mMenFileRename.Text = Language.strMenuRename;
|
||||
mMenFileDuplicate.Text = Language.strMenuDuplicate;
|
||||
}
|
||||
mMenReconnectAll.Text = Language.strMenuReconnectAll;
|
||||
}
|
||||
else
|
||||
{
|
||||
mMenFileNewConnection.Enabled = true;
|
||||
@@ -501,10 +511,12 @@ namespace mRemoteNG.UI.Forms
|
||||
mMenFileDelete.Enabled = false;
|
||||
mMenFileRename.Enabled = false;
|
||||
mMenFileDuplicate.Enabled = false;
|
||||
mMenFileDelete.Text = Language.strMenuDelete;
|
||||
mMenReconnectAll.Enabled = true;
|
||||
mMenFileDelete.Text = Language.strMenuDelete;
|
||||
mMenFileRename.Text = Language.strMenuRename;
|
||||
mMenFileDuplicate.Text = Language.strMenuDuplicate;
|
||||
}
|
||||
mMenReconnectAll.Text = Language.strMenuReconnectAll;
|
||||
}
|
||||
}
|
||||
|
||||
private static void mMenFileNewConnection_Click(object sender, EventArgs e)
|
||||
@@ -522,7 +534,7 @@ namespace mRemoteNG.UI.Forms
|
||||
private static void mMenFileNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
var saveFileDialog = Tools.Controls.ConnectionsSaveAsDialog();
|
||||
if (!(saveFileDialog.ShowDialog() == DialogResult.OK))
|
||||
if (saveFileDialog.ShowDialog() != DialogResult.OK)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
@@ -576,6 +588,36 @@ namespace mRemoteNG.UI.Forms
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
private static void mMenReconnectAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Runtime.WindowList == null || Runtime.WindowList.Count == 0) return;
|
||||
foreach (BaseWindow window in Runtime.WindowList)
|
||||
{
|
||||
var connectionWindow = window as ConnectionWindow;
|
||||
if (connectionWindow == null)
|
||||
return;
|
||||
|
||||
var ICList = new List<InterfaceControl>();
|
||||
foreach (Crownwood.Magic.Controls.TabPage tab in connectionWindow.TabController.TabPages)
|
||||
{
|
||||
var tag = tab.Tag as InterfaceControl;
|
||||
if (tag != null)
|
||||
{
|
||||
ICList.Add(tag);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var i in ICList)
|
||||
{
|
||||
i.Protocol.Close();
|
||||
Runtime.OpenConnection(i.Info, ConnectionInfo.Force.DoNotJump);
|
||||
}
|
||||
|
||||
// throw it on the garbage collector
|
||||
ICList = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void mMenFileImportFromFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
Import.ImportFromFile(Windows.treeForm.tvConnections.Nodes[0], Windows.treeForm.tvConnections.SelectedNode);
|
||||
@@ -1091,17 +1133,12 @@ namespace mRemoteNG.UI.Forms
|
||||
|
||||
private void ActivateConnection()
|
||||
{
|
||||
if (pnlDock.ActiveDocument is ConnectionWindow)
|
||||
{
|
||||
var cW = (ConnectionWindow) pnlDock.ActiveDocument;
|
||||
if (cW.TabController.SelectedTab != null)
|
||||
{
|
||||
var tab = cW.TabController.SelectedTab;
|
||||
var ifc = (InterfaceControl)tab.Tag;
|
||||
ifc.Protocol.Focus();
|
||||
((ConnectionWindow) ifc.FindForm()).RefreshIC();
|
||||
}
|
||||
}
|
||||
var w = pnlDock.ActiveDocument as ConnectionWindow;
|
||||
if (w?.TabController.SelectedTab == null) return;
|
||||
var tab = w.TabController.SelectedTab;
|
||||
var ifc = (InterfaceControl)tab.Tag;
|
||||
ifc.Protocol.Focus();
|
||||
((ConnectionWindow) ifc.FindForm())?.RefreshIC();
|
||||
}
|
||||
|
||||
private void pnlDock_ActiveDocumentChanged(object sender, EventArgs e)
|
||||
@@ -1160,7 +1197,7 @@ namespace mRemoteNG.UI.Forms
|
||||
|
||||
public void ShowHidePanelTabs(DockContent closingDocument = null)
|
||||
{
|
||||
var newDocumentStyle = pnlDock.DocumentStyle;
|
||||
DocumentStyle newDocumentStyle;
|
||||
|
||||
if (Settings.Default.AlwaysShowPanelTabs)
|
||||
{
|
||||
@@ -1169,22 +1206,16 @@ namespace mRemoteNG.UI.Forms
|
||||
else
|
||||
{
|
||||
var nonConnectionPanelCount = 0;
|
||||
foreach (DockContent document in pnlDock.Documents)
|
||||
foreach (var dockContent in pnlDock.Documents)
|
||||
{
|
||||
if ((closingDocument == null || document != closingDocument) && !(document is ConnectionWindow))
|
||||
var document = (DockContent) dockContent;
|
||||
if ((closingDocument == null || document != closingDocument) && !(document is ConnectionWindow))
|
||||
{
|
||||
nonConnectionPanelCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nonConnectionPanelCount == 0)
|
||||
{
|
||||
newDocumentStyle = DocumentStyle.DockingSdi; // Hide the panel tabs
|
||||
}
|
||||
else
|
||||
{
|
||||
newDocumentStyle = DocumentStyle.DockingWindow; // Show the panel tabs
|
||||
}
|
||||
|
||||
newDocumentStyle = nonConnectionPanelCount == 0 ? DocumentStyle.DockingSdi : DocumentStyle.DockingWindow;
|
||||
}
|
||||
|
||||
if (pnlDock.DocumentStyle != newDocumentStyle)
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.UI.Controls.FilteredPropertyGrid;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
|
||||
@@ -775,10 +776,10 @@ namespace mRemoteNG.UI.Window
|
||||
passwordName = Path.GetFileName(Runtime.GetStartupConnectionFileName());
|
||||
|
||||
var password = MiscTools.PasswordDialog(passwordName);
|
||||
if (string.IsNullOrEmpty(password))
|
||||
if (password.Length == 0)
|
||||
rootInfo.Password = false;
|
||||
else
|
||||
rootInfo.PasswordString = password;
|
||||
rootInfo.PasswordString = password.ConvertToUnsecureString();
|
||||
}
|
||||
break;
|
||||
case "Name":
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace mRemoteNG.UI.Window
|
||||
Controls.Add(TabController);
|
||||
Font = new Font("Segoe UI", 8.25F, FontStyle.Regular, GraphicsUnit.Point, Convert.ToByte(0));
|
||||
Icon = Resources.mRemote_Icon;
|
||||
Name = $"Connection";
|
||||
Name = "Connection";
|
||||
TabText = @"UI.Window.Connection";
|
||||
Text = @"UI.Window.Connection";
|
||||
cmenTab.ResumeLayout(false);
|
||||
|
||||
@@ -46,12 +46,16 @@
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Geckofx-Core, Version=45.0.19.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=x86">
|
||||
<HintPath>..\packages\Geckofx45.45.0.19.0\lib\net40\Geckofx-Core.dll</HintPath>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
|
||||
<HintPath>..\packages\BouncyCastle.1.8.1\lib\BouncyCastle.Crypto.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Geckofx-Winforms, Version=45.0.19.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Geckofx45.45.0.19.0\lib\net40\Geckofx-Winforms.dll</HintPath>
|
||||
<Reference Include="Geckofx-Core, Version=45.0.20.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=x86">
|
||||
<HintPath>..\packages\Geckofx45.45.0.20\lib\net40\Geckofx-Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Geckofx-Winforms, Version=45.0.20.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Geckofx45.45.0.20\lib\net40\Geckofx-Winforms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
@@ -93,12 +97,13 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>References\VncSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=2.5.0.15095, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>References\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
|
||||
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=2.9.0.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DockPanelSuite.2.10.0\lib\net40\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="WeifenLuo.WinFormsUI.Docking.ThemeVS2012Light">
|
||||
<HintPath>References\WeifenLuo.WinFormsUI.Docking.ThemeVS2012Light.dll</HintPath>
|
||||
<Reference Include="WeifenLuo.WinFormsUI.Docking.ThemeVS2012Light, Version=2.9.0.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DockPanelSuite.ThemeVS2012Light.2.10.0\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2012Light.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
@@ -129,10 +134,12 @@
|
||||
<Compile Include="Config\Connections\ConnectionsLoader.cs" />
|
||||
<Compile Include="Config\Connections\ConnectionsSaver.cs" />
|
||||
<Compile Include="Config\Connections\SqlCommandBuilder.cs" />
|
||||
<Compile Include="Config\Connections\SqlConnectionsLoader.cs" />
|
||||
<Compile Include="Config\Connections\SqlConnectionsUpdateChecker.cs" />
|
||||
<Compile Include="Config\Connections\SqlConnectionsProvider.cs" />
|
||||
<Compile Include="Config\Connections\SqlUpdateQueryBuilder.cs" />
|
||||
<Compile Include="Config\Connections\SqlUpdateTimer.cs" />
|
||||
<Compile Include="Config\Connections\XmlConnectionsLoader.cs" />
|
||||
<Compile Include="Config\Settings\ExternalAppsLoader.cs" />
|
||||
<Compile Include="Config\Settings\LayoutSettingsLoader.cs" />
|
||||
<Compile Include="Config\Settings\Providers\AppSettingsProvider.cs" />
|
||||
@@ -163,6 +170,14 @@
|
||||
<Compile Include="Connection\Protocol\RDP\RDPVersions.cs" />
|
||||
<Compile Include="Connection\Protocol\VNC\VNCEnum.cs" />
|
||||
<Compile Include="Messages\MessageClassEnum.cs" />
|
||||
<Compile Include="Security\BlockCipherEngines.cs" />
|
||||
<Compile Include="Security\BlockCipherModes.cs" />
|
||||
<Compile Include="Security\EncryptedSecureString.cs" />
|
||||
<Compile Include="Security\SymmetricEncryption\AeadCryptographyProvider.cs" />
|
||||
<Compile Include="Security\SymmetricEncryption\LegacyRijndaelCryptographyProvider.cs" />
|
||||
<Compile Include="Security\ICryptographyProvider.cs" />
|
||||
<Compile Include="Security\SecureStringExtensions.cs" />
|
||||
<Compile Include="Security\CryptographyProviderFactory.cs" />
|
||||
<Compile Include="Tools\ArgumentParser.cs" />
|
||||
<Compile Include="Tools\CmdArgumentsInterpreter.cs" />
|
||||
<Compile Include="Tools\ExternalToolsTypeConverter.cs" />
|
||||
@@ -335,7 +350,6 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Tree\Root\RootNodeInfo.cs" />
|
||||
<Compile Include="Security\Security.Crypt.cs" />
|
||||
<Compile Include="Security\Security.Impersonator.cs" />
|
||||
<Compile Include="Security\Security.Save.cs" />
|
||||
<Compile Include="Tools\IeBrowserEmulation.cs" />
|
||||
@@ -1273,14 +1287,14 @@ IF %25buildenv: =%25==ReleasePortable ("$(SolutionDir)Tools\build-relport.cmd")<
|
||||
</Target>
|
||||
-->
|
||||
<Import Project="$(MSBuildBinPath)/Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\Geckofx45.45.0.19.0\build\Geckofx45.targets" Condition="Exists('..\packages\Geckofx45.45.0.19.0\build\Geckofx45.targets')" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>echo $(ConfigurationName) > buildenv.tmp</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\packages\Geckofx45.45.0.20\build\Geckofx45.targets" Condition="Exists('..\packages\Geckofx45.45.0.20\build\Geckofx45.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Geckofx45.45.0.19.0\build\Geckofx45.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Geckofx45.45.0.19.0\build\Geckofx45.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Geckofx45.45.0.20\build\Geckofx45.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Geckofx45.45.0.20\build\Geckofx45.targets'))" />
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>echo $(ConfigurationName) > buildenv.tmp</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Geckofx45" version="45.0.19.0" targetFramework="net40" />
|
||||
<package id="BouncyCastle" version="1.8.1" targetFramework="net40" />
|
||||
<package id="DockPanelSuite" version="2.10.0" targetFramework="net40" />
|
||||
<package id="DockPanelSuite.ThemeVS2012Light" version="2.10.0" targetFramework="net40" />
|
||||
<package id="Geckofx45" version="45.0.20" targetFramework="net40" />
|
||||
</packages>
|
||||
986
packages/NUnit.3.2.0/CHANGES.txt
vendored
986
packages/NUnit.3.2.0/CHANGES.txt
vendored
@@ -1,986 +0,0 @@
|
||||
NUnit 3.2 - March 5, 2016
|
||||
|
||||
Framework
|
||||
|
||||
* Added an Order attribute that defines the order in which tests are run
|
||||
* Added Assert.ThrowsAsync for testing if async methods throw an exception
|
||||
* You can now compare unlike collections using Is.EquivalentTo().Using(...)
|
||||
* Added the ability to add custom message formatters to MsgUtils
|
||||
* TestCaseSourceAttribute now optionally takes an array of parameters that can be passed to the source method
|
||||
* Added Is.Zero and Is.Not.Zero to the fluent syntax as a shorter option for Is.EqualTo(0) and Is.Not.EqualTo(0)
|
||||
|
||||
Engine
|
||||
|
||||
* Engine extensions can be installed via NuGet packages
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 170 Test Order Attribute
|
||||
* 300 Create an NUnit Visual Studio Template
|
||||
* 464 Async delegate assertions
|
||||
* 532 Batch runner for Silverlight tests
|
||||
* 533 Separate NUnitLite runner and autorunner
|
||||
* 681 NUnit agent cannot resolve test dependency assemblies when mixed mode initialization runs in the default AppDomain
|
||||
* 793 Replace CoreEngine by use of Extensions
|
||||
* 907 Console report tests are too fragile
|
||||
* 922 Wrap Console in NUnitLite
|
||||
* 930 Switch from MSBuild based build system to Cake
|
||||
* 981 Define NUnit Versioning for post-3.0 Development
|
||||
* 1004 Poor formatting of results for Assert.AreEqual(DateTimeOffset, DateTimeOffset)
|
||||
* 1018 ArgumentException when 2.x version of NUnit Framework is in the bin directory
|
||||
* 1022 Support Comparing Unlike Collections using Is.EquivalentTo().Using(...)
|
||||
* 1044 Re-order Test Summary Errors/Failures
|
||||
* 1066 ApartmentAttribute and TestCaseAttribute(s) do not work together
|
||||
* 1103 Can't use TestCaseData from base class
|
||||
* 1109 NullReferenceException when using inherited property for ValueSource
|
||||
* 1113 Console runner and xml output consistency
|
||||
* 1117 Fix misbehaviour of Throws.Exception with non-void returning functions
|
||||
* 1120 NUnitProject should parse .nunit project files containing Xml Declarations
|
||||
* 1121 Usage of field set to null as value source leads to somewhat cryptic error
|
||||
* 1122 Region may be disposed before test delegate is executed
|
||||
* 1133 Provide a way to install extensions as nuget packages
|
||||
* 1136 Don't allow V2 framework to update in V2 driver tests
|
||||
* 1171 A bug when using Assert.That() with Is.Not.Empty
|
||||
* 1185 Engine finds .NET 4.0 Client Profile twice
|
||||
* 1187 ITestAssemblyRunner.StopRun as implemented by NUnitTestAssemblyRunner
|
||||
* 1195 name attribute in test-suite and test-results element of output xml is different to nunit 2.6.4 using nunit2-format
|
||||
* 1196 Custom value formatter for v3 via MsgUtils
|
||||
* 1210 Available runtimes issues
|
||||
* 1230 Add ability for testcasedatasource to have parameters passed to methods
|
||||
* 1233 Add TestAssemblyRunner tests to both portable and silverlight builds
|
||||
* 1234 Have default NUnitLite Runner Program.cs return exit code
|
||||
* 1236 Make Appveyor NuGet feed more useable
|
||||
* 1246 Introduce Is.Zero syntax to test for zero
|
||||
* 1252 Exception thrown when any assembly is not found
|
||||
* 1261 TypeHelper.GetDisplayName generates the wrong name for generic types with nested classes
|
||||
* 1278 Fix optional parameters in TestCaseAttribute
|
||||
* 1282 TestCase using Params Behaves Oddly
|
||||
* 1283 Engine should expose available frameworks.
|
||||
* 1286 value of the time attribute in nunit2 outputs depends on the machine culture
|
||||
* 1297 NUnit.Engine nuget package improvements
|
||||
* 1301 Assert.AreNotSame evaluates ToString unnecessarily
|
||||
|
||||
NUnit 3.0.1 - December 1, 2015
|
||||
|
||||
Console Runner
|
||||
|
||||
* The Nunit.Runners NuGet package was updated to become a meta-package that pulls in the NUnit.Console package
|
||||
* Reinstated the --pause command line option that will display a message box allowing you to attach a debugger if the --debug option does not work
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 994 Add max number of Agents to the NUnit project file
|
||||
* 1014 Ensure NUnit API assembly updates with MSI installs
|
||||
* 1024 Added --pause flag to console runner
|
||||
* 1030 Update Nunit.Runners package to 3.0
|
||||
* 1033 "No arguments were provided" with Theory and Values combination
|
||||
* 1035 Check null arguments
|
||||
* 1037 Async tests not working on Windows 10 Universal
|
||||
* 1041 NUnit2XmlResult Writer is reporting Sucess when test fails
|
||||
* 1042 NUnit2 reports on 3.0 is different than 2.6.4
|
||||
* 1046 FloatingPointNumerics.AreAlmostEqualUlps throws OverflowException
|
||||
* 1049 Cannot select Generic tests from command line
|
||||
* 1050 Do not expose System.Runtime.CompilerServices.ExtensionAttribute to public
|
||||
* 1054 Create nuget feeds for CI builds on Appveyor
|
||||
* 1055 nunit3 console runner --where option does not return error on invalid selection string
|
||||
* 1060 Remove "Version 3" from NUnit Nuget Package
|
||||
* 1061 Nunit30Settings.xml becomes corrupted
|
||||
* 1062 Console.WriteLine statements in "OneTimeSetUp" and "OneTimeTearDown" annotated methods are not directed to the console when using nunit3-console.exe runner
|
||||
* 1063 Error in Random Test
|
||||
|
||||
NUnit 3.0.0 Final Release - November 15, 2015
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 635 Mono 4.0 Support
|
||||
|
||||
NUnit 3.0.0 Release Candidate 3 - November 13, 2015
|
||||
|
||||
Engine
|
||||
|
||||
* The engine now only sets the config file for project.nunit to project.config if project.config exists. Otherwise, each assembly uses its own config, provided it is run in a separate AppDomain by itself.
|
||||
|
||||
NOTE: It is not possible for multiple assemblies in the same AppDomain to use different configs. This is not an NUnit limitation, it's just how configs work!
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 856 Extensions support for third party runners in NUnit 3.0
|
||||
* 1003 Delete TeamCityEventHandler as it is not used
|
||||
* 1015 Specifying .nunit project and --framework on command line causes crash
|
||||
* 1017 Remove Assert.Multiple from framework
|
||||
|
||||
NUnit 3.0.0 Release Candidate 2 - November 8, 2015
|
||||
|
||||
Engine
|
||||
|
||||
* The IDriverFactory extensibility interface has been modified.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 970 Define PARALLEL in CF build of nunitlite
|
||||
* 978 It should be possible to determine version of NUnit using nunit console tool
|
||||
* 983 Inconsistent return codes depending on ProcessModel
|
||||
* 986 Update docs for parallel execution
|
||||
* 988 Don't run portable tests from NUnit Console
|
||||
* 990 V2 driver is passing invalid filter elements to NUnit
|
||||
* 991 Mono.Options should not be exposed to public directly
|
||||
* 993 Give error message when a regex filter is used with NUnit V2
|
||||
* 997 Add missing XML Documentation
|
||||
* 1008 NUnitLite namespace not updated in the NuGet Packages
|
||||
|
||||
NUnit 3.0.0 Release Candidate - November 1, 2015
|
||||
|
||||
Framework
|
||||
|
||||
* The portable build now supports ASP.NET 5 and the new Core CLR.
|
||||
|
||||
NOTE: The `nunit3-console` runner cannot run tests that reference the portable build.
|
||||
You may run such tests using NUnitLite or a platform-specific runner.
|
||||
|
||||
* `TestCaseAttribute` and `TestCaseData` now allow modifying the test name without replacing it entirely.
|
||||
* The Silverlight packages are now separate downloads.
|
||||
|
||||
NUnitLite
|
||||
|
||||
* The NUnitLite runner now produces the same output display and XML results as the console runner.
|
||||
|
||||
Engine
|
||||
|
||||
* The format of the XML result file has been finalized and documented.
|
||||
|
||||
Console Runner
|
||||
|
||||
* The console runner program is now called `nunit3-console`.
|
||||
* Console runner output has been modified so that the summary comes at the end, to reduce the need for scrolling.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 59 Length of generated test names should be limited
|
||||
* 68 Customization of test case name generation
|
||||
* 404 Split tests between nunitlite.runner and nunit.framework
|
||||
* 575 Add support for ASP.NET 5 and the new Core CLR
|
||||
* 783 Package separately for Silverlight
|
||||
* 833 Intermittent failure of WorkItemQueueTests.StopQueue_WithWorkers
|
||||
* 859 NUnit-Console output - move Test Run Summary to end
|
||||
* 867 Remove Warnings from Ignored tests
|
||||
* 868 Review skipped tests
|
||||
* 887 Move environment and settings elements to the assembly suite in the result file
|
||||
* 899 Colors for ColorConsole on grey background are too light
|
||||
* 904 InternalPreserveStackTrace is not supported on all Portable platforms
|
||||
* 914 Unclear error message from console runner when assembly has no tests
|
||||
* 916 Console runner dies when test agent dies
|
||||
* 918 Console runner --where parameter is case sensitive
|
||||
* 920 Remove addins\nunit.engine.api.dll from NuGet package
|
||||
* 929 Rename nunit-console.exe
|
||||
* 931 Remove beta warnings from NuGet packages
|
||||
* 936 Explicit skipped tests not displayed
|
||||
* 939 Installer complains about .NET even if already installed
|
||||
* 940 Confirm or modify list of packages for release
|
||||
* 947 Breaking API change in ValueSourceAttribute
|
||||
* 949 Update copyright in NUnit Console
|
||||
* 954 NUnitLite XML output is not consistent with the engine's
|
||||
* 955 NUnitLite does not display the where clause
|
||||
* 959 Restore filter options for NUnitLite portable build
|
||||
* 960 Intermittent failure of CategoryFilterTests
|
||||
* 967 Run Settings Report is not being displayed.
|
||||
|
||||
NUnit 3.0.0 Beta 5 - October 16, 2015
|
||||
|
||||
Framework
|
||||
|
||||
* Parameterized test cases now support nullable arguments.
|
||||
* The NUnit framework may now be built for the .NET Core framework. Note that this is only available through building the source code. A binary will be available in the next release.
|
||||
|
||||
Engine
|
||||
|
||||
* The engine now runs multiple test assemblies in parallel by default
|
||||
* The output XML now includes more information about the test run, including the text of the command used, any engine settings and the filter used to select tests.
|
||||
* Extensions may now specify data in an identifying attribute, for use by the engine in deciding whether to load that extension.
|
||||
|
||||
|
||||
Console Runner
|
||||
|
||||
* The console now displays all settings used by the engine to run tests as well as the filter used to select tests.
|
||||
* The console runner accepts a new option --maxagents. If multiple assemblies are run in separate processes, this value may be used to limit the number that are executed simultaneously in parallel.
|
||||
* The console runner no longer accepts the --include and --exclude options. Instead, the new --where option provides a more general way to express which tests will be executed, such as --where "cat==Fast && Priority==High". See the docs for details of the syntax.
|
||||
* The new --debug option causes NUnit to break in the debugger immediately before tests are run. This simplifies debugging, especially when the test is run in a separate process.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 41 Check for zeroes in Assert messages
|
||||
* 254 Finalize XML format for test results
|
||||
* 275 NUnitEqualityComparer fails to compare IEquatable<T> where second object is derived from T
|
||||
* 304 Run test Assemblies in parallel
|
||||
* 374 New syntax for selecting tests to be run
|
||||
* 515 OSPlatform.IsMacOSX doesn't work
|
||||
* 573 nunit-console hangs on Mac OS X after all tests have run
|
||||
* 669 TeamCity service message should have assembly name as a part of test name.
|
||||
* 689 The TeamCity service message "testFinished" should have an integer value in the "duration" attribute
|
||||
* 713 Include command information in XML
|
||||
* 719 We have no way to configure tests for several assemblies using NUnit project file and the common installation from msi file
|
||||
* 735 Workers number in xml report file cannot be found
|
||||
* 784 Build Portable Framework on Linux
|
||||
* 790 Allow Extensions to provide data through an attribute
|
||||
* 794 Make it easier to debug tests as well as NUnit itself
|
||||
* 801 NUnit calls Dispose multiple times
|
||||
* 814 Support nullable types with TestCase
|
||||
* 818 Possible error in Merge Pull Request #797
|
||||
* 821 Wrapped method results in loss of result information
|
||||
* 822 Test for Debugger in NUnitTestAssemblyRunner probably should not be in CF build
|
||||
* 824 Remove unused System.Reflection using statements
|
||||
* 826 Randomizer uniqueness tests fail randomly!
|
||||
* 828 Merge pull request #827 (issue 826)
|
||||
* 830 Add ability to report test results synchronously to test runners
|
||||
* 837 Enumerators not disposed when comparing IEnumerables
|
||||
* 840 Add missing copyright notices
|
||||
* 844 Pull Request #835 (Issue #814) does not build in CF
|
||||
* 847 Add new --process:inprocess and --inprocess options
|
||||
* 850 Test runner fails if test name contains invalid xml characters
|
||||
* 851 'Exclude' console option is not working in NUnit Lite
|
||||
* 853 Cannot run NUnit Console from another directory
|
||||
* 860 Use CDATA section for message, stack-trace and output elements of XML
|
||||
* 863 Eliminate core engine
|
||||
* 865 Intermittent failures of StopWatchTests
|
||||
* 869 Tests that use directory separator char to determine platform misreport Linux on MaxOSX
|
||||
* 870 NUnit Console Runtime Environment misreports on MacOSX
|
||||
* 874 Add .NET Core Framework
|
||||
* 878 Cannot exclude MacOSX or XBox platforms when running on CF
|
||||
* 892 Fixed test runner returning early when executing more than one test run.
|
||||
* 894 Give nunit.engine and nunit.engine.api assemblies strong names
|
||||
* 896 NUnit 3.0 console runner not placing test result xml in --work directory
|
||||
|
||||
NUnit 3.0.0 Beta 4 - August 25, 2015
|
||||
|
||||
Framework
|
||||
|
||||
* A new RetryAttribute allows retrying of failing tests.
|
||||
* New SupersetConstraint and Is.SupersetOf syntax complement SubsetConstraint.
|
||||
* Tests skipped due to ExplicitAttribute are now reported as skipped.
|
||||
|
||||
Engine
|
||||
|
||||
* We now use Cecil to examine assemblies prior to loading them.
|
||||
* Extensions are no longer based on Mono.Addins but use our own extension framework.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 125 3rd-party dependencies should be downloaded on demand
|
||||
* 283 What should we do when a user extension does something bad?
|
||||
* 585 RetryAttribute
|
||||
* 642 Restructure MSBuild script
|
||||
* 649 Change how we zip packages
|
||||
* 654 ReflectionOnlyLoad and ReflectionOnlyLoadFrom
|
||||
* 664 Invalid "id" attribute in the report for case "test started"
|
||||
* 685 In the some cases when tests cannot be started NUnit returns exit code "0"
|
||||
* 728 Missing Assert.That overload
|
||||
* 741 Explicit Tests get run when using --exclude
|
||||
* 746 Framework should send events for all tests
|
||||
* 747 NUnit should apply attributes even if test is non-runnable
|
||||
* 749 Review Use of Mono.Addins for Engine Extensibility
|
||||
* 750 Include Explicit Tests in Test Results
|
||||
* 753 Feature request: Is.SupersetOf() assertion constraint
|
||||
* 755 TimeOut attribute doesn't work with TestCaseSource Attribute
|
||||
* 757 Implement some way to wait for execution to complete in ITestEngineRunner
|
||||
* 760 Packaging targets do not run on Linux
|
||||
* 766 Added overloads for True()/False() accepting booleans
|
||||
* 778 Build and build.cmd scripts invoke nuget.exe improperly
|
||||
* 780 Teamcity fix
|
||||
* 782 No sources for 2.6.4
|
||||
|
||||
NUnit 3.0.0 Beta 3 - July 15, 2015
|
||||
|
||||
Framework
|
||||
|
||||
* The RangeAttribute has been extended to support more data types including
|
||||
uint, long and ulong
|
||||
* Added platform support for Windows 10 and fixed issues with Windows 8 and
|
||||
8.1 support
|
||||
* Added async support to the portable version of NUnit Framework
|
||||
* The named members of the TestCaseSource and ValueSource attributes must now be
|
||||
static.
|
||||
* RandomAttribute has been extended to add support for new data types including
|
||||
uint, long, ulong, short, ushort, float, byte and sbyte
|
||||
* TestContext.Random has also been extended to add support for new data types including
|
||||
uint, long, ulong, short, ushort, float, byte, sbyte and decimal
|
||||
* Removed the dependency on Microsoft.Bcl.Async from the NUnit Framework assembly
|
||||
targeting .NET 4.0. If you want to write async tests in .NET 4.0, you will need
|
||||
to reference the NuGet package yourself.
|
||||
* Added a new TestFixtureSource attribute which is the equivalent to TestCaseSource
|
||||
but provides for instantiation of fixtures.
|
||||
* Significant improvements have been made in how NUnit deduces the type arguments of
|
||||
generic methods based on the arguments provided.
|
||||
|
||||
Engine
|
||||
|
||||
* If the target framework is not specified, test assemblies that are compiled
|
||||
to target .NET 4.5 will no longer run in .NET 4.0 compatibility mode
|
||||
|
||||
Console
|
||||
|
||||
* If the console is run without arguments, it will now display help
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 47 Extensions to RangeAttribute
|
||||
* 237 System.Uri .ctor works not properly under Nunit
|
||||
* 244 NUnit should properly distinguish between .NET 4.0 and 4.5
|
||||
* 310 Target framework not specified on the AppDomain when running against .Net 4.5
|
||||
* 321 Rationalize how we count tests
|
||||
* 472 Overflow exception and DivideByZero exception from the RangeAttribute
|
||||
* 524 int and char do not compare correctly?
|
||||
* 539 Truncation of string arguments
|
||||
* 544 AsyncTestMethodTests for 4.5 Framework fails frequently on Travis CI
|
||||
* 656 Unused parameter in Console.WriteLine found
|
||||
* 670 Failing Tests in TeamCity Build
|
||||
* 673 Ensure proper disposal of engine objects
|
||||
* 674 Engine does not release test assemblies
|
||||
* 679 Windows 10 Support
|
||||
* 682 Add Async Support to Portable Framework
|
||||
* 683 Make FrameworkController available in portable build
|
||||
* 687 TestAgency does not launch agent process correctly if runtime type is not specified (i.e. v4.0)
|
||||
* 692 PlatformAttribute_OperatingSystemBitNess fails when running in 32-bit process
|
||||
* 693 Generic Test<T> Method cannot determine type arguments for fixture when passed as IEnumerable<T>
|
||||
* 698 Require TestCaseSource and ValueSource named members to be static
|
||||
* 703 TeamCity non-equal flowid for 'testStarted' and 'testFinished' messages
|
||||
* 712 Extensions to RandomAttribute
|
||||
* 715 Provide a data source attribute at TestFixture Level
|
||||
* 718 RangeConstraint gives error with from and two args of differing types
|
||||
* 723 Does nunit.nuspec require dependency on Microsoft.Bcl.Async?
|
||||
* 724 Adds support for Nullable<bool> to Assert.IsTrue and Assert.IsFalse
|
||||
* 734 Console without parameters doesn't show help
|
||||
|
||||
NUnit 3.0.0 Beta 2 - May 12, 2015
|
||||
|
||||
Framework
|
||||
|
||||
* The Compact Framework version of the framework is now packaged separately
|
||||
and will be distributed as a ZIP file and as a NuGet package.
|
||||
* The NUnit 2.x RepeatAttribute was added back into the framework.
|
||||
* Added Throws.ArgumentNullException
|
||||
* Added GetString methods to NUnit.Framework.Internal.RandomGenerator to
|
||||
create repeatable random strings for testing
|
||||
* When checking the equality of DateTimeOffset, you can now use the
|
||||
WithSameOffset modifier
|
||||
* Some classes intended for internal usage that were public for testing
|
||||
have now been made internal. Additional classes will be made internal
|
||||
for the final 3.0 release.
|
||||
|
||||
Engine
|
||||
|
||||
* Added a core engine which is a non-extensible, minimal engine for use by
|
||||
devices and similar situations where reduced functionality is compensated
|
||||
for by reduced size and simplicity of usage. See
|
||||
https://github.com/nunit/dev/wiki/Core-Engine for more information.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 22 Add OSArchitecture Attribute to Environment node in result xml
|
||||
* 24 Assert on Dictionary Content
|
||||
* 48 Explicit seems to conflict with Ignore
|
||||
* 168 Create NUnit 3.0 documentation
|
||||
* 196 Compare DateTimeOffsets including the offset in the comparison
|
||||
* 217 New icon for the 3.0 release
|
||||
* 316 NUnitLite TextUI Runner
|
||||
* 320 No Tests found: Using parametrized Fixture and TestCaseSource
|
||||
* 360 Better exception message when using non-BCL class in property
|
||||
* 454 Rare registry configurations may cause NUnit to fail
|
||||
* 478 RepeatAttribute
|
||||
* 481 Testing multiple assemblies in nunitlite
|
||||
* 538 Potential bug using TestContext in constructors
|
||||
* 546 Enable Parallel in NUnitLite/CF (or more) builds
|
||||
* 551 TextRunner not passing the NumWorkers option to the ITestAssemblyRunner
|
||||
* 556 Executed tests should always return a non-zero duration
|
||||
* 559 Fix text of NuGet packages
|
||||
* 560 Fix PackageVersion property on wix install projects
|
||||
* 562 Program.cs in NUnitLite NuGet package is incorrect
|
||||
* 564 NUnitLite Nuget package is Beta 1a, Framework is Beta 1
|
||||
* 565 NUnitLite Nuget package adds Program.cs to a VB Project
|
||||
* 568 Isolate packaging from building
|
||||
* 570 ThrowsConstraint failure message should include stack trace of actual exception
|
||||
* 576 Throws.ArgumentNullException would be nice
|
||||
* 577 Documentation on some members of Throws falsely claims that they return `TargetInvocationException` constraints
|
||||
* 579 No documentation for recommended usage of TestCaseSourceAttribute
|
||||
* 580 TeamCity Service Message Uses Incorrect Test Name with NUnit2Driver
|
||||
* 582 Test Ids Are Not Unique
|
||||
* 583 TeamCity service messages to support parallel test execution
|
||||
* 584 Non-runnable assembly has incorrect ResultState
|
||||
* 609 Add support for integration with TeamCity
|
||||
* 611 Remove unused --teamcity option from CF build of NUnitLite
|
||||
* 612 MaxTime doesn't work when used for TestCase
|
||||
* 621 Core Engine
|
||||
* 622 nunit-console fails when use --output
|
||||
* 628 Modify IService interface and simplify ServiceContext
|
||||
* 631 Separate packaging for the compact framework
|
||||
* 646 ConfigurationManager.AppSettings Params Return Null under Beta 1
|
||||
* 648 Passing 2 or more test assemblies targeting > .NET 2.0 to nunit-console fails
|
||||
|
||||
NUnit 3.0.0 Beta 1 - March 25, 2015
|
||||
|
||||
General
|
||||
|
||||
* There is now a master windows installer for the framework, engine and console runner.
|
||||
|
||||
Framework
|
||||
|
||||
* We no longer create a separate framework build for .NET 3.5. The 2.0 and
|
||||
3.5 builds were essentially the same, so the former should now be used
|
||||
under both runtimes.
|
||||
* A new Constraint, DictionaryContainsKeyConstraint, may be used to test
|
||||
that a specified key is present in a dictionary.
|
||||
* LevelOfParallelizationAttribute has been renamed to LevelOfParallelismAttribute.
|
||||
* The Silverlight runner now displays output in color and includes any
|
||||
text output created by the tests.
|
||||
* The class and method names of each test are included in the output xml
|
||||
where applicable.
|
||||
* String arguments used in test case names are now truncated to 40 rather
|
||||
than 20 characters.
|
||||
|
||||
Engine
|
||||
|
||||
* The engine API has now been finalized. It permits specifying a minimum
|
||||
version of the engine that a runner is able to use. The best installed
|
||||
version of the engine will be loaded. Third-party runners may override
|
||||
the selection process by including a copy of the engine in their
|
||||
installation directory and specifying that it must be used.
|
||||
* The V2 framework driver now uses the event listener and test listener
|
||||
passed to it by the runner. This corrects several outstanding issues
|
||||
caused by events not being received and allows selecting V2 tests to
|
||||
be run from the command-line, in the same way that V3 tests are selected.
|
||||
|
||||
Console
|
||||
|
||||
* The console now defaults to not using shadowcopy. There is a new option
|
||||
--shadowcopy to turn it on if needed.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 224 Silverlight Support
|
||||
* 318 TestActionAttribute: Retrieving the TestFixture
|
||||
* 428 Add ExpectedExceptionAttribute to C# samples
|
||||
* 440 Automatic selection of Test Engine to use
|
||||
* 450 Create master install that includes the framework, engine and console installs
|
||||
* 477 Assert does not work with ArraySegment
|
||||
* 482 nunit-console has multiple errors related to -framework option
|
||||
* 483 Adds constraint for asserting that a dictionary contains a particular key
|
||||
* 484 Missing file in NUnit.Console nuget package
|
||||
* 485 Can't run v2 tests with nunit-console 3.0
|
||||
* 487 NUnitLite can't load assemblies by their file name
|
||||
* 488 Async setup and teardown still don't work
|
||||
* 497 Framework installer shold register the portable framework
|
||||
* 504 Option --workers:0 is ignored
|
||||
* 508 Travis builds with failure in engine tests show as successful
|
||||
* 509 Under linux, not all mono profiles are listed as available
|
||||
* 512 Drop the .NET 3.5 build
|
||||
* 517 V2 FrameworkDriver does not make use of passed in TestEventListener
|
||||
* 523 Provide an option to disable shadowcopy in NUnit v3
|
||||
* 528 V2 FrameworkDriver does not make use of passed in TestFilter
|
||||
* 530 Color display for Silverlight runner
|
||||
* 531 Display text output from tests in Silverlight runner
|
||||
* 534 Add classname and methodname to test result xml
|
||||
* 541 Console help doesn't indicate defaults
|
||||
|
||||
NUnit 3.0.0 Alpha 5 - January 30, 2015
|
||||
|
||||
General
|
||||
|
||||
* A Windows installer is now included in the release packages.
|
||||
|
||||
Framework
|
||||
|
||||
* TestCaseAttribute now allows arguments with default values to be omitted. Additionaly, it accepts a Platform property to specify the platforms on which the test case should be run.
|
||||
* TestFixture and TestCase attributes now enforce the requirement that a reason needs to be provided when ignoring a test.
|
||||
* SetUp, TearDown, OneTimeSetUp and OneTimeTearDown methods may now be async.
|
||||
* String arguments over 20 characters in length are truncated when used as part of a test name.
|
||||
|
||||
Engine
|
||||
|
||||
* The engine is now extensible using Mono.Addins. In this release, extension points are provided for FrameworkDrivers, ProjectLoaders and OutputWriters. The following addins are bundled as a part of NUnit:
|
||||
* A FrameworkDriver that allows running NUnit V2 tests under NUnit 3.0.
|
||||
* ProjectLoaders for NUnit and Visual Studio projects.
|
||||
* An OutputWriter that creates XML output in NUnit V2 format.
|
||||
* DomainUsage now defaults to Multiple if not specified by the runner
|
||||
|
||||
Console
|
||||
|
||||
* New options supported:
|
||||
* --testlist provides a list of tests to run in a file
|
||||
* --stoponerror indicates that the run should terminate when any test fails.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 20 TestCaseAttribute needs Platform property.
|
||||
* 60 NUnit should support async setup, teardown, fixture setup and fixture teardown.
|
||||
* 257 TestCaseAttribute should not require parameters with default values to be specified.
|
||||
* 266 Pluggable framework drivers.
|
||||
* 368 Create addin model.
|
||||
* 369 Project loader addins
|
||||
* 370 OutputWriter addins
|
||||
* 403 Move ConsoleOptions.cs and Options.cs to Common and share...
|
||||
* 419 Create Windows Installer for NUnit.
|
||||
* 427 [TestFixture(Ignore=true)] should not be allowed.
|
||||
* 437 Errors in tests under Linux due to hard-coded paths.
|
||||
* 441 NUnit-Console should support --testlist option
|
||||
* 442 Add --stoponerror option back to nunit-console.
|
||||
* 456 Fix memory leak in RuntimeFramework.
|
||||
* 459 Remove the Mixed Platforms build configuration.
|
||||
* 468 Change default domain usage to multiple.
|
||||
* 469 Truncate string arguments in test names in order to limit the length.
|
||||
|
||||
NUnit 3.0.0 Alpha 4 - December 30, 2014
|
||||
|
||||
Framework
|
||||
|
||||
* ApartmentAttribute has been added, replacing STAAttribute and MTAAttribute.
|
||||
* Unnecessary overloads of Assert.That and Assume.That have been removed.
|
||||
* Multiple SetUpFixtures may be specified in a single namespace.
|
||||
* Improvements to the Pairwise strategy test case generation algorithm.
|
||||
* The new NUnitLite runner --testlist option, allows a list of tests to be kept in a file.
|
||||
|
||||
Engine
|
||||
|
||||
* A driver is now included, which allows running NUnit 2.x tests under NUnit 3.0.
|
||||
* The engine can now load and run tests specified in a number of project formats:
|
||||
* NUnit (.nunit)
|
||||
* Visual Studio C# projects (.csproj)
|
||||
* Visual Studio F# projects (.vjsproj)
|
||||
* Visual Studio Visual Basic projects (.vbproj)
|
||||
* Visual Studio solutions (.sln)
|
||||
* Legacy C++ and Visual JScript projects (.csproj and .vjsproj) are also supported
|
||||
* Support for the current C++ format (.csxproj) is not yet available
|
||||
* Creation of output files like TestResult.xml in various formats is now a
|
||||
service of the engine, available to any runner.
|
||||
|
||||
Console
|
||||
|
||||
* The command-line may now include any number of assemblies and/or supported projects.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 37 Multiple SetUpFixtures should be permitted on same namespace
|
||||
* 210 TestContext.WriteLine in an AppDomain causes an error
|
||||
* 227 Add support for VS projects and solutions
|
||||
* 231 Update C# samples to use NUnit 3.0
|
||||
* 233 Update F# samples to use NUnit 3.0
|
||||
* 234 Update C++ samples to use NUnit 3.0
|
||||
* 265 Reorganize console reports for nunit-console and nunitlite
|
||||
* 299 No full path to assembly in XML file under Compact Framework
|
||||
* 301 Command-line length
|
||||
* 363 Make Xml result output an engine service
|
||||
* 377 CombiningStrategyAttributes don't work correctly on generic methods
|
||||
* 388 Improvements to NUnitLite runner output
|
||||
* 390 Specify exactly what happens when a test times out
|
||||
* 396 ApartmentAttribute
|
||||
* 397 CF nunitlite runner assembly has the wrong name
|
||||
* 407 Assert.Pass() with ]]> in message crashes console runner
|
||||
* 414 Simplify Assert overloads
|
||||
* 416 NUnit 2.x Framework Driver
|
||||
* 417 Complete work on NUnit projects
|
||||
* 420 Create Settings file in proper location
|
||||
|
||||
NUnit 3.0.0 Alpha 3 - November 29, 2014
|
||||
|
||||
Breaking Changes
|
||||
|
||||
* NUnitLite tests must reference both the nunit.framework and nunitlite assemblies.
|
||||
|
||||
Framework
|
||||
|
||||
* The NUnit and NUnitLite frameworks have now been merged. There is no longer any distinction
|
||||
between them in terms of features, although some features are not available on all platforms.
|
||||
* The release includes two new framework builds: compact framework 3.5 and portable. The portable
|
||||
library is compatible with .NET 4.5, Silverlight 5.0, Windows 8, Windows Phone 8.1,
|
||||
Windows Phone Silverlight 8, Mono for Android and MonoTouch.
|
||||
* A number of previously unsupported features are available for the Compact Framework:
|
||||
- Generic methods as tests
|
||||
- RegexConstraint
|
||||
- TimeoutAttribute
|
||||
- FileAssert, DirectoryAssert and file-related constraints
|
||||
|
||||
Engine
|
||||
|
||||
* The logic of runtime selection has now changed so that each assembly runs by default
|
||||
in a separate process using the runtime for which it was built.
|
||||
* On 64-bit systems, each test process is automatically created as 32-bit or 64-bit,
|
||||
depending on the platform specified for the test assembly.
|
||||
|
||||
Console
|
||||
|
||||
* The console runner now runs tests in a separate process per assembly by default. They may
|
||||
still be run in process or in a single separate process by use of command-line options.
|
||||
* The console runner now starts in the highest version of the .NET runtime available, making
|
||||
it simpler to debug tests by specifying that they should run in-process on the command-line.
|
||||
* The -x86 command-line option is provided to force execution in a 32-bit process on a 64-bit system.
|
||||
* A writeability check is performed for each output result file before trying to run the tests.
|
||||
* The -teamcity option is now supported.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 12 Compact framework should support generic methods
|
||||
* 145 NUnit-console fails if test result message contains invalid xml characters
|
||||
* 155 Create utility classes for platform-specific code
|
||||
* 223 Common code for NUnitLite console runner and NUnit-Console
|
||||
* 225 Compact Framework Support
|
||||
* 238 Improvements to running 32 bit tests on a 64 bit system
|
||||
* 261 Add portable nunitlite build
|
||||
* 284 NUnitLite Unification
|
||||
* 293 CF does not have a CurrentDirectory
|
||||
* 306 Assure NUnit can write resultfile
|
||||
* 308 Early disposal of runners
|
||||
* 309 NUnit-Console should support incremental output under TeamCity
|
||||
* 325 Add RegexConstraint to compact framework build
|
||||
* 326 Add TimeoutAttribute to compact framework build
|
||||
* 327 Allow generic test methods in the compact framework
|
||||
* 328 Use .NET Stopwatch class for compact framework builds
|
||||
* 331 Alpha 2 CF does not build
|
||||
* 333 Add parallel execution to desktop builds of NUnitLite
|
||||
* 334 Include File-related constraints and syntax in NUnitLite builds
|
||||
* 335 Re-introduce 'Classic' NUnit syntax in NUnitLite
|
||||
* 336 Document use of separate obj directories per build in our projects
|
||||
* 337 Update Standard Defines page for .NET 3.0
|
||||
* 341 Move the NUnitLite runners to separate assemblies
|
||||
* 367 Refactor XML Escaping Tests
|
||||
* 372 CF Build TestAssemblyRunnerTests
|
||||
* 373 Minor CF Test Fixes
|
||||
* 378 Correct documentation for PairwiseAttribute
|
||||
* 386 Console Output Improvements
|
||||
|
||||
NUnit 3.0.0 Alpha 2 - November 2, 2014
|
||||
|
||||
Breaking Changes
|
||||
|
||||
* The console runner no longer displays test results in the debugger.
|
||||
* The NUnitLite compact framework 2.0 build has been removed.
|
||||
* All addin support has been removed from the framework. Documentation of NUnit 3.0 extensibility features will be published in time for the beta release. In the interim, please ask for support on the nunit-discuss list.
|
||||
|
||||
General
|
||||
|
||||
* A separate solution has been created for Linux
|
||||
* We now have continuous integration builds under both Travis and Appveyor
|
||||
* The compact framework 3.5 build is now working and will be supported in future releases.
|
||||
|
||||
New Features
|
||||
|
||||
* The console runner now automatically detects 32- versus 64-bit test assemblies.
|
||||
* The NUnitLite report output has been standardized to match that of nunit-console.
|
||||
* The NUnitLite command-line has been standardized to match that of nunit-console where they share the same options.
|
||||
* Both nunit-console and NUnitLite now display output in color.
|
||||
* ActionAttributes now allow specification of multiple targets on the attribute as designed. This didn't work in the first alpha.
|
||||
* OneTimeSetUp and OneTimeTearDown failures are now shown on the test report. Individual test failures after OneTimeSetUp failure are no longer shown.
|
||||
* The console runner refuses to run tests build with older versions of NUnit. A plugin will be available to run older tests in the future.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 222 Color console for NUnitLite
|
||||
* 229 Timing failures in tests
|
||||
* 241 Remove reference to Microslft BCL packages
|
||||
* 243 Create solution for Linux
|
||||
* 245 Multiple targets on action attributes not implemented
|
||||
* 246 C++ tests do not compile in VS2013
|
||||
* 247 Eliminate trace display when running tests in debug
|
||||
* 255 Add new result states for more precision in where failures occur
|
||||
* 256 ContainsConstraint break when used with AndConstraint
|
||||
* 264 Stacktrace displays too many entries
|
||||
* 269 Add manifest to nunit-console and nunit-agent
|
||||
* 270 OneTimeSetUp failure results in too much output
|
||||
* 271 Invalid tests should be treated as errors
|
||||
* 274 Command line options should be case insensitive
|
||||
* 276 NUnit-console should not reference nunit.framework
|
||||
* 278 New result states (ChildFailure and SetupFailure) break NUnit2XmlOutputWriter
|
||||
* 282 Get tests for NUnit2XmlOutputWriter working
|
||||
* 288 Set up Appveyor CI build
|
||||
* 290 Stack trace still displays too many items
|
||||
* 315 NUnit 3.0 alpha: Cannot run in console on my assembly
|
||||
* 319 CI builds are not treating test failures as failures of the build
|
||||
* 322 Remove Stopwatch tests where they test the real .NET Stopwatch
|
||||
|
||||
NUnit 3.0.0 Alpha 1 - September 22, 2014
|
||||
|
||||
Breaking Changes
|
||||
|
||||
* Legacy suites are no longer supported
|
||||
* Assert.NullOrEmpty is no longer supported (Use Is.Null.Or.Empty)
|
||||
|
||||
General
|
||||
|
||||
* MsBuild is now used for the build rather than NAnt
|
||||
* The framework test harness has been removed now that nunit-console is at a point where it can run the tests.
|
||||
|
||||
New Features
|
||||
|
||||
* Action Attributes have been added with the same features as in NUnit 2.6.3.
|
||||
* TestContext now has a method that allows writing to the XML output.
|
||||
* TestContext.CurrentContext.Result now provides the error message and stack trace during teardown.
|
||||
* Does prefix operator supplies several added constraints.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 6 Log4net not working with NUnit
|
||||
* 13 Standardize commandline options for nunitlite runner
|
||||
* 17 No allowance is currently made for nullable arguents in TestCase parameter conversions
|
||||
* 33 TestCaseSource cannot refer to a parameterized test fixture
|
||||
* 54 Store message and stack trace in TestContext for use in TearDown
|
||||
* 111 Implement Changes to File, Directory and Path Assertions
|
||||
* 112 Implement Action Attributes
|
||||
* 156 Accessing multiple AppDomains within unit tests result in SerializationException
|
||||
* 163 Add --trace option to NUnitLite
|
||||
* 167 Create interim documentation for the alpha release
|
||||
* 169 Design and implement distribution of NUnit packages
|
||||
* 171 Assert.That should work with any lambda returning bool
|
||||
* 175 Test Harness should return an error if any tests fail
|
||||
* 180 Errors in Linux CI build
|
||||
* 181 Replace NAnt with MsBuild / XBuild
|
||||
* 183 Standardize commandline options for test harness
|
||||
* 188 No output from NUnitLite when selected test is not found
|
||||
* 189 Add string operators to Does prefix
|
||||
* 193 TestWorkerTests.BusyExecutedIdleEventsCalledInSequence fails occasionally
|
||||
* 197 Deprecate or remove Assert.NullOrEmpty
|
||||
* 202 Eliminate legacy suites
|
||||
* 203 Combine framework, engine and console runner in a single solution and repository
|
||||
* 209 Make Ignore attribute's reason mandatory
|
||||
* 215 Running 32-bit tests on a 64-bit OS
|
||||
* 219 Teardown failures are not reported
|
||||
|
||||
Console Issues Resolved (Old nunit-console project, now combined with nunit)
|
||||
|
||||
* 2 Failure in TestFixtureSetUp is not reported correctly
|
||||
* 5 CI Server for nunit-console
|
||||
* 6 System.NullReferenceException on start nunit-console-x86
|
||||
* 21 NUnitFrameworkDriverTests fail if not run from same directory
|
||||
* 24 'Debug' value for /trace option is deprecated in 2.6.3
|
||||
* 38 Confusing Excluded categories output
|
||||
|
||||
NUnit 2.9.7 - August 8, 2014
|
||||
|
||||
Breaking Changes
|
||||
|
||||
* NUnit no longer supports void async test methods. You should use a Task return Type instead.
|
||||
* The ExpectedExceptionAttribute is no longer supported. Use Assert.Throws() or Assert.That(..., Throws) instead for a more precise specification of where the exception is expected to be thrown.
|
||||
|
||||
New Features
|
||||
|
||||
* Parallel test execution is supported down to the Fixture level. Use ParallelizableAttribute to indicate types that may be run in parallel.
|
||||
* Async tests are supported for .NET 4.0 if the user has installed support for them.
|
||||
* A new FileExistsConstraint has been added along with FileAssert.Exists and FileAssert.DoesNotExist
|
||||
* ExpectedResult is now supported on simple (non-TestCase) tests.
|
||||
* The Ignore attribute now takes a named parameter Until, which allows specifying a date after which the test is no longer ignored.
|
||||
* The following new values are now recognized by PlatformAttribute: Win7, Win8, Win8.1, Win2012Server, Win2012ServerR2, NT6.1, NT6.2, 32-bit, 64-bit
|
||||
* TimeoutAttribute is now supported under Silverlight
|
||||
* ValuesAttribute may be used without any values on an enum or boolean argument. All possible values are used.
|
||||
* You may now specify a tolerance using Within when testing equality of DateTimeOffset values.
|
||||
* The XML output now includes a start and end time for each test.
|
||||
|
||||
Issues Resolved
|
||||
|
||||
* 8 [SetUpFixture] is not working as expected
|
||||
* 14 CI Server for NUnit Framework
|
||||
* 21 Is.InRange Constraint Ambiguity
|
||||
* 27 Values attribute support for enum types
|
||||
* 29 Specifying a tolerance with "Within" doesn't work for DateTimeOffset data types
|
||||
* 31 Report start and end time of test execution
|
||||
* 36 Make RequiresThread, RequiresSTA, RequiresMTA inheritable
|
||||
* 45 Need of Enddate together with Ignore
|
||||
* 55 Incorrect XML comments for CollectionAssert.IsSubsetOf
|
||||
* 62 Matches(Constraint) does not work as expected
|
||||
* 63 Async support should handle Task return type without state machine
|
||||
* 64 AsyncStateMachineAttribute should only be checked by name
|
||||
* 65 Update NUnit Wiki to show the new location of samples
|
||||
* 66 Parallel Test Execution within test assemblies
|
||||
* 67 Allow Expected Result on simple tests
|
||||
* 70 EquivalentTo isn't compatible with IgnoreCase for dictioneries
|
||||
* 75 Async tests should be supported for projects that target .NET 4.0
|
||||
* 82 nunit-framework tests are timing out on Linux
|
||||
* 83 Path-related tests fail on Linux
|
||||
* 85 Culture-dependent NUnit tests fail on non-English machine
|
||||
* 88 TestCaseSourceAttribute documentation
|
||||
* 90 EquivalentTo isn't compatible with IgnoreCase for char
|
||||
* 100 Changes to Tolerance definitions
|
||||
* 110 Add new platforms to PlatformAttribute
|
||||
* 113 Remove ExpectedException
|
||||
* 118 Workarounds for missing InternalPreserveStackTrace in mono
|
||||
* 121 Test harness does not honor the --worker option when set to zero
|
||||
* 129 Standardize Timeout in the Silverlight build
|
||||
* 130 Add FileAssert.Exists and FileAssert.DoesNotExist
|
||||
* 132 Drop support for void async methods
|
||||
* 153 Surprising behavior of DelayedConstraint pollingInterval
|
||||
* 161 Update API to support stopping an ongoing test run
|
||||
|
||||
NOTE: Bug Fixes below this point refer to the number of the bug in Launchpad.
|
||||
|
||||
NUnit 2.9.6 - October 4, 2013
|
||||
|
||||
Main Features
|
||||
|
||||
* Separate projects for nunit-console and nunit.engine
|
||||
* New builds for .NET 4.5 and Silverlight
|
||||
* TestContext is now supported
|
||||
* External API is now stable; internal interfaces are separate from API
|
||||
* Tests may be run in parallel on separate threads
|
||||
* Solutions and projects now use VS2012 (except for Compact framework)
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* 463470 We should encapsulate references to pre-2.0 collections
|
||||
* 498690 Assert.That() doesn't like properties with scoped setters
|
||||
* 501784 Theory tests do not work correctly when using null parameters
|
||||
* 531873 Feature: Extraction of unit tests from NUnit test assembly and calling appropriate one
|
||||
* 611325 Allow Teardown to detect if last test failed
|
||||
* 611938 Generic Test Instances disappear
|
||||
* 655882 Make CategoryAttribute inherited
|
||||
* 664081 Add Server2008 R2 and Windows 7 to PlatformAttribute
|
||||
* 671432 Upgrade NAnt to Latest Release
|
||||
* 676560 Assert.AreEqual does not support IEquatable<T>
|
||||
* 691129 Add Category parameter to TestFixture
|
||||
* 697069 Feature request: dynamic location for TestResult.xml
|
||||
* 708173 NUnit's logic for comparing arrays - use Comparer<T[]> if it is provided
|
||||
* 709062 "System.ArgumentException : Cannot compare" when the element is a list
|
||||
* 712156 Tests cannot use AppDomain.SetPrincipalPolicy
|
||||
* 719184 Platformdependency in src/ClientUtilities/util/Services/DomainManager.cs:40
|
||||
* 719187 Using Path.GetTempPath() causes conflicts in shared temporary folders
|
||||
* 735851 Add detection of 3.0, 3.5 and 4.0 frameworks to PlatformAttribute
|
||||
* 736062 Deadlock when EventListener performs a Trace call + EventPump synchronisation
|
||||
* 756843 Failing assertion does not show non-linear tolerance mode
|
||||
* 766749 net-2.0\nunit-console-x86.exe.config should have a <startup /> element and also enable loadFromRemoteSources
|
||||
* 770471 Assert.IsEmpty does not support IEnumerable
|
||||
* 785460 Add Category parameter to TestCaseSourceAttribute
|
||||
* 787106 EqualConstraint provides inadequate failure information for IEnumerables
|
||||
* 792466 TestContext MethodName
|
||||
* 794115 HashSet incorrectly reported
|
||||
* 800089 Assert.Throws() hides details of inner AssertionException
|
||||
* 848713 Feature request: Add switch for console to break on any test case error
|
||||
* 878376 Add 'Exactly(n)' to the NUnit constraint syntax
|
||||
* 882137 When no tests are run, higher level suites display as Inconclusive
|
||||
* 882517 NUnit 2.5.10 doesn't recognize TestFixture if there are only TestCaseSource inside
|
||||
* 885173 Tests are still executed after cancellation by user
|
||||
* 885277 Exception when project calls for a runtime using only 2 digits
|
||||
* 885604 Feature request: Explicit named parameter to TestCaseAttribute
|
||||
* 890129 DelayedConstraint doesn't appear to poll properties of objects
|
||||
* 892844 Not using Mono 4.0 profile under Windows
|
||||
* 893919 DelayedConstraint fails polling properties on references which are initially null
|
||||
* 896973 Console output lines are run together under Linux
|
||||
* 897289 Is.Empty constraint has unclear failure message
|
||||
* 898192 Feature Request: Is.Negative, Is.Positive
|
||||
* 898256 IEnumerable<T> for Datapoints doesn't work
|
||||
* 899178 Wrong failure message for parameterized tests that expect exceptions
|
||||
* 904841 After exiting for timeout the teardown method is not executed
|
||||
* 908829 TestCase attribute does not play well with variadic test functions
|
||||
* 910218 NUnit should add a trailing separator to the ApplicationBase
|
||||
* 920472 CollectionAssert.IsNotEmpty must dispose Enumerator
|
||||
* 922455 Add Support for Windows 8 and Windows 2012 Server to PlatformAttribute
|
||||
* 928246 Use assembly.Location instead of assembly.CodeBase
|
||||
* 958766 For development work under TeamCity, we need to support nunit2 formatted output under direct-runner
|
||||
* 1000181 Parameterized TestFixture with System.Type as constructor arguments fails
|
||||
* 1000213 Inconclusive message Not in report output
|
||||
* 1023084 Add Enum support to RandomAttribute
|
||||
* 1028188 Add Support for Silverlight
|
||||
* 1029785 Test loaded from remote folder failed to run with exception System.IODirectory
|
||||
* 1037144 Add MonoTouch support to PlatformAttribute
|
||||
* 1041365 Add MaxOsX and Xbox support to platform attribute
|
||||
* 1057981 C#5 async tests are not supported
|
||||
* 1060631 Add .NET 4.5 build
|
||||
* 1064014 Simple async tests should not return Task<T>
|
||||
* 1071164 Support async methods in usage scenarios of Throws constraints
|
||||
* 1071343 Runner.Load fails on CF if the test assembly contains a generic method
|
||||
* 1071861 Error in Path Constraints
|
||||
* 1072379 Report test execution time at a higher resolution
|
||||
* 1074568 Assert/Assume should support an async method for the ActualValueDelegate
|
||||
* 1082330 Better Exception if SetCulture attribute is applied multiple times
|
||||
* 1111834 Expose Random Object as part of the test context
|
||||
* 1111838 Include Random Seed in Test Report
|
||||
* 1172979 Add Category Support to nunitlite Runner
|
||||
* 1203361 Randomizer uniqueness tests sometimes fail
|
||||
* 1221712 When non-existing test method is specified in -test, result is still "Tests run: 1, Passed: 1"
|
||||
* 1223294 System.NullReferenceException thrown when ExpectedExceptionAttribute is used in a static class
|
||||
* 1225542 Standardize commandline options for test harness
|
||||
|
||||
Bug Fixes in 2.9.6 But Not Listed Here in the Release
|
||||
|
||||
* 541699 Silverlight Support
|
||||
* 1222148 /framework switch does not recognize net-4.5
|
||||
* 1228979 Theories with all test cases inconclusive are not reported as failures
|
||||
|
||||
|
||||
NUnit 2.9.5 - July 30, 2010
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* 483836 Allow non-public test fixtures consistently
|
||||
* 487878 Tests in generic class without proper TestFixture attribute should be invalid
|
||||
* 498656 TestCase should show array values in GUI
|
||||
* 513989 Is.Empty should work for directories
|
||||
* 519912 Thread.CurrentPrincipal Set In TestFixtureSetUp Not Maintained Between Tests
|
||||
* 532488 constraints from ConstraintExpression/ConstraintBuilder are not reusable
|
||||
* 590717 categorie contains dash or trail spaces is not selectable
|
||||
* 590970 static TestFixtureSetUp/TestFixtureTearDown methods in base classes are not run
|
||||
* 595683 NUnit console runner fails to load assemblies
|
||||
* 600627 Assertion message formatted poorly by PropertyConstraint
|
||||
* 601108 Duplicate test using abstract test fixtures
|
||||
* 601645 Parametered test should try to convert data type from source to parameter
|
||||
* 605432 ToString not working properly for some properties
|
||||
* 606548 Deprecate Directory Assert in 2.5 and remove it in 3.0
|
||||
* 608875 NUnit Equality Comparer incorrectly defines equality for Dictionary objects
|
||||
|
||||
NUnit 2.9.4 - May 4, 2010
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* 419411 Fixture With No Tests Shows as Non-Runnable
|
||||
* 459219 Changes to thread princpal cause failures under .NET 4.0
|
||||
* 459224 Culture test failure under .NET 4.0
|
||||
* 462019 Line endings needs to be better controlled in source
|
||||
* 462418 Assume.That() fails if I specify a message
|
||||
* 483845 TestCase expected return value cannot be null
|
||||
* 488002 Should not report tests in abstract class as invalid
|
||||
* 490679 Category in TestCaseData clashes with Category on ParameterizedMethodSuite
|
||||
* 501352 VS2010 projects have not been updated for new directory structure
|
||||
* 504018 Automatic Values For Theory Test Parameters Not Provided For bool And enum
|
||||
* 505899 'Description' parameter in both TestAttribute and TestCaseAttribute is not allowed
|
||||
* 523335 TestFixtureTearDown in static class not executed
|
||||
* 556971 Datapoint(s)Attribute should work on IEnumerable<T> as well as on Arrays
|
||||
* 561436 SetCulture broken with 2.5.4
|
||||
* 563532 DatapointsAttribute should be allowed on properties and methods
|
||||
|
||||
NUnit 2.9.3 - October 26, 2009
|
||||
|
||||
Main Features
|
||||
|
||||
* Created new API for controlling framework
|
||||
* New builds for .Net 3.5 and 4.0, compact framework 3.5
|
||||
* Support for old style tests has been removed
|
||||
* New adhoc runner for testing the framework
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* 432805 Some Framework Tests don't run on Linux
|
||||
* 440109 Full Framework does not support "Contains"
|
||||
|
||||
NUnit 2.9.2 - September 19, 2009
|
||||
|
||||
Main Features
|
||||
|
||||
* NUnitLite code is now merged with NUnit
|
||||
* Added NUnitLite runner to the framework code
|
||||
* Added Compact framework builds
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* 430100 Assert.Catch<T> should return T
|
||||
* 432566 NUnitLite shows empty string as argument
|
||||
* 432573 Mono test should be at runtime
|
||||
|
||||
NUnit 2.9.1 - August 27, 2009
|
||||
|
||||
General
|
||||
|
||||
* Created a separate project for the framework and framework tests
|
||||
* Changed license to MIT / X11
|
||||
* Created Windows installer for the framework
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* 400502 NUnitEqualityComparer.StreamsEqual fails for same stream
|
||||
* 400508 TestCaseSource attirbute is not working when Type is given
|
||||
* 400510 TestCaseData variable length ctor drops values
|
||||
* 417557 Add SetUICultureAttribute from NUnit 2.5.2
|
||||
* 417559 Add Ignore to TestFixture, TestCase and TestCaseData
|
||||
* 417560 Merge Assert.Throws and Assert.Catch changes from NUnit 2.5.2
|
||||
* 417564 TimeoutAttribute on Assembly
|
||||
20
packages/NUnit.3.2.0/LICENSE.txt
vendored
20
packages/NUnit.3.2.0/LICENSE.txt
vendored
@@ -1,20 +0,0 @@
|
||||
Copyright (c) 2016 Charlie Poole
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
5
packages/NUnit.3.2.0/NOTICES.txt
vendored
5
packages/NUnit.3.2.0/NOTICES.txt
vendored
@@ -1,5 +0,0 @@
|
||||
NUnit 3.0 is based on earlier versions of NUnit, with Portions
|
||||
|
||||
Copyright (c) 2002-2014 Charlie Poole or
|
||||
Copyright (c) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or
|
||||
Copyright (c) 2000-2002 Philip A. Craig
|
||||
BIN
packages/NUnit.3.2.0/NUnit.3.2.0.nupkg
vendored
BIN
packages/NUnit.3.2.0/NUnit.3.2.0.nupkg
vendored
Binary file not shown.
BIN
packages/NUnit.3.2.0/lib/dotnet/nunit.framework.dll
vendored
BIN
packages/NUnit.3.2.0/lib/dotnet/nunit.framework.dll
vendored
Binary file not shown.
15715
packages/NUnit.3.2.0/lib/dotnet/nunit.framework.xml
vendored
15715
packages/NUnit.3.2.0/lib/dotnet/nunit.framework.xml
vendored
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user