Skip to content

Commit ea60c46

Browse files
committed
Apertus 0.3.14 Release
added a button that pops open your current default browser window to display anything currently in the embeded browser as it has security limitations If run with sufficent privlidges it will now do a better job at setting the appropriate registry settings for IE Browser emulation.
1 parent eade6c6 commit ea60c46

9 files changed

Lines changed: 378 additions & 278 deletions

File tree

ADD/ADD.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
<Compile Include="RPC\Response\ListTransactionsResponse.cs" />
115115
<Compile Include="RPC\Response\ValidateAddressResponse.cs" />
116116
<Compile Include="Tools\Search.cs" />
117+
<Compile Include="Tools\WebBrowserHelper.cs" />
117118
<Compile Include="Trust.cs">
118119
<SubType>Form</SubType>
119120
</Compile>
@@ -227,6 +228,7 @@
227228
<None Include="Resources\Link.png" />
228229
<None Include="Resources\LinkDisabled.png" />
229230
<None Include="Resources\loading.gif" />
231+
<None Include="Resources\OpenInWeb.png" />
230232
<Content Include="Resources\Splash.png" />
231233
<None Include="Resources\Profile.png" />
232234
<Content Include="Resources\file-icon.png" />

ADD/About.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ADD/Main.Designer.cs

Lines changed: 254 additions & 238 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ADD/Main.cs

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using Microsoft.Win32;
1919
using System.ComponentModel;
2020
using System.Drawing.Imaging;
21+
using System.Diagnostics;
2122

2223

2324
namespace ADD
@@ -91,40 +92,22 @@ public Main()
9192
{
9293
InitializeComponent();
9394
Startup();
94-
FixBrowser();
9595
backgroundWorker1.WorkerReportsProgress = true;
9696
splitArchiveTools.SplitterWidth = 10;
9797
}
9898

99-
private void FixBrowser()
100-
{
101-
RegistryKey key;
102-
decimal keyValueDecimal = 11000;
103-
string subKey = "SOFTWARE\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION";
104-
105-
106-
try
107-
{
108-
key = Registry.CurrentUser.CreateSubKey(subKey);
109-
key.SetValue(Path.GetFileName(Application.ExecutablePath), keyValueDecimal, RegistryValueKind.DWord);
110-
key.SetValue("ADD.vshost.exe", keyValueDecimal, RegistryValueKind.DWord);
111-
112-
key.Close();
113-
114-
}
115-
catch (Exception ex)
116-
{
117-
}
118-
}
119-
99+
120100

121101
public void Startup()
122102
{
103+
Tools.WebBrowserHelper.FixBrowserVersion();
123104
tmrProcessBatch.Start();
124105
characterMap = glyphTypeface.CharacterToGlyphMap;
125106
infoArray = "Apertus immutably stores and interprets data on blockchains.|Never build files or click links from sources you do not trust.|Send a direct message by using @ followed by Address.|Click Help, then info for assistance.|Create a Profile and start sharing your thoughts.|#keywords allow people to discover and follow your causes.|Encrypt items by creating and selecting a Vault.|Signing your archives allows people to trust you.|This is beta software use at your own risk!|Press CTRL while submitting a search to rebuild the cache.|Search by Trans ID, Address, Free Text or #Keyword|Publish your work using a profile, signature, & tip address".Split('|');
126107
URLSecurityZoneAPI.InternetSetFeatureEnabled(URLSecurityZoneAPI.InternetFeaturelist.DISABLE_NAVIGATION_SOUNDS, URLSecurityZoneAPI.SetFeatureOn.PROCESS, true);
127108

109+
110+
128111
}
129112

130113
private char GetRandomDivider()
@@ -890,6 +873,7 @@ private void Form1_Load(object sender, EventArgs e)
890873
tmrStatusUpdate.Start();
891874
LoadUserPref();
892875
LoadFavorites();
876+
893877

894878
}
895879

@@ -4470,6 +4454,14 @@ private void imgOptionsOpen_Click(object sender, EventArgs e)
44704454
Properties.Settings.Default.HideOptions = false;
44714455
Properties.Settings.Default.Save();
44724456
}
4457+
4458+
private void imgOpenInBrowserButton_Click(object sender, EventArgs e)
4459+
{
4460+
if (webBrowser1.Url.ToString() != null)
4461+
{
4462+
Process.Start(webBrowser1.Url.ToString());
4463+
}
4464+
}
44734465
}
44744466

44754467
}

ADD/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.3.13")]
35+
[assembly: AssemblyVersion("0.3.14")]

