mirror of https://github.com/oxen-io/lokinet
finally make a user-friendly front-end for lokinet (requires .NET or mono CLR v2+)
This commit is contained in:
parent
2e5cdd7ec9
commit
a48ae79bba
|
@ -0,0 +1,62 @@
|
|||
using network.loki.lokinet.win32.ui.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace network.loki.lokinet.win32.ui
|
||||
{
|
||||
|
||||
class LogDumper
|
||||
{
|
||||
private const string LogFolderName = "logs";
|
||||
private const string LogFileName = "lokinet.log";
|
||||
private string tmp;
|
||||
private string LogPath;
|
||||
|
||||
public LogDumper(string text_dump)
|
||||
{
|
||||
tmp = text_dump;
|
||||
}
|
||||
|
||||
public void setText(string text)
|
||||
{
|
||||
tmp = text;
|
||||
}
|
||||
public string getLogPath()
|
||||
{
|
||||
return LogPath;
|
||||
}
|
||||
|
||||
public void CreateLog(string path)
|
||||
{
|
||||
var logFolderPath = Path.Combine(path, LogFolderName);
|
||||
if (!Directory.Exists(logFolderPath))
|
||||
Directory.CreateDirectory(logFolderPath);
|
||||
|
||||
var logFilePath = Path.Combine(logFolderPath, LogFileName);
|
||||
LogPath = logFilePath;
|
||||
|
||||
Rotate(logFilePath);
|
||||
|
||||
using (var sw = File.AppendText(logFilePath))
|
||||
{
|
||||
sw.WriteLine(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
private void Rotate(string filePath)
|
||||
{
|
||||
if (!File.Exists(filePath))
|
||||
return;
|
||||
|
||||
var fileInfo = new FileInfo(filePath);
|
||||
|
||||
var fileTime = DateTime.Now.ToString("dd-MM-yy__h-m-s");
|
||||
var rotatedPath = filePath.Replace(".log", $".{fileTime}.log");
|
||||
File.Move(filePath, rotatedPath);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -2,10 +2,12 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace lokivpn
|
||||
namespace network.loki.lokinet.win32.ui
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
public static OperatingSystem os_id = Environment.OSVersion;
|
||||
public static PlatformID platform = os_id.Platform;
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
|
@ -14,7 +16,13 @@ namespace lokivpn
|
|||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new UI_Main_Frame());
|
||||
Application.Run(new main_frame());
|
||||
try
|
||||
{
|
||||
main_frame.lokiNetDaemon.Kill();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +1,41 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("LokiNET for Windows")]
|
||||
[assembly: AssemblyDescription("LokiNET Client UI for Windows NT (standalone)")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Loki Project")]
|
||||
[assembly: AssemblyProduct("lokinet-win32")]
|
||||
[assembly: AssemblyCopyright("Copyright ©2018 Rick V for the Loki Project. All rights reserved. See LICENSE for more details.")]
|
||||
[assembly: AssemblyTrademark("Loki, Loki Project, LokiNET are ™ & © 2018 Loki Foundation")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("1cdee73c-29c5-4781-bd74-1eeac6f75a14")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("LokiNET end-user interface")]
|
||||
[assembly: AssemblyDescription("LokiNET end-user UI")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Loki Project")]
|
||||
[assembly: AssemblyProduct("LokiNET for Microsoft® Windows® NT™")]
|
||||
[assembly: AssemblyCopyright("Copyright ©2018-2019 Rick V for the Loki Project. All rights reserved. See LICENSE for more details.")]
|
||||
[assembly: AssemblyTrademark("Loki, Loki Project, LokiNET are ™ & ©2018-2019 Loki Foundation")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("1cdee73c-29c5-4781-bd74-1eeac6f75a14")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.4.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.4.0.0")]
|
||||
#if DEBUG
|
||||
[assembly: AssemblyInformationalVersion("0.4.0-dev-{chash:8}")]
|
||||
#else
|
||||
[assembly: AssemblyInformationalVersion("0.4.0 (RELEASE_CODENAME)")]
|
||||
#endif
|
|
@ -8,10 +8,10 @@
|
|||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace lokivpn.Properties
|
||||
{
|
||||
|
||||
|
||||
namespace network.loki.lokinet.win32.ui.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
|
@ -19,51 +19,43 @@ namespace lokivpn.Properties
|
|||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("lokivpn.Properties.Resources", typeof(Resources).Assembly);
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("network.loki.lokinet.win32.ui.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,21 +8,17 @@
|
|||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace lokivpn.Properties
|
||||
{
|
||||
|
||||
|
||||
namespace network.loki.lokinet.win32.ui.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace lokivpn
|
||||
namespace network.loki.lokinet.win32.ui
|
||||
{
|
||||
partial class UI_Main_Frame
|
||||
partial class main_frame
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
@ -29,7 +29,7 @@
|
|||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UI_Main_Frame));
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(main_frame));
|
||||
this.StatusLabel = new System.Windows.Forms.Label();
|
||||
this.lokinetd_fd1 = new System.Windows.Forms.TextBox();
|
||||
this.NotificationTrayIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
|
@ -67,13 +67,14 @@
|
|||
this.lokinetd_fd1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.lokinetd_fd1.Size = new System.Drawing.Size(776, 330);
|
||||
this.lokinetd_fd1.TabIndex = 1;
|
||||
this.lokinetd_fd1.Text = "[pipe lokinetd fd 1 here]";
|
||||
this.lokinetd_fd1.TextChanged += new System.EventHandler(this.lokinetd_fd1_TextChanged);
|
||||
//
|
||||
// NotificationTrayIcon
|
||||
//
|
||||
this.NotificationTrayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("NotificationTrayIcon.Icon")));
|
||||
this.NotificationTrayIcon.Text = "LokiNET for Windows - [status]";
|
||||
this.NotificationTrayIcon.Text = "LokiNET - disconnected";
|
||||
this.NotificationTrayIcon.Visible = true;
|
||||
this.NotificationTrayIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.NotificationTrayIcon_MouseDoubleClick);
|
||||
//
|
||||
// btnHide
|
||||
//
|
||||
|
@ -84,16 +85,17 @@
|
|||
this.btnHide.TabIndex = 2;
|
||||
this.btnHide.Text = "Hide";
|
||||
this.btnHide.UseVisualStyleBackColor = true;
|
||||
this.btnHide.Click += new System.EventHandler(this.btnHide_Click);
|
||||
//
|
||||
// UIVersionLabel
|
||||
//
|
||||
this.UIVersionLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.UIVersionLabel.AutoSize = true;
|
||||
this.UIVersionLabel.Location = new System.Drawing.Point(529, 388);
|
||||
this.UIVersionLabel.Location = new System.Drawing.Point(455, 388);
|
||||
this.UIVersionLabel.Name = "UIVersionLabel";
|
||||
this.UIVersionLabel.Size = new System.Drawing.Size(259, 13);
|
||||
this.UIVersionLabel.Size = new System.Drawing.Size(333, 13);
|
||||
this.UIVersionLabel.TabIndex = 3;
|
||||
this.UIVersionLabel.Text = "LokiNET for Windows UI [version]/LokiNET [vcs-rev]";
|
||||
this.UIVersionLabel.Text = "version label";
|
||||
this.UIVersionLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// btnConnect
|
||||
//
|
||||
|
@ -104,21 +106,24 @@
|
|||
this.btnConnect.TabIndex = 4;
|
||||
this.btnConnect.Text = "Connect";
|
||||
this.btnConnect.UseVisualStyleBackColor = true;
|
||||
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
|
||||
//
|
||||
// btnDrop
|
||||
//
|
||||
this.btnDrop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnDrop.Location = new System.Drawing.Point(95, 414);
|
||||
this.btnDrop.Enabled = false;
|
||||
this.btnDrop.Location = new System.Drawing.Point(95, 415);
|
||||
this.btnDrop.Name = "btnDrop";
|
||||
this.btnDrop.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnDrop.TabIndex = 5;
|
||||
this.btnDrop.Text = "Disconnect";
|
||||
this.btnDrop.UseVisualStyleBackColor = true;
|
||||
this.btnDrop.Click += new System.EventHandler(this.btnDrop_Click);
|
||||
//
|
||||
// btnConfigProfile
|
||||
//
|
||||
this.btnConfigProfile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnConfigProfile.Location = new System.Drawing.Point(177, 413);
|
||||
this.btnConfigProfile.Location = new System.Drawing.Point(177, 415);
|
||||
this.btnConfigProfile.Name = "btnConfigProfile";
|
||||
this.btnConfigProfile.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnConfigProfile.TabIndex = 6;
|
||||
|
@ -126,7 +131,7 @@
|
|||
this.btnConfigProfile.UseVisualStyleBackColor = true;
|
||||
this.btnConfigProfile.Click += new System.EventHandler(this.btnConfigProfile_Click);
|
||||
//
|
||||
// UI_Main_Frame
|
||||
// main_frame
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
|
@ -139,10 +144,10 @@
|
|||
this.Controls.Add(this.lokinetd_fd1);
|
||||
this.Controls.Add(this.StatusLabel);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "UI_Main_Frame";
|
||||
this.Name = "main_frame";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "LokiNET for Windows";
|
||||
this.Text = "LokiNET Launcher";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -151,13 +156,13 @@
|
|||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label StatusLabel;
|
||||
private System.Windows.Forms.TextBox lokinetd_fd1;
|
||||
private System.Windows.Forms.NotifyIcon NotificationTrayIcon;
|
||||
private System.Windows.Forms.Button btnHide;
|
||||
private System.Windows.Forms.Label UIVersionLabel;
|
||||
private System.Windows.Forms.Button btnConnect;
|
||||
private System.Windows.Forms.Button btnDrop;
|
||||
private System.Windows.Forms.Button btnConfigProfile;
|
||||
public System.Windows.Forms.TextBox lokinetd_fd1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,23 +1,104 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace lokivpn
|
||||
namespace network.loki.lokinet.win32.ui
|
||||
{
|
||||
public partial class UI_Main_Frame : Form
|
||||
public partial class main_frame : Form
|
||||
{
|
||||
public UI_Main_Frame()
|
||||
public static Process lokiNetDaemon = new Process();
|
||||
public static bool isConnected;
|
||||
public static string logText;
|
||||
|
||||
void UpdateUI(string text)
|
||||
{
|
||||
this.Invoke(new MethodInvoker(delegate () { lokinetd_fd1.AppendText(text); }));
|
||||
}
|
||||
|
||||
public main_frame()
|
||||
{
|
||||
InitializeComponent();
|
||||
StatusLabel.Text = "Disconnected";
|
||||
var build = ((AssemblyInformationalVersionAttribute)Assembly
|
||||
.GetAssembly(typeof(main_frame))
|
||||
.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false)[0])
|
||||
.InformationalVersion;
|
||||
UIVersionLabel.Text = String.Format("LokiNET version {0}", build);
|
||||
lokinetd_fd1.Text = string.Empty;
|
||||
logText = string.Empty;
|
||||
}
|
||||
|
||||
private void btnConfigProfile_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("not implemented yet", "error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||
//MessageBox.Show("not implemented yet", "error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||
UserSettingsForm f = new UserSettingsForm();
|
||||
f.ShowDialog();
|
||||
f.Dispose();
|
||||
}
|
||||
|
||||
private void btnConnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
string lokinetExeString;
|
||||
|
||||
if (Program.platform == PlatformID.Win32NT)
|
||||
lokinetExeString = String.Format("{0}\\lokinet.exe", Directory.GetCurrentDirectory());
|
||||
else
|
||||
lokinetExeString = String.Format("{0}/lokinet", Directory.GetCurrentDirectory());
|
||||
|
||||
lokiNetDaemon.StartInfo.UseShellExecute = false;
|
||||
lokiNetDaemon.StartInfo.RedirectStandardOutput = true;
|
||||
//lokiNetDaemon.EnableRaisingEvents = true;
|
||||
lokiNetDaemon.StartInfo.CreateNoWindow = true;
|
||||
lokiNetDaemon.StartInfo.FileName = lokinetExeString;
|
||||
lokiNetDaemon.OutputDataReceived += new DataReceivedEventHandler((s, ev) =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ev.Data))
|
||||
{
|
||||
UpdateUI(ev.Data + Environment.NewLine);
|
||||
}
|
||||
});
|
||||
lokiNetDaemon.Start();
|
||||
lokiNetDaemon.BeginOutputReadLine();
|
||||
btnConnect.Enabled = false;
|
||||
StatusLabel.Text = "Connected";
|
||||
isConnected = true;
|
||||
NotificationTrayIcon.Text = "LokiNET - connected";
|
||||
btnDrop.Enabled = true;
|
||||
}
|
||||
|
||||
private void btnDrop_Click(object sender, EventArgs e)
|
||||
{
|
||||
lokiNetDaemon.CancelOutputRead();
|
||||
lokiNetDaemon.Kill();
|
||||
btnConnect.Enabled = true;
|
||||
btnDrop.Enabled = false;
|
||||
StatusLabel.Text = "Disconnected";
|
||||
NotificationTrayIcon.Text = "LokiNET - disconnected";
|
||||
isConnected = false;
|
||||
logText = lokinetd_fd1.Text;
|
||||
lokinetd_fd1.Text = string.Empty;
|
||||
}
|
||||
|
||||
private void lokinetd_fd1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
lokinetd_fd1.ScrollToCaret();
|
||||
}
|
||||
|
||||
private void btnHide_Click(object sender, EventArgs e)
|
||||
{
|
||||
Hide();
|
||||
if (isConnected)
|
||||
NotificationTrayIcon.ShowBalloonTip(5, "LokiNET", "Currently connected.", ToolTipIcon.Info);
|
||||
else
|
||||
NotificationTrayIcon.ShowBalloonTip(5, "LokiNET", "Currently disconnected.", ToolTipIcon.Info);
|
||||
}
|
||||
|
||||
private void NotificationTrayIcon_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
namespace network.loki.lokinet.win32.ui
|
||||
{
|
||||
partial class UserSettingsForm
|
||||
{
|
||||
/// <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.btnOK = new System.Windows.Forms.Button();
|
||||
this.btnBoot = new System.Windows.Forms.Button();
|
||||
this.btnDumpLog = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnOK.Location = new System.Drawing.Point(109, 88);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOK.TabIndex = 0;
|
||||
this.btnOK.Text = "Close";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||
//
|
||||
// btnBoot
|
||||
//
|
||||
this.btnBoot.Location = new System.Drawing.Point(13, 13);
|
||||
this.btnBoot.Name = "btnBoot";
|
||||
this.btnBoot.Size = new System.Drawing.Size(270, 23);
|
||||
this.btnBoot.TabIndex = 1;
|
||||
this.btnBoot.Text = "Bootstrap Client from Web...";
|
||||
this.btnBoot.UseVisualStyleBackColor = true;
|
||||
this.btnBoot.Click += new System.EventHandler(this.btnBoot_Click);
|
||||
//
|
||||
// btnDumpLog
|
||||
//
|
||||
this.btnDumpLog.Location = new System.Drawing.Point(13, 43);
|
||||
this.btnDumpLog.Name = "btnDumpLog";
|
||||
this.btnDumpLog.Size = new System.Drawing.Size(270, 23);
|
||||
this.btnDumpLog.TabIndex = 2;
|
||||
this.btnDumpLog.Text = "Save Log...";
|
||||
this.btnDumpLog.UseVisualStyleBackColor = true;
|
||||
this.btnDumpLog.Click += new System.EventHandler(this.btnDumpLog_Click);
|
||||
//
|
||||
// UserSettingsForm
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnOK;
|
||||
this.ClientSize = new System.Drawing.Size(295, 123);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.btnDumpLog);
|
||||
this.Controls.Add(this.btnBoot);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "UserSettingsForm";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Settings";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Button btnBoot;
|
||||
private System.Windows.Forms.Button btnDumpLog;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace network.loki.lokinet.win32.ui
|
||||
{
|
||||
public partial class UserSettingsForm : Form
|
||||
{
|
||||
public UserSettingsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
if (Program.platform == PlatformID.Win32NT)
|
||||
config_path = Environment.ExpandEnvironmentVariables("%APPDATA%\\.lokinet");
|
||||
else
|
||||
config_path = Environment.ExpandEnvironmentVariables("%HOME%/.lokinet");
|
||||
}
|
||||
|
||||
private string config_path;
|
||||
private LogDumper ld;
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnBoot_Click(object sender, EventArgs e)
|
||||
{
|
||||
dlgBootstrap b = new dlgBootstrap();
|
||||
b.ShowDialog();
|
||||
b.Dispose();
|
||||
}
|
||||
|
||||
private void btnDumpLog_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (main_frame.isConnected)
|
||||
MessageBox.Show("Cannot dump log when client is running.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
else
|
||||
{
|
||||
if (main_frame.logText == string.Empty)
|
||||
{
|
||||
MessageBox.Show("Log is empty", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return;
|
||||
}
|
||||
if (ld == null)
|
||||
ld = new LogDumper(main_frame.logText);
|
||||
else
|
||||
ld.setText(main_frame.logText);
|
||||
|
||||
ld.CreateLog(config_path);
|
||||
MessageBox.Show(string.Format("Wrote log to {0}, previous log rotated", ld.getLogPath()), "LokiNET", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
main_frame.logText = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,101 @@
|
|||
namespace network.loki.lokinet.win32.ui
|
||||
{
|
||||
partial class dlgBootstrap
|
||||
{
|
||||
/// <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(dlgBootstrap));
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.uriBox = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.btnDownload = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
resources.ApplyResources(this.label1, "label1");
|
||||
this.label1.Name = "label1";
|
||||
//
|
||||
// uriBox
|
||||
//
|
||||
resources.ApplyResources(this.uriBox, "uriBox");
|
||||
this.uriBox.Name = "uriBox";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
resources.ApplyResources(this.label2, "label2");
|
||||
this.label2.Name = "label2";
|
||||
//
|
||||
// btnDownload
|
||||
//
|
||||
resources.ApplyResources(this.btnDownload, "btnDownload");
|
||||
this.btnDownload.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnDownload.Name = "btnDownload";
|
||||
this.btnDownload.UseVisualStyleBackColor = true;
|
||||
this.btnDownload.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
resources.ApplyResources(this.btnCancel, "btnCancel");
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.button1_Click_1);
|
||||
//
|
||||
// bootstrap
|
||||
//
|
||||
this.AcceptButton = this.btnDownload;
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnDownload);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.uriBox);
|
||||
this.Controls.Add(this.label1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "bootstrap";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox uriBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button btnDownload;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace network.loki.lokinet.win32.ui
|
||||
{
|
||||
public partial class dlgBootstrap : Form
|
||||
{
|
||||
public dlgBootstrap()
|
||||
{
|
||||
InitializeComponent();
|
||||
if (Program.platform == PlatformID.Win32NT)
|
||||
default_path = Environment.ExpandEnvironmentVariables("%APPDATA%\\.lokinet\\bootstrap.signed");
|
||||
else
|
||||
default_path = Environment.ExpandEnvironmentVariables("%HOME%/.lokinet/bootstrap.signed");
|
||||
label2.Text = String.Format("This file is automatically saved as {0}.", default_path);
|
||||
}
|
||||
|
||||
private WebClient wc;
|
||||
private string default_path;
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
wc = new WebClient();
|
||||
// add something more unique, this is the IE 5.0 default string
|
||||
wc.Headers.Add("User-Agent","Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.0)");
|
||||
try
|
||||
{
|
||||
wc.DownloadFile(uriBox.Text, default_path);
|
||||
MessageBox.Show("LokiNET node bootstrapped", "LokiNET", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
MessageBox.Show(string.Format("An error occured while downloading data. {0}, error {1}", ex.Message, ex.InnerException.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||
DialogResult = DialogResult.Abort;
|
||||
}
|
||||
wc.Dispose();
|
||||
Close();
|
||||
}
|
||||
|
||||
private void button1_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,276 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>13, 13</value>
|
||||
</data>
|
||||
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>196, 13</value>
|
||||
</data>
|
||||
<data name="label1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="label1.Text" xml:space="preserve">
|
||||
<value>Enter a URI to a node to bootstrap from:</value>
|
||||
</data>
|
||||
<data name=">>label1.Name" xml:space="preserve">
|
||||
<value>label1</value>
|
||||
</data>
|
||||
<data name=">>label1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>label1.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label1.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="uriBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Left, Right</value>
|
||||
</data>
|
||||
<data name="uriBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 29</value>
|
||||
</data>
|
||||
<data name="uriBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>520, 20</value>
|
||||
</data>
|
||||
<data name="uriBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>uriBox.Name" xml:space="preserve">
|
||||
<value>uriBox</value>
|
||||
</data>
|
||||
<data name=">>uriBox.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>uriBox.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>uriBox.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 52</value>
|
||||
</data>
|
||||
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>347, 13</value>
|
||||
</data>
|
||||
<data name="label2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="label2.Text" xml:space="preserve">
|
||||
<value>This file is automatically saved as $APPDATA\.lokinet\bootstrap.signed.</value>
|
||||
</data>
|
||||
<data name=">>label2.Name" xml:space="preserve">
|
||||
<value>label2</value>
|
||||
</data>
|
||||
<data name=">>label2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>label2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label2.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="btnDownload.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom</value>
|
||||
</data>
|
||||
<data name="btnDownload.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>196, 75</value>
|
||||
</data>
|
||||
<data name="btnDownload.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>75, 23</value>
|
||||
</data>
|
||||
<data name="btnDownload.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="btnDownload.Text" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name=">>btnDownload.Name" xml:space="preserve">
|
||||
<value>btnDownload</value>
|
||||
</data>
|
||||
<data name=">>btnDownload.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>btnDownload.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>btnDownload.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="btnCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom</value>
|
||||
</data>
|
||||
<data name="btnCancel.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>278, 75</value>
|
||||
</data>
|
||||
<data name="btnCancel.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>75, 23</value>
|
||||
</data>
|
||||
<data name="btnCancel.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="btnCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name=">>btnCancel.Name" xml:space="preserve">
|
||||
<value>btnCancel</value>
|
||||
</data>
|
||||
<data name=">>btnCancel.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>btnCancel.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>btnCancel.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>548, 111</value>
|
||||
</data>
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterParent</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>bootstrap from web...</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>bootstrap</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
|
@ -6,8 +6,8 @@
|
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1CDEE73C-29C5-4781-BD74-1EEAC6F75A14}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>lokivpn</RootNamespace>
|
||||
<AssemblyName>lokivpn</AssemblyName>
|
||||
<RootNamespace>network.loki.lokinet.win32.ui</RootNamespace>
|
||||
<AssemblyName>lokinetui</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
|
@ -46,6 +46,19 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="LogDumper.cs" />
|
||||
<Compile Include="dlgBootstrap.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="dlgBootstrap.Designer.cs">
|
||||
<DependentUpon>dlgBootstrap.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserSettings.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UserSettings.Designer.cs">
|
||||
<DependentUpon>UserSettings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UIMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -54,6 +67,12 @@
|
|||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="dlgBootstrap.resx">
|
||||
<DependentUpon>dlgBootstrap.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UserSettings.resx">
|
||||
<DependentUpon>UserSettings.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UIMain.resx">
|
||||
<DependentUpon>UIMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -65,6 +84,7 @@
|
|||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="App.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
|
@ -81,4 +101,12 @@
|
|||
<Content Include="lokinet.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>$(SolutionDir)versioning\NetRevisionTool /info /patch "$(ProjectDir)"
|
||||
$(SolutionDir)versioning\release.bat</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>$(SolutionDir)versioning\NetRevisionTool /restore "$(ProjectDir)"
|
||||
$(SolutionDir)versioning\unpatch.bat</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
Binary file not shown.
|
@ -0,0 +1,4 @@
|
|||
REM this requires some kind of cygwin toolset in $PATH
|
||||
REM or just having sed(1) at a minimum
|
||||
set /P RELEASE_NAME=<..\..\..\motto.txt
|
||||
sed -i 's/RELEASE_CODENAME/%RELEASE_NAME%/g' ..\..\Properties\AssemblyInfo.cs
|
|
@ -0,0 +1,4 @@
|
|||
REM this requires some kind of cygwin toolset in $PATH
|
||||
REM or just having sed(1) at a minimum
|
||||
set /P RELEASE_NAME=<..\..\..\motto.txt
|
||||
sed -i 's/%RELEASE_NAME%/RELEASE_CODENAME/g' ..\..\Properties\AssemblyInfo.cs
|
|
@ -5,12 +5,13 @@
|
|||
#define MyAppVersion "0.4.0"
|
||||
#define MyAppPublisher "Loki Project"
|
||||
#define MyAppURL "https://loki.network"
|
||||
#define MyAppExeName "lokinet.exe"
|
||||
#define MyAppExeName "lokinetui.exe"
|
||||
; change this to avoid compiler errors -despair
|
||||
#ifndef DevPath
|
||||
#define DevPath "D:\dev\external\llarp\"
|
||||
#endif
|
||||
#include <idp.iss>
|
||||
#include <idp.iss>
|
||||
#include "version.txt"
|
||||
|
||||
; see ../LICENSE
|
||||
|
||||
|
@ -36,11 +37,11 @@ Compression=lzma
|
|||
SolidCompression=yes
|
||||
VersionInfoVersion=0.4.0
|
||||
VersionInfoCompany=Loki Project
|
||||
VersionInfoDescription=lokinet for windows
|
||||
VersionInfoTextVersion=0.4.0-dev
|
||||
VersionInfoProductName=loki-network
|
||||
VersionInfoDescription=LokiNET for Microsoft® Windows® NT™
|
||||
VersionInfoTextVersion=0.4.0-dev-{#VCSRev}
|
||||
VersionInfoProductName=LokiNET
|
||||
VersionInfoProductVersion=0.4.0
|
||||
VersionInfoProductTextVersion=0.4.0-dev
|
||||
VersionInfoProductTextVersion=0.4.0-dev-{#VCSRev}
|
||||
InternalCompressLevel=ultra64
|
||||
MinVersion=0,5.0
|
||||
ArchitecturesInstallIn64BitMode=x64
|
||||
|
@ -57,15 +58,28 @@ Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescrip
|
|||
; only one of these is installed
|
||||
#ifdef SINGLE_ARCH
|
||||
Source: "{#DevPath}build\lokinet.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "{#DevPath}build\liblokinet-shared.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
#else
|
||||
Source: "{#DevPath}build\lokinet.exe"; DestDir: "{app}"; Flags: ignoreversion 32bit; Check: not IsWin64
|
||||
Source: "{#DevPath}build\liblokinet-shared.dll"; DestDir: "{app}"; Flags: ignoreversion 32bit; Check: not IsWin64
|
||||
Source: "{#DevPath}build64\lokinet.exe"; DestDir: "{app}"; Flags: ignoreversion 64bit; Check: IsWin64
|
||||
Source: "{#DevPath}build64\liblokinet-shared.dll"; DestDir: "{app}"; Flags: ignoreversion 64bit; Check: IsWin64
|
||||
#endif
|
||||
; UI has landed!
|
||||
#ifndef RELEASE
|
||||
Source: "{#DevPath}ui-win32\bin\debug\lokinetui.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "{#DevPath}ui-win32\bin\debug\lokinetui.exe.config"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "{#DevPath}ui-win32\bin\debug\lokinetui.pdb"; DestDir: "{app}"; Flags: ignoreversion
|
||||
#else
|
||||
Source: "{#DevPath}ui-win32\bin\release\lokinetui.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "{#DevPath}ui-win32\bin\release\lokinetui.exe.config"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "{#DevPath}ui-win32\bin\release\lokinetui.pdb"; DestDir: "{app}"; Flags: ignoreversion
|
||||
#endif
|
||||
; eh, might as well ship the 32-bit port of everything else
|
||||
Source: "{#DevPath}build\testAll.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "{#DevPath}LICENSE"; DestDir: "{app}"; Flags: ignoreversion
|
||||
; delet this after finishing setup, we only need it to extract the drivers
|
||||
; and download an initial RC
|
||||
; and download an initial RC. The UI has its own bootstrap built-in!
|
||||
Source: "{#DevPath}lokinet-bootstrap.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
|
||||
Source: "{#DevPath}win32-setup\7z.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
|
||||
; if nonexistent, then inet6 was already installed
|
||||
|
|
Loading…
Reference in New Issue