Permalink
Browse files

Merge branch 'hotfix11'

  • Loading branch information...
2 parents 68f052e + 9cee827 commit f63980f1228e3553ca76687b302fdc1fbed6a62f @sparerd sparerd committed Nov 8, 2017
View
@@ -1,3 +1,15 @@
+1.75.7011 (2017-11-07):
+
+Fixes:
+------
+#778: Custom connection file path command line argument (/c) not working
+#763: Sometimes minimizing folder causes connection tree to disappear
+#761: Connections using external tools do not start (introduced in v1.75.7009)
+#758: "Decryption failed" message when loading from SQL server
+Fixed issues with /resetpanels and /resetpos command line arguments
+Resolved bug where connection tree hotkeys would sometimes be disabled
+
+
1.75.7010 (2017-10-29):
Fixes:
@@ -0,0 +1,57 @@
+using System.Collections;
+using mRemoteNG.App;
+using mRemoteNG.Connection;
+using mRemoteNG.Connection.Protocol;
+using mRemoteNG.Tools;
+using mRemoteNG.UI.Window;
+using NUnit.Framework;
+using WeifenLuo.WinFormsUI.Docking;
+
+namespace mRemoteNGTests.Connection.Protocol
+{
+ public class IntegratedProgramTests
+ {
+ private readonly ExternalTool _extTool = new ExternalTool
+ {
+ DisplayName = "notepad",
+ FileName = @"%windir%\system32\notepad.exe",
+ Arguments = "",
+ TryIntegrate = true
+ };
+
+
+ [Test]
+ public void CanStartExternalApp()
+ {
+ SetExternalToolList(_extTool);
+ var sut = new IntegratedProgram();
+ sut.InterfaceControl = BuildInterfaceControl("notepad", sut);
+ sut.Initialize();
+ var appStarted = sut.Connect();
+ sut.Disconnect();
+ Assert.That(appStarted);
+ }
+
+ [Test]
+ public void ConnectingToExternalAppThatDoesntExistDoesNothing()
+ {
+ SetExternalToolList(_extTool);
+ var sut = new IntegratedProgram();
+ sut.InterfaceControl = BuildInterfaceControl("doesntExist", sut);
+ var appInitialized = sut.Initialize();
+ Assert.That(appInitialized, Is.False);
+ }
+
+ private void SetExternalToolList(ExternalTool externalTool)
+ {
+ Runtime.ExternalTools = new ArrayList {externalTool};
+ }
+
+ private InterfaceControl BuildInterfaceControl(string extAppName, ProtocolBase sut)
+ {
+ var connectionWindow = new ConnectionWindow(new DockContent());
+ var connectionInfo = new ConnectionInfo {ExtApp = extAppName};
+ return new InterfaceControl(connectionWindow, sut, connectionInfo);
+ }
+ }
+}
@@ -123,6 +123,7 @@
<Compile Include="Config\Serializers\XmlRootNodeSerializerTests.cs" />
<Compile Include="Connection\AbstractConnectionInfoDataTests.cs" />
<Compile Include="Connection\ConnectionInfoComparerTests.cs" />
+ <Compile Include="Connection\Protocol\IntegratedProgramTests.cs" />
<Compile Include="Connection\Protocol\ProtocolListTests.cs" />
<Compile Include="IntegrationTests\XmlSerializationLifeCycleTests.cs" />
<Compile Include="Security\Authentication\PasswordAuthenticatorTests.cs" />
@@ -56,6 +56,7 @@ private static void SwitchToCurrentInstance()
if (singletonInstanceWindowHandle == IntPtr.Zero) return;
if (NativeMethods.IsIconic(singletonInstanceWindowHandle) != 0)
NativeMethods.ShowWindow(singletonInstanceWindowHandle, (int)NativeMethods.SW_RESTORE);
+ NativeMethods.SetForegroundWindow(singletonInstanceWindowHandle);
}
private static IntPtr GetRunningSingletonInstanceWindowHandle()
View
@@ -469,7 +469,7 @@ public static void SaveConnections()
connectionsSaver.SQLDatabaseName = Settings.Default.SQLDatabaseName;
connectionsSaver.SQLUsername = Settings.Default.SQLUser;
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
- connectionsSaver.SQLPassword = cryptographyProvider.Decrypt(Settings.Default.SQLUser, EncryptionKey);
+ connectionsSaver.SQLPassword = cryptographyProvider.Decrypt(Settings.Default.SQLPass, EncryptionKey);
}
connectionsSaver.SaveConnections();
View
@@ -253,11 +253,11 @@ private static void ParseCommandLineArgs()
var ConsParam = "";
if (cmd["cons"] != null)
{
- ConsParam = "cons";
+ ConsParam = cmd["cons"];
}
if (cmd["c"] != null)
{
- ConsParam = "c";
+ ConsParam = cmd["c"];
}
var ResetPosParam = "";
@@ -318,8 +318,12 @@ private static void ParseCommandLineArgs()
if (!string.IsNullOrEmpty(ResetPosParam))
{
Settings.Default.MainFormKiosk = false;
- Settings.Default.MainFormLocation = new Point(999, 999);
- Settings.Default.MainFormSize = new Size(900, 600);
+ var newWidth = 900;
+ var newHeight = 600;
+ var newX = Screen.PrimaryScreen.WorkingArea.Width/2 - newWidth/2;
+ var newY = Screen.PrimaryScreen.WorkingArea.Height/2 - newHeight/2;
+ Settings.Default.MainFormLocation = new Point(newX, newY);
+ Settings.Default.MainFormSize = new Size(newWidth, newHeight);
Settings.Default.MainFormState = FormWindowState.Normal;
}
@@ -1,11 +1,11 @@
-using mRemoteNG.App;
-using mRemoteNG.Tools;
using System;
using System.Diagnostics;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
+using mRemoteNG.App;
using mRemoteNG.Messages;
+using mRemoteNG.Tools;
namespace mRemoteNG.Connection.Protocol
@@ -21,9 +21,15 @@ public class IntegratedProgram : ProtocolBase
#region Public Methods
public override bool Initialize()
{
- if (InterfaceControl.Info == null) return base.Initialize();
+ if (InterfaceControl.Info == null)
+ return base.Initialize();
- _externalTool = Runtime.GetExtAppByName(InterfaceControl.Info.Name);
+ _externalTool = Runtime.GetExtAppByName(InterfaceControl.Info.ExtApp);
+ if (_externalTool == null)
+ {
+ Runtime.MessageCollector?.AddMessage(MessageClass.ErrorMsg, string.Format(Language.CouldNotFindExternalTool, InterfaceControl.Info.ExtApp));
+ return false;
+ }
_externalTool.ConnectionInfo = InterfaceControl.Info;
return base.Initialize();
@@ -33,7 +39,7 @@ public override bool Connect()
{
try
{
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, $"Attempting to start: {_externalTool.DisplayName}", true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, $"Attempting to start: {_externalTool.DisplayName}", true);
if (_externalTool.TryIntegrate == false)
{
@@ -43,7 +49,7 @@ public override bool Connect()
* will be called - which is just going to call IntegratedProgram.Close() again anyway...
* Close();
*/
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, $"Assuming no other errors/exceptions occurred immediately before this message regarding {_externalTool.DisplayName}, the next \"closed by user\" message can be ignored", true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, $"Assuming no other errors/exceptions occurred immediately before this message regarding {_externalTool.DisplayName}, the next \"closed by user\" message can be ignored", true);
return false;
}
@@ -80,18 +86,18 @@ public override bool Connect()
}
NativeMethods.SetParent(_handle, InterfaceControl.Handle);
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strIntAppStuff, true);
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strIntAppHandle, _handle), true);
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strIntAppTitle, _process.MainWindowTitle), true);
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strIntAppParentHandle, InterfaceControl.Parent.Handle), true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, Language.strIntAppStuff, true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, string.Format(Language.strIntAppHandle, _handle), true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, string.Format(Language.strIntAppTitle, _process.MainWindowTitle), true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, string.Format(Language.strIntAppParentHandle, InterfaceControl.Parent.Handle), true);
Resize(this, new EventArgs());
base.Connect();
return true;
}
catch (Exception ex)
{
- Runtime.MessageCollector.AddExceptionMessage(Language.strIntAppConnectionFailed, ex);
+ Runtime.MessageCollector?.AddExceptionMessage(Language.strIntAppConnectionFailed, ex);
return false;
}
}
@@ -1,6 +1,6 @@
using System;
-using System.Windows.Forms;
using System.Threading;
+using System.Windows.Forms;
using mRemoteNG.App;
using mRemoteNG.Tools;
@@ -153,7 +153,7 @@ private void CloseBG()
}
catch (Exception ex)
{
- Runtime.MessageCollector.AddExceptionStackTrace("Couldn't dispose control, probably form is already closed (Connection.Protocol.Base)", ex);
+ Runtime.MessageCollector?.AddExceptionStackTrace("Couldn't dispose control, probably form is already closed (Connection.Protocol.Base)", ex);
}
}
@@ -172,12 +172,12 @@ private void CloseBG()
}
catch (Exception ex)
{
- Runtime.MessageCollector.AddExceptionStackTrace("Couldn't set InterfaceControl.Parent.Tag or Dispose Interface, probably form is already closed (Connection.Protocol.Base)", ex);
+ Runtime.MessageCollector?.AddExceptionStackTrace("Couldn't set InterfaceControl.Parent.Tag or Dispose Interface, probably form is already closed (Connection.Protocol.Base)", ex);
}
}
catch (Exception ex)
{
- Runtime.MessageCollector.AddExceptionStackTrace("Couldn't Close InterfaceControl BG (Connection.Protocol.Base)", ex);
+ Runtime.MessageCollector?.AddExceptionStackTrace("Couldn't Close InterfaceControl BG (Connection.Protocol.Base)", ex);
}
}
@@ -33,7 +33,7 @@
// by using the '*' as shown below:
// <Assembly: AssemblyVersion("1.0.*")>
-[assembly: AssemblyVersion("1.75.7010.*")]
+[assembly: AssemblyVersion("1.75.7011.*")]
[assembly:NeutralResourcesLanguageAttribute("en")]

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -2433,4 +2433,7 @@ mRemoteNG will now quit and begin with the installation.</value>
<data name="strPropertyNameRDPAlertIdleTimeout" xml:space="preserve">
<value>Alert on Idle Disconnect</value>
</data>
+ <data name="CouldNotFindExternalTool" xml:space="preserve">
+ <value>Could not find external tool with name "{0}"</value>
+ </data>
</root>
@@ -105,7 +105,7 @@ private ConnectionInfo GetAppropriateInstanceOfConnectionInfo()
private void SetConnectionInfoFields(ConnectionInfo newConnectionInfo)
{
newConnectionInfo.Protocol = ProtocolType.IntApp;
- newConnectionInfo.ExtApp = FileName;
+ newConnectionInfo.ExtApp = DisplayName;
newConnectionInfo.Name = DisplayName;
newConnectionInfo.Panel = Language.strMenuExternalTools;
}
@@ -60,9 +60,13 @@ public ConnectionContextMenu(ConnectionTree connectionTree)
Opening += (sender, args) =>
{
AddExternalApps();
+ if (_connectionTree.SelectedNode == null)
+ {
+ args.Cancel = true;
+ return;
+ }
ShowHideMenuItems();
};
- Closing += (sender, args) => EnableMenuItemsRecursive(Items);
}
private void InitializeComponent()
@@ -397,9 +401,6 @@ private void ApplyLanguage()
internal void ShowHideMenuItems()
{
- if (_connectionTree.SelectedNode == null)
- return;
-
try
{
Enabled = true;
@@ -443,7 +444,9 @@ internal void ShowHideMenuItemsForRootPuttyNode()
_cMenTreeToolsSort.Enabled = false;
_cMenTreeToolsExternalApps.Enabled = false;
_cMenTreeDuplicate.Enabled = false;
- _cMenTreeRename.Enabled = true;
+ _cMenTreeImport.Enabled = false;
+ _cMenTreeExportFile.Enabled = false;
+ _cMenTreeRename.Enabled = false;
_cMenTreeDelete.Enabled = false;
_cMenTreeMoveUp.Enabled = false;
_cMenTreeMoveDown.Enabled = false;
@@ -498,6 +501,8 @@ internal void ShowHideMenuItemsForPuttyNode(ConnectionInfo connectionInfo)
_cMenTreeDelete.Enabled = false;
_cMenTreeMoveUp.Enabled = false;
_cMenTreeMoveDown.Enabled = false;
+ _cMenTreeImport.Enabled = false;
+ _cMenTreeExportFile.Enabled = false;
}
internal void ShowHideMenuItemsForConnectionNode(ConnectionInfo connectionInfo)
Oops, something went wrong.

0 comments on commit f63980f

Please sign in to comment.