mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Compare commits
3 Commits
renovate/a
...
v1.8-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a82a8fce52 | ||
|
|
4113721b17 | ||
|
|
99e7e78558 |
180
ExternalConnectors/AWS/AWSConnectionForm.Designer.cs
generated
180
ExternalConnectors/AWS/AWSConnectionForm.Designer.cs
generated
@@ -1,180 +0,0 @@
|
||||
namespace ExternalConnectors.AWS
|
||||
{
|
||||
partial class AWSConnectionForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tbAccesKeyID = new System.Windows.Forms.TextBox();
|
||||
this.tbAccesKey = new System.Windows.Forms.TextBox();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tbAccesKeyID
|
||||
//
|
||||
this.tbAccesKeyID.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbAccesKeyID.Location = new System.Drawing.Point(152, 4);
|
||||
this.tbAccesKeyID.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.tbAccesKeyID.Name = "tbAccesKeyID";
|
||||
this.tbAccesKeyID.Size = new System.Drawing.Size(490, 23);
|
||||
this.tbAccesKeyID.TabIndex = 0;
|
||||
//
|
||||
// tbAccesKey
|
||||
//
|
||||
this.tbAccesKey.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbAccesKey.Location = new System.Drawing.Point(152, 43);
|
||||
this.tbAccesKey.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.tbAccesKey.Name = "tbAccesKey";
|
||||
this.tbAccesKey.Size = new System.Drawing.Size(490, 23);
|
||||
this.tbAccesKey.TabIndex = 2;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(219, 12);
|
||||
this.btnOK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(88, 26);
|
||||
this.btnOK.TabIndex = 10;
|
||||
this.btnOK.Text = "OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(338, 12);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(88, 26);
|
||||
this.btnCancel.TabIndex = 11;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 22.92994F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 77.07006F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tbAccesKeyID, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tbAccesKey, 1, 1);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 3;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 23F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 23F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 23F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(646, 102);
|
||||
this.tableLayoutPanel1.TabIndex = 12;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(4, 0);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(140, 39);
|
||||
this.label1.TabIndex = 2;
|
||||
this.label1.Text = "Access Key ID";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(4, 39);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(140, 39);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "Access Key";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
this.tableLayoutPanel2.ColumnCount = 5;
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 93F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 23F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 93F));
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnOK, 1, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnCancel, 3, 0);
|
||||
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 112);
|
||||
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
this.tableLayoutPanel2.RowCount = 1;
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(646, 50);
|
||||
this.tableLayoutPanel2.TabIndex = 13;
|
||||
//
|
||||
// AWSConnectionForm
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(646, 162);
|
||||
this.Controls.Add(this.tableLayoutPanel2);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.Name = "AWSConnectionForm";
|
||||
this.Text = "AWS EC2 API Login Data";
|
||||
this.Activated += new System.EventHandler(this.AWSConnectionForm_Activated);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public System.Windows.Forms.TextBox tbAccesKeyID;
|
||||
public System.Windows.Forms.TextBox tbAccesKey;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
namespace ExternalConnectors.AWS
|
||||
{
|
||||
public partial class AWSConnectionForm : Form
|
||||
{
|
||||
public AWSConnectionForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
private void AWSConnectionForm_Activated(object sender, EventArgs e)
|
||||
{
|
||||
tbAccesKeyID.Focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<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>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,119 +0,0 @@
|
||||
using Amazon;
|
||||
using Amazon.EC2;
|
||||
using Amazon.EC2.Model;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace ExternalConnectors.AWS
|
||||
{
|
||||
public class EC2FetchDataService
|
||||
{
|
||||
private static DateTime lastFetch;
|
||||
private static List<InstanceInfo>? lastData;
|
||||
|
||||
// input must be in format "AWSAPI:instanceid" where instanceid is the ec2 instance id, e.g. i-066f750a76c97583d
|
||||
public static async Task<string> GetEC2InstanceDataAsync(string input, string region)
|
||||
{
|
||||
// get secret id
|
||||
if (!input.StartsWith("AWSAPI:"))
|
||||
throw new Exception("calling this function requires AWSAPI: input");
|
||||
string InstanceID = input[7..];
|
||||
|
||||
// init connection credentials, display popup if necessary
|
||||
AWSConnectionData.Init();
|
||||
var alldata = await GetEC2IPDataAsync(region);
|
||||
var found = alldata.Where(x => x.InstanceId == InstanceID).SingleOrDefault();
|
||||
return (found == null) ? "" : found.PublicIP;
|
||||
}
|
||||
|
||||
private static async Task<List<InstanceInfo>> GetEC2IPDataAsync(string region)
|
||||
{
|
||||
// caching
|
||||
TimeSpan timeSpan = DateTime.Now - lastFetch;
|
||||
if (timeSpan.TotalMinutes < 1 && lastData != null)
|
||||
return lastData;
|
||||
|
||||
//AWSConfigs.AWSRegion = AWSConnectionData.region;
|
||||
AWSConfigs.AWSRegion = region;
|
||||
string awsAccessKeyId = AWSConnectionData.awsKeyID;
|
||||
string awsSecretAccessKey = AWSConnectionData.awsKey;
|
||||
|
||||
var _client = new AmazonEC2Client(awsAccessKeyId, awsSecretAccessKey, RegionEndpoint.EUCentral1);
|
||||
bool done = false;
|
||||
|
||||
List<InstanceInfo> instanceList = new();
|
||||
var request = new DescribeInstancesRequest();
|
||||
while (!done)
|
||||
{
|
||||
DescribeInstancesResponse response = await _client.DescribeInstancesAsync(request);
|
||||
|
||||
foreach (var reservation in response.Reservations)
|
||||
{
|
||||
foreach (var instance in reservation.Instances)
|
||||
{
|
||||
string vmname = "";
|
||||
foreach (var tag in instance.Tags)
|
||||
{
|
||||
if (tag.Key == "Name")
|
||||
{
|
||||
vmname = tag.Value;
|
||||
}
|
||||
}
|
||||
InstanceInfo inf = new(instance, vmname);
|
||||
instanceList.Add(inf);
|
||||
}
|
||||
}
|
||||
|
||||
request.NextToken = response.NextToken;
|
||||
|
||||
if (response.NextToken == null)
|
||||
{
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
lastData = instanceList.OrderBy(x => x.Name).ToList();
|
||||
lastFetch = DateTime.Now;
|
||||
return lastData;
|
||||
}
|
||||
|
||||
|
||||
public static class AWSConnectionData
|
||||
{
|
||||
private static readonly RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\mRemoteAWSInterface");
|
||||
|
||||
public static string awsKeyID = "";
|
||||
public static string awsKey = "";
|
||||
//public static string _region = "eu-central-1";
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
if (awsKey != "")
|
||||
return;
|
||||
// display gui and ask for data
|
||||
AWSConnectionForm f = new();
|
||||
f.tbAccesKeyID.Text = "" + key.GetValue("KeyID");
|
||||
f.tbAccesKey.Text = "" + key.GetValue("Key");
|
||||
//f.tbRegion.Text = "" + key.GetValue("Region");
|
||||
//if (f.tbRegion.Text == null || f.tbRegion.Text.Length < 2)
|
||||
// f.tbRegion.Text = region;
|
||||
_ = f.ShowDialog();
|
||||
|
||||
if (f.DialogResult != DialogResult.OK)
|
||||
return;
|
||||
|
||||
// store values to memory
|
||||
awsKeyID = f.tbAccesKeyID.Text;
|
||||
awsKey = f.tbAccesKey.Text;
|
||||
//region = f.tbRegion.Text;
|
||||
|
||||
|
||||
// write values to registry
|
||||
key.SetValue("KeyID", awsKeyID);
|
||||
key.SetValue("Key", awsKey);
|
||||
//key.SetValue("Region", region);
|
||||
key.Close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
using Amazon.EC2.Model;
|
||||
using System;
|
||||
|
||||
namespace ExternalConnectors.AWS
|
||||
{
|
||||
public class InstanceInfo
|
||||
{
|
||||
public string InstanceId { get; }
|
||||
public string Name { get; }
|
||||
public string Status { get; }
|
||||
public string PublicIP { get; }
|
||||
public string PrivateIP { get; }
|
||||
public InstanceInfo(Instance instance, string name)
|
||||
{
|
||||
InstanceId = instance.InstanceId;
|
||||
Name = name;
|
||||
|
||||
switch(instance.State.Code)
|
||||
{
|
||||
case 0: Status = "Pending"; break;
|
||||
case 16: Status = "Running"; break;
|
||||
case 32: Status = "Shutdown"; break;
|
||||
case 48: Status = "Terminated"; break;
|
||||
case 64: Status = "Stopping"; break;
|
||||
case 80: Status = "Stopped"; break;
|
||||
default: Status = "Unknown"; break;
|
||||
};
|
||||
|
||||
PublicIP = instance.PublicIpAddress ?? "";
|
||||
PrivateIP = instance.PrivateIpAddress ?? "";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Library</OutputType>
|
||||
<UseWindowsForms>True</UseWindowsForms>
|
||||
<Platforms>x64</Platforms>
|
||||
<Configurations>Debug;Release;Debug Portable;Release Portable</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AWSSDK.Core" Version="3.7.6" />
|
||||
<PackageReference Include="AWSSDK.EC2" Version="3.7.55.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="AWS\AWSConnectionForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="TSS\SSConnectionForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
280
ExternalConnectors/TSS/SSConnectionForm.Designer.cs
generated
280
ExternalConnectors/TSS/SSConnectionForm.Designer.cs
generated
@@ -1,280 +0,0 @@
|
||||
namespace ExternalConnectors.TSS
|
||||
{
|
||||
partial class SSConnectionForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SSConnectionForm));
|
||||
this.tbSSURL = new System.Windows.Forms.TextBox();
|
||||
this.tbUsername = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.tbPassword = new System.Windows.Forms.TextBox();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.cbUseSSO = new System.Windows.Forms.CheckBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.tbOTP = new System.Windows.Forms.TextBox();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tbSSURL
|
||||
//
|
||||
this.tbSSURL.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbSSURL.Location = new System.Drawing.Point(260, 4);
|
||||
this.tbSSURL.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.tbSSURL.Name = "tbSSURL";
|
||||
this.tbSSURL.Size = new System.Drawing.Size(536, 23);
|
||||
this.tbSSURL.TabIndex = 0;
|
||||
//
|
||||
// tbUsername
|
||||
//
|
||||
this.tbUsername.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbUsername.Location = new System.Drawing.Point(260, 35);
|
||||
this.tbUsername.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.tbUsername.Name = "tbUsername";
|
||||
this.tbUsername.Size = new System.Drawing.Size(536, 23);
|
||||
this.tbUsername.TabIndex = 2;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label3.Location = new System.Drawing.Point(4, 62);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(248, 31);
|
||||
this.label3.TabIndex = 5;
|
||||
this.label3.Text = "Password";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// tbPassword
|
||||
//
|
||||
this.tbPassword.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbPassword.Location = new System.Drawing.Point(260, 66);
|
||||
this.tbPassword.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.tbPassword.Name = "tbPassword";
|
||||
this.tbPassword.Size = new System.Drawing.Size(536, 23);
|
||||
this.tbPassword.TabIndex = 4;
|
||||
this.tbPassword.UseSystemPasswordChar = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(296, 12);
|
||||
this.btnOK.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(88, 26);
|
||||
this.btnOK.TabIndex = 6;
|
||||
this.btnOK.Text = "OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(415, 12);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(88, 26);
|
||||
this.btnCancel.TabIndex = 11;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 32.06997F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67.93003F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tbSSURL, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.cbUseSSO, 0, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tbUsername, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tbPassword, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label6, 0, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tbOTP, 1, 3);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 5;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(800, 159);
|
||||
this.tableLayoutPanel1.TabIndex = 12;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label5.Location = new System.Drawing.Point(260, 124);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(536, 35);
|
||||
this.label5.TabIndex = 15;
|
||||
this.label5.Text = "For SSO to work, additional IIS configuration is required!";
|
||||
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(4, 0);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(248, 31);
|
||||
this.label1.TabIndex = 2;
|
||||
this.label1.Text = "Secret Server URL";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(4, 31);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(248, 31);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "DOMAIN\\Username";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// cbUseSSO
|
||||
//
|
||||
this.cbUseSSO.AutoSize = true;
|
||||
this.cbUseSSO.Location = new System.Drawing.Point(4, 128);
|
||||
this.cbUseSSO.Margin = new System.Windows.Forms.Padding(4, 4, 4, 0);
|
||||
this.cbUseSSO.Name = "cbUseSSO";
|
||||
this.cbUseSSO.Size = new System.Drawing.Size(69, 19);
|
||||
this.cbUseSSO.TabIndex = 14;
|
||||
this.cbUseSSO.Text = "Use SSO";
|
||||
this.cbUseSSO.UseVisualStyleBackColor = true;
|
||||
this.cbUseSSO.CheckedChanged += new System.EventHandler(this.cbUseSSO_CheckedChanged);
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label6.Location = new System.Drawing.Point(3, 93);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(250, 31);
|
||||
this.label6.TabIndex = 15;
|
||||
this.label6.Text = "2FA OTP (Optional)";
|
||||
//
|
||||
// tbOTP
|
||||
//
|
||||
this.tbOTP.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbOTP.Location = new System.Drawing.Point(259, 96);
|
||||
this.tbOTP.Name = "tbOTP";
|
||||
this.tbOTP.Size = new System.Drawing.Size(538, 23);
|
||||
this.tbOTP.TabIndex = 5;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
this.tableLayoutPanel2.ColumnCount = 5;
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 93F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 23F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 93F));
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnOK, 1, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnCancel, 3, 0);
|
||||
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 225);
|
||||
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
this.tableLayoutPanel2.RowCount = 1;
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(800, 50);
|
||||
this.tableLayoutPanel2.TabIndex = 13;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label4.Location = new System.Drawing.Point(0, 159);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(341, 15);
|
||||
this.label4.TabIndex = 14;
|
||||
this.label4.Text = "URL is the base URL, like https://cred.domain.local/SecretServer";
|
||||
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// SSConnectionForm
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 275);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.tableLayoutPanel2);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "SSConnectionForm";
|
||||
this.Text = "Secret Server API Login Data";
|
||||
this.Activated += new System.EventHandler(this.SSConnectionForm_Activated);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Label label3;
|
||||
|
||||
public System.Windows.Forms.TextBox tbSSURL;
|
||||
public System.Windows.Forms.TextBox tbUsername;
|
||||
public System.Windows.Forms.TextBox tbPassword;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
public System.Windows.Forms.CheckBox cbUseSSO;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private Label label5;
|
||||
private Label label6;
|
||||
public TextBox tbOTP;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
namespace ExternalConnectors.TSS
|
||||
{
|
||||
public partial class SSConnectionForm : Form
|
||||
{
|
||||
public SSConnectionForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SSConnectionForm_Activated(object sender, EventArgs e)
|
||||
{
|
||||
SetVisibility();
|
||||
if (cbUseSSO.Checked)
|
||||
btnOK.Focus();
|
||||
else
|
||||
tbPassword.Focus();
|
||||
}
|
||||
|
||||
private void cbUseSSO_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetVisibility();
|
||||
}
|
||||
private void SetVisibility()
|
||||
{
|
||||
bool ch = cbUseSSO.Checked;
|
||||
tbPassword.Enabled = !ch;
|
||||
tbUsername.Enabled = !ch;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,615 +0,0 @@
|
||||
<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>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAQAQEAAAAEAIAAoQAAARgAAACAgAAABACAAKBAAAG5AAAAYGAAAAQAgACgJAACWUAAAEBAAAAEA
|
||||
IAAoBAAAvlkAACgAAABAAAAAgAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9/f3e/f397vz9
|
||||
/e79/f3u7ezr7p6Xju5XTEHuNScV7i8hCe4rHwjuKx8I7isfCO4rHwjuKx8I7isfCO4rHwj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AAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,383 +0,0 @@
|
||||
//----------------------
|
||||
// <auto-generated>
|
||||
// Generated using the NSwag toolchain v13.14.8.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
|
||||
// </auto-generated>
|
||||
//----------------------
|
||||
|
||||
#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
|
||||
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
|
||||
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
|
||||
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
|
||||
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
|
||||
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
|
||||
#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
|
||||
|
||||
namespace SecretServerAuthentication.TSS
|
||||
{
|
||||
using System = global::System;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.14.8.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v11.0.0.0))")]
|
||||
public partial class OAuth2ServiceClient
|
||||
{
|
||||
private string _baseUrl = "";
|
||||
private System.Net.Http.HttpClient _httpClient;
|
||||
private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings;
|
||||
|
||||
public OAuth2ServiceClient(string baseUrl, System.Net.Http.HttpClient httpClient)
|
||||
{
|
||||
BaseUrl = baseUrl;
|
||||
_httpClient = httpClient;
|
||||
_settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings);
|
||||
}
|
||||
|
||||
private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings()
|
||||
{
|
||||
var settings = new Newtonsoft.Json.JsonSerializerSettings();
|
||||
UpdateJsonSerializerSettings(settings);
|
||||
return settings;
|
||||
}
|
||||
|
||||
public string BaseUrl
|
||||
{
|
||||
get { return _baseUrl; }
|
||||
set { _baseUrl = value; }
|
||||
}
|
||||
|
||||
protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }
|
||||
|
||||
partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
|
||||
|
||||
|
||||
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
|
||||
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
|
||||
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);
|
||||
/// <summary>Retrieve or Refresh Access Token</summary>
|
||||
/// <param name="grant_type">Authentication grant type. Use 'password' when authenticating, and 'refresh_token' when refreshing a token.</param>
|
||||
/// <param name="username">Secret Server authentication username. Required when authenticating.</param>
|
||||
/// <param name="password">Secret Server authentication password. Required when authenticating.</param>
|
||||
/// <param name="refresh_token">The refresh token. Required when refreshing a token.</param>
|
||||
/// <returns>Successful retrieval of an access token</returns>
|
||||
/// <exception cref="ApiException">A server side error occurred.</exception>
|
||||
public System.Threading.Tasks.Task<TokenResponse> AuthorizeAsync(Grant_type grant_type, string username, string password, string refresh_token, string OTP)
|
||||
{
|
||||
return AuthorizeAsync(grant_type, username, password, refresh_token, System.Threading.CancellationToken.None, OTP);
|
||||
}
|
||||
|
||||
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
|
||||
/// <summary>Retrieve or Refresh Access Token</summary>
|
||||
/// <param name="grant_type">Authentication grant type. Use 'password' when authenticating, and 'refresh_token' when refreshing a token.</param>
|
||||
/// <param name="username">Secret Server authentication username. Required when authenticating.</param>
|
||||
/// <param name="password">Secret Server authentication password. Required when authenticating.</param>
|
||||
/// <param name="refresh_token">The refresh token. Required when refreshing a token.</param>
|
||||
/// <returns>Successful retrieval of an access token</returns>
|
||||
/// <exception cref="ApiException">A server side error occurred.</exception>
|
||||
public async System.Threading.Tasks.Task<TokenResponse> AuthorizeAsync(Grant_type grant_type, string username, string password, string refresh_token, System.Threading.CancellationToken cancellationToken, string OTP)
|
||||
{
|
||||
var urlBuilder_ = new System.Text.StringBuilder();
|
||||
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/oauth2/token");
|
||||
|
||||
var client_ = _httpClient;
|
||||
var disposeClient_ = false;
|
||||
try
|
||||
{
|
||||
using (var request_ = new System.Net.Http.HttpRequestMessage())
|
||||
{
|
||||
var keyValues_ = new System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, string>>();
|
||||
if (grant_type == null)
|
||||
throw new System.ArgumentNullException("grant_type");
|
||||
else
|
||||
keyValues_.Add(new System.Collections.Generic.KeyValuePair<string, string>("grant_type", ConvertToString(grant_type, System.Globalization.CultureInfo.InvariantCulture)));
|
||||
if (username != null)
|
||||
keyValues_.Add(new System.Collections.Generic.KeyValuePair<string, string>("username", ConvertToString(username, System.Globalization.CultureInfo.InvariantCulture)));
|
||||
if (password != null)
|
||||
keyValues_.Add(new System.Collections.Generic.KeyValuePair<string, string>("password", ConvertToString(password, System.Globalization.CultureInfo.InvariantCulture)));
|
||||
if (refresh_token != null)
|
||||
keyValues_.Add(new System.Collections.Generic.KeyValuePair<string, string>("refresh_token", ConvertToString(refresh_token, System.Globalization.CultureInfo.InvariantCulture)));
|
||||
if (OTP != null)
|
||||
request_.Headers.Add("OTP", ConvertToString(OTP, System.Globalization.CultureInfo.InvariantCulture));
|
||||
|
||||
request_.Content = new System.Net.Http.FormUrlEncodedContent(keyValues_);
|
||||
request_.Method = new System.Net.Http.HttpMethod("POST");
|
||||
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
|
||||
|
||||
PrepareRequest(client_, request_, urlBuilder_);
|
||||
|
||||
var url_ = urlBuilder_.ToString();
|
||||
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
|
||||
|
||||
PrepareRequest(client_, request_, url_);
|
||||
|
||||
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
|
||||
var disposeResponse_ = true;
|
||||
try
|
||||
{
|
||||
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
|
||||
if (response_.Content != null && response_.Content.Headers != null)
|
||||
{
|
||||
foreach (var item_ in response_.Content.Headers)
|
||||
headers_[item_.Key] = item_.Value;
|
||||
}
|
||||
|
||||
ProcessResponse(client_, response_);
|
||||
|
||||
var status_ = (int)response_.StatusCode;
|
||||
if (status_ == 200)
|
||||
{
|
||||
var objectResponse_ = await ReadObjectResponseAsync<TokenResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
|
||||
if (objectResponse_.Object == null)
|
||||
{
|
||||
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
|
||||
}
|
||||
|
||||
return objectResponse_.Object;
|
||||
}
|
||||
else
|
||||
if (status_ == 400)
|
||||
{
|
||||
var objectResponse_ = await ReadObjectResponseAsync<TokenErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
|
||||
if (objectResponse_.Object == null)
|
||||
{
|
||||
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
|
||||
}
|
||||
throw new ApiException<TokenErrorResponse>("An error occurred", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (disposeResponse_)
|
||||
response_.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (disposeClient_)
|
||||
client_.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
protected struct ObjectResponseResult<T>
|
||||
{
|
||||
public ObjectResponseResult(T responseObject, string responseText)
|
||||
{
|
||||
this.Object = responseObject;
|
||||
this.Text = responseText;
|
||||
}
|
||||
|
||||
public T Object { get; }
|
||||
|
||||
public string Text { get; }
|
||||
}
|
||||
|
||||
public bool ReadResponseAsString { get; set; }
|
||||
|
||||
protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken)
|
||||
{
|
||||
if (response == null || response.Content == null)
|
||||
{
|
||||
return new ObjectResponseResult<T>(default(T), string.Empty);
|
||||
}
|
||||
|
||||
if (ReadResponseAsString)
|
||||
{
|
||||
var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(responseText, JsonSerializerSettings);
|
||||
return new ObjectResponseResult<T>(typedBody, responseText);
|
||||
}
|
||||
catch (Newtonsoft.Json.JsonException exception)
|
||||
{
|
||||
var message = "Could not deserialize the response body string as " + typeof(T).FullName + ".";
|
||||
throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
|
||||
using (var streamReader = new System.IO.StreamReader(responseStream))
|
||||
using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader))
|
||||
{
|
||||
var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings);
|
||||
var typedBody = serializer.Deserialize<T>(jsonTextReader);
|
||||
return new ObjectResponseResult<T>(typedBody, string.Empty);
|
||||
}
|
||||
}
|
||||
catch (Newtonsoft.Json.JsonException exception)
|
||||
{
|
||||
var message = "Could not deserialize the response body stream as " + typeof(T).FullName + ".";
|
||||
throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
if (value is System.Enum)
|
||||
{
|
||||
var name = System.Enum.GetName(value.GetType(), value);
|
||||
if (name != null)
|
||||
{
|
||||
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
|
||||
if (field != null)
|
||||
{
|
||||
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute))
|
||||
as System.Runtime.Serialization.EnumMemberAttribute;
|
||||
if (attribute != null)
|
||||
{
|
||||
return attribute.Value != null ? attribute.Value : name;
|
||||
}
|
||||
}
|
||||
|
||||
var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo));
|
||||
return converted == null ? string.Empty : converted;
|
||||
}
|
||||
}
|
||||
else if (value is bool)
|
||||
{
|
||||
return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant();
|
||||
}
|
||||
else if (value is byte[])
|
||||
{
|
||||
return System.Convert.ToBase64String((byte[])value);
|
||||
}
|
||||
else if (value.GetType().IsArray)
|
||||
{
|
||||
var array = System.Linq.Enumerable.OfType<object>((System.Array)value);
|
||||
return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo)));
|
||||
}
|
||||
|
||||
var result = System.Convert.ToString(value, cultureInfo);
|
||||
return result == null ? "" : result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>API access token response</summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
|
||||
public partial class TokenResponse
|
||||
{
|
||||
/// <summary>Authentication token</summary>
|
||||
[Newtonsoft.Json.JsonProperty("access_token", Required = Newtonsoft.Json.Required.Always)]
|
||||
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
||||
public string Access_token { get; set; }
|
||||
|
||||
/// <summary>Authentication token type</summary>
|
||||
[Newtonsoft.Json.JsonProperty("token_type", Required = Newtonsoft.Json.Required.Always)]
|
||||
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
|
||||
public TokenResponseToken_type Token_type { get; set; }
|
||||
|
||||
|
||||
private string _Expires_in;
|
||||
/// <summary>Authentication token expiration time, in seconds</summary>
|
||||
[Newtonsoft.Json.JsonProperty("expires_in", Required = Newtonsoft.Json.Required.Always)]
|
||||
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
||||
// public string Expires_in { get; set; }
|
||||
|
||||
public string Expires_in
|
||||
{
|
||||
get { return _Expires_in; }
|
||||
set
|
||||
{
|
||||
_Expires_in = value;
|
||||
Expires_on = DateTime.UtcNow.AddSeconds(Double.Parse(value) - 60);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Authentication token expiration time in UTC</summary>
|
||||
public DateTime Expires_on { get; set; }
|
||||
|
||||
/// <summary>Refresh token. This is only provided when the server is set to allow refresh tokens for web services and when the session timeout duration is not set to Unlimited.</summary>
|
||||
[Newtonsoft.Json.JsonProperty("refresh_token", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
|
||||
public string Refresh_token { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>API access token error response</summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
|
||||
public partial class TokenErrorResponse
|
||||
{
|
||||
/// <summary>Authentication token</summary>
|
||||
[Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Always)]
|
||||
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
||||
public string Message { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>Authentication grant type. Use 'password' when authenticating, and 'refresh_token' when refreshing a token.</summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
|
||||
public enum Grant_type
|
||||
{
|
||||
[System.Runtime.Serialization.EnumMember(Value = @"password")]
|
||||
Password = 0,
|
||||
|
||||
[System.Runtime.Serialization.EnumMember(Value = @"refresh_token")]
|
||||
Refresh_token = 1,
|
||||
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
|
||||
public enum TokenResponseToken_type
|
||||
{
|
||||
[System.Runtime.Serialization.EnumMember(Value = @"bearer")]
|
||||
Bearer = 0,
|
||||
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.14.8.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v11.0.0.0))")]
|
||||
public partial class ApiException : System.Exception
|
||||
{
|
||||
public int StatusCode { get; private set; }
|
||||
|
||||
public string Response { get; private set; }
|
||||
|
||||
public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; }
|
||||
|
||||
public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException)
|
||||
: base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException)
|
||||
{
|
||||
StatusCode = statusCode;
|
||||
Response = response;
|
||||
Headers = headers;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.14.8.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v11.0.0.0))")]
|
||||
public partial class ApiException<TResult> : ApiException
|
||||
{
|
||||
public TResult Result { get; private set; }
|
||||
|
||||
public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException)
|
||||
: base(message, statusCode, response, headers, innerException)
|
||||
{
|
||||
Result = result;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
#pragma warning restore 1573
|
||||
#pragma warning restore 472
|
||||
#pragma warning restore 114
|
||||
#pragma warning restore 108
|
||||
#pragma warning restore 3016
|
||||
@@ -1,239 +0,0 @@
|
||||
using Microsoft.Win32;
|
||||
using SecretServerAuthentication.TSS;
|
||||
using SecretServerRestClient.TSS;
|
||||
|
||||
namespace ExternalConnectors.TSS
|
||||
{
|
||||
public class SecretServerInterface
|
||||
{
|
||||
private static class SSConnectionData
|
||||
{
|
||||
public static string ssUsername = "";
|
||||
public static string ssPassword = "";
|
||||
public static string ssUrl = "";
|
||||
public static string ssOTP = "";
|
||||
public static bool ssSSO = false;
|
||||
public static bool initdone = false;
|
||||
|
||||
//token
|
||||
public static string ssTokenBearer = "";
|
||||
public static DateTime ssTokenExpiresOn = DateTime.UtcNow;
|
||||
public static string ssTokenRefresh = "";
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
if (ssPassword != "" || initdone == true)
|
||||
return;
|
||||
|
||||
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\mRemoteSSInterface");
|
||||
try
|
||||
{
|
||||
// display gui and ask for data
|
||||
SSConnectionForm f = new SSConnectionForm();
|
||||
string? un = key.GetValue("Username") as string;
|
||||
f.tbUsername.Text = un ?? "";
|
||||
|
||||
string? url = key.GetValue("URL") as string;
|
||||
if (url == null || !url.Contains("://"))
|
||||
url = "https://cred.domain.local/SecretServer";
|
||||
f.tbSSURL.Text = url;
|
||||
|
||||
var b = key.GetValue("SSO");
|
||||
if (b == null || (string)b != "True")
|
||||
ssSSO = false;
|
||||
else
|
||||
{
|
||||
ssSSO = true;
|
||||
initdone = true;
|
||||
}
|
||||
f.cbUseSSO.Checked = ssSSO;
|
||||
|
||||
// show dialog
|
||||
while (true)
|
||||
{
|
||||
_ = f.ShowDialog();
|
||||
|
||||
if (f.DialogResult != DialogResult.OK)
|
||||
return;
|
||||
|
||||
// store values to memory
|
||||
ssUsername = f.tbUsername.Text;
|
||||
ssPassword = f.tbPassword.Text;
|
||||
ssUrl = f.tbSSURL.Text;
|
||||
ssSSO = f.cbUseSSO.Checked;
|
||||
ssOTP = f.tbOTP.Text;
|
||||
// check connection first
|
||||
try
|
||||
{
|
||||
if (TestCredentials() == true)
|
||||
break;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Test Credentials failed - please check your credentials");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// write values to registry
|
||||
key.SetValue("Username", ssUsername);
|
||||
key.SetValue("URL", ssUrl);
|
||||
key.SetValue("SSO", ssSSO);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
key.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TestCredentials()
|
||||
{
|
||||
if (SSConnectionData.ssSSO)
|
||||
{
|
||||
// checking creds doesn't really make sense here, as we can't modify them anyway if something is wrong
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (!String.IsNullOrEmpty(GetToken()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void FetchSecret(int secretID, out string secretUsername, out string secretPassword, out string secretDomain)
|
||||
{
|
||||
string baseURL = SSConnectionData.ssUrl;
|
||||
|
||||
SecretModel secret;
|
||||
if (SSConnectionData.ssSSO)
|
||||
{
|
||||
// REQUIRES IIS CONFIG! https://docs.thycotic.com/ss/11.0.0/api-scripting/webservice-iwa-powershell
|
||||
var handler = new HttpClientHandler() { UseDefaultCredentials = true };
|
||||
using (var httpClient = new HttpClient(handler))
|
||||
{
|
||||
// Call REST API:
|
||||
var client = new SecretsServiceClient($"{baseURL}/winauthwebservices/api", httpClient);
|
||||
secret = client.GetSecretAsync(false, true, secretID, null).Result;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var httpClient = new HttpClient())
|
||||
{
|
||||
|
||||
var token = GetToken();
|
||||
// Set credentials (token):
|
||||
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token);
|
||||
|
||||
// Call REST API:
|
||||
var client = new SecretsServiceClient($"{baseURL}/api", httpClient);
|
||||
secret = client.GetSecretAsync(false, true, secretID, null).Result;
|
||||
}
|
||||
}
|
||||
|
||||
// clear return variables
|
||||
secretDomain = "";
|
||||
secretUsername = "";
|
||||
secretPassword = "";
|
||||
|
||||
// parse data and extract what we need
|
||||
foreach (var item in secret.Items)
|
||||
{
|
||||
if (item.FieldName.ToLower().Equals("domain"))
|
||||
secretDomain = item.ItemValue;
|
||||
else if (item.FieldName.ToLower().Equals("username"))
|
||||
secretUsername = item.ItemValue;
|
||||
else if (item.FieldName.ToLower().Equals("password"))
|
||||
secretPassword = item.ItemValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static string GetToken()
|
||||
{
|
||||
|
||||
string authUsername = SSConnectionData.ssUsername;
|
||||
string authPassword = SSConnectionData.ssPassword;
|
||||
string baseURL = SSConnectionData.ssUrl;
|
||||
string OTP = SSConnectionData.ssOTP;
|
||||
string Bearer = SSConnectionData.ssTokenBearer;
|
||||
string Refresh = SSConnectionData.ssTokenRefresh;
|
||||
DateTime ExpiresOn = SSConnectionData.ssTokenExpiresOn;
|
||||
|
||||
|
||||
// Check if current token is valid
|
||||
if (!String.IsNullOrEmpty(Bearer))
|
||||
{
|
||||
if (ExpiresOn >= DateTime.UtcNow)
|
||||
{
|
||||
return Bearer;
|
||||
}
|
||||
else
|
||||
{
|
||||
//try using refresh token
|
||||
using (var httpClient = new HttpClient())
|
||||
{
|
||||
var tokenClient = new OAuth2ServiceClient(baseURL, httpClient);
|
||||
var token = tokenClient.AuthorizeAsync(Grant_type.Refresh_token, null, null, Refresh, null).Result;
|
||||
var tokenResult = token.Access_token;
|
||||
|
||||
SSConnectionData.ssTokenBearer = tokenResult;
|
||||
SSConnectionData.ssTokenRefresh = token.Refresh_token;
|
||||
SSConnectionData.ssTokenExpiresOn = token.Expires_on;
|
||||
return tokenResult;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var httpClient = new HttpClient())
|
||||
{
|
||||
// Authenticate:
|
||||
var tokenClient = new OAuth2ServiceClient(baseURL, httpClient);
|
||||
// call below will throw an exception if the creds are invalid
|
||||
var token = tokenClient.AuthorizeAsync(Grant_type.Password, authUsername, authPassword, null, OTP).Result;
|
||||
// here we can be sure the creds are ok - return success state
|
||||
var tokenResult = token.Access_token;
|
||||
|
||||
SSConnectionData.ssTokenBearer = tokenResult;
|
||||
SSConnectionData.ssTokenRefresh = token.Refresh_token;
|
||||
SSConnectionData.ssTokenExpiresOn = token.Expires_on;
|
||||
return tokenResult;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// input must be in form "SSAPI:xxxx" where xxx is the secret id to fetch
|
||||
public static void FetchSecretFromServer(string input, out string username, out string password, out string domain)
|
||||
{
|
||||
// get secret id
|
||||
if (!input.StartsWith("SSAPI:"))
|
||||
throw new Exception("calling this function requires SSAPI: input");
|
||||
int secretID = Int32.Parse(input.Substring(6));
|
||||
|
||||
// init connection credentials, display popup if necessary
|
||||
SSConnectionData.Init();
|
||||
|
||||
// get the secret
|
||||
FetchSecret(secretID, out username, out password, out domain);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 32 KiB |
@@ -1,294 +0,0 @@
|
||||
#####################################
|
||||
# Authors: David Sparer & Jack Denton
|
||||
# Summary:
|
||||
# This is intended to be a template for creating connections in bulk. This uses the serializers directly from the mRemoteNG binaries.
|
||||
# You will still need to create the connection info objects, but the library will handle serialization. It is expected that you
|
||||
# are familiar with PowerShell. If this is not the case, reach out to the mRemoteNG community for help.
|
||||
# Usage:
|
||||
# Replace or modify the examples that are shown toward the end of the script to create your own connection info objects.
|
||||
#####################################
|
||||
|
||||
foreach ($Path in 'HKLM:\SOFTWARE\WOW6432Node\mRemoteNG', 'HKLM:\SOFTWARE\mRemoteNG') {
|
||||
Try {
|
||||
$mRNGPath = (Get-ItemProperty -Path $Path -Name InstallDir -ErrorAction Stop).InstallDir
|
||||
break
|
||||
}
|
||||
Catch {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if (!$mRNGPath) {
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$FolderBrowser = [System.Windows.Forms.FolderBrowserDialog]@{
|
||||
Description = 'Please select the folder which contains mRemoteNG.exe'
|
||||
ShowNewFolderButton = $false
|
||||
}
|
||||
|
||||
$Response = $FolderBrowser.ShowDialog()
|
||||
|
||||
if ($Response.value__ -eq 1) {
|
||||
$mRNGPath = $FolderBrowser.SelectedPath
|
||||
}
|
||||
elseif ($Response.value__ -eq 2) {
|
||||
Write-Warning 'A folder containing mRemoteNG.exe has not been selected'
|
||||
return
|
||||
}
|
||||
}
|
||||
$null = [System.Reflection.Assembly]::LoadFile((Join-Path -Path $mRNGPath -ChildPath "mRemoteNG.exe"))
|
||||
Add-Type -Path (Join-Path -Path $mRNGPath -ChildPath "BouncyCastle.Crypto.dll")
|
||||
|
||||
|
||||
|
||||
function ConvertTo-mRNGSerializedXml {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
[Parameter(Mandatory)]
|
||||
[mRemoteNG.Connection.ConnectionInfo[]]
|
||||
$Xml
|
||||
)
|
||||
|
||||
function Get-ChildNodes {
|
||||
Param ($Xml)
|
||||
|
||||
$Xml
|
||||
|
||||
if ($Xml -is [mRemoteNG.Container.ContainerInfo] -and $Xml.HasChildren()) {
|
||||
foreach ($Node in $Xml.Children) {
|
||||
Get-ChildNodes -Xml $Node
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$AllNodes = Get-ChildNodes -Xml $Xml
|
||||
if (
|
||||
$AllNodes.Password -or
|
||||
$AllNodes.RDGatewayPassword -or
|
||||
$AllNodes.VNCProxyPassword
|
||||
) {
|
||||
$Password = Read-Host -Message 'If you have password protected your ConfCons.xml please enter the password here otherwise just press enter' -AsSecureString
|
||||
}
|
||||
else {
|
||||
$Password = [securestring]::new()
|
||||
}
|
||||
$CryptoProvider = [mRemoteNG.Security.SymmetricEncryption.AeadCryptographyProvider]::new()
|
||||
$SaveFilter = [mRemoteNG.Security.SaveFilter]::new()
|
||||
$ConnectionNodeSerializer = [mRemoteNG.Config.Serializers.Xml.XmlConnectionNodeSerializer26]::new($CryptoProvider, $Password, $SaveFilter)
|
||||
$XmlSerializer = [mRemoteNG.Config.Serializers.Xml.XmlConnectionsSerializer]::new($CryptoProvider, $ConnectionNodeSerializer)
|
||||
|
||||
$RootNode = [mRemoteNG.Tree.Root.RootNodeInfo]::new('Connection')
|
||||
foreach ($Node in $Xml) {
|
||||
$RootNode.AddChild($Node)
|
||||
}
|
||||
$XmlSerializer.Serialize($RootNode)
|
||||
}
|
||||
|
||||
function New-mRNGConnection {
|
||||
[CmdletBinding(DefaultParameterSetName = 'Credential')]
|
||||
Param (
|
||||
[Parameter(Mandatory)]
|
||||
[string]
|
||||
$Name,
|
||||
|
||||
[Parameter(Mandatory)]
|
||||
[string]
|
||||
$Hostname,
|
||||
|
||||
[Parameter(Mandatory)]
|
||||
[mRemoteNG.Connection.Protocol.ProtocolType]
|
||||
$Protocol,
|
||||
|
||||
[Parameter(ParameterSetName = 'Credential')]
|
||||
[pscredential]
|
||||
$Credential,
|
||||
|
||||
[Parameter(ParameterSetName = 'InheritCredential')]
|
||||
[switch]
|
||||
$InheritCredential,
|
||||
|
||||
[Parameter()]
|
||||
[mRemoteNG.Container.ContainerInfo]
|
||||
$ParentContainer,
|
||||
|
||||
[Parameter()]
|
||||
[switch]
|
||||
$PassThru
|
||||
)
|
||||
|
||||
$Connection = [mRemoteNG.Connection.ConnectionInfo]@{
|
||||
Name = $Name
|
||||
Hostname = $Hostname
|
||||
Protocol = $Protocol
|
||||
}
|
||||
|
||||
if ($Credential) {
|
||||
$Connection.Username = $Credential.GetNetworkCredential().UserName
|
||||
$Connection.Domain = $Credential.GetNetworkCredential().Domain
|
||||
$Connection.Password = $Credential.GetNetworkCredential().Password
|
||||
}
|
||||
|
||||
if ($InheritCredential) {
|
||||
$Connection.Inheritance.Username = $true
|
||||
$Connection.Inheritance.Domain = $true
|
||||
$Connection.Inheritance.Password = $true
|
||||
}
|
||||
|
||||
if ($ParentContainer) {
|
||||
$ParentContainer.AddChild($Connection)
|
||||
|
||||
if ($PSBoundParameters.ContainsKey('PassThru')) {
|
||||
$Connection
|
||||
}
|
||||
}
|
||||
else {
|
||||
$Connection
|
||||
}
|
||||
}
|
||||
|
||||
function New-mRNGContainer {
|
||||
[CmdletBinding(DefaultParameterSetName = 'Credential')]
|
||||
Param (
|
||||
[Parameter(Mandatory)]
|
||||
[string]
|
||||
$Name,
|
||||
|
||||
[Parameter(ParameterSetName = 'Credential')]
|
||||
[pscredential]
|
||||
$Credential,
|
||||
|
||||
[Parameter(ParameterSetName = 'InheritCredential')]
|
||||
[switch]
|
||||
$InheritCredential,
|
||||
|
||||
[Parameter()]
|
||||
[mRemoteNG.Container.ContainerInfo]
|
||||
$ParentContainer
|
||||
)
|
||||
|
||||
$Container = [mRemoteNG.Container.ContainerInfo]@{
|
||||
Name = $Name
|
||||
}
|
||||
|
||||
if ($Credential) {
|
||||
$Container.Username = $Credential.GetNetworkCredential().UserName
|
||||
$Container.Domain = $Credential.GetNetworkCredential().Domain
|
||||
$Container.Password = $Credential.GetNetworkCredential().Password
|
||||
}
|
||||
|
||||
if ($InheritCredential) {
|
||||
$Container.Inheritance.Username = $true
|
||||
$Container.Inheritance.Domain = $true
|
||||
$Container.Inheritance.Password = $true
|
||||
}
|
||||
|
||||
if ($ParentContainer) {
|
||||
$ParentContainer.AddChild($Container)
|
||||
}
|
||||
|
||||
$Container
|
||||
}
|
||||
|
||||
function Export-mRNGXml {
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
[Parameter()]
|
||||
[string]
|
||||
$Path,
|
||||
|
||||
[Parameter()]
|
||||
[string]
|
||||
$SerializedXml
|
||||
)
|
||||
|
||||
$FilePathProvider = [mRemoteNG.Config.DataProviders.FileDataProvider]::new($Path)
|
||||
$filePathProvider.Save($SerializedXml)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------
|
||||
# Example 1: serialize many connections, no containers
|
||||
# Here you can define the number of connection info objects to create
|
||||
# You can also provide a list of desired hostnames and iterate over those
|
||||
|
||||
$Connections = foreach ($i in 1..5) {
|
||||
# Create new connection
|
||||
$Splat = @{
|
||||
Name = 'Server-{0:D2}' -f $i
|
||||
Hostname = 'Server-{0:D2}' -f $i
|
||||
Protocol = 'RDP'
|
||||
InheritCredential = $true
|
||||
}
|
||||
New-mRNGConnection @Splat
|
||||
}
|
||||
|
||||
# Serialize the connections
|
||||
$SerializedXml = ConvertTo-mRNGSerializedXml -Xml $Connections
|
||||
|
||||
# Write the XML to a file ready to import into mRemoteNG
|
||||
Export-mRNGXml -Path "$ENV:APPDATA\mRemoteNG\PowerShellGenerated.xml" -SerializedXml $SerializedXml
|
||||
|
||||
# Now open up mRemoteNG and press Ctrl+O and open up the exported XML file
|
||||
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------
|
||||
# Example 2: serialize a container which has connections
|
||||
# You can also create containers and add connections and containers to them, which will be nested correctly when serialized
|
||||
# If you specify the ParentContainer parameter for new connections then there will be no output unless the PassThru parameter is also used
|
||||
|
||||
$ProdServerCreds = Get-Credential
|
||||
$ProdServers = New-mRNGContainer -Name 'ProdServers' -Credential $ProdServerCreds
|
||||
|
||||
foreach ($i in 1..3) {
|
||||
# Create new connection
|
||||
$Splat = @{
|
||||
Name = 'Server-{0:D2}' -f $i
|
||||
Hostname = 'Server-{0:D2}' -f $i
|
||||
Protocol = 'RDP'
|
||||
InheritCredential = $true
|
||||
ParentContainer = $ProdServers
|
||||
}
|
||||
New-mRNGConnection @Splat
|
||||
}
|
||||
|
||||
$ProdWebServers = New-mRNGContainer -Name 'WebServers' -ParentContainer $ProdServers -InheritCredential
|
||||
|
||||
foreach ($i in 1..3) {
|
||||
# Create new connection
|
||||
$Splat = @{
|
||||
Name = 'WebServer-{0:D2}' -f $i
|
||||
Hostname = 'WebServer-{0:D2}' -f $i
|
||||
Protocol = 'SSH1'
|
||||
InheritCredential = $true
|
||||
ParentContainer = $ProdWebServers
|
||||
}
|
||||
New-mRNGConnection @Splat
|
||||
}
|
||||
|
||||
$DevServers = New-mRNGContainer -Name 'DevServers'
|
||||
|
||||
foreach ($i in 1..3) {
|
||||
# Create new connection
|
||||
$Splat = @{
|
||||
Name = 'DevServer-{0:D2}' -f $i
|
||||
Hostname = 'DevServer-{0:D2}' -f $i
|
||||
Protocol = 'RDP'
|
||||
InheritCredential = $true
|
||||
ParentContainer = $DevServers
|
||||
PassThru = $true
|
||||
}
|
||||
|
||||
# Specified the PassThru parameter in order to catch the connection and change a property
|
||||
$Connection = New-mRNGConnection @Splat
|
||||
$Connection.Resolution = 'FullScreen'
|
||||
}
|
||||
|
||||
# Serialize the container
|
||||
$SerializedXml = ConvertTo-mRNGSerializedXml -Xml $ProdServers, $DevServers
|
||||
|
||||
# Write the XML to a file ready to import into mRemoteNG
|
||||
Export-mRNGXml -Path "$ENV:APPDATA\mRemoteNG\PowerShellGenerated.xml" -SerializedXml $SerializedXml
|
||||
|
||||
# Now open up mRemoteNG and press Ctrl+O and open up the exported XML file
|
||||
Binary file not shown.
@@ -1,109 +0,0 @@
|
||||
#Requires -Version 4.0
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TagName,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ValidateSet("Stable","Beta","Development")]
|
||||
$UpdateChannel
|
||||
)
|
||||
|
||||
|
||||
|
||||
function New-MsiUpdateFileContent {
|
||||
param (
|
||||
[System.IO.FileInfo]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$MsiFile,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TagName
|
||||
)
|
||||
|
||||
$version = $MsiFile.BaseName -replace "[a-zA-Z-]*"
|
||||
$certThumbprint = (Get-AuthenticodeSignature -FilePath $MsiFile).SignerCertificate.Thumbprint
|
||||
$hash = Get-FileHash -Algorithm SHA512 $MsiFile | % { $_.Hash }
|
||||
|
||||
$fileContents = `
|
||||
"Version: $version
|
||||
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/$TagName/$($MsiFile.Name)
|
||||
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/$TagName/CHANGELOG.md
|
||||
CertificateThumbprint: $certThumbprint
|
||||
Checksum: $hash"
|
||||
Write-Output $fileContents
|
||||
}
|
||||
|
||||
|
||||
function New-ZipUpdateFileContent {
|
||||
param (
|
||||
[System.IO.FileInfo]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$ZipFile,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TagName
|
||||
)
|
||||
|
||||
$version = $ZipFile.BaseName -replace "[a-zA-Z-]*"
|
||||
$hash = Get-FileHash -Algorithm SHA512 $ZipFile | % { $_.Hash }
|
||||
|
||||
$fileContents = `
|
||||
"Version: $version
|
||||
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/$TagName/$($ZipFile.Name)
|
||||
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/$TagName/CHANGELOG.TXT
|
||||
Checksum: $hash"
|
||||
Write-Output $fileContents
|
||||
}
|
||||
|
||||
|
||||
function Resolve-UpdateCheckFileName {
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ValidateSet("Stable","Beta","Development")]
|
||||
$UpdateChannel,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ValidateSet("Normal","Portable")]
|
||||
$Type
|
||||
)
|
||||
|
||||
$fileName = ""
|
||||
|
||||
if ($UpdateChannel -eq "Beta") { $fileName += "beta-" }
|
||||
elseif ($UpdateChannel -eq "Development") { $fileName += "dev-" }
|
||||
|
||||
$fileName += "update"
|
||||
|
||||
if ($Type -eq "Portable") { $fileName += "-portable" }
|
||||
|
||||
$fileName += ".txt"
|
||||
|
||||
Write-Output $fileName
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$releaseFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\Release" -Resolve
|
||||
|
||||
# build msi update file
|
||||
$msiFile = Get-ChildItem -Path "$releaseFolder\*.msi" | sort LastWriteTime | select -last 1
|
||||
$msiUpdateContents = New-MsiUpdateFileContent -MsiFile $msiFile -TagName $TagName
|
||||
$msiUpdateFileName = Resolve-UpdateCheckFileName -UpdateChannel $UpdateChannel -Type Normal
|
||||
Write-Output "`n`nMSI Update Check File Contents ($msiUpdateFileName)`n------------------------------"
|
||||
Tee-Object -InputObject $msiUpdateContents -FilePath "$releaseFolder\$msiUpdateFileName"
|
||||
|
||||
|
||||
# build zip update file
|
||||
$zipFile = Get-ChildItem -Path "$releaseFolder\*.zip" | sort LastWriteTime | select -last 1
|
||||
$zipUpdateContents = New-ZipUpdateFileContent -ZipFile $zipFile -TagName $TagName
|
||||
$zipUpdateFileName = Resolve-UpdateCheckFileName -UpdateChannel $UpdateChannel -Type Portable
|
||||
Write-Output "`n`nZip Update Check File Contents ($zipUpdateFileName)`n------------------------------"
|
||||
Tee-Object -InputObject $zipUpdateContents -FilePath "$releaseFolder\$zipUpdateFileName"
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,61 +0,0 @@
|
||||
[CmdletBinding()]
|
||||
|
||||
param (
|
||||
[string]
|
||||
# Name of the file to find
|
||||
$FileName
|
||||
)
|
||||
|
||||
|
||||
|
||||
function EditBinCertificateIsValid() {
|
||||
param (
|
||||
[string]
|
||||
$Path
|
||||
)
|
||||
|
||||
# Verify file certificate
|
||||
$valid_microsoft_cert_thumbprints = @(
|
||||
"3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC",
|
||||
"98ED99A67886D020C564923B7DF25E9AC019DF26",
|
||||
"108E2BA23632620C427C570B6D9DB51AC31387FE",
|
||||
"5EAD300DC7E4D637948ECB0ED829A072BD152E17"
|
||||
)
|
||||
$file_signature = Get-AuthenticodeSignature -FilePath $Path
|
||||
if (($file_signature.Status -ne "Valid") -or ($valid_microsoft_cert_thumbprints -notcontains $file_signature.SignerCertificate.Thumbprint)) {
|
||||
Write-Warning "Could not validate the signature of $Path"
|
||||
return $false
|
||||
} else {
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ToolCanBeExecuted {
|
||||
param (
|
||||
[string]
|
||||
$Path
|
||||
)
|
||||
$null = & $Path
|
||||
Write-Output ($LASTEXITCODE -gt 0)
|
||||
}
|
||||
|
||||
$rootSearchPaths = @(
|
||||
[System.IO.Directory]::EnumerateFileSystemEntries("C:\Program Files", "*Visual Studio*", [System.IO.SearchOption]::TopDirectoryOnly),
|
||||
[System.IO.Directory]::EnumerateFileSystemEntries("C:\Program Files (x86)", "*Visual Studio*", [System.IO.SearchOption]::TopDirectoryOnly)
|
||||
)
|
||||
|
||||
# Returns the first full path to the $FileName that our search can find
|
||||
foreach ($searchPath in $rootSearchPaths) {
|
||||
foreach ($visualStudioFolder in $searchPath) {
|
||||
Write-Verbose "Searching in folder '$visualStudioFolder'"
|
||||
$matchingExes = [System.IO.Directory]::EnumerateFileSystemEntries($visualStudioFolder, $FileName, [System.IO.SearchOption]::AllDirectories)
|
||||
foreach ($matchingExe in $matchingExes) {
|
||||
if ((EditBinCertificateIsValid -Path $matchingExe) -and (ToolCanBeExecuted -Path $matchingExe)) {
|
||||
return $matchingExe
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Error "Could not find any valid file by the name $FileName." -ErrorAction Stop
|
||||
@@ -1,235 +0,0 @@
|
||||
$githubUrl = 'https://api.github.com'
|
||||
# GitHub doesn't support the default powershell protocol (TLS 1.0)
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
function Publish-GitHubRelease {
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Owner,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Repository,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$ReleaseTitle,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$TagName,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# Either the SHA of the commit to target or the branch name.
|
||||
$TargetCommitish,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Description,
|
||||
|
||||
[bool]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$IsDraft,
|
||||
|
||||
[bool]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$IsPrerelease,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# The OAuth2 token to use for authentication.
|
||||
$AuthToken
|
||||
)
|
||||
|
||||
$body = New-GitHubReleaseRequestBody -TagName $TagName -TargetCommitish $TargetCommitish -ReleaseTitle $ReleaseTitle -Description $Description -IsDraft $IsDraft -IsPrerelease $IsPrerelease
|
||||
$req_publishRelease = Invoke-WebRequest -Uri "$githubUrl/repos/$Owner/$Repository/releases" -Method Post -Headers @{"Authorization"="token $AuthToken"} -Body $body -ErrorAction Stop
|
||||
$response_publishRelease = ConvertFrom-Json -InputObject $req_publishRelease.Content
|
||||
|
||||
Write-Output $response_publishRelease
|
||||
}
|
||||
|
||||
|
||||
function Edit-GitHubRelease {
|
||||
param (
|
||||
[string]
|
||||
#[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Owner,
|
||||
|
||||
[string]
|
||||
#[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Repository,
|
||||
|
||||
[string]
|
||||
#[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$ReleaseId,
|
||||
|
||||
[string]
|
||||
#
|
||||
$ReleaseTitle,
|
||||
|
||||
[string]
|
||||
#
|
||||
$TagName,
|
||||
|
||||
[string]
|
||||
# Either the SHA of the commit to target or the branch name.
|
||||
$TargetCommitish,
|
||||
|
||||
[string]
|
||||
#
|
||||
$Description,
|
||||
|
||||
[bool]
|
||||
#
|
||||
$IsDraft,
|
||||
|
||||
[bool]
|
||||
#
|
||||
$IsPrerelease,
|
||||
|
||||
[string]
|
||||
#[Parameter(Mandatory=$true)]
|
||||
# The OAuth2 token to use for authentication.
|
||||
$AuthToken
|
||||
)
|
||||
|
||||
$body_params = @{
|
||||
"TagName" = $TagName
|
||||
"TargetCommitish" = $TargetCommitish
|
||||
"ReleaseTitle" = $ReleaseTitle
|
||||
"Description" = $Description
|
||||
}
|
||||
if ($PSBoundParameters.ContainsKey("IsDraft")) { $body_params.Add("IsDraft", $IsDraft) }
|
||||
if ($PSBoundParameters.ContainsKey("IsPrerelease")) { $body_params.Add("IsPrerelease", $IsPrerelease) }
|
||||
|
||||
$body = New-GitHubReleaseRequestBody @body_params
|
||||
$req_editRelease = Invoke-WebRequest -Uri "$githubUrl/repos/$Owner/$Repository/releases/$ReleaseId" -Method Post -Headers @{"Authorization"="token $AuthToken"} -Body $body -ErrorAction Stop
|
||||
$response_editRelease = ConvertFrom-Json -InputObject $req_editRelease.Content
|
||||
|
||||
Write-Output $response_editRelease
|
||||
}
|
||||
|
||||
|
||||
function Get-GitHubRelease {
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Owner,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Repository,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$ReleaseId,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# The OAuth2 token to use for authentication.
|
||||
$AuthToken
|
||||
)
|
||||
|
||||
$req_getRelease = Invoke-WebRequest -Uri "$githubUrl/repos/$Owner/$Repository/releases/$ReleaseId" -Method Get -Headers @{"Authorization"="token $AuthToken"} -ErrorAction Stop
|
||||
$response_getRelease = ConvertFrom-Json -InputObject $req_getRelease.Content
|
||||
|
||||
Write-Output $response_getRelease
|
||||
}
|
||||
|
||||
|
||||
function Upload-GitHubReleaseAsset {
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$UploadUri,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# Path to the file to upload with the release
|
||||
$FilePath,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# Content type of the file
|
||||
$ContentType,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# The OAuth2 token to use for authentication.
|
||||
$AuthToken,
|
||||
|
||||
[string]
|
||||
# A short description label for the asset
|
||||
$Label = ""
|
||||
)
|
||||
|
||||
$UploadUri = $UploadUri -replace "(\{[\w,\?]*\})$"
|
||||
$files = Get-Item -Path $FilePath
|
||||
|
||||
$labelParam = ""
|
||||
if ($Label -ne "") {
|
||||
$labelParam = "&label=$Label"
|
||||
}
|
||||
|
||||
# Get-Item could produce an array of files if a wildcard is provided. (C:\*.txt)
|
||||
# Upload each matching item individually
|
||||
foreach ($file in $files) {
|
||||
Write-Output "Uploading asset to GitHub release: '$($file.FullName)'"
|
||||
$req_uploadZipAsset = Invoke-WebRequest -Uri "$($UploadUri)?name=$($file.Name)$labelParam" -Method Post -Headers @{"Authorization"="token $AuthToken"} -ContentType $ContentType -InFile $file.FullName -ErrorAction Stop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function New-GitHubReleaseRequestBody {
|
||||
param (
|
||||
[string]
|
||||
#
|
||||
$TagName,
|
||||
|
||||
[string]
|
||||
# Either the SHA of the commit to target or the branch name.
|
||||
$TargetCommitish,
|
||||
|
||||
[string]
|
||||
# Title of the release
|
||||
$ReleaseTitle,
|
||||
|
||||
[string]
|
||||
# Description of the release
|
||||
$Description,
|
||||
|
||||
[bool]
|
||||
# Is this a draft?
|
||||
$IsDraft,
|
||||
|
||||
[bool]
|
||||
# Is this a pre-release?
|
||||
$IsPrerelease
|
||||
)
|
||||
|
||||
$body_params = [ordered]@{}
|
||||
if ($TagName -ne "") { $body_params.Add("tag_name", $TagName) }
|
||||
if ($TargetCommitish -ne "") { $body_params.Add("target_commitish", $TargetCommitish) }
|
||||
if ($ReleaseTitle -ne "") { $body_params.Add("name", $ReleaseTitle) }
|
||||
if ($Description -ne "") { $body_params.Add("body", $Description) }
|
||||
if ($PSBoundParameters.ContainsKey("IsDraft")) { $body_params.Add("draft", $IsDraft) }
|
||||
if ($PSBoundParameters.ContainsKey("IsPrerelease")) { $body_params.Add("prerelease", $IsPrerelease) }
|
||||
|
||||
$json_body = ConvertTo-Json -InputObject $body_params -Compress
|
||||
Write-Output $json_body
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$SolutionDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetFileName,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$ConfigurationName,
|
||||
|
||||
[string]
|
||||
$CertificatePath,
|
||||
|
||||
[string]
|
||||
$CertificatePassword,
|
||||
|
||||
[string[]]
|
||||
$ExcludeFromSigning
|
||||
)
|
||||
|
||||
Write-Output "+===========================================================================================+"
|
||||
Write-Output "| Beginning mRemoteNG Installer Post Build |"
|
||||
Write-Output "+===========================================================================================+"
|
||||
Format-Table -AutoSize -Wrap -InputObject @{
|
||||
"SolutionDir" = $SolutionDir
|
||||
"TargetDir" = $TargetDir
|
||||
"TargetFileName" = $TargetFileName
|
||||
"ConfigurationName" = $ConfigurationName
|
||||
"CertificatePath" = $CertificatePath
|
||||
"ExcludeFromSigning" = $ExcludeFromSigning
|
||||
}
|
||||
|
||||
|
||||
& "$PSScriptRoot\sign_binaries.ps1" -TargetDir $TargetDir -CertificatePath $CertificatePath -CertificatePassword $CertificatePassword -ConfigurationName $ConfigurationName -Exclude $ExcludeFromSigning -SolutionDir $SolutionDir
|
||||
& "$PSScriptRoot\verify_binary_signatures.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName -CertificatePath $CertificatePath -SolutionDir $SolutionDir
|
||||
& "$PSScriptRoot\rename_and_copy_installer.ps1" -SolutionDir $SolutionDir
|
||||
@@ -1,61 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$SolutionDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetFileName,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$ConfigurationName,
|
||||
|
||||
[string]
|
||||
$CertificatePath,
|
||||
|
||||
[string]
|
||||
$CertificatePassword,
|
||||
|
||||
[string[]]
|
||||
$ExcludeFromSigning
|
||||
)
|
||||
|
||||
Write-Output "+===========================================================================================+"
|
||||
Write-Output "| Beginning mRemoteNG Post Build |"
|
||||
Write-Output "+===========================================================================================+"
|
||||
Format-Table -AutoSize -Wrap -InputObject @{
|
||||
"SolutionDir" = $SolutionDir
|
||||
"TargetDir" = $TargetDir
|
||||
"TargetFileName" = $TargetFileName
|
||||
"ConfigurationName" = $ConfigurationName
|
||||
"CertificatePath" = $CertificatePath
|
||||
"ExcludeFromSigning" = $ExcludeFromSigning
|
||||
}
|
||||
|
||||
# Move dlls resurses into folder
|
||||
#Remove-Item -Path "$TargetDir\libs" -Recurse -ErrorAction Ignore
|
||||
#New-Item -ItemType "directory" -Force -Path $TargetDir -Name "libs"
|
||||
#Move-Item -Path "$TargetDir\*.dll" -Destination "$TargetDir\libs" -force
|
||||
|
||||
|
||||
###
|
||||
|
||||
# Move lang resurses into folder
|
||||
#Remove-Item -Path "$TargetDir\languages" -Recurse -ErrorAction Ignore
|
||||
#New-Item -ItemType "directory" -Force -Path $TargetDir -Name "languages"
|
||||
#"cs-CZ,de,el,en-US,es-AR,es,fr,hu,it,lt,ja-JP,ko-KR,nb-NO,nl,pt,pt-BR,pl,ru,uk,tr-TR,zh-CN,zh-TW,fi-FI".Split(",") | ForEach {
|
||||
# Move-Item -Path "$TargetDir\$_" -Destination "$TargetDir\languages" -force
|
||||
# }
|
||||
###
|
||||
|
||||
& "$PSScriptRoot\set_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
|
||||
& "$PSScriptRoot\verify_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
|
||||
& "$PSScriptRoot\tidy_files_for_release.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName
|
||||
& "$PSScriptRoot\sign_binaries.ps1" -TargetDir $TargetDir -CertificatePath $CertificatePath -CertificatePassword $CertificatePassword -ConfigurationName $ConfigurationName -Exclude $ExcludeFromSigning -SolutionDir $SolutionDir
|
||||
& "$PSScriptRoot\verify_binary_signatures.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName -CertificatePath $CertificatePath -SolutionDir $SolutionDir
|
||||
& "$PSScriptRoot\zip_files.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir -ConfigurationName $ConfigurationName
|
||||
@@ -1,25 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Owner,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Repository,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$ReleaseId,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# The OAuth2 token to use for authentication.
|
||||
$AuthToken
|
||||
)
|
||||
|
||||
. "$PSScriptRoot\github_functions.ps1"
|
||||
|
||||
Edit-GitHubRelease -Owner $Owner -Repository $Repository -ReleaseId $ReleaseId -AuthToken $AuthToken -IsDraft $false
|
||||
@@ -1,81 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Owner,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Repository,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$ReleaseTitle,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$TagName,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# Either the SHA of the commit to target or the branch name.
|
||||
$TargetCommitish,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
#
|
||||
$Description,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ValidateSet("true","false")]
|
||||
# true/false
|
||||
$IsDraft,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ValidateSet("true","false")]
|
||||
# true/false
|
||||
$IsPrerelease,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# Path to the folder which contains release assets to upload
|
||||
$ReleaseFolderPath,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# The OAuth2 token to use for authentication.
|
||||
$AuthToken,
|
||||
|
||||
[switch]
|
||||
# Enable this switch to treat $Description as a Base64 encoded string. It will be decoded before being used elsewhere in the script.
|
||||
$DescriptionIsBase64Encoded
|
||||
)
|
||||
|
||||
|
||||
if ($DescriptionIsBase64Encoded) {
|
||||
$Description = ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Description)))
|
||||
}
|
||||
|
||||
|
||||
. "$PSScriptRoot\github_functions.ps1"
|
||||
|
||||
|
||||
$releaseFolderItems = Get-ChildItem -Path $ReleaseFolderPath
|
||||
$mrngPortablePath = ($releaseFolderItems | ?{$_.Name -match "portable-[\d\.]+\.zip"}).FullName
|
||||
$mrngNormalPath = ($releaseFolderItems | ?{$_.Name -match "installer-[\d\.]+\.msi"}).FullName
|
||||
$mrngPortableSymbolsPath = ($releaseFolderItems | ?{$_.Name -match "mremoteng-portable-symbols-[\d\.]+\.zip"}).FullName
|
||||
$mrngNormalSymbolsPath = ($releaseFolderItems | ?{$_.Name -match "mremoteng-symbols-[\d\.]+\.zip"}).FullName
|
||||
|
||||
|
||||
$release = Publish-GitHubRelease -Owner $Owner -Repository $Repository -ReleaseTitle $ReleaseTitle -TagName $TagName -TargetCommitish $TargetCommitish -Description $Description -IsDraft ([bool]::Parse($IsDraft)) -IsPrerelease ([bool]::Parse($IsPrerelease)) -AuthToken $AuthToken
|
||||
$zipUpload = Upload-GitHubReleaseAsset -UploadUri $release.upload_url -FilePath $mrngPortablePath -ContentType "application/zip" -AuthToken $AuthToken -Label "Portable Edition (zip)"
|
||||
$msiUpload = Upload-GitHubReleaseAsset -UploadUri $release.upload_url -FilePath $mrngNormalPath -ContentType "application/octet-stream" -AuthToken $AuthToken -Label "Normal Edition (msi)"
|
||||
|
||||
$portableEditionSymbols = Upload-GitHubReleaseAsset -UploadUri $release.upload_url -FilePath $mrngPortableSymbolsPath -ContentType "application/zip" -AuthToken $AuthToken -Label "Portable Edition Debug Symbols"
|
||||
$normalEditionSymbols = Upload-GitHubReleaseAsset -UploadUri $release.upload_url -FilePath $mrngNormalSymbolsPath -ContentType "application/zip" -AuthToken $AuthToken -Label "Normal Edition Debug Symbols"
|
||||
Write-Output (Get-GitHubRelease -Owner $Owner -Repository $Repository -ReleaseId $release.id -AuthToken $AuthToken)
|
||||
@@ -1,13 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
$SolutionDir
|
||||
)
|
||||
|
||||
|
||||
$targetVersionedFile = "$SolutionDir\mRemoteNG\bin\x64\Release\mRemoteNG.exe"
|
||||
$version = &"$SolutionDir\Tools\exes\sigcheck.exe" /accepteula -q -n $targetVersionedFile
|
||||
$src = $SolutionDir + "mRemoteNGInstaller\Installer\bin\Release\en-US\mRemoteNG-Installer.msi"
|
||||
$dst = $SolutionDir + "mRemoteNG\bin\x64\Release\mRemoteNG-Installer-" + $version + ".msi"
|
||||
|
||||
# Copy file
|
||||
Copy-Item $src -Destination $dst -Force
|
||||
@@ -1,22 +0,0 @@
|
||||
[CmdletBinding()]
|
||||
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetFileName
|
||||
)
|
||||
|
||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||
|
||||
$path_editBin = Join-Path -Path $PSScriptRoot -ChildPath "exes\editbin.exe"
|
||||
$path_outputExe = Join-Path -Path $TargetDir -ChildPath $TargetFileName
|
||||
|
||||
# Set LargeAddressAware
|
||||
Write-Output "Setting LargeAddressAware on binary file:`n`"$path_outputExe`" `nwith:`n`"$path_editBin`""
|
||||
& "$path_editBin" /largeaddressaware "$path_outputExe"
|
||||
|
||||
Write-Output ""
|
||||
@@ -1,88 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$ConfigurationName,
|
||||
|
||||
[string[]]
|
||||
# File names to exclude from signing
|
||||
$Exclude,
|
||||
|
||||
[string]
|
||||
[AllowEmptyString()]
|
||||
# The code signing certificate to use when signing the files.
|
||||
$CertificatePath,
|
||||
|
||||
[string]
|
||||
# Password to unlock the code signing certificate.
|
||||
$CertificatePassword,
|
||||
|
||||
[string]
|
||||
$SolutionDir
|
||||
)
|
||||
|
||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||
|
||||
|
||||
$timeserver = "http://timestamp.verisign.com/scripts/timstamp.dll"
|
||||
|
||||
|
||||
# validate release versions and if the certificate value was passed
|
||||
if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
||||
|
||||
if(-Not ([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) ) {
|
||||
$CertificatePath = Join-Path -Path $SolutionDir -ChildPath $CertificatePath
|
||||
}
|
||||
|
||||
# make sure the cert is actually available
|
||||
if ($CertificatePath -eq "" -or !(Test-Path -Path $CertificatePath -PathType Leaf))
|
||||
{
|
||||
Write-Output "Certificate is not present - we won't sign files."
|
||||
return
|
||||
}
|
||||
|
||||
if ($CertificatePassword -eq "") {
|
||||
Write-Output "No certificate password was provided - we won't sign files."
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
$certKeyStore = [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::MachineKeySet
|
||||
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertificatePath, $CertificatePassword, $certKeyStore) -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Output "Error loading certificate file - we won't sign files."
|
||||
Write-Output $Error[0]
|
||||
return
|
||||
}
|
||||
|
||||
# Sign MSI if we are building a release version and the certificate is available
|
||||
Write-Output "Signing Binaries"
|
||||
Write-Output "Getting files from path: $TargetDir"
|
||||
$signableFiles = Get-ChildItem -Path $TargetDir -Recurse | ?{$_.Extension -match "dll|exe|msi"} | ?{$Exclude -notcontains $_.Name}
|
||||
|
||||
$excluded_files = Get-ChildItem -Path $TargetDir -Recurse | ?{$_.Extension -match "dll|exe|msi"} | ?{$Exclude -contains $_.Name}
|
||||
$excluded_files | ForEach-Object `
|
||||
-Begin { Write-Output "The following files were excluded from signing due to being on the exclusion list:" } `
|
||||
-Process { Write-Output "-- $($_.FullName)" }
|
||||
|
||||
Write-Output "Signable files count: $($signableFiles.Count)"
|
||||
|
||||
|
||||
foreach ($file in $signableFiles) {
|
||||
Set-AuthenticodeSignature -Certificate $cert -TimestampServer $timeserver -IncludeChain all -FilePath $file.FullName
|
||||
}
|
||||
|
||||
|
||||
# Release certificate
|
||||
if ($cert -ne $null) {
|
||||
$cert.Dispose()
|
||||
}
|
||||
} else {
|
||||
Write-Output "This is not a release build or CertificatePath wasn't provided - we won't sign files."
|
||||
Write-Output "Config: $($ConfigurationName)`tCertPath: $($CertificatePath)"
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
@@ -1,31 +0,0 @@
|
||||
param(
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
# Folder path that contains the files you would like to sign. Recursive.
|
||||
$PathToSignableFiles,
|
||||
|
||||
[string]
|
||||
# The code signing certificate to use when signing the files.
|
||||
$CertificatePath = "C:\mRemoteNG_code_signing_cert.pfx",
|
||||
|
||||
[SecureString]
|
||||
# Password to unlock the code signing certificate.
|
||||
$CertificatePassword = (Get-Credential -Message "Enter password for the mRemoteNG code signing certificate" -UserName "USERNAME NOT NEEDED").Password,
|
||||
|
||||
[string[]]
|
||||
# File names to exclude from signing
|
||||
$Exclude
|
||||
)
|
||||
|
||||
|
||||
$timeserver = "http://timestamp.verisign.com/scripts/timstamp.dll"
|
||||
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertificatePath, $CertificatePassword)
|
||||
|
||||
|
||||
Write-Output "Getting files from path: $PathToSignableFiles"
|
||||
$signableFiles = Get-ChildItem -Path $PathToSignableFiles -Recurse | ?{$_.Extension -match "dll|exe|msi"} | ?{$Exclude -notcontains $_.Name}
|
||||
Write-Output "Signable files count: $($signableFiles.Count)"
|
||||
|
||||
foreach ($file in $signableFiles) {
|
||||
Set-AuthenticodeSignature -Certificate $cert -TimestampServer $timeserver -IncludeChain all -FilePath $file.FullName
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$ConfigurationName
|
||||
)
|
||||
Write-Output ""
|
||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||
|
||||
# Remove unnecessary files from Release versions
|
||||
if ($ConfigurationName -match "Release")
|
||||
{
|
||||
$test = Join-Path -Path $TargetDir -ChildPath "app.publish"
|
||||
if (Test-Path $test -PathType Container)
|
||||
{
|
||||
Remove-Item -Path (Join-Path -Path $TargetDir -ChildPath "app.publish") -Recurse -Force
|
||||
}
|
||||
|
||||
$filesToDelete = Get-ChildItem -Path $TargetDir -Recurse -Include @(
|
||||
"*.publish",
|
||||
"*.xml",
|
||||
"*.backup",
|
||||
"*.log",
|
||||
"*vshost*",
|
||||
"*.tmp"
|
||||
) -Exclude @(
|
||||
"mRemoteNG.VisualElementsManifest.xml"
|
||||
)
|
||||
if ($filesToDelete)
|
||||
{
|
||||
Write-Output "Unnecessary files are detected and will be removed"
|
||||
Remove-Item -Path $filesToDelete.FullName
|
||||
Write-Output $filesToDelete.FullName
|
||||
} else
|
||||
{
|
||||
Write-Output " No unnecessary files are detected"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Output "We will not remove anything - this is not a release build."
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
@@ -1,17 +0,0 @@
|
||||
# $FullPath Full path to the Microsoft executable to validate
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$FullPath
|
||||
)
|
||||
|
||||
$validMSCertThumbprints = @("3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC", "108E2BA23632620C427C570B6D9DB51AC31387FE", "98ED99A67886D020C564923B7DF25E9AC019DF26", "5EAD300DC7E4D637948ECB0ED829A072BD152E17")
|
||||
$exeSignature = Get-AuthenticodeSignature -FilePath $FullPath
|
||||
$baseErrorMsg = "Could not validate the certificate of $FullPath. "
|
||||
|
||||
if ($exeSignature.Status -ne "Valid") {
|
||||
Write-Error -Message ($baseErrorMsg+"The signature was invalid.") -ErrorAction Stop
|
||||
}
|
||||
elseif ($validMSCertThumbprints -notcontains $exeSignature.SignerCertificate.Thumbprint) {
|
||||
Write-Error -Message ($baseErrorMsg+"The certificate thumbprint ($($exeSignature.SignerCertificate.Thumbprint)) is not trusted.") -ErrorAction Stop
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
[CmdletBinding()]
|
||||
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetFileName
|
||||
)
|
||||
|
||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||
|
||||
$path_dumpBin = Join-Path -Path $PSScriptRoot -ChildPath "exes\dumpbin.exe"
|
||||
$path_outputExe = Join-Path -Path $TargetDir -ChildPath $TargetFileName
|
||||
|
||||
# Dump exe header
|
||||
$output = & "$path_dumpBin" /NOLOGO /HEADERS "$path_outputExe" | Select-String large
|
||||
|
||||
if ($output -eq $null)
|
||||
{
|
||||
Write-Warning "Could not validate LargeAddressAware"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Output $output.ToString().TrimStart(" ")
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
@@ -1,60 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$ConfigurationName,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
[AllowEmptyString()]
|
||||
# The code signing certificate to use when signing the files.
|
||||
$CertificatePath,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$SolutionDir
|
||||
)
|
||||
|
||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||
|
||||
|
||||
# validate release versions and if the certificate value was passed
|
||||
if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
||||
|
||||
if(-Not ([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) ) {
|
||||
$CertificatePath = Join-Path -Path $SolutionDir -ChildPath $CertificatePath
|
||||
}
|
||||
|
||||
# make sure the cert is actually available
|
||||
if ($CertificatePath -eq "" -or !(Test-Path -Path $CertificatePath -PathType Leaf))
|
||||
{
|
||||
Write-Output "Certificate is not present - files likely not signed - we won't verify file signatures."
|
||||
return
|
||||
}
|
||||
|
||||
Write-Output "Verifying signature of binaries"
|
||||
Write-Output "Getting files from path: $TargetDir"
|
||||
$signableFiles = Get-ChildItem -Path $TargetDir -Recurse | ?{$_.Extension -match "dll|exe|msi"}
|
||||
Write-Output "Signable files count: $($signableFiles.Count)"
|
||||
$badSignatureFound = $false
|
||||
foreach ($file in $signableFiles) {
|
||||
$signature = Get-AuthenticodeSignature -FilePath $file.FullName
|
||||
if ($signature.Status -ne "Valid") {
|
||||
Write-Warning "File $($file.FullName) does not have a valid signature."
|
||||
$badSignatureFound = $true
|
||||
}
|
||||
}
|
||||
if ($badSignatureFound) {
|
||||
Write-Output "One or more files were improperly signed."
|
||||
} else {
|
||||
Write-Output "All files have valid signatures."
|
||||
}
|
||||
} else {
|
||||
Write-Output "This is not a release build or CertificatePath wasn't provided - we won't verify file signatures."
|
||||
Write-Output "Config: $($ConfigurationName)`tCertPath: $($CertificatePath)"
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
@@ -1,83 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$SolutionDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$TargetDir,
|
||||
|
||||
[string]
|
||||
[Parameter(Mandatory=$true)]
|
||||
$ConfigurationName
|
||||
)
|
||||
|
||||
Write-Output ""
|
||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||
|
||||
$ConfigurationName = $ConfigurationName.Trim()
|
||||
Write-Output "Config Name (trimmed): '$($ConfigurationName)'"
|
||||
$exe = Join-Path -Path $TargetDir -ChildPath $TargetFileName
|
||||
$Version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($exe).FileVersion
|
||||
Write-Output "Version is $($version)"
|
||||
|
||||
# Fix for AppVeyor
|
||||
if(!([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))) {
|
||||
if(!(test-path "Release")) {
|
||||
New-Item -ItemType Directory -Force -Path "Release" | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
# Package debug symbols zip file
|
||||
if ($ConfigurationName -match "Release") {
|
||||
Write-Output "Packaging debug symbols"
|
||||
|
||||
if ($ConfigurationName -match "Portable") {
|
||||
$zipFilePrefix = "mRemoteNG-Portable-symbols"
|
||||
} else {
|
||||
$zipFilePrefix = "mRemoteNG-symbols"
|
||||
}
|
||||
|
||||
$debugFile = Join-Path -Path $TargetDir -ChildPath "mRemoteNG.pdb"
|
||||
|
||||
# AppVeyor build
|
||||
if(!([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))) {
|
||||
$outputZipPath = Join-Path -Path $SolutionDir -ChildPath "Release\$zipFilePrefix-$($version).zip"
|
||||
7z a $outputZipPath $debugFile
|
||||
}
|
||||
# Local build
|
||||
else {
|
||||
if (!(Test-Path -Path $debugFile -PathType Leaf))
|
||||
{
|
||||
$outputZipPath = "$($SolutionDir)Release\$zipFilePrefix-$($version).zip"
|
||||
Compress-Archive $debugFile $outputZipPath -Force
|
||||
} else {
|
||||
write-host "File do not exist:" $debugFile", nothing to compress"
|
||||
}
|
||||
}
|
||||
|
||||
Remove-Item $debugFile
|
||||
}
|
||||
|
||||
# Package portable release zip file
|
||||
if ($ConfigurationName -eq "Release Portable") {
|
||||
Write-Output "Packaging portable ZIP file"
|
||||
|
||||
# AppVeyor build
|
||||
if(!([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))) {
|
||||
$outputZipPath = Join-Path -Path $SolutionDir -ChildPath "Release\mRemoteNG-Portable-$($version).zip"
|
||||
7z a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath $TargetDir\*
|
||||
}
|
||||
# Local build
|
||||
else {
|
||||
if ($Source)
|
||||
{
|
||||
$outputZipPath="$($SolutionDir)\Release\mRemoteNG-Portable-$($version).zip"
|
||||
Compress-Archive $Source $outputZipPath -Force
|
||||
} else {
|
||||
write-host "File do not exist:" $Source", nothing to compress"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
BIN
UI concept/sketch.xlsx
Normal file
BIN
UI concept/sketch.xlsx
Normal file
Binary file not shown.
@@ -1,87 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31912.275
|
||||
MinimumVisualStudioVersion = 14.0.25420.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mRemoteNG", "mRemoteNG\mRemoteNG.csproj", "{4934A491-40BC-4E5B-9166-EA1169A220F6}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mRemoteNGTests", "mRemoteNGTests\mRemoteNGTests.csproj", "{1453B37F-8621-499E-B0B2-6091F76DC0BB}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mRemoteNGInstaller", "mRemoteNGInstaller", "{4FE795BE-646E-4F1B-BAD0-A68EA26394DD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomActions", "mRemoteNGInstaller\CustomActions\CustomActions.csproj", "{5423D985-CB48-4344-B47F-E8C6D60C8B04}"
|
||||
EndProject
|
||||
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "mRemoteNGInstaller\Installer\Installer.wixproj", "{F0168B9F-6815-40DF-BA53-46CEE7683B68}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5423D985-CB48-4344-B47F-E8C6D60C8B04} = {5423D985-CB48-4344-B47F-E8C6D60C8B04}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mRemoteNGSpecs", "mRemoteNGSpecs\mRemoteNGSpecs.csproj", "{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExternalConnectors", "ExternalConnectors\ExternalConnectors.csproj", "{A56A2029-79B8-492A-ABE5-D2BFE05801BD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug Portable|x64 = Debug Portable|x64
|
||||
Debug|x64 = Debug|x64
|
||||
Release Installer|x64 = Release Installer|x64
|
||||
Release Portable|x64 = Release Portable|x64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug Portable|x64.ActiveCfg = Debug Portable|x64
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug Portable|x64.Build.0 = Debug Portable|x64
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug|x64.Build.0 = Debug|x64
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Installer|x64.ActiveCfg = Release|x64
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Installer|x64.Build.0 = Release|x64
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|x64.ActiveCfg = Release Portable|x64
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|x64.Build.0 = Release Portable|x64
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|x64.ActiveCfg = Release|x64
|
||||
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|x64.Build.0 = Release|x64
|
||||
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug Portable|x64.ActiveCfg = Debug Portable|x64
|
||||
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Installer|x64.ActiveCfg = Release|x64
|
||||
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|x64.ActiveCfg = Release Portable|x64
|
||||
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|x64.Build.0 = Release Portable|x64
|
||||
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release|x64.ActiveCfg = Release|x64
|
||||
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release|x64.Build.0 = Release|x64
|
||||
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug Portable|x64.ActiveCfg = Debug Portable|x64
|
||||
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Installer|x64.ActiveCfg = Release|x64
|
||||
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Installer|x64.Build.0 = Release|x64
|
||||
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Portable|x64.ActiveCfg = Release Portable|x64
|
||||
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release|x64.ActiveCfg = Release|x64
|
||||
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug Portable|x64.ActiveCfg = Debug Portable|x64
|
||||
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release Installer|x64.ActiveCfg = Release|x64
|
||||
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release Installer|x64.Build.0 = Release|x64
|
||||
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release Portable|x64.ActiveCfg = Release Portable|x64
|
||||
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release|x64.ActiveCfg = Release|x64
|
||||
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Debug Portable|x64.ActiveCfg = Debug Portable|x64
|
||||
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Installer|x64.ActiveCfg = Release|x64
|
||||
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Portable|x64.ActiveCfg = Release Portable|x64
|
||||
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release|x64.ActiveCfg = Release|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Debug Portable|x64.ActiveCfg = Debug Portable|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Debug Portable|x64.Build.0 = Debug Portable|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Debug|x64.Build.0 = Debug|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Release Installer|x64.ActiveCfg = Release|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Release Installer|x64.Build.0 = Release|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Release Portable|x64.ActiveCfg = Release Portable|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Release Portable|x64.Build.0 = Release Portable|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Release|x64.ActiveCfg = Release|x64
|
||||
{A56A2029-79B8-492A-ABE5-D2BFE05801BD}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{5423D985-CB48-4344-B47F-E8C6D60C8B04} = {4FE795BE-646E-4F1B-BAD0-A68EA26394DD}
|
||||
{F0168B9F-6815-40DF-BA53-46CEE7683B68} = {4FE795BE-646E-4F1B-BAD0-A68EA26394DD}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {5D390A0C-2FC4-4908-B86E-7E4DEF5916EC}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,53 +0,0 @@
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
|
||||
[*.xml]
|
||||
indent_size = 4
|
||||
|
||||
[*.cs]
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
charset = utf-8-bom
|
||||
|
||||
# reStructuredText
|
||||
[*.rst]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_size = 3
|
||||
max_line_length = 120
|
||||
|
||||
# Organize usings
|
||||
dotnet_sort_system_directives_first = true
|
||||
|
||||
# this. preferences
|
||||
dotnet_style_qualification_for_field = false:none
|
||||
dotnet_style_qualification_for_property = false:none
|
||||
dotnet_style_qualification_for_method = false:none
|
||||
dotnet_style_qualification_for_event = false:none
|
||||
|
||||
# New line preferences
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
csharp_new_line_between_query_expression_clauses = true
|
||||
|
||||
# Space preferences
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||
csharp_space_between_parentheses = false
|
||||
csharp_space_before_colon_in_inheritance_clause = true
|
||||
csharp_space_after_colon_in_inheritance_clause = true
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
@@ -1,111 +0,0 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.Win32;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Properties;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.UI.TaskDialog;
|
||||
using mRemoteNG.Resources.Language;
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public static class CompatibilityChecker
|
||||
{
|
||||
public static void CheckCompatibility(MessageCollector messageCollector)
|
||||
{
|
||||
CheckFipsPolicy(messageCollector);
|
||||
CheckLenovoAutoScrollUtility(messageCollector);
|
||||
}
|
||||
|
||||
private static void CheckFipsPolicy(MessageCollector messageCollector)
|
||||
{
|
||||
if (Settings.Default.OverrideFIPSCheck)
|
||||
{
|
||||
messageCollector.AddMessage(MessageClass.InformationMsg, "OverrideFIPSCheck is set. Will skip check", true);
|
||||
return;
|
||||
}
|
||||
|
||||
messageCollector.AddMessage(MessageClass.InformationMsg, "Checking FIPS policy...", true);
|
||||
messageCollector.AddMessage(MessageClass.InformationMsg, $"FIPS2003: {FipsPolicyEnabledForServer2003()}", true);
|
||||
messageCollector.AddMessage(MessageClass.InformationMsg, $"FIPS2008+: {FipsPolicyEnabledForServer2008AndNewer()}", true);
|
||||
|
||||
if (!FipsPolicyEnabledForServer2003() && !FipsPolicyEnabledForServer2008AndNewer()) return;
|
||||
|
||||
var errorText = string.Format(Language.ErrorFipsPolicyIncompatible, GeneralAppInfo.ProductName);
|
||||
messageCollector.AddMessage(MessageClass.ErrorMsg, errorText, true);
|
||||
|
||||
//About to pop up a message, let's not block it...
|
||||
FrmSplashScreen.getInstance().Close();
|
||||
|
||||
var ShouldIStayOrShouldIGo = CTaskDialog.MessageBox(Application.ProductName,
|
||||
Language.CompatibilityProblemDetected, errorText, "",
|
||||
"",
|
||||
Language.CheckboxDoNotShowThisMessageAgain,
|
||||
ETaskDialogButtons.OkCancel, ESysIcons.Warning,
|
||||
ESysIcons.Warning);
|
||||
if (CTaskDialog.VerificationChecked && ShouldIStayOrShouldIGo == DialogResult.OK)
|
||||
{
|
||||
messageCollector.AddMessage(MessageClass.ErrorMsg, "User requests that FIPS check be overridden", true);
|
||||
Settings.Default.OverrideFIPSCheck = true;
|
||||
Settings.Default.Save();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ShouldIStayOrShouldIGo == DialogResult.Cancel)
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
private static bool FipsPolicyEnabledForServer2003()
|
||||
{
|
||||
var regKey = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Control\Lsa");
|
||||
if (!(regKey?.GetValue("FIPSAlgorithmPolicy") is int fipsPolicy))
|
||||
return false;
|
||||
return fipsPolicy != 0;
|
||||
}
|
||||
|
||||
private static bool FipsPolicyEnabledForServer2008AndNewer()
|
||||
{
|
||||
var regKey = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy");
|
||||
if (!(regKey?.GetValue("Enabled") is int fipsPolicy))
|
||||
return false;
|
||||
return fipsPolicy != 0;
|
||||
}
|
||||
|
||||
private static void CheckLenovoAutoScrollUtility(MessageCollector messageCollector)
|
||||
{
|
||||
messageCollector.AddMessage(MessageClass.InformationMsg, "Checking Lenovo AutoScroll Utility...", true);
|
||||
|
||||
if (!Settings.Default.CompatibilityWarnLenovoAutoScrollUtility)
|
||||
return;
|
||||
|
||||
var proccesses = new Process[] { };
|
||||
try
|
||||
{
|
||||
proccesses = Process.GetProcessesByName("virtscrl");
|
||||
}
|
||||
catch (InvalidOperationException ex)
|
||||
{
|
||||
messageCollector.AddExceptionMessage("Error in CheckLenovoAutoScrollUtility", ex);
|
||||
}
|
||||
|
||||
if (proccesses.Length <= 0)
|
||||
{
|
||||
messageCollector.AddMessage(MessageClass.InformationMsg, "Lenovo AutoScroll Utility not found", true);
|
||||
return;
|
||||
}
|
||||
|
||||
messageCollector.AddMessage(MessageClass.WarningMsg, "Lenovo AutoScroll Utility found", true);
|
||||
|
||||
CTaskDialog.MessageBox(Application.ProductName, Language.CompatibilityProblemDetected,
|
||||
string.Format(Language.CompatibilityLenovoAutoScrollUtilityDetected,
|
||||
Application.ProductName), "",
|
||||
"", Language.CheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.Ok,
|
||||
ESysIcons.Warning,
|
||||
ESysIcons.Warning);
|
||||
if (CTaskDialog.VerificationChecked)
|
||||
Settings.Default.CompatibilityWarnLenovoAutoScrollUtility = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.Config.Connections;
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Config.Serializers;
|
||||
using mRemoteNG.Config.Serializers.ConnectionSerializers.Csv;
|
||||
using mRemoteNG.Config.Serializers.ConnectionSerializers.Xml;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.Factories;
|
||||
using mRemoteNG.Tree;
|
||||
using mRemoteNG.Tree.Root;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public static class Export
|
||||
{
|
||||
public static void ExportToFile(ConnectionInfo selectedNode, ConnectionTreeModel connectionTreeModel)
|
||||
{
|
||||
try
|
||||
{
|
||||
var saveFilter = new SaveFilter();
|
||||
|
||||
using (var exportForm = new FrmExport())
|
||||
{
|
||||
if (selectedNode?.GetTreeNodeType() == TreeNodeType.Container)
|
||||
exportForm.SelectedFolder = selectedNode as ContainerInfo;
|
||||
else if (selectedNode?.GetTreeNodeType() == TreeNodeType.Connection)
|
||||
{
|
||||
if (selectedNode.Parent.GetTreeNodeType() == TreeNodeType.Container)
|
||||
exportForm.SelectedFolder = selectedNode.Parent;
|
||||
exportForm.SelectedConnection = selectedNode;
|
||||
}
|
||||
|
||||
if (exportForm.ShowDialog(FrmMain.Default) != DialogResult.OK)
|
||||
return;
|
||||
|
||||
ConnectionInfo exportTarget;
|
||||
switch (exportForm.Scope)
|
||||
{
|
||||
case FrmExport.ExportScope.SelectedFolder:
|
||||
exportTarget = exportForm.SelectedFolder;
|
||||
break;
|
||||
case FrmExport.ExportScope.SelectedConnection:
|
||||
exportTarget = exportForm.SelectedConnection;
|
||||
break;
|
||||
default:
|
||||
exportTarget = connectionTreeModel.RootNodes.First(node => node is RootNodeInfo);
|
||||
break;
|
||||
}
|
||||
|
||||
saveFilter.SaveUsername = exportForm.IncludeUsername;
|
||||
saveFilter.SavePassword = exportForm.IncludePassword;
|
||||
saveFilter.SaveDomain = exportForm.IncludeDomain;
|
||||
saveFilter.SaveInheritance = exportForm.IncludeInheritance;
|
||||
saveFilter.SaveCredentialId = exportForm.IncludeAssignedCredential;
|
||||
|
||||
SaveExportFile(exportForm.FileName, exportForm.SaveFormat, saveFilter, exportTarget);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage("App.Export.ExportToFile() failed.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SaveExportFile(string fileName,
|
||||
SaveFormat saveFormat,
|
||||
SaveFilter saveFilter,
|
||||
ConnectionInfo exportTarget)
|
||||
{
|
||||
try
|
||||
{
|
||||
ISerializer<ConnectionInfo, string> serializer;
|
||||
switch (saveFormat)
|
||||
{
|
||||
case SaveFormat.mRXML:
|
||||
var cryptographyProvider = new CryptoProviderFactoryFromSettings().Build();
|
||||
var rootNode = exportTarget.GetRootParent() as RootNodeInfo;
|
||||
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
|
||||
cryptographyProvider,
|
||||
rootNode?.PasswordString
|
||||
.ConvertToSecureString() ??
|
||||
new RootNodeInfo(RootNodeType
|
||||
.Connection)
|
||||
.PasswordString
|
||||
.ConvertToSecureString(),
|
||||
saveFilter);
|
||||
serializer = new XmlConnectionsSerializer(cryptographyProvider, connectionNodeSerializer);
|
||||
break;
|
||||
case SaveFormat.mRCSV:
|
||||
serializer =
|
||||
new CsvConnectionsSerializerMremotengFormat(saveFilter, Runtime.CredentialProviderCatalog);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(saveFormat), saveFormat, null);
|
||||
}
|
||||
|
||||
var serializedData = serializer.Serialize(exportTarget);
|
||||
var fileDataProvider = new FileDataProvider(fileName);
|
||||
fileDataProvider.Save(serializedData);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionStackTrace($"Export.SaveExportFile(\"{fileName}\") failed.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Runtime.ConnectionsService.RemoteConnectionsSyncronizer?.Enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.Config.Import;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Connection.Protocol;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Resources.Language;
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public static class Import
|
||||
{
|
||||
public static void ImportFromFile(ContainerInfo importDestinationContainer)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var openFileDialog = new OpenFileDialog())
|
||||
{
|
||||
openFileDialog.CheckFileExists = true;
|
||||
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
|
||||
openFileDialog.Multiselect = true;
|
||||
|
||||
var fileTypes = new List<string>();
|
||||
fileTypes.AddRange(new[] {Language.FilterAllImportable, "*.xml;*.rdp;*.rdg;*.dat;*.csv"});
|
||||
fileTypes.AddRange(new[] {Language.FiltermRemoteXML, "*.xml"});
|
||||
fileTypes.AddRange(new[] {Language.FiltermRemoteCSV, "*.csv"});
|
||||
fileTypes.AddRange(new[] {Language.FilterRDP, "*.rdp"});
|
||||
fileTypes.AddRange(new[] {Language.FilterRdgFiles, "*.rdg"});
|
||||
fileTypes.AddRange(new[] {Language.FilterPuttyConnectionManager, "*.dat"});
|
||||
fileTypes.AddRange(new[] {Language.FilterAll, "*.*"});
|
||||
|
||||
openFileDialog.Filter = string.Join("|", fileTypes.ToArray());
|
||||
|
||||
if (openFileDialog.ShowDialog() != DialogResult.OK)
|
||||
return;
|
||||
|
||||
HeadlessFileImport(
|
||||
openFileDialog.FileNames,
|
||||
importDestinationContainer,
|
||||
Runtime.ConnectionsService,
|
||||
fileName => MessageBox.Show(string.Format(Language.ImportFileFailedContent, fileName), Language.AskUpdatesMainInstruction,
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage("Unable to import file.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void HeadlessFileImport(
|
||||
IEnumerable<string> filePaths,
|
||||
ContainerInfo importDestinationContainer,
|
||||
ConnectionsService connectionsService,
|
||||
Action<string> exceptionAction = null)
|
||||
{
|
||||
using (connectionsService.BatchedSavingContext())
|
||||
{
|
||||
foreach (var fileName in filePaths)
|
||||
{
|
||||
try
|
||||
{
|
||||
var importer = BuildConnectionImporterFromFileExtension(fileName);
|
||||
importer.Import(fileName, importDestinationContainer);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
exceptionAction?.Invoke(fileName);
|
||||
Runtime.MessageCollector.AddExceptionMessage($"Error occurred while importing file '{fileName}'.", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ImportFromActiveDirectory(string ldapPath,
|
||||
ContainerInfo importDestinationContainer,
|
||||
bool importSubOu)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Runtime.ConnectionsService.BatchedSavingContext())
|
||||
{
|
||||
ActiveDirectoryImporter.Import(ldapPath, importDestinationContainer, importSubOu);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage("App.Import.ImportFromActiveDirectory() failed.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ImportFromPortScan(IEnumerable<ScanHost> hosts,
|
||||
ProtocolType protocol,
|
||||
ContainerInfo importDestinationContainer)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Runtime.ConnectionsService.BatchedSavingContext())
|
||||
{
|
||||
var importer = new PortScanImporter(protocol);
|
||||
importer.Import(hosts, importDestinationContainer);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage("App.Import.ImportFromPortScan() failed.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static IConnectionImporter<string> BuildConnectionImporterFromFileExtension(string fileName)
|
||||
{
|
||||
// TODO: Use the file contents to determine the file type instead of trusting the extension
|
||||
var extension = Path.GetExtension(fileName) ?? "";
|
||||
switch (extension.ToLowerInvariant())
|
||||
{
|
||||
case ".xml":
|
||||
return new MRemoteNGXmlImporter();
|
||||
case ".csv":
|
||||
return new MRemoteNGCsvImporter();
|
||||
case ".rdp":
|
||||
return new RemoteDesktopConnectionImporter();
|
||||
case ".rdg":
|
||||
return new RemoteDesktopConnectionManagerImporter();
|
||||
case ".dat":
|
||||
return new PuttyConnectionManagerImporter();
|
||||
default:
|
||||
throw new FileFormatException("Unrecognized file format.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace mRemoteNG.App.Info
|
||||
{
|
||||
public static class ConnectionsFileInfo
|
||||
{
|
||||
public static readonly string DefaultConnectionsPath = SettingsFileInfo.SettingsPath;
|
||||
public static readonly string DefaultConnectionsFile = "confCons.xml";
|
||||
public static readonly string DefaultConnectionsFileNew = "confConsNew.xml";
|
||||
public static readonly Version ConnectionFileVersion = new Version(2, 9);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace mRemoteNG.App.Info
|
||||
{
|
||||
public class CredentialsFileInfo
|
||||
{
|
||||
public static readonly string CredentialsPath = SettingsFileInfo.SettingsPath;
|
||||
public static readonly string CredentialsFile = "confCreds.xml";
|
||||
public static readonly string CredentialsFileNew = "confCredsNew.xml";
|
||||
public static readonly double CredentialsFileVersion = 1.0;
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using static System.Environment;
|
||||
|
||||
|
||||
namespace mRemoteNG.App.Info
|
||||
{
|
||||
public static class GeneralAppInfo
|
||||
{
|
||||
public const string UrlHome = "https://www.mremoteng.org";
|
||||
public const string UrlDonate = "https://mremoteng.org/contribute";
|
||||
public const string UrlForum = "https://www.reddit.com/r/mRemoteNG";
|
||||
public const string UrlBugs = "https://bugs.mremoteng.org";
|
||||
public const string UrlDocumentation = "https://mremoteng.readthedocs.io/en/latest/";
|
||||
public static string ApplicationVersion = Application.ProductVersion;
|
||||
public static readonly string ProductName = 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 string ReportingFilePath = "";
|
||||
public static readonly string PuttyPath = HomePath + "\\PuTTYNG.exe";
|
||||
|
||||
public static string UserAgent
|
||||
{
|
||||
get
|
||||
{
|
||||
var details = new List<string>
|
||||
{
|
||||
"compatible",
|
||||
OSVersion.Platform == PlatformID.Win32NT
|
||||
? $"Windows NT {OSVersion.Version.Major}.{OSVersion.Version.Minor}"
|
||||
: OSVersion.VersionString
|
||||
};
|
||||
if (Is64BitProcess)
|
||||
{
|
||||
details.Add("WOW64");
|
||||
}
|
||||
|
||||
details.Add(Thread.CurrentThread.CurrentUICulture.Name);
|
||||
details.Add($".NET CLR {Environment.Version}");
|
||||
var detailsString = string.Join("; ", details.ToArray());
|
||||
|
||||
return $"Mozilla/5.0 ({detailsString}) {ProductName}/{ApplicationVersion}";
|
||||
}
|
||||
}
|
||||
|
||||
public static Version GetApplicationVersion()
|
||||
{
|
||||
System.Version.TryParse(ApplicationVersion, out var v);
|
||||
return v;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.Connection;
|
||||
|
||||
namespace mRemoteNG.App.Info
|
||||
{
|
||||
public static class SettingsFileInfo
|
||||
{
|
||||
private static readonly string ExePath =
|
||||
Path.GetDirectoryName(Assembly.GetAssembly(typeof(ConnectionInfo))?.Location);
|
||||
|
||||
public static string SettingsPath =>
|
||||
Runtime.IsPortableEdition
|
||||
? ExePath
|
||||
: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + Application.ProductName;
|
||||
|
||||
public static string LayoutFileName { get; } = "pnlLayout.xml";
|
||||
public static string ExtAppsFilesName { get; } = "extApps.xml";
|
||||
public static string ThemesFileName { get; } = "Themes.xml";
|
||||
|
||||
public static string ThemeFolder { get; } =
|
||||
SettingsPath != null ? Path.Combine(SettingsPath, "Themes") : String.Empty;
|
||||
|
||||
public static string InstalledThemeFolder { get; } =
|
||||
ExePath != null ? Path.Combine(ExePath, "Themes") : String.Empty;
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System;
|
||||
using mRemoteNG.Properties;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace mRemoteNG.App.Info
|
||||
{
|
||||
public static class UpdateChannelInfo
|
||||
{
|
||||
public const string STABLE = "Stable";
|
||||
public const string PREVIEW = "Preview";
|
||||
public const string NIGHTLY = "Nightly";
|
||||
|
||||
public const string STABLE_PORTABLE = "update-portable.txt";
|
||||
public const string PREVIEW_PORTABLE = "preview-update-portable.txt";
|
||||
public const string NIGHTLY_PORTABLE = "nightly-update-portable.txt";
|
||||
|
||||
public const string STABLE_MSI = "update.txt";
|
||||
public const string PREVIEW_MSI = "preview-update.txt";
|
||||
public const string NIGHTLY_MSI = "nightly-update.txt";
|
||||
|
||||
|
||||
public static Uri GetUpdateChannelInfo()
|
||||
{
|
||||
var channel = IsValidChannel(Settings.Default.UpdateChannel) ? Settings.Default.UpdateChannel : STABLE;
|
||||
return GetUpdateTxtUri(channel);
|
||||
}
|
||||
|
||||
private static string GetChannelFileName(string channel)
|
||||
{
|
||||
return Runtime.IsPortableEdition
|
||||
? GetChannelFileNamePortableEdition(channel)
|
||||
: GetChannelFileNameNormalEdition(channel);
|
||||
}
|
||||
|
||||
private static string GetChannelFileNameNormalEdition(string channel)
|
||||
{
|
||||
switch (channel)
|
||||
{
|
||||
case STABLE:
|
||||
return STABLE_MSI;
|
||||
case PREVIEW:
|
||||
return PREVIEW_MSI;
|
||||
case NIGHTLY:
|
||||
return NIGHTLY_MSI;
|
||||
default:
|
||||
return STABLE_MSI;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetChannelFileNamePortableEdition(string channel)
|
||||
{
|
||||
switch (channel)
|
||||
{
|
||||
case STABLE:
|
||||
return STABLE_PORTABLE;
|
||||
case PREVIEW:
|
||||
return PREVIEW_PORTABLE;
|
||||
case NIGHTLY:
|
||||
return NIGHTLY_PORTABLE;
|
||||
default:
|
||||
return STABLE_PORTABLE;
|
||||
}
|
||||
}
|
||||
|
||||
private static Uri GetUpdateTxtUri(string channel)
|
||||
{
|
||||
return new Uri(new Uri(Settings.Default.UpdateAddress),
|
||||
new Uri(GetChannelFileName(channel), UriKind.Relative));
|
||||
}
|
||||
|
||||
private static bool IsValidChannel(string s)
|
||||
{
|
||||
return s.Equals(STABLE) || s.Equals(PREVIEW) || s.Equals(NIGHTLY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using mRemoteNG.Connection;
|
||||
|
||||
|
||||
namespace mRemoteNG.App.Initialization
|
||||
{
|
||||
public class ConnectionIconLoader
|
||||
{
|
||||
private readonly string _path;
|
||||
|
||||
public ConnectionIconLoader(string folderPath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(folderPath))
|
||||
throw new ArgumentException($"{nameof(folderPath)} must be a valid folder path.");
|
||||
|
||||
_path = folderPath;
|
||||
}
|
||||
|
||||
public void GetConnectionIcons()
|
||||
{
|
||||
if (Directory.Exists(_path) == false)
|
||||
return;
|
||||
|
||||
foreach (var f in Directory.GetFiles(_path, "*.ico", SearchOption.AllDirectories))
|
||||
{
|
||||
var fInfo = new FileInfo(f);
|
||||
Array.Resize(ref ConnectionIcon.Icons, ConnectionIcon.Icons.Length + 1);
|
||||
ConnectionIcon.Icons.SetValue(fInfo.Name.Replace(".ico", ""), ConnectionIcon.Icons.Length - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using System.IO;
|
||||
using mRemoteNG.Config.Connections;
|
||||
using mRemoteNG.Properties;
|
||||
|
||||
namespace mRemoteNG.App.Initialization
|
||||
{
|
||||
public class CredsAndConsSetup
|
||||
{
|
||||
public void LoadCredsAndCons()
|
||||
{
|
||||
new SaveConnectionsOnEdit(Runtime.ConnectionsService);
|
||||
|
||||
if (Settings.Default.FirstStart && !Settings.Default.LoadConsFromCustomLocation &&
|
||||
!File.Exists(Runtime.ConnectionsService.GetStartupConnectionFileName()))
|
||||
Runtime.ConnectionsService.NewConnectionsFile(Runtime.ConnectionsService
|
||||
.GetStartupConnectionFileName());
|
||||
|
||||
Runtime.LoadConnections();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Messages.MessageFilteringOptions;
|
||||
using mRemoteNG.Messages.MessageWriters;
|
||||
using mRemoteNG.Messages.WriterDecorators;
|
||||
|
||||
namespace mRemoteNG.App.Initialization
|
||||
{
|
||||
public class MessageCollectorSetup
|
||||
{
|
||||
public static void SetupMessageCollector(MessageCollector messageCollector,
|
||||
IList<IMessageWriter> messageWriterList)
|
||||
{
|
||||
messageCollector.CollectionChanged += (o, args) =>
|
||||
{
|
||||
var messages = args.NewItems.Cast<IMessage>().ToArray();
|
||||
foreach (var printer in messageWriterList)
|
||||
foreach (var message in messages)
|
||||
printer.Write(message);
|
||||
};
|
||||
}
|
||||
|
||||
public static void BuildMessageWritersFromSettings(IList<IMessageWriter> messageWriterList)
|
||||
{
|
||||
#if DEBUG
|
||||
messageWriterList.Add(BuildDebugConsoleWriter());
|
||||
#endif
|
||||
messageWriterList.Add(BuildTextLogMessageWriter());
|
||||
messageWriterList.Add(BuildNotificationPanelMessageWriter());
|
||||
messageWriterList.Add(BuildPopupMessageWriter());
|
||||
}
|
||||
|
||||
private static IMessageWriter BuildDebugConsoleWriter()
|
||||
{
|
||||
return new DebugConsoleMessageWriter();
|
||||
}
|
||||
|
||||
private static IMessageWriter BuildTextLogMessageWriter()
|
||||
{
|
||||
return new MessageTypeFilterDecorator(
|
||||
new LogMessageTypeFilteringOptions(),
|
||||
new TextLogMessageWriter(Logger.Instance)
|
||||
);
|
||||
}
|
||||
|
||||
private static IMessageWriter BuildNotificationPanelMessageWriter()
|
||||
{
|
||||
return new OnlyLogMessageFilter(
|
||||
new MessageTypeFilterDecorator(
|
||||
new
|
||||
NotificationPanelMessageFilteringOptions(),
|
||||
new MessageFocusDecorator(
|
||||
Windows.ErrorsForm,
|
||||
new
|
||||
NotificationPanelSwitchOnMessageFilteringOptions(),
|
||||
new
|
||||
NotificationPanelMessageWriter(Windows
|
||||
.ErrorsForm)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private static IMessageWriter BuildPopupMessageWriter()
|
||||
{
|
||||
return new OnlyLogMessageFilter(
|
||||
new MessageTypeFilterDecorator(
|
||||
new PopupMessageFilteringOptions(),
|
||||
new PopupMessageWriter()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
using System;
|
||||
using System.Management;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Resources.Language;
|
||||
|
||||
namespace mRemoteNG.App.Initialization
|
||||
{
|
||||
public class StartupDataLogger
|
||||
{
|
||||
private readonly MessageCollector _messageCollector;
|
||||
|
||||
public StartupDataLogger(MessageCollector messageCollector)
|
||||
{
|
||||
if (messageCollector == null)
|
||||
throw new ArgumentNullException(nameof(messageCollector));
|
||||
|
||||
_messageCollector = messageCollector;
|
||||
}
|
||||
|
||||
public void LogStartupData()
|
||||
{
|
||||
LogApplicationData();
|
||||
LogCmdLineArgs();
|
||||
LogSystemData();
|
||||
LogClrData();
|
||||
LogCultureData();
|
||||
}
|
||||
|
||||
private void LogSystemData()
|
||||
{
|
||||
var osData = GetOperatingSystemData();
|
||||
var architecture = GetArchitectureData();
|
||||
var nonEmptyData = Array.FindAll(new[] {osData, architecture}, s => !string.IsNullOrEmpty(s));
|
||||
var data = string.Join(" ", nonEmptyData);
|
||||
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
|
||||
}
|
||||
|
||||
private string GetOperatingSystemData()
|
||||
{
|
||||
var osVersion = string.Empty;
|
||||
var servicePack = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem WHERE Primary=True")
|
||||
.Get())
|
||||
{
|
||||
var managementObject = (ManagementObject)o;
|
||||
osVersion = Convert.ToString(managementObject.GetPropertyValue("Caption")).Trim();
|
||||
servicePack = GetOSServicePack(servicePack, managementObject);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_messageCollector.AddExceptionMessage("Error retrieving operating system information from WMI.", ex);
|
||||
}
|
||||
|
||||
var osData = string.Join(" ", osVersion, servicePack);
|
||||
return osData;
|
||||
}
|
||||
|
||||
private string GetOSServicePack(string servicePack, ManagementObject managementObject)
|
||||
{
|
||||
var servicePackNumber = Convert.ToInt32(managementObject.GetPropertyValue("ServicePackMajorVersion"));
|
||||
if (servicePackNumber != 0)
|
||||
{
|
||||
servicePack = $"Service Pack {servicePackNumber}";
|
||||
}
|
||||
|
||||
return servicePack;
|
||||
}
|
||||
|
||||
private string GetArchitectureData()
|
||||
{
|
||||
var architecture = string.Empty;
|
||||
try
|
||||
{
|
||||
foreach (var o in new ManagementObjectSearcher("SELECT AddressWidth FROM Win32_Processor WHERE DeviceID=\'CPU0\'")
|
||||
.Get())
|
||||
{
|
||||
var managementObject = (ManagementObject)o;
|
||||
var addressWidth = Convert.ToInt32(managementObject.GetPropertyValue("AddressWidth"));
|
||||
architecture = $"{addressWidth}-bit";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_messageCollector.AddExceptionMessage("Error retrieving operating system address width from WMI.", ex);
|
||||
}
|
||||
|
||||
return architecture;
|
||||
}
|
||||
|
||||
private void LogApplicationData()
|
||||
{
|
||||
var data = $"{Application.ProductName} {Application.ProductVersion}";
|
||||
if (Runtime.IsPortableEdition)
|
||||
data += $" {Language.PortableEdition}";
|
||||
data += " starting.";
|
||||
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
|
||||
}
|
||||
|
||||
private void LogCmdLineArgs()
|
||||
{
|
||||
var data = $"Command Line: {string.Join(" ", Environment.GetCommandLineArgs())}";
|
||||
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
|
||||
}
|
||||
|
||||
private void LogClrData()
|
||||
{
|
||||
var data = $"Microsoft .NET CLR {Environment.Version}";
|
||||
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
|
||||
}
|
||||
|
||||
private void LogCultureData()
|
||||
{
|
||||
var data =
|
||||
$"System Culture: {Thread.CurrentThread.CurrentUICulture.Name}/{Thread.CurrentThread.CurrentUICulture.NativeName}";
|
||||
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using log4net.Appender;
|
||||
using log4net.Config;
|
||||
using mRemoteNG.Properties;
|
||||
|
||||
// ReSharper disable ArrangeAccessorOwnerBody
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public class Logger
|
||||
{
|
||||
public static readonly Logger Instance = new Logger();
|
||||
|
||||
public ILog Log { get; private set; }
|
||||
|
||||
public static string DefaultLogPath => BuildLogFilePath();
|
||||
|
||||
private Logger()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
XmlConfigurator.Configure(LogManager.CreateRepository("mRemoteNG"));
|
||||
if (string.IsNullOrEmpty(Settings.Default.LogFilePath))
|
||||
Settings.Default.LogFilePath = BuildLogFilePath();
|
||||
|
||||
SetLogPath(Settings.Default.LogToApplicationDirectory ? DefaultLogPath : Settings.Default.LogFilePath);
|
||||
}
|
||||
|
||||
public void SetLogPath(string path)
|
||||
{
|
||||
var repository = LogManager.GetRepository("mRemoteNG");
|
||||
XmlConfigurator.Configure(repository, new FileInfo("log4net.config"));
|
||||
var appenders = repository.GetAppenders();
|
||||
|
||||
foreach (var appender in appenders)
|
||||
{
|
||||
var fileAppender = (RollingFileAppender)appender;
|
||||
if (fileAppender == null || fileAppender.Name != "LogFileAppender") continue;
|
||||
fileAppender.File = path;
|
||||
fileAppender.ActivateOptions();
|
||||
}
|
||||
|
||||
Log = LogManager.GetLogger("mRemoteNG", "Logger");
|
||||
}
|
||||
|
||||
private static string BuildLogFilePath()
|
||||
{
|
||||
var logFilePath = Runtime.IsPortableEdition ? GetLogPathPortableEdition() : GetLogPathNormalEdition();
|
||||
var logFileName = Path.ChangeExtension(Application.ProductName, ".log");
|
||||
if (logFileName == null) return "mRemoteNG.log";
|
||||
var logFile = Path.Combine(logFilePath, logFileName);
|
||||
return logFile;
|
||||
}
|
||||
|
||||
private static string GetLogPathNormalEdition()
|
||||
{
|
||||
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
Application.ProductName);
|
||||
}
|
||||
|
||||
private static string GetLogPathPortableEdition()
|
||||
{
|
||||
return Application.StartupPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,552 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.ConstrainedExecution;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
#pragma warning disable 649
|
||||
#pragma warning disable 169
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public static class NativeMethods
|
||||
{
|
||||
#region Functions
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern bool AppendMenu(IntPtr hMenu, int uFlags, IntPtr uIDNewItem, string lpNewItem);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr CreatePopupMenu();
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr FindWindowEx(IntPtr parentHandle,
|
||||
IntPtr childAfter,
|
||||
string lclassName,
|
||||
string windowTitle);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr GetForegroundWindow();
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern bool InsertMenu(IntPtr hMenu,
|
||||
int uPosition,
|
||||
int uFlags,
|
||||
IntPtr uIDNewItem,
|
||||
string lpNewItem);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern int IsIconic(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern bool MoveWindow(IntPtr hWnd, int x, int y, int cx, int cy, bool repaint);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern bool PostMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, StringBuilder lParam);
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, string lParam);
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr SendMessage([In] IntPtr hWnd,
|
||||
[In] uint msg,
|
||||
[Out] StringBuilder wParam,
|
||||
[In] IntPtr lParam);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr SetClipboardViewer(IntPtr hWndNewViewer);
|
||||
|
||||
[DllImport("User32.dll", CharSet = CharSet.Auto)]
|
||||
internal static extern bool ChangeClipboardChain(
|
||||
IntPtr hWndRemove, // handle to window to remove
|
||||
IntPtr hWndNewNext // handle to next window
|
||||
);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern bool SetMenuItemBitmaps(IntPtr hMenu,
|
||||
int uPosition,
|
||||
int uFlags,
|
||||
IntPtr hBitmapUnchecked,
|
||||
IntPtr hBitmapChecked);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern long SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern int ShowWindow(IntPtr hWnd, int nCmdShow);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern IntPtr WindowFromPoint(Point point);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern int GetDlgCtrlID(IntPtr hwndCtl);
|
||||
|
||||
[DllImport("user32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
|
||||
internal static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
|
||||
|
||||
[DllImport("user32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
|
||||
internal static extern bool SetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
|
||||
|
||||
[DllImport("kernel32", SetLastError = true)]
|
||||
internal static extern bool CloseHandle(IntPtr handle);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Structures
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct WINDOWPOS
|
||||
{
|
||||
public IntPtr hwnd;
|
||||
public IntPtr hwndInsertAfter;
|
||||
public int x;
|
||||
public int y;
|
||||
public int cx;
|
||||
public int cy;
|
||||
public int flags;
|
||||
}
|
||||
|
||||
internal struct WINDOWPLACEMENT
|
||||
{
|
||||
public uint length;
|
||||
public uint flags;
|
||||
public uint showCmd;
|
||||
public POINT ptMinPosition;
|
||||
public POINT ptMaxPosition;
|
||||
public RECT rcNormalPosition;
|
||||
}
|
||||
|
||||
internal struct POINT
|
||||
{
|
||||
public long x;
|
||||
public long y;
|
||||
}
|
||||
|
||||
internal struct RECT
|
||||
{
|
||||
public long left;
|
||||
public long top;
|
||||
public long right;
|
||||
public long bottom;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Helpers
|
||||
|
||||
public static int MAKELONG(int wLow, int wHigh)
|
||||
{
|
||||
return wLow | wHigh << 16;
|
||||
}
|
||||
|
||||
public static int MAKELPARAM(ref int wLow, ref int wHigh)
|
||||
{
|
||||
return MAKELONG(wLow, wHigh);
|
||||
}
|
||||
|
||||
public static int LOWORD(int value)
|
||||
{
|
||||
return value & 0xFFFF;
|
||||
}
|
||||
|
||||
public static int LOWORD(IntPtr value)
|
||||
{
|
||||
return LOWORD(value.ToInt32());
|
||||
}
|
||||
|
||||
public static int HIWORD(int value)
|
||||
{
|
||||
return value >> 16;
|
||||
}
|
||||
|
||||
public static int HIWORD(IntPtr value)
|
||||
{
|
||||
return HIWORD(value.ToInt32());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constants
|
||||
|
||||
public const int TRUE = 1;
|
||||
|
||||
#region GetWindowLong
|
||||
|
||||
public const int GWL_STYLE = (-16);
|
||||
|
||||
#endregion
|
||||
|
||||
#region AppendMenu / ModifyMenu / DeleteMenu / RemoveMenu
|
||||
|
||||
public const int MF_BYCOMMAND = 0x0;
|
||||
public const int MF_BYPOSITION = 0x400;
|
||||
public const int MF_STRING = 0x0;
|
||||
public const int MF_POPUP = 0x10;
|
||||
public const int MF_SEPARATOR = 0x800;
|
||||
|
||||
#endregion
|
||||
|
||||
#region WM_LBUTTONDOWN / WM_LBUTTONUP
|
||||
|
||||
public const int MK_LBUTTON = 0x1;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ShowWindow
|
||||
|
||||
public const uint SW_HIDE = 0;
|
||||
public const uint SW_SHOWNORMAL = 1;
|
||||
public const uint SW_SHOWMINIMIZED = 2;
|
||||
public const uint SW_SHOWMAXIMIZED = 3;
|
||||
public const uint SW_MAXIMIZE = 3;
|
||||
public const uint SW_SHOWNOACTIVATE = 4;
|
||||
public const uint SW_SHOW = 5;
|
||||
public const uint SW_MINIMIZE = 6;
|
||||
public const uint SW_SHOWMINNOACTIVE = 7;
|
||||
public const uint SW_SHOWNA = 8;
|
||||
public const uint SW_RESTORE = 9;
|
||||
|
||||
#endregion
|
||||
|
||||
#region SetWindowPos / WM_WINDOWPOSCHANGING / WM_WINDOWPOSCHANGED
|
||||
|
||||
/// <summary>
|
||||
/// Retains the current size (ignores the cx and cy parameters).
|
||||
/// </summary>
|
||||
public const int SWP_NOSIZE = 0x1;
|
||||
|
||||
/// <summary>
|
||||
/// Retains the current position (ignores the x and y parameters).
|
||||
/// </summary>
|
||||
public const int SWP_NOMOVE = 0x2;
|
||||
|
||||
/// <summary>
|
||||
/// Retains the current Z order (ignores the hWndInsertAfter parameter).
|
||||
/// </summary>
|
||||
public const int SWP_NOZORDER = 0x4;
|
||||
|
||||
/// <summary>
|
||||
/// Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
|
||||
/// </summary>
|
||||
public const int SWP_NOREDRAW = 0x8;
|
||||
|
||||
/// <summary>
|
||||
/// Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
|
||||
/// </summary>
|
||||
public const int SWP_NOACTIVATE = 0x10;
|
||||
|
||||
/// <summary>
|
||||
/// Draws a frame (defined in the window's class description) around the window.
|
||||
/// </summary>
|
||||
public const int SWP_DRAWFRAME = 0x20;
|
||||
|
||||
/// <summary>
|
||||
/// Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.
|
||||
/// </summary>
|
||||
public const int SWP_FRAMECHANGED = 0x20;
|
||||
|
||||
/// <summary>
|
||||
/// Displays the window.
|
||||
/// </summary>
|
||||
public const int SWP_SHOWWINDOW = 0x40;
|
||||
|
||||
/// <summary>
|
||||
/// Hides the window.
|
||||
/// </summary>
|
||||
public const int SWP_HIDEWINDOW = 0x80;
|
||||
|
||||
/// <summary>
|
||||
/// Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.
|
||||
/// </summary>
|
||||
public const int SWP_NOCOPYBITS = 0x100;
|
||||
|
||||
/// <summary>
|
||||
/// Does not change the owner window's position in the Z order.
|
||||
/// </summary>
|
||||
public const int SWP_NOOWNERZORDER = 0x200;
|
||||
|
||||
/// <summary>
|
||||
/// Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
|
||||
/// </summary>
|
||||
public const int SWP_NOSENDCHANGING = 0x400;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const int SWP_NOCLIENTSIZE = 0x800;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const int SWP_NOCLIENTMOVE = 0x1000;
|
||||
|
||||
/// <summary>
|
||||
/// Prevents generation of the WM_SYNCPAINT message.
|
||||
/// </summary>
|
||||
public const int SWP_DEFERERASE = 0x2000;
|
||||
|
||||
/// <summary>
|
||||
/// If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.
|
||||
/// </summary>
|
||||
public const int SWP_ASYNCWINDOWPOS = 0x4000;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const int SWP_STATECHANGED = 0x8000;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Window Placement Flags (WPF)
|
||||
|
||||
public const uint WPF_SETMINPOSITION = 0x1;
|
||||
public const uint WPF_RESTORETOMAXIMIZED = 0x2;
|
||||
public const uint WPF_ASYNCWINDOWPLACEMENT = 0x4;
|
||||
|
||||
#endregion
|
||||
|
||||
#region WM_ACTIVATE
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const int WA_INACTIVE = 0x0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const int WA_ACTIVE = 0x1;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to both the window being activated and the window being deactivated.
|
||||
/// If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the
|
||||
/// top-level window being deactivated, then to the window procedure of the top-level window being activated. If the
|
||||
/// windows use different input queues, the message is sent asynchronously, so the window is activated immediately.
|
||||
/// </summary>
|
||||
public const int WA_CLICKACTIVE = 0x2;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Window Messages
|
||||
|
||||
/// <summary>
|
||||
/// Sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.
|
||||
/// </summary>
|
||||
public const int WM_CREATE = 0x1;
|
||||
|
||||
/// <summary>
|
||||
/// Sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. This message is sent first to the window being destroyed and then to the child windows(if any) as they are destroyed.During the processing of the message, it can be assumed that all child windows still exist.
|
||||
/// </summary>
|
||||
public const int WM_DESTROY = 0x2;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately.
|
||||
/// </summary>
|
||||
public const int WM_ACTIVATE = 0x6;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const int WM_SETTEXT = 0xC;
|
||||
|
||||
/// <summary>
|
||||
/// Copies the text that corresponds to a window into a buffer provided by the caller.
|
||||
/// </summary>
|
||||
public const int WM_GETTEXT = 0xD;
|
||||
|
||||
/// <summary>
|
||||
/// Sent as a signal that a window or an application should terminate.
|
||||
/// </summary>
|
||||
public const int WM_CLOSE = 0x10;
|
||||
|
||||
/// <summary>
|
||||
/// Sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.
|
||||
/// </summary>
|
||||
public const int WM_ACTIVATEAPP = 0x1C;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
|
||||
/// </summary>
|
||||
public const int WM_SETCURSOR = 0x20;
|
||||
|
||||
/// <summary>
|
||||
/// Sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.
|
||||
/// </summary>
|
||||
public const int WM_MOUSEACTIVATE = 0x21;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.
|
||||
/// </summary>
|
||||
public const int WM_GETMINMAXINFO = 0x24;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.
|
||||
/// </summary>
|
||||
public const int WM_WINDOWPOSCHANGING = 0x46;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.
|
||||
/// </summary>
|
||||
public const int WM_WINDOWPOSCHANGED = 0x47;
|
||||
|
||||
/// <summary>
|
||||
/// Posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.
|
||||
/// </summary>
|
||||
public const int WM_KEYDOWN = 0x100;
|
||||
|
||||
/// <summary>
|
||||
/// Posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.
|
||||
/// </summary>
|
||||
public const int WM_KEYUP = 0x101;
|
||||
|
||||
/// <summary>
|
||||
/// Posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed.
|
||||
/// </summary>
|
||||
public const int WM_CHAR = 0x102;
|
||||
|
||||
/// <summary>
|
||||
/// Sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
|
||||
/// </summary>
|
||||
public const int WM_COMMAND = 0x111;
|
||||
|
||||
/// <summary>
|
||||
/// A window receives this message when the user chooses a command from the Window menu (formerly known as the system or control menu) or when the user chooses the maximize button, minimize button, restore button, or close button.
|
||||
/// </summary>
|
||||
public const int WM_SYSCOMMAND = 0x112;
|
||||
|
||||
/// <summary>
|
||||
/// Posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
/// </summary>
|
||||
public const int WM_MOUSEMOVE = 0x200;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
/// </summary>
|
||||
public const int WM_LBUTTONDOWN = 0x201;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
/// </summary>
|
||||
public const int WM_LBUTTONUP = 0x202;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
/// </summary>
|
||||
public const int WM_RBUTTONDOWN = 0x204;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
/// </summary>
|
||||
public const int WM_RBUTTONUP = 0x205;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
/// </summary>
|
||||
public const int WM_MBUTTONDOWN = 0x207;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
/// </summary>
|
||||
public const int WM_MBUTTONUP = 0x208;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
/// </summary>
|
||||
public const int WM_XBUTTONDOWN = 0x20B;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
/// </summary>
|
||||
public const int WM_XBUTTONUP = 0x20C;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to a window when a significant action occurs on a descendant window. This message is now extended to include the WM_POINTERDOWN event. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.
|
||||
/// </summary>
|
||||
public const int WM_PARENTNOTIFY = 0x210;
|
||||
|
||||
/// <summary>
|
||||
/// Sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
|
||||
/// </summary>
|
||||
public const int WM_ENTERSIZEMOVE = 0x231;
|
||||
|
||||
/// <summary>
|
||||
/// Sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
|
||||
/// </summary>
|
||||
public const int WM_EXITSIZEMOVE = 0x232;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.
|
||||
/// </summary>
|
||||
public const int WM_DRAWCLIPBOARD = 0x308;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to the first window in the clipboard viewer chain when a window is being removed from the chain.
|
||||
/// </summary>
|
||||
public const int WM_CHANGECBCHAIN = 0x30D;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Window Styles
|
||||
|
||||
public const int WS_MAXIMIZE = 0x1000000;
|
||||
public const int WS_VISIBLE = 0x10000000;
|
||||
public const int WS_CHILD = 0x40000000;
|
||||
public const int WS_EX_MDICHILD = 0x40;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Virtual Key Codes
|
||||
|
||||
public const int VK_CONTROL = 0x11;
|
||||
public const int VK_C = 0x67;
|
||||
|
||||
#endregion
|
||||
|
||||
#region EM
|
||||
|
||||
public const uint ECM_FIRST = 0x1500;
|
||||
public const uint EM_SETCUEBANNER = ECM_FIRST + 1;
|
||||
public const uint EM_GETCUEBANNER = ECM_FIRST + 2;
|
||||
|
||||
#endregion
|
||||
|
||||
#region LB
|
||||
|
||||
public const int LB_ERR = -1;
|
||||
public const int LB_SELECTSTRING = 0x18C;
|
||||
|
||||
#endregion
|
||||
|
||||
#region TCM
|
||||
|
||||
internal const int TCM_ADJUSTRECT = 0x1328;
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.Properties;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public static class ProgramRoot
|
||||
{
|
||||
private static Mutex _mutex;
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
if (Settings.Default.SingleInstance)
|
||||
StartApplicationAsSingleInstance();
|
||||
else
|
||||
StartApplication();
|
||||
}
|
||||
|
||||
private static void StartApplication()
|
||||
{
|
||||
CatchAllUnhandledExceptions();
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
var frmSplashScreen = FrmSplashScreen.getInstance();
|
||||
frmSplashScreen.Show();
|
||||
Application.Run(FrmMain.Default);
|
||||
}
|
||||
|
||||
public static void CloseSingletonInstanceMutex()
|
||||
{
|
||||
_mutex?.Close();
|
||||
}
|
||||
|
||||
private static void StartApplicationAsSingleInstance()
|
||||
{
|
||||
const string mutexID = "mRemoteNG_SingleInstanceMutex";
|
||||
_mutex = new Mutex(false, mutexID, out var newInstanceCreated);
|
||||
if (!newInstanceCreated)
|
||||
{
|
||||
SwitchToCurrentInstance();
|
||||
return;
|
||||
}
|
||||
|
||||
StartApplication();
|
||||
GC.KeepAlive(_mutex);
|
||||
}
|
||||
|
||||
private static void SwitchToCurrentInstance()
|
||||
{
|
||||
var singletonInstanceWindowHandle = GetRunningSingletonInstanceWindowHandle();
|
||||
if (singletonInstanceWindowHandle == IntPtr.Zero) return;
|
||||
if (NativeMethods.IsIconic(singletonInstanceWindowHandle) != 0)
|
||||
NativeMethods.ShowWindow(singletonInstanceWindowHandle, (int)NativeMethods.SW_RESTORE);
|
||||
NativeMethods.SetForegroundWindow(singletonInstanceWindowHandle);
|
||||
}
|
||||
|
||||
private static IntPtr GetRunningSingletonInstanceWindowHandle()
|
||||
{
|
||||
var windowHandle = IntPtr.Zero;
|
||||
var currentProcess = Process.GetCurrentProcess();
|
||||
foreach (var enumeratedProcess in Process.GetProcessesByName(currentProcess.ProcessName))
|
||||
{
|
||||
if (enumeratedProcess.Id != currentProcess.Id &&
|
||||
enumeratedProcess.MainModule.FileName == currentProcess.MainModule.FileName &&
|
||||
enumeratedProcess.MainWindowHandle != IntPtr.Zero)
|
||||
windowHandle = enumeratedProcess.MainWindowHandle;
|
||||
}
|
||||
|
||||
return windowHandle;
|
||||
}
|
||||
|
||||
private static void CatchAllUnhandledExceptions()
|
||||
{
|
||||
Application.ThreadException += ApplicationOnThreadException;
|
||||
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
|
||||
}
|
||||
|
||||
private static void ApplicationOnThreadException(object sender, ThreadExceptionEventArgs e)
|
||||
{
|
||||
if (!FrmSplashScreen.getInstance().IsDisposed)
|
||||
FrmSplashScreen.getInstance().Close();
|
||||
|
||||
if (FrmMain.Default.IsDisposed) return;
|
||||
|
||||
var window = new FrmUnhandledException(e.Exception, false);
|
||||
window.ShowDialog(FrmMain.Default);
|
||||
|
||||
}
|
||||
|
||||
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
if (!FrmSplashScreen.getInstance().IsDisposed)
|
||||
FrmSplashScreen.getInstance().Close();
|
||||
|
||||
var window = new FrmUnhandledException(e.ExceptionObject as Exception, e.IsTerminating);
|
||||
window.ShowDialog(FrmMain.Default);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,231 +0,0 @@
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Config.Putty;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Credential;
|
||||
using mRemoteNG.Credential.Repositories;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tree.Root;
|
||||
using mRemoteNG.UI;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.UI.TaskDialog;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.Properties;
|
||||
using mRemoteNG.Resources.Language;
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public static class Runtime
|
||||
{
|
||||
public static bool IsPortableEdition
|
||||
{
|
||||
get
|
||||
{
|
||||
#if PORTABLE
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Feature flag to enable the credential manager feature
|
||||
/// </summary>
|
||||
public static bool UseCredentialManager => false;
|
||||
|
||||
public static WindowList WindowList { get; set; }
|
||||
public static MessageCollector MessageCollector { get; } = new MessageCollector();
|
||||
public static NotificationAreaIcon NotificationAreaIcon { get; set; }
|
||||
public static ExternalToolsService ExternalToolsService { get; } = new ExternalToolsService();
|
||||
|
||||
public static SecureString EncryptionKey { get; set; } =
|
||||
new RootNodeInfo(RootNodeType.Connection).PasswordString.ConvertToSecureString();
|
||||
|
||||
public static ICredentialRepositoryList CredentialProviderCatalog { get; } = new CredentialRepositoryList();
|
||||
|
||||
public static ConnectionInitiator ConnectionInitiator { get; set; } = new ConnectionInitiator();
|
||||
|
||||
public static ConnectionsService ConnectionsService { get; } =
|
||||
new ConnectionsService(PuttySessionsManager.Instance);
|
||||
|
||||
#region Connections Loading/Saving
|
||||
|
||||
public static void LoadConnectionsAsync()
|
||||
{
|
||||
var t = new Thread(LoadConnectionsBGd);
|
||||
t.SetApartmentState(ApartmentState.STA);
|
||||
t.Start();
|
||||
}
|
||||
|
||||
private static void LoadConnectionsBGd()
|
||||
{
|
||||
LoadConnections();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="withDialog">
|
||||
/// Should we show the file selection dialog to allow the user to select
|
||||
/// a connection file
|
||||
/// </param>
|
||||
public static void LoadConnections(bool withDialog = false)
|
||||
{
|
||||
var connectionFileName = "";
|
||||
|
||||
try
|
||||
{
|
||||
// disable sql update checking while we are loading updates
|
||||
ConnectionsService.RemoteConnectionsSyncronizer?.Disable();
|
||||
|
||||
if (withDialog)
|
||||
{
|
||||
var loadDialog = DialogFactory.BuildLoadConnectionsDialog();
|
||||
if (loadDialog.ShowDialog() != DialogResult.OK)
|
||||
return;
|
||||
|
||||
connectionFileName = loadDialog.FileName;
|
||||
Settings.Default.UseSQLServer = false;
|
||||
Settings.Default.Save();
|
||||
}
|
||||
else if (!Settings.Default.UseSQLServer)
|
||||
{
|
||||
connectionFileName = ConnectionsService.GetStartupConnectionFileName();
|
||||
}
|
||||
|
||||
ConnectionsService.LoadConnections(Settings.Default.UseSQLServer, false, connectionFileName);
|
||||
|
||||
if (Settings.Default.UseSQLServer)
|
||||
{
|
||||
ConnectionsService.LastSqlUpdate = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConnectionsService.LastFileUpdate = System.IO.File.GetLastWriteTime(connectionFileName);
|
||||
}
|
||||
|
||||
// re-enable sql update checking after updates are loaded
|
||||
ConnectionsService.RemoteConnectionsSyncronizer?.Enable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FrmSplashScreen.getInstance().Close();
|
||||
|
||||
if (Settings.Default.UseSQLServer)
|
||||
{
|
||||
MessageCollector.AddExceptionMessage(Language.LoadFromSqlFailed, ex);
|
||||
var commandButtons = string.Join("|", Language._TryAgain,
|
||||
Language.CommandOpenConnectionFile,
|
||||
string.Format(Language.CommandExitProgram,
|
||||
Application.ProductName));
|
||||
CTaskDialog.ShowCommandBox(Application.ProductName, Language.LoadFromSqlFailed,
|
||||
Language.LoadFromSqlFailedContent,
|
||||
MiscTools.GetExceptionMessageRecursive(ex), "", "",
|
||||
commandButtons, false, ESysIcons.Error, ESysIcons.Error);
|
||||
switch (CTaskDialog.CommandButtonResult)
|
||||
{
|
||||
case 0:
|
||||
LoadConnections(withDialog);
|
||||
return;
|
||||
case 1:
|
||||
Settings.Default.UseSQLServer = false;
|
||||
LoadConnections(true);
|
||||
return;
|
||||
default:
|
||||
Application.Exit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ex is FileNotFoundException && !withDialog)
|
||||
{
|
||||
MessageCollector.AddExceptionMessage(
|
||||
string.Format(Language.ConnectionsFileCouldNotBeLoadedNew,
|
||||
connectionFileName), ex,
|
||||
MessageClass.InformationMsg);
|
||||
|
||||
string[] commandButtons =
|
||||
{
|
||||
Language.ConfigurationCreateNew,
|
||||
Language.ConfigurationCustomPath,
|
||||
Language.ConfigurationImportFile,
|
||||
Language.Exit
|
||||
};
|
||||
|
||||
var answered = false;
|
||||
while (!answered)
|
||||
{
|
||||
try
|
||||
{
|
||||
CTaskDialog.ShowTaskDialogBox(
|
||||
GeneralAppInfo.ProductName,
|
||||
Language.ConnectionFileNotFound,
|
||||
"", "", "", "", "",
|
||||
string.Join(" | ", commandButtons),
|
||||
ETaskDialogButtons.None,
|
||||
ESysIcons.Question,
|
||||
ESysIcons.Question);
|
||||
|
||||
switch (CTaskDialog.CommandButtonResult)
|
||||
{
|
||||
case 0:
|
||||
ConnectionsService.NewConnectionsFile(connectionFileName);
|
||||
answered = true;
|
||||
break;
|
||||
case 1:
|
||||
LoadConnections(true);
|
||||
answered = true;
|
||||
break;
|
||||
case 2:
|
||||
ConnectionsService.NewConnectionsFile(connectionFileName);
|
||||
Import.ImportFromFile(ConnectionsService.ConnectionTreeModel.RootNodes[0]);
|
||||
answered = true;
|
||||
break;
|
||||
case 3:
|
||||
Application.Exit();
|
||||
answered = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
MessageCollector.AddExceptionMessage(
|
||||
string
|
||||
.Format(Language.ConnectionsFileCouldNotBeLoadedNew,
|
||||
connectionFileName), exc,
|
||||
MessageClass.InformationMsg);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
MessageCollector.AddExceptionStackTrace(
|
||||
string.Format(Language.ConnectionsFileCouldNotBeLoaded,
|
||||
connectionFileName), ex);
|
||||
if (connectionFileName != ConnectionsService.GetStartupConnectionFileName())
|
||||
{
|
||||
LoadConnections(withDialog);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(FrmMain.Default,
|
||||
string.Format(Language.ErrorStartupConnectionFileLoad, Environment.NewLine,
|
||||
Application.ProductName,
|
||||
ConnectionsService.GetStartupConnectionFileName(),
|
||||
MiscTools.GetExceptionMessageRecursive(ex)),
|
||||
@"Could not load startup file.", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public static class Screens
|
||||
{
|
||||
public static void SendFormToScreen(Screen screen)
|
||||
{
|
||||
var frmMain = FrmMain.Default;
|
||||
var wasMax = false;
|
||||
|
||||
if (frmMain.WindowState == FormWindowState.Maximized)
|
||||
{
|
||||
wasMax = true;
|
||||
frmMain.WindowState = FormWindowState.Normal;
|
||||
}
|
||||
|
||||
frmMain.Location = screen.Bounds.Location;
|
||||
|
||||
if (wasMax)
|
||||
{
|
||||
frmMain.WindowState = FormWindowState.Maximized;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SendPanelToScreen(DockContent panel, Screen screen)
|
||||
{
|
||||
panel.DockState = DockState.Float;
|
||||
if (panel.ParentForm == null) return;
|
||||
panel.ParentForm.Left = screen.Bounds.Location.X;
|
||||
panel.ParentForm.Top = screen.Bounds.Location.Y;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
using mRemoteNG.Tools;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.Config.Connections;
|
||||
using mRemoteNG.Config.Putty;
|
||||
using mRemoteNG.Properties;
|
||||
using mRemoteNG.UI.Controls;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.Resources.Language;
|
||||
|
||||
// ReSharper disable ArrangeAccessorOwnerBody
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public static class Shutdown
|
||||
{
|
||||
private static string _updateFilePath;
|
||||
|
||||
private static bool UpdatePending
|
||||
{
|
||||
get { return !string.IsNullOrEmpty(_updateFilePath); }
|
||||
}
|
||||
|
||||
public static void Quit(string updateFilePath = null)
|
||||
{
|
||||
_updateFilePath = updateFilePath;
|
||||
FrmMain.Default.Close();
|
||||
ProgramRoot.CloseSingletonInstanceMutex();
|
||||
}
|
||||
|
||||
public static void Cleanup(Control quickConnectToolStrip,
|
||||
ExternalToolsToolStrip externalToolsToolStrip,
|
||||
MultiSshToolStrip multiSshToolStrip,
|
||||
FrmMain frmMain)
|
||||
{
|
||||
try
|
||||
{
|
||||
StopPuttySessionWatcher();
|
||||
DisposeNotificationAreaIcon();
|
||||
SaveConnections();
|
||||
SaveSettings(quickConnectToolStrip, externalToolsToolStrip, multiSshToolStrip, frmMain);
|
||||
UnregisterBrowsers();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionStackTrace(Language.SettingsCouldNotBeSavedOrTrayDispose, ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void StopPuttySessionWatcher()
|
||||
{
|
||||
PuttySessionsManager.Instance.StopWatcher();
|
||||
}
|
||||
|
||||
private static void DisposeNotificationAreaIcon()
|
||||
{
|
||||
if (Runtime.NotificationAreaIcon != null && Runtime.NotificationAreaIcon.Disposed == false)
|
||||
Runtime.NotificationAreaIcon.Dispose();
|
||||
}
|
||||
|
||||
private static void SaveConnections()
|
||||
{
|
||||
DateTime lastUpdate;
|
||||
DateTime updateDate;
|
||||
DateTime currentDate = DateTime.Now;
|
||||
|
||||
//OBSOLETE: Settings.Default.SaveConsOnExit is obsolete and should be removed in a future release
|
||||
if (Settings.Default.SaveConsOnExit || (Settings.Default.SaveConnectionsFrequency == (int)ConnectionsBackupFrequencyEnum.OnExit))
|
||||
{
|
||||
Runtime.ConnectionsService.SaveConnections();
|
||||
return;
|
||||
}
|
||||
lastUpdate = Runtime.ConnectionsService.UsingDatabase ? Runtime.ConnectionsService.LastSqlUpdate : Runtime.ConnectionsService.LastFileUpdate;
|
||||
|
||||
switch (Settings.Default.SaveConnectionsFrequency)
|
||||
{
|
||||
case (int)ConnectionsBackupFrequencyEnum.Daily:
|
||||
updateDate = lastUpdate.AddDays(1);
|
||||
break;
|
||||
case (int)ConnectionsBackupFrequencyEnum.Weekly:
|
||||
updateDate = lastUpdate.AddDays(7);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentDate >= updateDate)
|
||||
{
|
||||
Runtime.ConnectionsService.SaveConnections();
|
||||
}
|
||||
}
|
||||
|
||||
private static void SaveSettings(Control quickConnectToolStrip,
|
||||
ExternalToolsToolStrip externalToolsToolStrip,
|
||||
MultiSshToolStrip multiSshToolStrip,
|
||||
FrmMain frmMain)
|
||||
{
|
||||
Config.Settings.SettingsSaver.SaveSettings(quickConnectToolStrip, externalToolsToolStrip, multiSshToolStrip,
|
||||
frmMain);
|
||||
}
|
||||
|
||||
private static void UnregisterBrowsers()
|
||||
{
|
||||
IeBrowserEmulation.Unregister();
|
||||
}
|
||||
|
||||
public static void StartUpdate()
|
||||
{
|
||||
try
|
||||
{
|
||||
RunUpdateFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionStackTrace("The update could not be started.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void RunUpdateFile()
|
||||
{
|
||||
if (UpdatePending)
|
||||
Process.Start(new ProcessStartInfo(_updateFilePath) { UseShellExecute = true });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.App.Initialization;
|
||||
using mRemoteNG.App.Update;
|
||||
using mRemoteNG.Config.Connections.Multiuser;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Properties;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tools.Cmdline;
|
||||
using mRemoteNG.UI;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
private AppUpdater _appUpdate;
|
||||
private readonly ConnectionIconLoader _connectionIconLoader;
|
||||
private readonly FrmMain _frmMain = FrmMain.Default;
|
||||
|
||||
public static Startup Instance { get; } = new Startup();
|
||||
|
||||
private Startup()
|
||||
{
|
||||
_appUpdate = new AppUpdater();
|
||||
_connectionIconLoader = new ConnectionIconLoader(GeneralAppInfo.HomePath + "\\Icons\\");
|
||||
}
|
||||
|
||||
static Startup()
|
||||
{
|
||||
}
|
||||
|
||||
public void InitializeProgram(MessageCollector messageCollector)
|
||||
{
|
||||
Debug.Print("---------------------------" + Environment.NewLine + "[START] - " +
|
||||
Convert.ToString(DateTime.Now, CultureInfo.InvariantCulture));
|
||||
var startupLogger = new StartupDataLogger(messageCollector);
|
||||
startupLogger.LogStartupData();
|
||||
CompatibilityChecker.CheckCompatibility(messageCollector);
|
||||
ParseCommandLineArgs(messageCollector);
|
||||
IeBrowserEmulation.Register();
|
||||
_connectionIconLoader.GetConnectionIcons();
|
||||
DefaultConnectionInfo.Instance.LoadFrom(Settings.Default, a => "ConDefault" + a);
|
||||
DefaultConnectionInheritance.Instance.LoadFrom(Settings.Default, a => "InhDefault" + a);
|
||||
}
|
||||
|
||||
private static void ParseCommandLineArgs(MessageCollector messageCollector)
|
||||
{
|
||||
var interpreter = new StartupArgumentsInterpreter(messageCollector);
|
||||
interpreter.ParseArguments(Environment.GetCommandLineArgs());
|
||||
}
|
||||
|
||||
public void CreateConnectionsProvider(MessageCollector messageCollector)
|
||||
{
|
||||
messageCollector.AddMessage(MessageClass.DebugMsg, "Determining if we need a database syncronizer");
|
||||
if (!Settings.Default.UseSQLServer) return;
|
||||
messageCollector.AddMessage(MessageClass.DebugMsg, "Creating database syncronizer");
|
||||
Runtime.ConnectionsService.RemoteConnectionsSyncronizer =
|
||||
new RemoteConnectionsSyncronizer(new SqlConnectionsUpdateChecker());
|
||||
Runtime.ConnectionsService.RemoteConnectionsSyncronizer.Enable();
|
||||
}
|
||||
|
||||
public async Task CheckForUpdate()
|
||||
{
|
||||
if (_appUpdate == null)
|
||||
{
|
||||
_appUpdate = new AppUpdater();
|
||||
}
|
||||
else if (_appUpdate.IsGetUpdateInfoRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var nextUpdateCheck =
|
||||
Convert.ToDateTime(Settings.Default.CheckForUpdatesLastCheck.Add(
|
||||
TimeSpan
|
||||
.FromDays(Convert.ToDouble(Settings
|
||||
.Default
|
||||
.CheckForUpdatesFrequencyDays))));
|
||||
if (!Settings.Default.UpdatePending && DateTime.UtcNow < nextUpdateCheck)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
await _appUpdate.GetUpdateInfoAsync();
|
||||
if (_appUpdate.IsUpdateAvailable())
|
||||
{
|
||||
Windows.Show(WindowType.Update);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage("CheckForUpdate() failed.", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Runtime.Serialization;
|
||||
using mRemoteNG.Properties;
|
||||
|
||||
// ReSharper disable ArrangeAccessorOwnerBody
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class SupportedCultures : Dictionary<string, string>
|
||||
{
|
||||
private static SupportedCultures _Instance;
|
||||
|
||||
private static SupportedCultures SingletonInstance
|
||||
{
|
||||
get { return _Instance ?? (_Instance = new SupportedCultures()); }
|
||||
}
|
||||
|
||||
|
||||
private SupportedCultures()
|
||||
{
|
||||
foreach (var CultureName in Settings.Default.SupportedUICultures.Split(','))
|
||||
{
|
||||
try
|
||||
{
|
||||
var CultureInfo = new CultureInfo(CultureName.Trim());
|
||||
Add(CultureInfo.Name, CultureInfo.TextInfo.ToTitleCase(CultureInfo.NativeName));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Print(
|
||||
$"An exception occurred while adding the culture {CultureName} to the list of supported cultures. {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fix CA2229 - https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2229-implement-serialization-constructors?view=vs-2017
|
||||
private SupportedCultures(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public static bool IsNameSupported(string CultureName)
|
||||
{
|
||||
return SingletonInstance.ContainsKey(CultureName);
|
||||
}
|
||||
|
||||
public static bool IsNativeNameSupported(string CultureNativeName)
|
||||
{
|
||||
return SingletonInstance.ContainsValue(CultureNativeName);
|
||||
}
|
||||
|
||||
public static string get_CultureName(string CultureNativeName)
|
||||
{
|
||||
var Names = new string[SingletonInstance.Count + 1];
|
||||
var NativeNames = new string[SingletonInstance.Count + 1];
|
||||
|
||||
SingletonInstance.Keys.CopyTo(Names, 0);
|
||||
SingletonInstance.Values.CopyTo(NativeNames, 0);
|
||||
|
||||
for (var Index = 0; Index <= SingletonInstance.Count; Index++)
|
||||
{
|
||||
if (NativeNames[Index] == CultureNativeName)
|
||||
{
|
||||
return Names[Index];
|
||||
}
|
||||
}
|
||||
|
||||
throw (new KeyNotFoundException());
|
||||
}
|
||||
|
||||
public static string get_CultureNativeName(string CultureName)
|
||||
{
|
||||
return SingletonInstance[CultureName];
|
||||
}
|
||||
|
||||
public static List<string> CultureNativeNames
|
||||
{
|
||||
get
|
||||
{
|
||||
var ValueList = new List<string>();
|
||||
foreach (var Value in SingletonInstance.Values)
|
||||
{
|
||||
ValueList.Add(Value);
|
||||
}
|
||||
|
||||
return ValueList;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,269 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading.Tasks;
|
||||
using mRemoteNG.Properties;
|
||||
#if !PORTABLE
|
||||
using mRemoteNG.Tools;
|
||||
|
||||
#else
|
||||
using System.Windows.Forms;
|
||||
|
||||
#endif
|
||||
// ReSharper disable ArrangeAccessorOwnerBody
|
||||
|
||||
namespace mRemoteNG.App.Update
|
||||
{
|
||||
public class AppUpdater
|
||||
{
|
||||
private const int _bufferLength = 8192;
|
||||
private WebProxy _webProxy;
|
||||
private HttpClient _httpClient;
|
||||
private CancellationTokenSource _changeLogCancelToken;
|
||||
private CancellationTokenSource _getUpdateInfoCancelToken;
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public UpdateInfo CurrentUpdateInfo { get; private set; }
|
||||
|
||||
public bool IsGetUpdateInfoRunning
|
||||
{
|
||||
get
|
||||
{
|
||||
return _getUpdateInfoCancelToken != null;
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsGetChangeLogRunning
|
||||
{
|
||||
get
|
||||
{
|
||||
return _changeLogCancelToken != null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public AppUpdater()
|
||||
{
|
||||
SetDefaultProxySettings();
|
||||
}
|
||||
|
||||
private void SetDefaultProxySettings()
|
||||
{
|
||||
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, Runtime.EncryptionKey);
|
||||
|
||||
SetProxySettings(shouldWeUseProxy, proxyAddress, port, useAuthentication, username, password);
|
||||
}
|
||||
|
||||
public void SetProxySettings(bool useProxy,
|
||||
string address,
|
||||
int port,
|
||||
bool useAuthentication,
|
||||
string username,
|
||||
string password)
|
||||
{
|
||||
if (useProxy && !string.IsNullOrEmpty(address))
|
||||
{
|
||||
_webProxy = port != 0 ? new WebProxy(address, port) : new WebProxy(address);
|
||||
_webProxy.Credentials = useAuthentication ? new NetworkCredential(username, password) : null;
|
||||
}
|
||||
else
|
||||
{
|
||||
_webProxy = null;
|
||||
}
|
||||
|
||||
UpdateHttpClient();
|
||||
}
|
||||
|
||||
public bool IsUpdateAvailable()
|
||||
{
|
||||
if (CurrentUpdateInfo == null || !CurrentUpdateInfo.IsValid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return CurrentUpdateInfo.Version > GeneralAppInfo.GetApplicationVersion();
|
||||
}
|
||||
|
||||
public async Task DownloadUpdateAsync(IProgress<int> progress)
|
||||
{
|
||||
if (IsGetUpdateInfoRunning)
|
||||
{
|
||||
_getUpdateInfoCancelToken.Cancel();
|
||||
_getUpdateInfoCancelToken.Dispose();
|
||||
_getUpdateInfoCancelToken = null;
|
||||
|
||||
throw new InvalidOperationException("A previous call to DownloadUpdateAsync() is still in progress.");
|
||||
}
|
||||
|
||||
if (CurrentUpdateInfo == null || !CurrentUpdateInfo.IsValid)
|
||||
{
|
||||
throw new InvalidOperationException("CurrentUpdateInfo is not valid. GetUpdateInfoAsync() must be called before calling DownloadUpdateAsync().");
|
||||
}
|
||||
#if !PORTABLE
|
||||
CurrentUpdateInfo.UpdateFilePath = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), "msi"));
|
||||
#else
|
||||
var sfd = new SaveFileDialog
|
||||
{
|
||||
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory),
|
||||
FileName = CurrentUpdateInfo.FileName,
|
||||
RestoreDirectory = true
|
||||
};
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
CurrentUpdateInfo.UpdateFilePath = sfd.FileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
try
|
||||
{
|
||||
_getUpdateInfoCancelToken = new CancellationTokenSource();
|
||||
using var response = await _httpClient.GetAsync(CurrentUpdateInfo.DownloadAddress, HttpCompletionOption.ResponseHeadersRead, _getUpdateInfoCancelToken.Token);
|
||||
var buffer = new byte[_bufferLength];
|
||||
var totalBytes = response.Content.Headers.ContentLength ?? 0;
|
||||
var readBytes = 0L;
|
||||
|
||||
await using (var httpStream = await response.Content.ReadAsStreamAsync(_getUpdateInfoCancelToken.Token))
|
||||
{
|
||||
await using var fileStream = new FileStream(CurrentUpdateInfo.UpdateFilePath, FileMode.Create,
|
||||
FileAccess.Write, FileShare.None, _bufferLength, true);
|
||||
|
||||
while (readBytes <= totalBytes || !_getUpdateInfoCancelToken.IsCancellationRequested)
|
||||
{
|
||||
var bytesRead =
|
||||
await httpStream.ReadAsync(buffer, 0, _bufferLength, _getUpdateInfoCancelToken.Token);
|
||||
if (bytesRead == 0)
|
||||
{
|
||||
progress.Report(100);
|
||||
break;
|
||||
}
|
||||
|
||||
await fileStream.WriteAsync(buffer, 0, bytesRead, _getUpdateInfoCancelToken.Token);
|
||||
|
||||
readBytes += bytesRead;
|
||||
|
||||
var percentComplete = (int)(readBytes * 100 / totalBytes);
|
||||
progress.Report(percentComplete);
|
||||
}
|
||||
}
|
||||
|
||||
#if !PORTABLE
|
||||
var updateAuthenticode = new Authenticode(CurrentUpdateInfo.UpdateFilePath)
|
||||
{
|
||||
RequireThumbprintMatch = true,
|
||||
ThumbprintToMatch = CurrentUpdateInfo.CertificateThumbprint
|
||||
};
|
||||
|
||||
if (updateAuthenticode.Verify() != Authenticode.StatusValue.Verified)
|
||||
{
|
||||
if (updateAuthenticode.Status == Authenticode.StatusValue.UnhandledException)
|
||||
{
|
||||
throw updateAuthenticode.Exception;
|
||||
}
|
||||
|
||||
throw new Exception(updateAuthenticode.GetStatusMessage());
|
||||
}
|
||||
#endif
|
||||
|
||||
using var checksum = SHA512.Create();
|
||||
await using var stream = File.OpenRead(CurrentUpdateInfo.UpdateFilePath);
|
||||
var hash = await checksum.ComputeHashAsync(stream);
|
||||
var hashString = BitConverter.ToString(hash).Replace("-", "").ToUpperInvariant();
|
||||
if (!hashString.Equals(CurrentUpdateInfo.Checksum))
|
||||
throw new Exception("SHA512 Hashes didn't match!");
|
||||
} finally{
|
||||
_getUpdateInfoCancelToken?.Dispose();
|
||||
_getUpdateInfoCancelToken = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void UpdateHttpClient()
|
||||
{
|
||||
if (_httpClient != null)
|
||||
{
|
||||
_httpClient.Dispose();
|
||||
}
|
||||
|
||||
var httpClientHandler = new HttpClientHandler();
|
||||
if (_webProxy != null)
|
||||
{
|
||||
httpClientHandler.UseProxy = true;
|
||||
httpClientHandler.Proxy = _webProxy;
|
||||
}
|
||||
_httpClient = new HttpClient(httpClientHandler);
|
||||
_httpClient.DefaultRequestHeaders.UserAgent.ParseAdd(GeneralAppInfo.UserAgent);
|
||||
}
|
||||
|
||||
public async Task GetUpdateInfoAsync()
|
||||
{
|
||||
if (IsGetUpdateInfoRunning)
|
||||
{
|
||||
_getUpdateInfoCancelToken.Cancel();
|
||||
_getUpdateInfoCancelToken.Dispose();
|
||||
_getUpdateInfoCancelToken = null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_getUpdateInfoCancelToken = new CancellationTokenSource();
|
||||
var updateInfo = await _httpClient.GetStringAsync(UpdateChannelInfo.GetUpdateChannelInfo(), _getUpdateInfoCancelToken.Token);
|
||||
CurrentUpdateInfo = UpdateInfo.FromString(updateInfo);
|
||||
Settings.Default.CheckForUpdatesLastCheck = DateTime.UtcNow;
|
||||
|
||||
if (!Settings.Default.UpdatePending)
|
||||
{
|
||||
Settings.Default.UpdatePending = IsUpdateAvailable();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_getUpdateInfoCancelToken?.Dispose();
|
||||
_getUpdateInfoCancelToken = null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> GetChangeLogAsync()
|
||||
{
|
||||
if (IsGetChangeLogRunning)
|
||||
{
|
||||
_changeLogCancelToken.Cancel();
|
||||
_changeLogCancelToken.Dispose();
|
||||
_changeLogCancelToken = null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_changeLogCancelToken = new CancellationTokenSource();
|
||||
return await _httpClient.GetStringAsync(CurrentUpdateInfo.ChangeLogAddress, _changeLogCancelToken.Token);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_changeLogCancelToken?.Dispose();
|
||||
_changeLogCancelToken = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace mRemoteNG.App.Update
|
||||
{
|
||||
public class UpdateFile
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
// ReSharper disable MemberCanBePrivate.Local
|
||||
// ReSharper disable once MemberCanBePrivate.Global
|
||||
public Dictionary<string, string> Items { get; } =
|
||||
new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public UpdateFile(string content)
|
||||
{
|
||||
FromString(content);
|
||||
}
|
||||
|
||||
// ReSharper disable MemberCanBePrivate.Local
|
||||
// ReSharper disable once MemberCanBePrivate.Global
|
||||
public void FromString(string content)
|
||||
{
|
||||
if (string.IsNullOrEmpty(content)) return;
|
||||
|
||||
char[] keyValueSeparators = {':', '='};
|
||||
char[] commentCharacters = {'#', ';', '\''};
|
||||
|
||||
// no separators means no valid update data...
|
||||
if (content.Trim().IndexOfAny(keyValueSeparators) == -1) return;
|
||||
|
||||
using (var sr = new StringReader(content))
|
||||
{
|
||||
string line;
|
||||
while ((line = sr.ReadLine()) != null)
|
||||
{
|
||||
var trimmedLine = line.Trim();
|
||||
if (trimmedLine.Length == 0)
|
||||
continue;
|
||||
|
||||
if (trimmedLine.Substring(0, 1).IndexOfAny(commentCharacters) != -1)
|
||||
continue;
|
||||
|
||||
var parts = trimmedLine.Split(keyValueSeparators, 2);
|
||||
if (parts.Length != 2)
|
||||
continue;
|
||||
|
||||
// make sure we have valid data in both parts before adding to the collection. If either part is empty, then it's not valid data.
|
||||
if (string.IsNullOrEmpty(parts[0].Trim()) || string.IsNullOrEmpty(parts[1].Trim()))
|
||||
continue;
|
||||
|
||||
Items.Add(parts[0].Trim(), parts[1].Trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ReSharper disable MemberCanBePrivate.Local
|
||||
private string GetString(string key)
|
||||
{
|
||||
// ReSharper restore MemberCanBePrivate.Local
|
||||
return !Items.ContainsKey(key) ? string.Empty : Items[key];
|
||||
}
|
||||
|
||||
public Version GetVersion(string key = "Version")
|
||||
{
|
||||
var value = GetString(key);
|
||||
return string.IsNullOrEmpty(value) ? null : new Version(value);
|
||||
}
|
||||
|
||||
public Uri GetUri(string key)
|
||||
{
|
||||
var value = GetString(key);
|
||||
return string.IsNullOrEmpty(value) ? null : new Uri(value);
|
||||
}
|
||||
|
||||
public string GetThumbprint(string key = "CertificateThumbprint")
|
||||
{
|
||||
return GetString(key).Replace(" ", "").ToUpperInvariant();
|
||||
}
|
||||
|
||||
public string GetFileName()
|
||||
{
|
||||
var value = GetString("dURL");
|
||||
var sv = value.Split('/');
|
||||
return sv[sv.Length - 1];
|
||||
}
|
||||
|
||||
public string GetChecksum(string key = "Checksum")
|
||||
{
|
||||
return GetString(key).Replace(" ", "").ToUpperInvariant();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
using System;
|
||||
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Local
|
||||
|
||||
namespace mRemoteNG.App.Update
|
||||
{
|
||||
public class UpdateInfo
|
||||
{
|
||||
public bool IsValid { get; private set; }
|
||||
public Version Version { get; private set; }
|
||||
public Uri DownloadAddress { get; private set; }
|
||||
public string UpdateFilePath { get; set; }
|
||||
public Uri ChangeLogAddress { get; private set; }
|
||||
public Uri ImageAddress { get; private set; }
|
||||
public Uri ImageLinkAddress { get; private set; }
|
||||
#if !PORTABLE
|
||||
public string CertificateThumbprint { get; private set; }
|
||||
#endif
|
||||
// ReSharper disable once MemberCanBePrivate.Global
|
||||
public string FileName { get; set; }
|
||||
public string Checksum { get; private set; }
|
||||
|
||||
public static UpdateInfo FromString(string input)
|
||||
{
|
||||
var newInfo = new UpdateInfo();
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
newInfo.IsValid = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
var updateFile = new UpdateFile(input);
|
||||
newInfo.Version = updateFile.GetVersion();
|
||||
newInfo.DownloadAddress = updateFile.GetUri("dURL");
|
||||
newInfo.ChangeLogAddress = updateFile.GetUri("clURL");
|
||||
#if false
|
||||
newInfo.ImageAddress = updateFile.GetUri("imgURL");
|
||||
newInfo.ImageLinkAddress = updateFile.GetUri("imgURLLink");
|
||||
#endif
|
||||
#if !PORTABLE
|
||||
newInfo.CertificateThumbprint = updateFile.GetThumbprint();
|
||||
#endif
|
||||
newInfo.FileName = updateFile.GetFileName();
|
||||
newInfo.Checksum = updateFile.GetChecksum();
|
||||
newInfo.IsValid = newInfo.CheckIfValid();
|
||||
}
|
||||
|
||||
return newInfo;
|
||||
}
|
||||
|
||||
public bool CheckIfValid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Version.ToString()))
|
||||
return false;
|
||||
if (string.IsNullOrEmpty(DownloadAddress.AbsoluteUri))
|
||||
return false;
|
||||
if (string.IsNullOrEmpty(ChangeLogAddress.AbsoluteUri))
|
||||
return false;
|
||||
#if false
|
||||
if (string.IsNullOrEmpty(ImageAddress.AbsoluteUri))
|
||||
return false;
|
||||
if (string.IsNullOrEmpty(ImageLinkAddress.AbsoluteUri))
|
||||
return false;
|
||||
#endif
|
||||
#if !PORTABLE
|
||||
if (string.IsNullOrEmpty(CertificateThumbprint))
|
||||
return false;
|
||||
#endif
|
||||
if (string.IsNullOrEmpty(FileName))
|
||||
return false;
|
||||
// ReSharper disable once ConvertIfStatementToReturnStatement
|
||||
if (string.IsNullOrEmpty(Checksum))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
using System;
|
||||
using mRemoteNG.UI;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.UI.Window;
|
||||
|
||||
namespace mRemoteNG.App
|
||||
{
|
||||
public static class Windows
|
||||
{
|
||||
private static ActiveDirectoryImportWindow _adimportForm;
|
||||
private static ExternalToolsWindow _externalappsForm;
|
||||
private static PortScanWindow _portscanForm;
|
||||
private static UltraVNCWindow _ultravncscForm;
|
||||
private static ConnectionTreeWindow _treeForm;
|
||||
|
||||
internal static ConnectionTreeWindow TreeForm
|
||||
{
|
||||
get => _treeForm ?? (_treeForm = new ConnectionTreeWindow());
|
||||
set => _treeForm = value;
|
||||
}
|
||||
|
||||
internal static ConfigWindow ConfigForm { get; set; } = new ConfigWindow();
|
||||
internal static ErrorAndInfoWindow ErrorsForm { get; set; } = new ErrorAndInfoWindow();
|
||||
private static UpdateWindow UpdateForm { get; set; } = new UpdateWindow();
|
||||
internal static SSHTransferWindow SshtransferForm { get; private set; } = new SSHTransferWindow();
|
||||
|
||||
|
||||
public static void Show(WindowType windowType)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dockPanel = FrmMain.Default.pnlDock;
|
||||
// ReSharper disable once SwitchStatementMissingSomeCases
|
||||
switch (windowType)
|
||||
{
|
||||
case WindowType.ActiveDirectoryImport:
|
||||
if (_adimportForm == null || _adimportForm.IsDisposed)
|
||||
_adimportForm = new ActiveDirectoryImportWindow();
|
||||
_adimportForm.Show(dockPanel);
|
||||
break;
|
||||
case WindowType.Options:
|
||||
using (var optionsForm = new FrmOptions())
|
||||
{
|
||||
optionsForm.ShowDialog(dockPanel);
|
||||
}
|
||||
|
||||
break;
|
||||
case WindowType.SSHTransfer:
|
||||
if (SshtransferForm == null || SshtransferForm.IsDisposed)
|
||||
SshtransferForm = new SSHTransferWindow();
|
||||
SshtransferForm.Show(dockPanel);
|
||||
break;
|
||||
case WindowType.Update:
|
||||
if (UpdateForm == null || UpdateForm.IsDisposed)
|
||||
UpdateForm = new UpdateWindow();
|
||||
UpdateForm.Show(dockPanel);
|
||||
break;
|
||||
case WindowType.ExternalApps:
|
||||
if (_externalappsForm == null || _externalappsForm.IsDisposed)
|
||||
_externalappsForm = new ExternalToolsWindow();
|
||||
_externalappsForm.Show(dockPanel);
|
||||
break;
|
||||
case WindowType.PortScan:
|
||||
_portscanForm = new PortScanWindow();
|
||||
_portscanForm.Show(dockPanel);
|
||||
break;
|
||||
case WindowType.UltraVNCSC:
|
||||
if (_ultravncscForm == null || _ultravncscForm.IsDisposed)
|
||||
_ultravncscForm = new UltraVNCWindow();
|
||||
_ultravncscForm.Show(dockPanel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionStackTrace("App.Runtime.Windows.Show() failed.", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace mRemoteNG.Config
|
||||
{
|
||||
public enum ConfirmCloseEnum
|
||||
{
|
||||
Unspecified = 0,
|
||||
Never = 1,
|
||||
Exit = 2,
|
||||
Multiple = 3,
|
||||
All = 4
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public enum ConnectionsBackupFrequencyEnum
|
||||
{
|
||||
Unassigned = 0,
|
||||
Never = 1,
|
||||
OnEdit = 2,
|
||||
OnExit = 3,
|
||||
Daily = 4,
|
||||
Weekly = 5,
|
||||
Custom = 6
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
using System;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tree;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class ConnectionsLoadedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The previous <see cref="ConnectionTreeModel"/> that is being
|
||||
/// unloaded.
|
||||
/// </summary>
|
||||
public Optional<ConnectionTreeModel> PreviousConnectionTreeModel { get; }
|
||||
|
||||
/// <summary>
|
||||
/// True if the previous <see cref="ConnectionTreeModel"/> was loaded from
|
||||
/// a database.
|
||||
/// </summary>
|
||||
public bool PreviousSourceWasDatabase { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The new <see cref="ConnectionTreeModel"/> that is being loaded.
|
||||
/// </summary>
|
||||
public ConnectionTreeModel NewConnectionTreeModel { get; }
|
||||
|
||||
/// <summary>
|
||||
/// True if the new <see cref="ConnectionTreeModel"/> was loaded from
|
||||
/// a database.
|
||||
/// </summary>
|
||||
public bool NewSourceIsDatabase { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The path to the new connections source.
|
||||
/// If <see cref="NewSourceIsDatabase"/> is True, this will be the server and database name.
|
||||
/// If False, it will be a file path to the connection file.
|
||||
/// </summary>
|
||||
public string NewSourcePath { get; }
|
||||
|
||||
public ConnectionsLoadedEventArgs(Optional<ConnectionTreeModel> previousTreeModelModel,
|
||||
ConnectionTreeModel newTreeModelModel,
|
||||
bool previousSourceWasDatabase,
|
||||
bool newSourceIsDatabase,
|
||||
string newSourcePath)
|
||||
{
|
||||
if (previousTreeModelModel == null)
|
||||
throw new ArgumentNullException(nameof(previousTreeModelModel));
|
||||
if (newTreeModelModel == null)
|
||||
throw new ArgumentNullException(nameof(newTreeModelModel));
|
||||
if (newSourcePath == null)
|
||||
throw new ArgumentNullException(nameof(newSourcePath));
|
||||
|
||||
PreviousConnectionTreeModel = previousTreeModelModel;
|
||||
PreviousSourceWasDatabase = previousSourceWasDatabase;
|
||||
NewConnectionTreeModel = newTreeModelModel;
|
||||
NewSourceIsDatabase = newSourceIsDatabase;
|
||||
NewSourcePath = newSourcePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System;
|
||||
using mRemoteNG.Tree;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class ConnectionsSavedEventArgs
|
||||
{
|
||||
public ConnectionTreeModel ModelThatWasSaved { get; }
|
||||
public bool PreviouslyUsingDatabase { get; }
|
||||
public bool UsingDatabase { get; }
|
||||
public string ConnectionFileName { get; }
|
||||
|
||||
public ConnectionsSavedEventArgs(ConnectionTreeModel modelThatWasSaved,
|
||||
bool previouslyUsingDatabase,
|
||||
bool usingDatabase,
|
||||
string connectionFileName)
|
||||
{
|
||||
if (modelThatWasSaved == null)
|
||||
throw new ArgumentNullException(nameof(modelThatWasSaved));
|
||||
|
||||
ModelThatWasSaved = modelThatWasSaved;
|
||||
PreviouslyUsingDatabase = previouslyUsingDatabase;
|
||||
UsingDatabase = usingDatabase;
|
||||
ConnectionFileName = connectionFileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Config.Serializers.ConnectionSerializers.Csv;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Tree;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class CsvConnectionsSaver : ISaver<ConnectionTreeModel>
|
||||
{
|
||||
private readonly string _connectionFileName;
|
||||
private readonly SaveFilter _saveFilter;
|
||||
|
||||
public CsvConnectionsSaver(string connectionFileName, SaveFilter saveFilter)
|
||||
{
|
||||
if (string.IsNullOrEmpty(connectionFileName))
|
||||
throw new ArgumentException($"Argument '{nameof(connectionFileName)}' cannot be null or empty");
|
||||
if (saveFilter == null)
|
||||
throw new ArgumentNullException(nameof(saveFilter));
|
||||
|
||||
_connectionFileName = connectionFileName;
|
||||
_saveFilter = saveFilter;
|
||||
}
|
||||
|
||||
public void Save(ConnectionTreeModel connectionTreeModel, string propertyNameTrigger = "")
|
||||
{
|
||||
var csvConnectionsSerializer =
|
||||
new CsvConnectionsSerializerMremotengFormat(_saveFilter, Runtime.CredentialProviderCatalog);
|
||||
var dataProvider = new FileDataProvider(_connectionFileName);
|
||||
var csvContent = csvConnectionsSerializer.Serialize(connectionTreeModel);
|
||||
dataProvider.Save(csvContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using mRemoteNG.Tree;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public interface IConnectionsLoader
|
||||
{
|
||||
ConnectionTreeModel Load();
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using mRemoteNG.Config.DatabaseConnectors;
|
||||
|
||||
namespace mRemoteNG.Config.Connections.Multiuser
|
||||
{
|
||||
public delegate void
|
||||
ConnectionsUpdateAvailableEventHandler(object sender, ConnectionsUpdateAvailableEventArgs args);
|
||||
|
||||
public class ConnectionsUpdateAvailableEventArgs : EventArgs
|
||||
{
|
||||
public IDatabaseConnector DatabaseConnector { get; private set; }
|
||||
public DateTime UpdateTime { get; private set; }
|
||||
public bool Handled { get; set; }
|
||||
|
||||
public ConnectionsUpdateAvailableEventArgs(IDatabaseConnector databaseConnector, DateTime updateTime)
|
||||
{
|
||||
if (databaseConnector == null)
|
||||
throw new ArgumentNullException(nameof(databaseConnector));
|
||||
DatabaseConnector = databaseConnector;
|
||||
UpdateTime = updateTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace mRemoteNG.Config.Connections.Multiuser
|
||||
{
|
||||
public delegate void UpdateCheckFinishedEventHandler(object sender, ConnectionsUpdateCheckFinishedEventArgs args);
|
||||
|
||||
public class ConnectionsUpdateCheckFinishedEventArgs : EventArgs
|
||||
{
|
||||
public bool UpdateAvailable { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace mRemoteNG.Config.Connections.Multiuser
|
||||
{
|
||||
public interface IConnectionsUpdateChecker : IDisposable
|
||||
{
|
||||
bool IsUpdateAvailable();
|
||||
|
||||
void IsUpdateAvailableAsync();
|
||||
|
||||
event EventHandler UpdateCheckStarted;
|
||||
event UpdateCheckFinishedEventHandler UpdateCheckFinished;
|
||||
event ConnectionsUpdateAvailableEventHandler ConnectionsUpdateAvailable;
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
using mRemoteNG.App;
|
||||
using System;
|
||||
using System.Timers;
|
||||
|
||||
// ReSharper disable ArrangeAccessorOwnerBody
|
||||
|
||||
namespace mRemoteNG.Config.Connections.Multiuser
|
||||
{
|
||||
public class RemoteConnectionsSyncronizer : IConnectionsUpdateChecker
|
||||
{
|
||||
private readonly System.Timers.Timer _updateTimer;
|
||||
private readonly IConnectionsUpdateChecker _updateChecker;
|
||||
|
||||
public double TimerIntervalInMilliseconds
|
||||
{
|
||||
get { return _updateTimer.Interval; }
|
||||
}
|
||||
|
||||
public RemoteConnectionsSyncronizer(IConnectionsUpdateChecker updateChecker)
|
||||
{
|
||||
_updateChecker = updateChecker;
|
||||
_updateTimer = new System.Timers.Timer(3000);
|
||||
SetEventListeners();
|
||||
}
|
||||
|
||||
private void SetEventListeners()
|
||||
{
|
||||
_updateChecker.UpdateCheckStarted += OnUpdateCheckStarted;
|
||||
_updateChecker.UpdateCheckFinished += OnUpdateCheckFinished;
|
||||
_updateChecker.ConnectionsUpdateAvailable +=
|
||||
(sender, args) => ConnectionsUpdateAvailable?.Invoke(sender, args);
|
||||
_updateTimer.Elapsed += (sender, args) => _updateChecker.IsUpdateAvailableAsync();
|
||||
ConnectionsUpdateAvailable += Load;
|
||||
}
|
||||
|
||||
private void Load(object sender, ConnectionsUpdateAvailableEventArgs args)
|
||||
{
|
||||
Runtime.ConnectionsService.LoadConnections(true, false, "");
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
public void Enable()
|
||||
{
|
||||
_updateTimer.Start();
|
||||
}
|
||||
|
||||
public void Disable()
|
||||
{
|
||||
_updateTimer.Stop();
|
||||
}
|
||||
|
||||
public bool IsUpdateAvailable()
|
||||
{
|
||||
return _updateChecker.IsUpdateAvailable();
|
||||
}
|
||||
|
||||
public void IsUpdateAvailableAsync()
|
||||
{
|
||||
_updateChecker.IsUpdateAvailableAsync();
|
||||
}
|
||||
|
||||
|
||||
private void OnUpdateCheckStarted(object sender, EventArgs eventArgs)
|
||||
{
|
||||
_updateTimer.Stop();
|
||||
UpdateCheckStarted?.Invoke(sender, eventArgs);
|
||||
}
|
||||
|
||||
private void OnUpdateCheckFinished(object sender, ConnectionsUpdateCheckFinishedEventArgs eventArgs)
|
||||
{
|
||||
_updateTimer.Start();
|
||||
UpdateCheckFinished?.Invoke(sender, eventArgs);
|
||||
}
|
||||
|
||||
public event EventHandler UpdateCheckStarted;
|
||||
public event UpdateCheckFinishedEventHandler UpdateCheckFinished;
|
||||
public event ConnectionsUpdateAvailableEventHandler ConnectionsUpdateAvailable;
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
private void Dispose(bool itIsSafeToAlsoFreeManagedObjects)
|
||||
{
|
||||
if (!itIsSafeToAlsoFreeManagedObjects) return;
|
||||
_updateTimer.Dispose();
|
||||
_updateChecker.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Threading;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Config.DatabaseConnectors;
|
||||
using mRemoteNG.Messages;
|
||||
|
||||
namespace mRemoteNG.Config.Connections.Multiuser
|
||||
{
|
||||
public class SqlConnectionsUpdateChecker : IConnectionsUpdateChecker
|
||||
{
|
||||
private readonly IDatabaseConnector _dbConnector;
|
||||
private readonly DbCommand _dbQuery;
|
||||
private DateTime LastUpdateTime => Runtime.ConnectionsService.LastSqlUpdate;
|
||||
private DateTime _lastDatabaseUpdateTime;
|
||||
|
||||
|
||||
public SqlConnectionsUpdateChecker()
|
||||
{
|
||||
_dbConnector = DatabaseConnectorFactory.DatabaseConnectorFromSettings();
|
||||
_dbQuery = _dbConnector.DbCommand("SELECT * FROM tblUpdate");
|
||||
_lastDatabaseUpdateTime = default(DateTime);
|
||||
}
|
||||
|
||||
public bool IsUpdateAvailable()
|
||||
{
|
||||
RaiseUpdateCheckStartedEvent();
|
||||
ConnectToSqlDb();
|
||||
var updateIsAvailable = DatabaseIsMoreUpToDateThanUs();
|
||||
if (updateIsAvailable)
|
||||
RaiseConnectionsUpdateAvailableEvent();
|
||||
RaiseUpdateCheckFinishedEvent(updateIsAvailable);
|
||||
return updateIsAvailable;
|
||||
}
|
||||
|
||||
public void IsUpdateAvailableAsync()
|
||||
{
|
||||
var thread = new Thread(() => IsUpdateAvailable());
|
||||
thread.SetApartmentState(ApartmentState.STA);
|
||||
thread.Start();
|
||||
}
|
||||
|
||||
private void ConnectToSqlDb()
|
||||
{
|
||||
try
|
||||
{
|
||||
_dbConnector.Connect();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
|
||||
"Unable to connect to Sql DB to check for updates." +
|
||||
Environment.NewLine + e.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
private bool DatabaseIsMoreUpToDateThanUs()
|
||||
{
|
||||
var lastUpdateInDb = GetLastUpdateTimeFromDbResponse();
|
||||
var amTheLastoneUpdated = CheckIfIAmTheLastOneUpdated(lastUpdateInDb);
|
||||
return (lastUpdateInDb > LastUpdateTime && !amTheLastoneUpdated);
|
||||
}
|
||||
|
||||
private bool CheckIfIAmTheLastOneUpdated(DateTime lastUpdateInDb)
|
||||
{
|
||||
DateTime lastSqlUpdateWithoutMilliseconds =
|
||||
new DateTime(LastUpdateTime.Ticks - (LastUpdateTime.Ticks % TimeSpan.TicksPerSecond),
|
||||
LastUpdateTime.Kind);
|
||||
return lastUpdateInDb == lastSqlUpdateWithoutMilliseconds;
|
||||
}
|
||||
|
||||
private DateTime GetLastUpdateTimeFromDbResponse()
|
||||
{
|
||||
var lastUpdateInDb = default(DateTime);
|
||||
try
|
||||
{
|
||||
var sqlReader = _dbQuery.ExecuteReader(CommandBehavior.CloseConnection);
|
||||
sqlReader.Read();
|
||||
if (sqlReader.HasRows)
|
||||
lastUpdateInDb = Convert.ToDateTime(sqlReader["LastUpdate"]);
|
||||
sqlReader.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
|
||||
"Error executing Sql query to get updates from the DB." +
|
||||
Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
|
||||
_lastDatabaseUpdateTime = lastUpdateInDb;
|
||||
return lastUpdateInDb;
|
||||
}
|
||||
|
||||
|
||||
public event EventHandler UpdateCheckStarted;
|
||||
|
||||
private void RaiseUpdateCheckStartedEvent()
|
||||
{
|
||||
UpdateCheckStarted?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
public event UpdateCheckFinishedEventHandler UpdateCheckFinished;
|
||||
|
||||
private void RaiseUpdateCheckFinishedEvent(bool updateAvailable)
|
||||
{
|
||||
var args = new ConnectionsUpdateCheckFinishedEventArgs {UpdateAvailable = updateAvailable};
|
||||
UpdateCheckFinished?.Invoke(this, args);
|
||||
}
|
||||
|
||||
public event ConnectionsUpdateAvailableEventHandler ConnectionsUpdateAvailable;
|
||||
|
||||
private void RaiseConnectionsUpdateAvailableEvent()
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, "Remote connection update is available");
|
||||
var args = new ConnectionsUpdateAvailableEventArgs(_dbConnector, _lastDatabaseUpdateTime);
|
||||
ConnectionsUpdateAvailable?.Invoke(this, args);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
private void Dispose(bool itIsSafeToDisposeManagedObjects)
|
||||
{
|
||||
if (!itIsSafeToDisposeManagedObjects) return;
|
||||
_dbConnector.Disconnect();
|
||||
_dbConnector.Dispose();
|
||||
_dbQuery.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.Properties;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class SaveConnectionsOnEdit
|
||||
{
|
||||
private readonly ConnectionsService _connectionsService;
|
||||
|
||||
public SaveConnectionsOnEdit(ConnectionsService connectionsService)
|
||||
{
|
||||
if (connectionsService == null)
|
||||
throw new ArgumentNullException(nameof(connectionsService));
|
||||
|
||||
_connectionsService = connectionsService;
|
||||
connectionsService.ConnectionsLoaded += ConnectionsServiceOnConnectionsLoaded;
|
||||
}
|
||||
|
||||
private void ConnectionsServiceOnConnectionsLoaded(object sender,
|
||||
ConnectionsLoadedEventArgs connectionsLoadedEventArgs)
|
||||
{
|
||||
connectionsLoadedEventArgs.NewConnectionTreeModel.CollectionChanged +=
|
||||
ConnectionTreeModelOnCollectionChanged;
|
||||
connectionsLoadedEventArgs.NewConnectionTreeModel.PropertyChanged += ConnectionTreeModelOnPropertyChanged;
|
||||
|
||||
foreach (var oldTree in connectionsLoadedEventArgs.PreviousConnectionTreeModel)
|
||||
{
|
||||
oldTree.CollectionChanged -= ConnectionTreeModelOnCollectionChanged;
|
||||
oldTree.PropertyChanged -= ConnectionTreeModelOnPropertyChanged;
|
||||
}
|
||||
}
|
||||
|
||||
private void ConnectionTreeModelOnPropertyChanged(object sender,
|
||||
PropertyChangedEventArgs propertyChangedEventArgs)
|
||||
{
|
||||
SaveConnectionOnEdit(propertyChangedEventArgs.PropertyName);
|
||||
}
|
||||
|
||||
private void ConnectionTreeModelOnCollectionChanged(object sender,
|
||||
NotifyCollectionChangedEventArgs
|
||||
notifyCollectionChangedEventArgs)
|
||||
{
|
||||
SaveConnectionOnEdit();
|
||||
}
|
||||
|
||||
private void SaveConnectionOnEdit(string propertyName = "")
|
||||
{
|
||||
//OBSOLETE: mRemoteNG.Settings.Default.SaveConnectionsAfterEveryEdit is obsolete and should be removed in a future release
|
||||
if (mRemoteNG.Properties.Settings.Default.SaveConnectionsAfterEveryEdit || (mRemoteNG.Properties.Settings.Default.SaveConnectionsFrequency == (int)ConnectionsBackupFrequencyEnum.OnEdit))
|
||||
{
|
||||
if (FrmMain.Default.IsClosing)
|
||||
return;
|
||||
|
||||
_connectionsService.SaveConnectionsAsync(propertyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public enum SaveFormat
|
||||
{
|
||||
None,
|
||||
mRXML,
|
||||
mRCSV,
|
||||
SQL
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security;
|
||||
using mRemoteNG.Config.DatabaseConnectors;
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Config.Serializers;
|
||||
using mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql;
|
||||
using mRemoteNG.Config.Serializers.Versioning;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.Authentication;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tree;
|
||||
using mRemoteNG.Tree.Root;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class SqlConnectionsLoader : IConnectionsLoader
|
||||
{
|
||||
private readonly IDeserializer<string, IEnumerable<LocalConnectionPropertiesModel>>
|
||||
_localConnectionPropertiesDeserializer;
|
||||
|
||||
private readonly IDataProvider<string> _dataProvider;
|
||||
|
||||
public Func<Optional<SecureString>> AuthenticationRequestor { get; set; } =
|
||||
() => MiscTools.PasswordDialog("", false);
|
||||
|
||||
public SqlConnectionsLoader(
|
||||
IDeserializer<string, IEnumerable<LocalConnectionPropertiesModel>> localConnectionPropertiesDeserializer,
|
||||
IDataProvider<string> dataProvider)
|
||||
{
|
||||
_localConnectionPropertiesDeserializer =
|
||||
localConnectionPropertiesDeserializer.ThrowIfNull(nameof(localConnectionPropertiesDeserializer));
|
||||
_dataProvider = dataProvider.ThrowIfNull(nameof(dataProvider));
|
||||
}
|
||||
|
||||
public ConnectionTreeModel Load()
|
||||
{
|
||||
var connector = DatabaseConnectorFactory.DatabaseConnectorFromSettings();
|
||||
var dataProvider = new SqlDataProvider(connector);
|
||||
var metaDataRetriever = new SqlDatabaseMetaDataRetriever();
|
||||
var databaseVersionVerifier = new SqlDatabaseVersionVerifier(connector);
|
||||
var cryptoProvider = new LegacyRijndaelCryptographyProvider();
|
||||
|
||||
var metaData = metaDataRetriever.GetDatabaseMetaData(connector) ??
|
||||
HandleFirstRun(metaDataRetriever, connector);
|
||||
var decryptionKey = GetDecryptionKey(metaData);
|
||||
|
||||
if (!decryptionKey.Any())
|
||||
throw new Exception("Could not load SQL connections");
|
||||
|
||||
databaseVersionVerifier.VerifyDatabaseVersion(metaData.ConfVersion);
|
||||
var dataTable = dataProvider.Load();
|
||||
var deserializer = new DataTableDeserializer(cryptoProvider, decryptionKey.First());
|
||||
var connectionTree = deserializer.Deserialize(dataTable);
|
||||
ApplyLocalConnectionProperties(connectionTree.RootNodes.First(i => i is RootNodeInfo));
|
||||
return connectionTree;
|
||||
}
|
||||
|
||||
private Optional<SecureString> GetDecryptionKey(SqlConnectionListMetaData metaData)
|
||||
{
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
var cipherText = metaData.Protected;
|
||||
var authenticator = new PasswordAuthenticator(cryptographyProvider, cipherText, AuthenticationRequestor);
|
||||
var authenticated =
|
||||
authenticator.Authenticate(new RootNodeInfo(RootNodeType.Connection).DefaultPassword
|
||||
.ConvertToSecureString());
|
||||
|
||||
if (authenticated)
|
||||
return authenticator.LastAuthenticatedPassword;
|
||||
return Optional<SecureString>.Empty;
|
||||
}
|
||||
|
||||
private void ApplyLocalConnectionProperties(ContainerInfo rootNode)
|
||||
{
|
||||
var localPropertiesXml = _dataProvider.Load();
|
||||
var localConnectionProperties = _localConnectionPropertiesDeserializer.Deserialize(localPropertiesXml);
|
||||
|
||||
rootNode
|
||||
.GetRecursiveChildList()
|
||||
.Join(localConnectionProperties,
|
||||
con => con.ConstantID,
|
||||
locals => locals.ConnectionId,
|
||||
(con, locals) => new {Connection = con, LocalProperties = locals})
|
||||
.ForEach(x =>
|
||||
{
|
||||
x.Connection.PleaseConnect = x.LocalProperties.Connected;
|
||||
x.Connection.Favorite = x.LocalProperties.Favorite;
|
||||
if (x.Connection is ContainerInfo container)
|
||||
container.IsExpanded = x.LocalProperties.Expanded;
|
||||
});
|
||||
}
|
||||
|
||||
private SqlConnectionListMetaData HandleFirstRun(SqlDatabaseMetaDataRetriever metaDataRetriever, IDatabaseConnector connector)
|
||||
{
|
||||
metaDataRetriever.WriteDatabaseMetaData(new RootNodeInfo(RootNodeType.Connection), connector);
|
||||
return metaDataRetriever.GetDatabaseMetaData(connector);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Config.DatabaseConnectors;
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Config.Serializers;
|
||||
using mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql;
|
||||
using mRemoteNG.Config.Serializers.Versioning;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tree;
|
||||
using mRemoteNG.Tree.Root;
|
||||
using mRemoteNG.Resources.Language;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class SqlConnectionsSaver : ISaver<ConnectionTreeModel>
|
||||
{
|
||||
private readonly SaveFilter _saveFilter;
|
||||
private readonly ISerializer<IEnumerable<LocalConnectionPropertiesModel>, string> _localPropertiesSerializer;
|
||||
private readonly IDataProvider<string> _dataProvider;
|
||||
|
||||
public SqlConnectionsSaver(SaveFilter saveFilter,
|
||||
ISerializer<IEnumerable<LocalConnectionPropertiesModel>, string>
|
||||
localPropertieSerializer,
|
||||
IDataProvider<string> localPropertiesDataProvider)
|
||||
{
|
||||
if (saveFilter == null)
|
||||
throw new ArgumentNullException(nameof(saveFilter));
|
||||
_saveFilter = saveFilter;
|
||||
_localPropertiesSerializer = localPropertieSerializer.ThrowIfNull(nameof(localPropertieSerializer));
|
||||
_dataProvider = localPropertiesDataProvider.ThrowIfNull(nameof(localPropertiesDataProvider));
|
||||
}
|
||||
|
||||
public void Save(ConnectionTreeModel connectionTreeModel, string propertyNameTrigger = "")
|
||||
{
|
||||
var rootTreeNode = connectionTreeModel.RootNodes.OfType<RootNodeInfo>().First();
|
||||
|
||||
UpdateLocalConnectionProperties(rootTreeNode);
|
||||
|
||||
if (PropertyIsLocalOnly(propertyNameTrigger))
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg,
|
||||
$"Property {propertyNameTrigger} is local only. Not saving to database.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (SqlUserIsReadOnly())
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
|
||||
"Trying to save connection tree but the SQL read only checkbox is checked, aborting!");
|
||||
return;
|
||||
}
|
||||
|
||||
using (var dbConnector = DatabaseConnectorFactory.DatabaseConnectorFromSettings())
|
||||
{
|
||||
dbConnector.Connect();
|
||||
var databaseVersionVerifier = new SqlDatabaseVersionVerifier(dbConnector);
|
||||
var metaDataRetriever = new SqlDatabaseMetaDataRetriever();
|
||||
var metaData = metaDataRetriever.GetDatabaseMetaData(dbConnector);
|
||||
|
||||
if (!databaseVersionVerifier.VerifyDatabaseVersion(metaData.ConfVersion))
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
|
||||
Language.ErrorConnectionListSaveFailed);
|
||||
return;
|
||||
}
|
||||
|
||||
metaDataRetriever.WriteDatabaseMetaData(rootTreeNode, dbConnector);
|
||||
UpdateConnectionsTable(rootTreeNode, dbConnector);
|
||||
UpdateUpdatesTable(dbConnector);
|
||||
|
||||
}
|
||||
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, "Saved connections to database");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if a given property name should be only saved
|
||||
/// locally.
|
||||
/// </summary>
|
||||
/// <param name="property">
|
||||
/// The name of the property that triggered the save event
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
private bool PropertyIsLocalOnly(string property)
|
||||
{
|
||||
return property == nameof(ConnectionInfo.OpenConnections) ||
|
||||
property == nameof(ContainerInfo.IsExpanded) ||
|
||||
property == nameof(ContainerInfo.Favorite);
|
||||
}
|
||||
|
||||
private void UpdateLocalConnectionProperties(ContainerInfo rootNode)
|
||||
{
|
||||
var a = rootNode.GetRecursiveChildList().Select(info => new LocalConnectionPropertiesModel
|
||||
{
|
||||
ConnectionId = info.ConstantID,
|
||||
Connected = info.OpenConnections.Count > 0,
|
||||
Expanded = info is ContainerInfo c && c.IsExpanded,
|
||||
Favorite = info.Favorite,
|
||||
});
|
||||
|
||||
var serializedProperties = _localPropertiesSerializer.Serialize(a);
|
||||
_dataProvider.Save(serializedProperties);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, "Saved local connection properties");
|
||||
}
|
||||
|
||||
private void UpdateRootNodeTable(RootNodeInfo rootTreeNode, IDatabaseConnector databaseConnector)
|
||||
{
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
string strProtected;
|
||||
if (rootTreeNode != null)
|
||||
{
|
||||
if (rootTreeNode.Password)
|
||||
{
|
||||
var password = rootTreeNode.PasswordString.ConvertToSecureString();
|
||||
strProtected = cryptographyProvider.Encrypt("ThisIsProtected", password);
|
||||
}
|
||||
else
|
||||
{
|
||||
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", Runtime.EncryptionKey);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", Runtime.EncryptionKey);
|
||||
}
|
||||
|
||||
var dbQuery = databaseConnector.DbCommand("DELETE FROM tblRoot");
|
||||
dbQuery.ExecuteNonQuery();
|
||||
|
||||
if (rootTreeNode != null)
|
||||
{
|
||||
dbQuery =
|
||||
databaseConnector.DbCommand(
|
||||
"INSERT INTO tblRoot (Name, Export, Protected, ConfVersion) VALUES('" +
|
||||
MiscTools.PrepareValueForDB(rootTreeNode.Name) + "', 0, '" + strProtected + "','" +
|
||||
ConnectionsFileInfo.ConnectionFileVersion.ToString() + "')");
|
||||
dbQuery.ExecuteNonQuery();
|
||||
}
|
||||
else
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
|
||||
$"UpdateRootNodeTable: rootTreeNode was null. Could not insert!");
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateConnectionsTable(RootNodeInfo rootTreeNode, IDatabaseConnector databaseConnector)
|
||||
{
|
||||
var dataProvider = new SqlDataProvider(databaseConnector);
|
||||
var currentDataTable = dataProvider.Load();
|
||||
|
||||
var cryptoProvider = new LegacyRijndaelCryptographyProvider();
|
||||
var serializer = new DataTableSerializer(_saveFilter, cryptoProvider,
|
||||
rootTreeNode.PasswordString.ConvertToSecureString());
|
||||
serializer.SetSourceDataTable(currentDataTable);
|
||||
var dataTable = serializer.Serialize(rootTreeNode);
|
||||
//var dbQuery = databaseConnector.DbCommand("DELETE FROM tblCons");
|
||||
//dbQuery.ExecuteNonQuery();
|
||||
|
||||
dataProvider.Save(dataTable);
|
||||
}
|
||||
|
||||
private void UpdateUpdatesTable(IDatabaseConnector databaseConnector)
|
||||
{
|
||||
var dbQuery = databaseConnector.DbCommand("DELETE FROM tblUpdate");
|
||||
dbQuery.ExecuteNonQuery();
|
||||
dbQuery = databaseConnector.DbCommand("INSERT INTO tblUpdate (LastUpdate) VALUES('" + MiscTools.DBDate(DateTime.Now) + "')");
|
||||
dbQuery.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
private bool SqlUserIsReadOnly()
|
||||
{
|
||||
return Properties.Settings.Default.SQLReadOnly;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tree;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using mRemoteNG.Config.Serializers.ConnectionSerializers.Xml;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class XmlConnectionsLoader : IConnectionsLoader
|
||||
{
|
||||
private readonly string _connectionFilePath;
|
||||
|
||||
public XmlConnectionsLoader(string connectionFilePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(connectionFilePath))
|
||||
throw new ArgumentException($"{nameof(connectionFilePath)} cannot be null or empty");
|
||||
|
||||
if (!File.Exists(connectionFilePath))
|
||||
throw new FileNotFoundException($"{connectionFilePath} does not exist");
|
||||
|
||||
_connectionFilePath = connectionFilePath;
|
||||
}
|
||||
|
||||
public ConnectionTreeModel Load()
|
||||
{
|
||||
var dataProvider = new FileDataProvider(_connectionFilePath);
|
||||
var xmlString = dataProvider.Load();
|
||||
var deserializer = new XmlConnectionsDeserializer(PromptForPassword);
|
||||
return deserializer.Deserialize(xmlString);
|
||||
}
|
||||
|
||||
private Optional<SecureString> PromptForPassword()
|
||||
{
|
||||
var password = MiscTools.PasswordDialog(Path.GetFileName(_connectionFilePath), false);
|
||||
return password;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Config.Serializers.ConnectionSerializers.Xml;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.Factories;
|
||||
using mRemoteNG.Tree;
|
||||
using mRemoteNG.Tree.Root;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class XmlConnectionsSaver : ISaver<ConnectionTreeModel>
|
||||
{
|
||||
private readonly string _connectionFileName;
|
||||
private readonly SaveFilter _saveFilter;
|
||||
|
||||
public XmlConnectionsSaver(string connectionFileName, SaveFilter saveFilter)
|
||||
{
|
||||
if (string.IsNullOrEmpty(connectionFileName))
|
||||
throw new ArgumentException($"Argument '{nameof(connectionFileName)}' cannot be null or empty");
|
||||
if (saveFilter == null)
|
||||
throw new ArgumentNullException(nameof(saveFilter));
|
||||
|
||||
_connectionFileName = connectionFileName;
|
||||
_saveFilter = saveFilter;
|
||||
}
|
||||
|
||||
public void Save(ConnectionTreeModel connectionTreeModel, string propertyNameTrigger = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
var cryptographyProvider = new CryptoProviderFactoryFromSettings().Build();
|
||||
var serializerFactory = new XmlConnectionSerializerFactory();
|
||||
|
||||
var xmlConnectionsSerializer = serializerFactory.Build(
|
||||
cryptographyProvider,
|
||||
connectionTreeModel,
|
||||
_saveFilter,
|
||||
Properties.Settings.Default.EncryptCompleteConnectionsFile);
|
||||
|
||||
var rootNode = connectionTreeModel.RootNodes.OfType<RootNodeInfo>().First();
|
||||
var xml = xmlConnectionsSerializer.Serialize(rootNode);
|
||||
|
||||
var fileDataProvider = new FileDataProviderWithRollingBackup(_connectionFileName);
|
||||
fileDataProvider.Save(xml);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector?.AddExceptionStackTrace("SaveToXml failed", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security;
|
||||
using System.Xml.Linq;
|
||||
using mRemoteNG.Credential;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.Factories;
|
||||
|
||||
namespace mRemoteNG.Config
|
||||
{
|
||||
public class CredentialHarvester
|
||||
{
|
||||
private readonly IEqualityComparer<ICredentialRecord> _credentialComparer = new CredentialDomainUserComparer();
|
||||
|
||||
// maps a connectioninfo (by its id) to the credential object that was harvested
|
||||
public Dictionary<Guid, ICredentialRecord> ConnectionToCredentialMap { get; } =
|
||||
new Dictionary<Guid, ICredentialRecord>();
|
||||
|
||||
public IEnumerable<ICredentialRecord> Harvest(XDocument xDocument, SecureString decryptionKey)
|
||||
{
|
||||
if (xDocument == null)
|
||||
throw new ArgumentNullException(nameof(xDocument));
|
||||
|
||||
var cryptoProvider = new CryptoProviderFactoryFromXml(xDocument.Root).Build();
|
||||
|
||||
foreach (var element in xDocument.Descendants("Node"))
|
||||
{
|
||||
if (!EntryHasSomeCredentialData(element)) continue;
|
||||
var newCredential = BuildCredential(element, cryptoProvider, decryptionKey);
|
||||
|
||||
Guid connectionId;
|
||||
Guid.TryParse(element.Attribute("Id")?.Value, out connectionId);
|
||||
if (connectionId == Guid.Empty)
|
||||
{
|
||||
//error
|
||||
}
|
||||
|
||||
if (ConnectionToCredentialMap.Values.Contains(newCredential, _credentialComparer))
|
||||
{
|
||||
var existingCredential =
|
||||
ConnectionToCredentialMap.Values.First(record =>
|
||||
_credentialComparer.Equals(newCredential, record));
|
||||
ConnectionToCredentialMap.Add(connectionId, existingCredential);
|
||||
}
|
||||
else
|
||||
ConnectionToCredentialMap.Add(connectionId, newCredential);
|
||||
}
|
||||
|
||||
return ConnectionToCredentialMap.Values.Distinct(_credentialComparer);
|
||||
}
|
||||
|
||||
private ICredentialRecord BuildCredential(XElement element,
|
||||
ICryptographyProvider cryptographyProvider,
|
||||
SecureString decryptionKey)
|
||||
{
|
||||
var credential = new CredentialRecord
|
||||
{
|
||||
Title = $"{element.Attribute("Username")?.Value}\\{element.Attribute("Domain")?.Value}",
|
||||
Username = element.Attribute("Username")?.Value,
|
||||
Domain = element.Attribute("Domain")?.Value,
|
||||
Password = cryptographyProvider.Decrypt(element.Attribute("Password")?.Value, decryptionKey)
|
||||
.ConvertToSecureString()
|
||||
};
|
||||
return credential;
|
||||
}
|
||||
|
||||
private static bool EntryHasSomeCredentialData(XElement e)
|
||||
{
|
||||
return e.Attribute("Username")?.Value != "" ||
|
||||
e.Attribute("Domain")?.Value != "" ||
|
||||
e.Attribute("Password")?.Value != "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security;
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Config.Serializers;
|
||||
using mRemoteNG.Credential;
|
||||
|
||||
|
||||
namespace mRemoteNG.Config
|
||||
{
|
||||
public class CredentialRecordLoader
|
||||
{
|
||||
private readonly IDataProvider<string> _dataProvider;
|
||||
private readonly ISecureDeserializer<string, IEnumerable<ICredentialRecord>> _deserializer;
|
||||
|
||||
public CredentialRecordLoader(IDataProvider<string> dataProvider,
|
||||
ISecureDeserializer<string, IEnumerable<ICredentialRecord>> deserializer)
|
||||
{
|
||||
if (dataProvider == null)
|
||||
throw new ArgumentNullException(nameof(dataProvider));
|
||||
if (deserializer == null)
|
||||
throw new ArgumentNullException(nameof(deserializer));
|
||||
|
||||
_dataProvider = dataProvider;
|
||||
_deserializer = deserializer;
|
||||
}
|
||||
|
||||
public IEnumerable<ICredentialRecord> Load(SecureString key)
|
||||
{
|
||||
var serializedCredentials = _dataProvider.Load();
|
||||
return _deserializer.Deserialize(serializedCredentials, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security;
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Config.Serializers;
|
||||
using mRemoteNG.Credential;
|
||||
|
||||
|
||||
namespace mRemoteNG.Config
|
||||
{
|
||||
public class CredentialRecordSaver
|
||||
{
|
||||
private readonly IDataProvider<string> _dataProvider;
|
||||
private readonly ISecureSerializer<IEnumerable<ICredentialRecord>, string> _serializer;
|
||||
|
||||
public CredentialRecordSaver(IDataProvider<string> dataProvider,
|
||||
ISecureSerializer<IEnumerable<ICredentialRecord>, string> serializer)
|
||||
{
|
||||
if (dataProvider == null)
|
||||
throw new ArgumentNullException(nameof(dataProvider));
|
||||
if (serializer == null)
|
||||
throw new ArgumentNullException(nameof(serializer));
|
||||
|
||||
_dataProvider = dataProvider;
|
||||
_serializer = serializer;
|
||||
}
|
||||
|
||||
public void Save(IEnumerable<ICredentialRecord> credentialRecords, SecureString key)
|
||||
{
|
||||
var serializedCredentials = _serializer.Serialize(credentialRecords, key);
|
||||
_dataProvider.Save(serializedCredentials);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Config.Serializers.CredentialProviderSerializer;
|
||||
using mRemoteNG.Credential;
|
||||
|
||||
namespace mRemoteNG.Config
|
||||
{
|
||||
public class CredentialRepositoryListLoader : ILoader<IEnumerable<ICredentialRepository>>
|
||||
{
|
||||
private readonly IDataProvider<string> _dataProvider;
|
||||
private readonly CredentialRepositoryListDeserializer _deserializer;
|
||||
|
||||
public CredentialRepositoryListLoader(IDataProvider<string> dataProvider,
|
||||
CredentialRepositoryListDeserializer deserializer)
|
||||
{
|
||||
if (dataProvider == null)
|
||||
throw new ArgumentNullException(nameof(dataProvider));
|
||||
if (deserializer == null)
|
||||
throw new ArgumentNullException(nameof(deserializer));
|
||||
|
||||
_dataProvider = dataProvider;
|
||||
_deserializer = deserializer;
|
||||
}
|
||||
|
||||
public IEnumerable<ICredentialRepository> Load()
|
||||
{
|
||||
var data = _dataProvider.Load();
|
||||
return _deserializer.Deserialize(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using mRemoteNG.Config.DataProviders;
|
||||
using mRemoteNG.Config.Serializers.CredentialProviderSerializer;
|
||||
using mRemoteNG.Credential;
|
||||
|
||||
namespace mRemoteNG.Config
|
||||
{
|
||||
public class CredentialRepositoryListSaver : ISaver<IEnumerable<ICredentialRepository>>
|
||||
{
|
||||
private readonly IDataProvider<string> _dataProvider;
|
||||
|
||||
public CredentialRepositoryListSaver(IDataProvider<string> dataProvider)
|
||||
{
|
||||
if (dataProvider == null)
|
||||
throw new ArgumentNullException(nameof(dataProvider));
|
||||
|
||||
_dataProvider = dataProvider;
|
||||
}
|
||||
|
||||
public void Save(IEnumerable<ICredentialRepository> repositories, string propertyNameTrigger = "")
|
||||
{
|
||||
var serializer = new CredentialRepositoryListSerializer();
|
||||
var data = serializer.Serialize(repositories);
|
||||
_dataProvider.Save(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Resources.Language;
|
||||
|
||||
namespace mRemoteNG.Config.DataProviders
|
||||
{
|
||||
public class FileBackupCreator
|
||||
{
|
||||
public void CreateBackupFile(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (WeDontNeedToBackup(fileName))
|
||||
return;
|
||||
|
||||
var backupFileName =
|
||||
string.Format(Properties.Settings.Default.BackupFileNameFormat, fileName, DateTime.Now);
|
||||
File.Copy(fileName, backupFileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage(Language.ConnectionsFileBackupFailed, ex,
|
||||
MessageClass.WarningMsg);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private bool WeDontNeedToBackup(string filePath)
|
||||
{
|
||||
return FeatureIsTurnedOff() || FileDoesntExist(filePath);
|
||||
}
|
||||
|
||||
private bool FileDoesntExist(string filePath)
|
||||
{
|
||||
return !File.Exists(filePath);
|
||||
}
|
||||
|
||||
private bool FeatureIsTurnedOff()
|
||||
{
|
||||
return Properties.Settings.Default.BackupFileKeepCount == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace mRemoteNG.Config.DataProviders
|
||||
{
|
||||
public class FileBackupPruner
|
||||
{
|
||||
public void PruneBackupFiles(string filePath, int maxBackupsToKeep)
|
||||
{
|
||||
var fileName = Path.GetFileName(filePath);
|
||||
var directoryName = Path.GetDirectoryName(filePath);
|
||||
|
||||
if (string.IsNullOrEmpty(fileName) || string.IsNullOrEmpty(directoryName))
|
||||
return;
|
||||
|
||||
var searchPattern = string.Format(Properties.Settings.Default.BackupFileNameFormat, fileName, "*");
|
||||
var files = Directory.GetFiles(directoryName, searchPattern);
|
||||
|
||||
if (files.Length <= maxBackupsToKeep)
|
||||
return;
|
||||
|
||||
var filesToDelete = files
|
||||
.OrderByDescending(s => s)
|
||||
.Skip(maxBackupsToKeep);
|
||||
|
||||
foreach (var file in filesToDelete)
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using mRemoteNG.App;
|
||||
|
||||
namespace mRemoteNG.Config.DataProviders
|
||||
{
|
||||
public class FileDataProvider : IDataProvider<string>
|
||||
{
|
||||
public string FilePath { get; set; }
|
||||
|
||||
public FileDataProvider(string filePath)
|
||||
{
|
||||
FilePath = filePath;
|
||||
}
|
||||
|
||||
public virtual string Load()
|
||||
{
|
||||
var fileContents = "";
|
||||
try
|
||||
{
|
||||
fileContents = File.ReadAllText(FilePath);
|
||||
}
|
||||
catch (FileNotFoundException ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionStackTrace(
|
||||
$"Could not load file. File does not exist '{FilePath}'",
|
||||
ex);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionStackTrace($"Failed to load file {FilePath}", ex);
|
||||
}
|
||||
|
||||
return fileContents;
|
||||
}
|
||||
|
||||
public virtual void Save(string content)
|
||||
{
|
||||
try
|
||||
{
|
||||
CreateMissingDirectories();
|
||||
File.WriteAllText(FilePath, content);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionStackTrace($"Failed to save file {FilePath}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void MoveTo(string newPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Move(FilePath, newPath);
|
||||
FilePath = newPath;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionStackTrace($"Failed to move file {FilePath} to {newPath}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateMissingDirectories()
|
||||
{
|
||||
var dirname = Path.GetDirectoryName(FilePath);
|
||||
if (dirname == null) return;
|
||||
Directory.CreateDirectory(dirname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
namespace mRemoteNG.Config.DataProviders
|
||||
{
|
||||
public class FileDataProviderWithRollingBackup : FileDataProvider
|
||||
{
|
||||
private readonly FileBackupCreator _fileBackupCreator;
|
||||
|
||||
public FileDataProviderWithRollingBackup(string filePath) : base(filePath)
|
||||
{
|
||||
_fileBackupCreator = new FileBackupCreator();
|
||||
}
|
||||
|
||||
public override void Save(string content)
|
||||
{
|
||||
_fileBackupCreator.CreateBackupFile(FilePath);
|
||||
base.Save(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace mRemoteNG.Config.DataProviders
|
||||
{
|
||||
public interface IDataProvider<TFormat>
|
||||
{
|
||||
TFormat Load();
|
||||
|
||||
void Save(TFormat contents);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace mRemoteNG.Config.DataProviders
|
||||
{
|
||||
public class InMemoryStringDataProvider : IDataProvider<string>
|
||||
{
|
||||
private string _contents;
|
||||
|
||||
public InMemoryStringDataProvider(string initialContents = "")
|
||||
{
|
||||
_contents = initialContents;
|
||||
}
|
||||
|
||||
public string Load()
|
||||
{
|
||||
return _contents;
|
||||
}
|
||||
|
||||
public void Save(string contents)
|
||||
{
|
||||
_contents = contents;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
using System.Data;
|
||||
using mRemoteNG.Config.DatabaseConnectors;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.App;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace mRemoteNG.Config.DataProviders
|
||||
{
|
||||
public class SqlDataProvider : IDataProvider<DataTable>
|
||||
{
|
||||
public IDatabaseConnector DatabaseConnector { get; }
|
||||
|
||||
public SqlDataProvider(IDatabaseConnector databaseConnector)
|
||||
{
|
||||
DatabaseConnector = databaseConnector;
|
||||
}
|
||||
|
||||
public DataTable Load()
|
||||
{
|
||||
var dataTable = new DataTable();
|
||||
var dbQuery = DatabaseConnector.DbCommand("SELECT * FROM tblCons ORDER BY PositionID ASC");
|
||||
DatabaseConnector.AssociateItemToThisConnector(dbQuery);
|
||||
if (!DatabaseConnector.IsConnected)
|
||||
OpenConnection();
|
||||
var dbDataReader = dbQuery.ExecuteReader(CommandBehavior.CloseConnection);
|
||||
|
||||
if (dbDataReader.HasRows)
|
||||
dataTable.Load(dbDataReader);
|
||||
dbDataReader.Close();
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
public void Save(DataTable dataTable)
|
||||
{
|
||||
if (DbUserIsReadOnly())
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
|
||||
"Trying to save connections but the SQL read only checkbox is checked, aborting!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DatabaseConnector.IsConnected)
|
||||
OpenConnection();
|
||||
if (DatabaseConnector.GetType() == typeof(MSSqlDatabaseConnector))
|
||||
{
|
||||
SqlConnection sqlConnection = (SqlConnection)DatabaseConnector.DbConnection();
|
||||
using (SqlTransaction transaction = sqlConnection.BeginTransaction(System.Data.IsolationLevel.Serializable))
|
||||
{
|
||||
using (SqlCommand sqlCommand = new SqlCommand())
|
||||
{
|
||||
sqlCommand.Connection = sqlConnection;
|
||||
sqlCommand.Transaction = transaction;
|
||||
sqlCommand.CommandText = "SELECT * FROM tblCons";
|
||||
using (SqlDataAdapter dataAdpater = new SqlDataAdapter())
|
||||
{
|
||||
dataAdpater.SelectCommand = sqlCommand;
|
||||
|
||||
SqlCommandBuilder builder = new SqlCommandBuilder(dataAdpater);
|
||||
// Avoid optimistic concurrency, check if it is necessary.
|
||||
builder.ConflictOption = ConflictOption.OverwriteChanges;
|
||||
|
||||
dataAdpater.UpdateCommand = builder.GetUpdateCommand();
|
||||
|
||||
dataAdpater.DeleteCommand = builder.GetDeleteCommand();
|
||||
dataAdpater.InsertCommand = builder.GetInsertCommand();
|
||||
|
||||
dataAdpater.Update(dataTable);
|
||||
transaction.Commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (DatabaseConnector.GetType() == typeof(MySqlDatabaseConnector))
|
||||
{
|
||||
var dbConnection = (MySqlConnection) DatabaseConnector.DbConnection();
|
||||
using (MySqlTransaction transaction = dbConnection.BeginTransaction(System.Data.IsolationLevel.Serializable))
|
||||
{
|
||||
using (MySqlCommand sqlCommand = new MySqlCommand())
|
||||
{
|
||||
sqlCommand.Connection = dbConnection;
|
||||
sqlCommand.Transaction = transaction;
|
||||
sqlCommand.CommandText = "SELECT * FROM tblCons";
|
||||
using (MySqlDataAdapter dataAdapter = new MySqlDataAdapter(sqlCommand))
|
||||
{
|
||||
dataAdapter.UpdateBatchSize = 1000;
|
||||
using (MySqlCommandBuilder cb = new MySqlCommandBuilder(dataAdapter))
|
||||
{
|
||||
dataAdapter.Update(dataTable);
|
||||
transaction.Commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenConnection()
|
||||
{
|
||||
DatabaseConnector.Connect();
|
||||
}
|
||||
|
||||
public void CloseConnection()
|
||||
{
|
||||
DatabaseConnector.Disconnect();
|
||||
}
|
||||
|
||||
private bool DbUserIsReadOnly()
|
||||
{
|
||||
return Properties.Settings.Default.SQLReadOnly;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace mRemoteNG.Config.DatabaseConnectors
|
||||
{
|
||||
public enum ConnectionTestResult
|
||||
{
|
||||
ConnectionSucceded,
|
||||
ServerNotAccessible,
|
||||
UnknownDatabase,
|
||||
CredentialsRejected,
|
||||
UnknownError
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mRemoteNG.Config.DatabaseConnectors
|
||||
{
|
||||
/// <summary>
|
||||
/// A helper class for testing database connectivity
|
||||
/// </summary>
|
||||
public class DatabaseConnectionTester
|
||||
{
|
||||
public async Task<ConnectionTestResult> TestConnectivity(string type,
|
||||
string server,
|
||||
string database,
|
||||
string username,
|
||||
string password)
|
||||
{
|
||||
using (var dbConnector = DatabaseConnectorFactory.DatabaseConnector(type, server, database, username, password))
|
||||
{
|
||||
try
|
||||
{
|
||||
await dbConnector.ConnectAsync();
|
||||
return ConnectionTestResult.ConnectionSucceded;
|
||||
}
|
||||
catch (SqlException sqlException)
|
||||
{
|
||||
if (sqlException.Message.Contains("The server was not found"))
|
||||
return ConnectionTestResult.ServerNotAccessible;
|
||||
if (sqlException.Message.Contains("Cannot open database"))
|
||||
return ConnectionTestResult.UnknownDatabase;
|
||||
if (sqlException.Message.Contains("Login failed for user"))
|
||||
return ConnectionTestResult.CredentialsRejected;
|
||||
return ConnectionTestResult.UnknownError;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return ConnectionTestResult.UnknownError;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
|
||||
namespace mRemoteNG.Config.DatabaseConnectors
|
||||
{
|
||||
public class DatabaseConnectorFactory
|
||||
{
|
||||
public static IDatabaseConnector DatabaseConnectorFromSettings()
|
||||
{
|
||||
var sqlType = Properties.Settings.Default.SQLServerType;
|
||||
var sqlHost = Properties.Settings.Default.SQLHost;
|
||||
var sqlCatalog = Properties.Settings.Default.SQLDatabaseName;
|
||||
var sqlUsername = Properties.Settings.Default.SQLUser;
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
var sqlPassword = cryptographyProvider.Decrypt(Properties.Settings.Default.SQLPass, Runtime.EncryptionKey);
|
||||
|
||||
return DatabaseConnector(sqlType, sqlHost, sqlCatalog, sqlUsername, sqlPassword);
|
||||
}
|
||||
|
||||
public static IDatabaseConnector DatabaseConnector(string type, string server, string database, string username, string password)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case "mysql":
|
||||
return new MySqlDatabaseConnector(server, database, username, password);
|
||||
case "mssql":
|
||||
default:
|
||||
return new MSSqlDatabaseConnector(server, database, username, password);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Data.Common;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mRemoteNG.Config.DatabaseConnectors
|
||||
{
|
||||
public interface IDatabaseConnector : IDisposable
|
||||
{
|
||||
DbConnection DbConnection();
|
||||
DbCommand DbCommand(string dbCommand);
|
||||
bool IsConnected { get; }
|
||||
void Connect();
|
||||
Task ConnectAsync();
|
||||
void Disconnect();
|
||||
void AssociateItemToThisConnector(DbCommand dbCommand);
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlClient;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// ReSharper disable ArrangeAccessorOwnerBody
|
||||
|
||||
namespace mRemoteNG.Config.DatabaseConnectors
|
||||
{
|
||||
public class MSSqlDatabaseConnector : IDatabaseConnector
|
||||
{
|
||||
private DbConnection _dbConnection { get; set; } = default(SqlConnection);
|
||||
private string _dbConnectionString = "";
|
||||
private readonly string _dbHost;
|
||||
private readonly string _dbCatalog;
|
||||
private readonly string _dbUsername;
|
||||
private readonly string _dbPassword;
|
||||
|
||||
public DbConnection DbConnection()
|
||||
{
|
||||
return _dbConnection;
|
||||
}
|
||||
|
||||
public DbCommand DbCommand(string dbCommand)
|
||||
{
|
||||
return new SqlCommand(dbCommand, (SqlConnection) _dbConnection);
|
||||
}
|
||||
|
||||
public bool IsConnected => (_dbConnection.State == ConnectionState.Open);
|
||||
|
||||
public MSSqlDatabaseConnector(string sqlServer, string catalog, string username, string password)
|
||||
{
|
||||
_dbHost = sqlServer;
|
||||
_dbCatalog = catalog;
|
||||
_dbUsername = username;
|
||||
_dbPassword = password;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
BuildSqlConnectionString();
|
||||
_dbConnection = new SqlConnection(_dbConnectionString);
|
||||
}
|
||||
|
||||
private void BuildSqlConnectionString()
|
||||
{
|
||||
if (_dbUsername != "")
|
||||
BuildDbConnectionStringWithCustomCredentials();
|
||||
else
|
||||
BuildDbConnectionStringWithDefaultCredentials();
|
||||
}
|
||||
|
||||
private void BuildDbConnectionStringWithCustomCredentials()
|
||||
{
|
||||
string[] hostParts = _dbHost.Split(new char[] { ':' }, 2);
|
||||
var _dbPort = (hostParts.Length == 2) ? hostParts[1] : "1433";
|
||||
|
||||
_dbConnectionString = new SqlConnectionStringBuilder
|
||||
{
|
||||
DataSource = $"{hostParts[0]},{_dbPort}",
|
||||
InitialCatalog = _dbCatalog,
|
||||
UserID = _dbUsername,
|
||||
Password = _dbPassword,
|
||||
}.ToString();
|
||||
}
|
||||
|
||||
private void BuildDbConnectionStringWithDefaultCredentials()
|
||||
{
|
||||
_dbConnectionString = new SqlConnectionStringBuilder
|
||||
{
|
||||
DataSource = _dbHost,
|
||||
InitialCatalog = _dbCatalog,
|
||||
IntegratedSecurity = true
|
||||
}.ToString();
|
||||
}
|
||||
|
||||
public void Connect()
|
||||
{
|
||||
_dbConnection.Open();
|
||||
}
|
||||
|
||||
public async Task ConnectAsync()
|
||||
{
|
||||
await _dbConnection.OpenAsync();
|
||||
}
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
_dbConnection.Close();
|
||||
}
|
||||
|
||||
public void AssociateItemToThisConnector(DbCommand dbCommand)
|
||||
{
|
||||
dbCommand.Connection = (SqlConnection) _dbConnection;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
private void Dispose(bool itIsSafeToFreeManagedObjects)
|
||||
{
|
||||
if (!itIsSafeToFreeManagedObjects) return;
|
||||
_dbConnection.Close();
|
||||
_dbConnection.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Threading.Tasks;
|
||||
using MySql.Data.MySqlClient;
|
||||
|
||||
// ReSharper disable ArrangeAccessorOwnerBody
|
||||
|
||||
namespace mRemoteNG.Config.DatabaseConnectors
|
||||
{
|
||||
public class MySqlDatabaseConnector : IDatabaseConnector
|
||||
{
|
||||
private DbConnection _dbConnection { get; set; } = default(MySqlConnection);
|
||||
private string _dbConnectionString = "";
|
||||
private readonly string _dbHost;
|
||||
private readonly string _dbPort;
|
||||
private readonly string _dbName;
|
||||
private readonly string _dbUsername;
|
||||
private readonly string _dbPassword;
|
||||
|
||||
public DbConnection DbConnection()
|
||||
{
|
||||
return _dbConnection;
|
||||
}
|
||||
|
||||
public DbCommand DbCommand(string dbCommand)
|
||||
{
|
||||
return new MySqlCommand(dbCommand, (MySqlConnection) _dbConnection);
|
||||
}
|
||||
|
||||
public bool IsConnected => (_dbConnection.State == ConnectionState.Open);
|
||||
|
||||
public MySqlDatabaseConnector(string host, string database, string username, string password)
|
||||
{
|
||||
string[] hostParts = host.Split(new char[]{':'}, 2);
|
||||
_dbHost = hostParts[0];
|
||||
_dbPort = (hostParts.Length == 2)?hostParts[1]:"3306";
|
||||
_dbName = database;
|
||||
_dbUsername = username;
|
||||
_dbPassword = password;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
BuildSqlConnectionString();
|
||||
_dbConnection = new MySqlConnection(_dbConnectionString);
|
||||
}
|
||||
|
||||
private void BuildSqlConnectionString()
|
||||
{
|
||||
_dbConnectionString = $"server={_dbHost};user={_dbUsername};database={_dbName};port={_dbPort};password={_dbPassword}";
|
||||
}
|
||||
|
||||
public void Connect()
|
||||
{
|
||||
_dbConnection.Open();
|
||||
}
|
||||
|
||||
public async Task ConnectAsync()
|
||||
{
|
||||
await _dbConnection.OpenAsync();
|
||||
}
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
_dbConnection.Close();
|
||||
}
|
||||
|
||||
public void AssociateItemToThisConnector(DbCommand dbCommand)
|
||||
{
|
||||
dbCommand.Connection = (MySqlConnection) _dbConnection;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
private void Dispose(bool itIsSafeToFreeManagedObjects)
|
||||
{
|
||||
if (!itIsSafeToFreeManagedObjects) return;
|
||||
_dbConnection.Close();
|
||||
_dbConnection.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace mRemoteNG.Config
|
||||
{
|
||||
public interface ILoader<out T>
|
||||
{
|
||||
T Load();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace mRemoteNG.Config
|
||||
{
|
||||
public interface ISaver<in T>
|
||||
{
|
||||
void Save(T model, string propertyNameTrigger = "");
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user