diff --git a/ui-win32/dlgBootstrap.cs b/ui-win32/dlgBootstrap.cs index 51c9196ef..474d8c649 100644 --- a/ui-win32/dlgBootstrap.cs +++ b/ui-win32/dlgBootstrap.cs @@ -24,18 +24,18 @@ namespace network.loki.lokinet.win32.ui private string default_path; private void button1_Click(object sender, EventArgs e) { - ServicePointManager.ServerCertificateValidationCallback += cert_check; - ServicePointManager.SecurityProtocol = (SecurityProtocolType)48 | 0 | (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072; - 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 - { + { + 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.DownloadFile(uriBox.Text, default_path); MessageBox.Show("LokiNET node bootstrapped", "LokiNET", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult = DialogResult.OK; } - catch (NotSupportedException ex) + catch (Exception ex) { string lokinetExeString; Process lokinet_bootstrap = new Process(); @@ -49,20 +49,20 @@ namespace network.loki.lokinet.win32.ui lokinet_bootstrap.StartInfo.CreateNoWindow = true; lokinet_bootstrap.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory(); lokinet_bootstrap.StartInfo.FileName = lokinetExeString; - lokinet_bootstrap.StartInfo.Arguments = string.Format("--cacert rootcerts.pem -L {0} --output {1}", uriBox.Text, default_path); + lokinet_bootstrap.StartInfo.Arguments = string.Format("--cacert rootcerts.pem -L {0} --output \"{1}\"", uriBox.Text, default_path); lokinet_bootstrap.Start(); lokinet_bootstrap.WaitForExit(); if (lokinet_bootstrap.ExitCode == 0) + { DialogResult = DialogResult.OK; + MessageBox.Show("LokiNET node bootstrapped", "LokiNET", MessageBoxButtons.OK, MessageBoxIcon.Information); + } else - throw (ex); // pass the original exception back to the caller, TLS failed + { + MessageBox.Show(string.Format("An error occured while downloading data. {0}", ex.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); + DialogResult = DialogResult.Abort; + } } - catch (Exception ex) - { - MessageBox.Show(string.Format("An error occured while downloading data. {0}", ex.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); - DialogResult = DialogResult.Abort; - } - wc.Dispose(); Close(); } diff --git a/win32-setup/lokinet-win32.iss b/win32-setup/lokinet-win32.iss index e5e0e9149..6f5ac3569 100644 --- a/win32-setup/lokinet-win32.iss +++ b/win32-setup/lokinet-win32.iss @@ -226,7 +226,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 --output {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/bootstrap.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