ADD/Properties/Resources.Designer.cs

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ADD/Properties/Resources.resx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120120
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
121-
<data name="Friend" type="System.Resources.ResXFileRef, System.Windows.Forms">
122-
<value>..\Resources\Friend.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
123-
</data>
124121
<data name="FriendDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
125122
<value>..\Resources\FriendDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126123
</data>
@@ -130,9 +127,6 @@
130127
<data name="OpenLeftDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
131128
<value>..\Resources\OpenLeftDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
132129
</data>
133-
<data name="OpenDown" type="System.Resources.ResXFileRef, System.Windows.Forms">
134-
<value>..\Resources\OpenDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
135-
</data>
136130
<data name="LinkDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
137131
<value>..\Resources\LinkDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
138132
</data>
@@ -145,46 +139,55 @@
145139
<data name="OpenRightDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
146140
<value>..\Resources\OpenRightDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
147141
</data>
142+
<data name="Trash" type="System.Resources.ResXFileRef, System.Windows.Forms">
143+
<value>..\Resources\Trash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
144+
</data>
148145
<data name="Tip" type="System.Resources.ResXFileRef, System.Windows.Forms">
149146
<value>..\Resources\Tip.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
150147
</data>
148+
<data name="Button2" type="System.Resources.ResXFileRef, System.Windows.Forms">
149+
<value>..\Resources\Attach.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
150+
</data>
151151
<data name="Save" type="System.Resources.ResXFileRef, System.Windows.Forms">
152152
<value>..\Resources\Save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
153153
</data>
154154
<data name="TipDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
155155
<value>..\Resources\TipDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
156156
</data>
157-
<data name="star" type="System.Resources.ResXFileRef, System.Windows.Forms">
158-
<value>..\Resources\star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
157+
<data name="loading" type="System.Resources.ResXFileRef, System.Windows.Forms">
158+
<value>..\Resources\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
159+
</data>
160+
<data name="Link" type="System.Resources.ResXFileRef, System.Windows.Forms">
161+
<value>..\Resources\Link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
159162
</data>
160163
<data name="OpenRight" type="System.Resources.ResXFileRef, System.Windows.Forms">
161164
<value>..\Resources\OpenRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
162165
</data>
163166
<data name="OpenUp" type="System.Resources.ResXFileRef, System.Windows.Forms">
164167
<value>..\Resources\OpenUp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
165168
</data>
166-
<data name="Button2" type="System.Resources.ResXFileRef, System.Windows.Forms">
167-
<value>..\Resources\Attach.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
169+
<data name="star" type="System.Resources.ResXFileRef, System.Windows.Forms">
170+
<value>..\Resources\star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
168171
</data>
169172
<data name="Splash" type="System.Resources.ResXFileRef, System.Windows.Forms">
170173
<value>..\Resources\Splash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
171174
</data>
172175
<data name="TrashDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
173176
<value>..\Resources\TrashDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
174177
</data>
175-
<data name="Link" type="System.Resources.ResXFileRef, System.Windows.Forms">
176-
<value>..\Resources\Link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
178+
<data name="OpenDown" type="System.Resources.ResXFileRef, System.Windows.Forms">
179+
<value>..\Resources\OpenDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
177180
</data>
178181
<data name="home" type="System.Resources.ResXFileRef, System.Windows.Forms">
179182
<value>..\Resources\home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
180183
</data>
181184
<data name="Profile" type="System.Resources.ResXFileRef, System.Windows.Forms">
182185
<value>..\Resources\Profile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
183186
</data>
184-
<data name="Trash" type="System.Resources.ResXFileRef, System.Windows.Forms">
185-
<value>..\Resources\Trash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
187+
<data name="Friend" type="System.Resources.ResXFileRef, System.Windows.Forms">
188+
<value>..\Resources\Friend.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
186189
</data>
187-
<data name="loading" type="System.Resources.ResXFileRef, System.Windows.Forms">
188-
<value>..\Resources\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
190+
<data name="OpenInWeb" type="System.Resources.ResXFileRef, System.Windows.Forms">
191+
<value>..\Resources\OpenInWeb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
189192
</data>
190193
</root>

ADD/Resources/OpenInWeb.png

179 Bytes
Loading

ADD/Tools/WebBrowserHelper.cs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Windows.Forms;
6+
7+
namespace ADD.Tools
8+
{
9+
public class WebBrowserHelper
10+
{
11+
12+
13+
public static int GetEmbVersion()
14+
{
15+
int BrowserVer;
16+
17+
// get the installed IE version
18+
using (WebBrowser Wb = new WebBrowser())
19+
BrowserVer = Wb.Version.Major;
20+
21+
// set the appropriate IE version
22+
if (BrowserVer >= 11)
23+
return 11001;
24+
else if (BrowserVer == 10)
25+
return 10001;
26+
else if (BrowserVer == 9)
27+
return 9999;
28+
else if (BrowserVer == 8)
29+
return 8888;
30+
else
31+
return 7000;
32+
} // End Function GetEmbVersion
33+
34+
public static void FixBrowserVersion()
35+
{
36+
string appName = System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().Location);
37+
FixBrowserVersion(appName);
38+
}
39+
40+
public static void FixBrowserVersion(string appName)
41+
{
42+
FixBrowserVersion(appName, GetEmbVersion());
43+
} // End Sub FixBrowserVersion
44+
45+
// FixBrowserVersion("<YourAppName>", 9000);
46+
public static void FixBrowserVersion(string appName, int ieVer)
47+
{
48+
FixBrowserVersion_Internal("HKEY_LOCAL_MACHINE", appName + ".exe", ieVer);
49+
FixBrowserVersion_Internal("HKEY_CURRENT_USER", appName + ".exe", ieVer);
50+
FixBrowserVersion_Internal("HKEY_LOCAL_MACHINE", appName + ".vshost.exe", ieVer);
51+
FixBrowserVersion_Internal("HKEY_CURRENT_USER", appName + ".vshost.exe", ieVer);
52+
} // End Sub FixBrowserVersion
53+
54+
private static void FixBrowserVersion_Internal(string root, string appName, int ieVer)
55+
{
56+
try
57+
{
58+
//For 64 bit Machine
59+
if (Environment.Is64BitOperatingSystem)
60+
Microsoft.Win32.Registry.SetValue(root + @"\Software\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", appName, ieVer);
61+
else //For 32 bit Machine
62+
Microsoft.Win32.Registry.SetValue(root + @"\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", appName, ieVer);
63+
64+
65+
}
66+
catch (Exception)
67+
{
68+
// some config will hit access rights exceptions
69+
// this is why we try with both LOCAL_MACHINE and CURRENT_USER
70+
}
71+
} // End Sub FixBrowserVersion_Internal
72+
73+
74+
75+
76+
}
77+
}

0 commit comments

Comments
 (0)