From 32588b3d840280eef8c0aaf6bf930412fcd2b985 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 18 May 2015 20:30:54 -0700 Subject: A visit to the Windows house of pain: (1) Yes, you *can* create a mixed 32/64 bit Windows MSI installer that installs drivers. All you have to do is... umm... create individual sub-MSI files for each driver (one for 32, one for 64) and then package those in the main MSI files as "chained" MSI installers. Each of these must only be considered a prerequisite on 32 or 64 bit machines, respectively. (2) Upgrade Advanced Installer version, add rules to uninstall NDIS6 tap device on uninstall. (3) Fix IE issue in UI code. --- .../tap-windows-ndis6/x64/ZeroTierOne_NDIS6_x64.msi | Bin 0 -> 1454080 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ext/bin/tap-windows-ndis6/x64/ZeroTierOne_NDIS6_x64.msi (limited to 'ext/bin') diff --git a/ext/bin/tap-windows-ndis6/x64/ZeroTierOne_NDIS6_x64.msi b/ext/bin/tap-windows-ndis6/x64/ZeroTierOne_NDIS6_x64.msi new file mode 100644 index 00000000..7e6fc426 Binary files /dev/null and b/ext/bin/tap-windows-ndis6/x64/ZeroTierOne_NDIS6_x64.msi differ -- cgit v1.2.3 From b4a34cc1057d799450a32f9e910dde779506ce45 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 19 May 2015 13:01:55 -0700 Subject: Add 32-bit chained MSI for NDIS6 driver... now to go test on 32-bit Windows (clean). (And Windows 10, and Windows Server, and ...) --- .../x86/ZeroTierOne_NDIS6_x86.msi | Bin 0 -> 1070592 bytes ...roTier One Virtual Network Port (NDIS6_x86).aip | 157 +++++++++++++++++++++ ext/installfiles/windows/ZeroTier One.aip | 6 +- 3 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 ext/bin/tap-windows-ndis6/x86/ZeroTierOne_NDIS6_x86.msi create mode 100644 ext/installfiles/windows/ZeroTier One Virtual Network Port (NDIS6_x86).aip (limited to 'ext/bin') diff --git a/ext/bin/tap-windows-ndis6/x86/ZeroTierOne_NDIS6_x86.msi b/ext/bin/tap-windows-ndis6/x86/ZeroTierOne_NDIS6_x86.msi new file mode 100644 index 00000000..80b330a8 Binary files /dev/null and b/ext/bin/tap-windows-ndis6/x86/ZeroTierOne_NDIS6_x86.msi differ diff --git a/ext/installfiles/windows/ZeroTier One Virtual Network Port (NDIS6_x86).aip b/ext/installfiles/windows/ZeroTier One Virtual Network Port (NDIS6_x86).aip new file mode 100644 index 00000000..5936875a --- /dev/null +++ b/ext/installfiles/windows/ZeroTier One Virtual Network Port (NDIS6_x86).aip @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ext/installfiles/windows/ZeroTier One.aip b/ext/installfiles/windows/ZeroTier One.aip index 59d58b1a..aef8ba5a 100644 --- a/ext/installfiles/windows/ZeroTier One.aip +++ b/ext/installfiles/windows/ZeroTier One.aip @@ -23,7 +23,7 @@ - + @@ -107,10 +107,12 @@ - + + + -- cgit v1.2.3 From 44d1bd14bd2f9c22fee6b57ac3df4018db146e1d Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 19 May 2015 14:48:57 -0700 Subject: Enable right-click menu for copy/paste/etc. in Windows UI wrapper. --- ext/bin/win-ui-wrapper/ZeroTier One.exe | Bin 0 -> 761304 bytes ext/installfiles/windows/ZeroTier One.aip | 2 +- ext/win-ui-wrapper/ZeroTier One.exe | Bin 761304 -> 0 bytes windows/WebUIWrapper/Form1.Designer.cs | 11 ++++++----- 4 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 ext/bin/win-ui-wrapper/ZeroTier One.exe delete mode 100644 ext/win-ui-wrapper/ZeroTier One.exe (limited to 'ext/bin') diff --git a/ext/bin/win-ui-wrapper/ZeroTier One.exe b/ext/bin/win-ui-wrapper/ZeroTier One.exe new file mode 100644 index 00000000..50eec7d6 Binary files /dev/null and b/ext/bin/win-ui-wrapper/ZeroTier One.exe differ diff --git a/ext/installfiles/windows/ZeroTier One.aip b/ext/installfiles/windows/ZeroTier One.aip index aef8ba5a..bab72e04 100644 --- a/ext/installfiles/windows/ZeroTier One.aip +++ b/ext/installfiles/windows/ZeroTier One.aip @@ -81,7 +81,7 @@ - + diff --git a/ext/win-ui-wrapper/ZeroTier One.exe b/ext/win-ui-wrapper/ZeroTier One.exe deleted file mode 100644 index 3e129be7..00000000 Binary files a/ext/win-ui-wrapper/ZeroTier One.exe and /dev/null differ diff --git a/windows/WebUIWrapper/Form1.Designer.cs b/windows/WebUIWrapper/Form1.Designer.cs index 8d8eb9e9..81d69cd0 100644 --- a/windows/WebUIWrapper/Form1.Designer.cs +++ b/windows/WebUIWrapper/Form1.Designer.cs @@ -36,20 +36,21 @@ // this.webContainer.AllowNavigation = false; this.webContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.webContainer.IsWebBrowserContextMenuEnabled = false; this.webContainer.Location = new System.Drawing.Point(0, 0); - this.webContainer.MinimumSize = new System.Drawing.Size(20, 20); + this.webContainer.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.webContainer.MinimumSize = new System.Drawing.Size(18, 16); this.webContainer.Name = "webContainer"; - this.webContainer.Size = new System.Drawing.Size(1012, 556); + this.webContainer.Size = new System.Drawing.Size(900, 445); this.webContainer.TabIndex = 0; // // Form1 // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1012, 556); + this.ClientSize = new System.Drawing.Size(900, 445); this.Controls.Add(this.webContainer); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Name = "Form1"; this.Text = "ZeroTier One"; this.Load += new System.EventHandler(this.Form1_Load); -- cgit v1.2.3 From 63cea7d337a55fed8333a3aaf3d1d5bb50a03018 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 19 May 2015 16:02:26 -0700 Subject: Try to automatically enable access to http://127.0.0.1 in web wrapper if IE is in enhanced security mode. --- ext/bin/win-ui-wrapper/ZeroTier One.exe | Bin 761304 -> 763352 bytes windows/WebUIWrapper/Program.cs | 70 ++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) (limited to 'ext/bin') diff --git a/ext/bin/win-ui-wrapper/ZeroTier One.exe b/ext/bin/win-ui-wrapper/ZeroTier One.exe index 50eec7d6..622b5b36 100644 Binary files a/ext/bin/win-ui-wrapper/ZeroTier One.exe and b/ext/bin/win-ui-wrapper/ZeroTier One.exe differ diff --git a/windows/WebUIWrapper/Program.cs b/windows/WebUIWrapper/Program.cs index 3dfdb94f..bfcdb831 100644 --- a/windows/WebUIWrapper/Program.cs +++ b/windows/WebUIWrapper/Program.cs @@ -3,17 +3,87 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; +using System.Runtime.InteropServices; +using System.ComponentModel; namespace WebUIWrapper { + [ComImport, GuidAttribute("79EAC9EE-BAF9-11CE-8C82-00AA004BA90B"), + InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + public interface IInternetSecurityManager + { + [return: MarshalAs(UnmanagedType.I4)] + [PreserveSig] + int SetSecuritySite([In] IntPtr pSite); + + [return: MarshalAs(UnmanagedType.I4)] + [PreserveSig] + int GetSecuritySite([Out] IntPtr pSite); + + [return: MarshalAs(UnmanagedType.I4)] + [PreserveSig] + int MapUrlToZone([In, MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, out UInt32 pdwZone, UInt32 dwFlags); + + [return: MarshalAs(UnmanagedType.I4)] + [PreserveSig] + int GetSecurityId([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, [MarshalAs(UnmanagedType.LPArray)] byte[] pbSecurityId, ref UInt32 pcbSecurityId, uint dwReserved); + + [return: MarshalAs(UnmanagedType.I4)] + [PreserveSig] + int ProcessUrlAction([In, MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, UInt32 dwAction, out byte pPolicy, UInt32 cbPolicy, byte pContext, UInt32 cbContext, UInt32 dwFlags, UInt32 dwReserved); + + [return: MarshalAs(UnmanagedType.I4)] + [PreserveSig] + int QueryCustomPolicy([In, MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, ref Guid guidKey, ref byte ppPolicy, ref UInt32 pcbPolicy, ref byte pContext, UInt32 cbContext, UInt32 dwReserved); + + [return: MarshalAs(UnmanagedType.I4)] + [PreserveSig] + int SetZoneMapping(UInt32 dwZone, [In, MarshalAs(UnmanagedType.LPWStr)] string lpszPattern, UInt32 dwFlags); + + [return: MarshalAs(UnmanagedType.I4)] + [PreserveSig] + int GetZoneMappings(UInt32 dwZone, out UCOMIEnumString ppenumString, UInt32 dwFlags); + } + static class Program { + // constants from urlmon.h + public const UInt32 URLZONE_LOCAL_MACHINE = 0; + public const UInt32 URLZONE_INTRANET = URLZONE_LOCAL_MACHINE + 1; + public const UInt32 URLZONE_TRUSTED = URLZONE_INTRANET + 1; + public const UInt32 URLZONE_INTERNET = URLZONE_TRUSTED + 1; + public const UInt32 URLZONE_UNTRUSTED = URLZONE_INTERNET + 1; + public const UInt32 URLZONE_ESC_FLAG = 0x100; + public const UInt32 SZM_CREATE = 0; + public const UInt32 SZM_DELETE = 0x1; + + public static Guid CLSID_InternetSecurityManager = new Guid("7b8a2d94-0ac9-11d1-896c-00c04fb6bfc4"); + public static Guid IID_IInternetSecurityManager = new Guid("79eac9ee-baf9-11ce-8c82-00aa004ba90b"); + /// /// The main entry point for the application. /// [STAThread] static void Main() { + try + { + Type t = Type.GetTypeFromCLSID(CLSID_InternetSecurityManager); + object securityManager = Activator.CreateInstance(t); + if (securityManager != null) + { + IInternetSecurityManager ism = (IInternetSecurityManager)securityManager; + ism.SetZoneMapping(URLZONE_TRUSTED, "http://127.0.0.1", SZM_CREATE); + ism.SetZoneMapping(URLZONE_INTRANET, "http://127.0.0.1", SZM_CREATE); + ism.SetZoneMapping(URLZONE_ESC_FLAG | URLZONE_TRUSTED, "http://127.0.0.1", SZM_CREATE); + ism.SetZoneMapping(URLZONE_ESC_FLAG | URLZONE_INTRANET, "http://127.0.0.1", SZM_CREATE); + } + } + catch + { + // Okay to continue if adding URL to trusted zone doesn't work... + } + Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); -- cgit v1.2.3