From 9aefa32964ef67e11b3ee6b57aa375d0e9a19d55 Mon Sep 17 00:00:00 2001 From: Rick V Date: Mon, 16 Dec 2019 18:48:35 -0600 Subject: [PATCH 1/2] update netid on windows side --- ui-win32/dlgBootstrap.cs | 2 +- ui-win32/dlgBootstrap.resx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-win32/dlgBootstrap.cs b/ui-win32/dlgBootstrap.cs index c2d784405..51b5464ce 100644 --- a/ui-win32/dlgBootstrap.cs +++ b/ui-win32/dlgBootstrap.cs @@ -33,7 +33,7 @@ namespace network.loki.lokinet.win32.ui ServicePointManager.ServerCertificateValidationCallback += cert_check; ServicePointManager.SecurityProtocol = (SecurityProtocolType)48 | 0 | (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072; wc = new WebClient(); - wc.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.0)"); + wc.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.0); lokinet-win32-managed-ui/0.6"); wc.DownloadFile(uriBox.Text, string.Format("{0}{1}{2}", default_path, Path.DirectorySeparatorChar, rcName)); MessageBox.Show("LokiNET node bootstrapped", "LokiNET", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult = DialogResult.OK; diff --git a/ui-win32/dlgBootstrap.resx b/ui-win32/dlgBootstrap.resx index eab9d99c3..d1152d86d 100644 --- a/ui-win32/dlgBootstrap.resx +++ b/ui-win32/dlgBootstrap.resx @@ -160,7 +160,7 @@ 1 - https://seed.lokinet.org/bootstrap.signed + https://seed.lokinet.org/lokinet.signed uriBox From 5d9225dbf90986f6c231b6994c3652402142af2b Mon Sep 17 00:00:00 2001 From: Rick V Date: Mon, 16 Dec 2019 18:59:45 -0600 Subject: [PATCH 2/2] do not hardcode version into user-agent string --- ui-win32/dlgBootstrap.cs | 7 ++++++- win32-setup/lokinet-win32.iss | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ui-win32/dlgBootstrap.cs b/ui-win32/dlgBootstrap.cs index 51b5464ce..5ae172a4c 100644 --- a/ui-win32/dlgBootstrap.cs +++ b/ui-win32/dlgBootstrap.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.IO; using System.Net; using System.Net.Security; +using System.Reflection; using System.Security.Cryptography.X509Certificates; using System.Windows.Forms; @@ -27,13 +28,17 @@ namespace network.loki.lokinet.win32.ui private void button1_Click(object sender, EventArgs e) { Directory.CreateDirectory(default_path); + var build = ((AssemblyInformationalVersionAttribute)Assembly + .GetAssembly(typeof(main_frame)) + .GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false)[0]) + .InformationalVersion; // add something more unique, this is the IE 5.0 default string try { ServicePointManager.ServerCertificateValidationCallback += cert_check; ServicePointManager.SecurityProtocol = (SecurityProtocolType)48 | 0 | (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072; wc = new WebClient(); - wc.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.0); lokinet-win32-managed-ui/0.6"); + wc.Headers.Add("User-Agent", string.Format("Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.0); lokinet-win32-managed-ui/{0}", build)); wc.DownloadFile(uriBox.Text, string.Format("{0}{1}{2}", default_path, Path.DirectorySeparatorChar, rcName)); MessageBox.Show("LokiNET node bootstrapped", "LokiNET", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult = DialogResult.OK; diff --git a/win32-setup/lokinet-win32.iss b/win32-setup/lokinet-win32.iss index 091856b54..da1d5325f 100644 --- a/win32-setup/lokinet-win32.iss +++ b/win32-setup/lokinet-win32.iss @@ -201,7 +201,7 @@ Filename: "{app}\{#MyAppExeName}"; Flags: nowait postinstall skipifsilent; Descr Filename: "{tmp}\7z.exe"; Parameters: "x tuntapv9.7z"; WorkingDir: "{app}"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "extract TUN/TAP-v9 driver"; StatusMsg: "Extracting driver..."; OnlyBelowVersion: 0, 6.0 Filename: "{tmp}\7z.exe"; Parameters: "x tuntapv9_n6.7z"; WorkingDir: "{app}"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "extract TUN/TAP-v9 driver"; StatusMsg: "Extracting driver..."; MinVersion: 0, 6.0 Filename: "{tmp}\7z.exe"; Parameters: "x inet6.7z"; WorkingDir: "{app}"; Flags: skipifdoesntexist runascurrentuser waituntilterminated skipifdoesntexist; Description: "extract inet6 driver"; StatusMsg: "Extracting IPv6 driver..."; MinVersion: 0, 5.0; OnlyBelowVersion: 0, 5.1 -Filename: "{app}\lokinet-bootstrap.exe"; Parameters:"-L https://seed.lokinet.org/bootstrap.signed --cacert rootcerts.pem -o ""{userappdata}\.lokinet\bootstrap.signed"""; WorkingDir: "{app}"; Flags: runascurrentuser waituntilterminated; Description: "bootstrap dht"; StatusMsg: "Downloading initial RC..." +Filename: "{app}\lokinet-bootstrap.exe"; Parameters:"-L https://seed.lokinet.org/lokinet.signed --cacert rootcerts.pem -o ""{userappdata}\.lokinet\bootstrap.signed"""; WorkingDir: "{app}"; Flags: runascurrentuser waituntilterminated; Description: "bootstrap dht"; StatusMsg: "Downloading initial RC..." ; then ask to install drivers Filename: "{app}\tap-windows-9.9.2\install.bat"; WorkingDir: "{app}\tap-windows-9.9.2\"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "Install TUN/TAP-v9 driver"; StatusMsg: "Installing driver..."; OnlyBelowVersion: 0, 6.0; Check: not IsTapInstalled Filename: "{app}\tap-windows-9.21.2\install.bat"; WorkingDir: "{app}\tap-windows-9.21.2\"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "Install TUN/TAP-v9 driver"; StatusMsg: "Installing driver..."; MinVersion: 0, 6.0; Check: not IsTapInstalled