Skip to content

Commit

Permalink
Apertus 0.3.14 Release
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
embiimob committed Oct 26, 2017
1 parent eade6c6 commit ea60c46
Show file tree
Hide file tree
Showing 9 changed files with 378 additions and 278 deletions.
2 changes: 2 additions & 0 deletions ADD/ADD.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
<Compile Include="RPC\Response\ListTransactionsResponse.cs" />
<Compile Include="RPC\Response\ValidateAddressResponse.cs" />
<Compile Include="Tools\Search.cs" />
<Compile Include="Tools\WebBrowserHelper.cs" />
<Compile Include="Trust.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -227,6 +228,7 @@
<None Include="Resources\Link.png" />
<None Include="Resources\LinkDisabled.png" />
<None Include="Resources\loading.gif" />
<None Include="Resources\OpenInWeb.png" />
<Content Include="Resources\Splash.png" />
<None Include="Resources\Profile.png" />
<Content Include="Resources\file-icon.png" />
Expand Down
2 changes: 1 addition & 1 deletion ADD/About.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

492 changes: 254 additions & 238 deletions ADD/Main.Designer.cs

Large diffs are not rendered by default.

36 changes: 14 additions & 22 deletions ADD/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Microsoft.Win32;
using System.ComponentModel;
using System.Drawing.Imaging;
using System.Diagnostics;


namespace ADD
Expand Down Expand Up @@ -91,40 +92,22 @@ public Main()
{
InitializeComponent();
Startup();
FixBrowser();
backgroundWorker1.WorkerReportsProgress = true;
splitArchiveTools.SplitterWidth = 10;
}

private void FixBrowser()
{
RegistryKey key;
decimal keyValueDecimal = 11000;
string subKey = "SOFTWARE\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION";


try
{
key = Registry.CurrentUser.CreateSubKey(subKey);
key.SetValue(Path.GetFileName(Application.ExecutablePath), keyValueDecimal, RegistryValueKind.DWord);
key.SetValue("ADD.vshost.exe", keyValueDecimal, RegistryValueKind.DWord);

key.Close();

}
catch (Exception ex)
{
}
}



public void Startup()
{
Tools.WebBrowserHelper.FixBrowserVersion();
tmrProcessBatch.Start();
characterMap = glyphTypeface.CharacterToGlyphMap;
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('|');
URLSecurityZoneAPI.InternetSetFeatureEnabled(URLSecurityZoneAPI.InternetFeaturelist.DISABLE_NAVIGATION_SOUNDS, URLSecurityZoneAPI.SetFeatureOn.PROCESS, true);



}

private char GetRandomDivider()
Expand Down Expand Up @@ -890,6 +873,7 @@ private void Form1_Load(object sender, EventArgs e)
tmrStatusUpdate.Start();
LoadUserPref();
LoadFavorites();


}

Expand Down Expand Up @@ -4470,6 +4454,14 @@ private void imgOptionsOpen_Click(object sender, EventArgs e)
Properties.Settings.Default.HideOptions = false;
Properties.Settings.Default.Save();
}

private void imgOpenInBrowserButton_Click(object sender, EventArgs e)
{
if (webBrowser1.Url.ToString() != null)
{
Process.Start(webBrowser1.Url.ToString());
}
}
}

}
2 changes: 1 addition & 1 deletion ADD/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// 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.3.13")]
[assembly: AssemblyVersion("0.3.14")]
10 changes: 10 additions & 0 deletions ADD/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 19 additions & 16 deletions ADD/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Friend" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Friend.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FriendDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FriendDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand All @@ -130,9 +127,6 @@
<data name="OpenLeftDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OpenLeftDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="OpenDown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OpenDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LinkDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LinkDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand All @@ -145,46 +139,55 @@
<data name="OpenRightDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OpenRightDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Trash" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Trash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tip" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Tip.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Button2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Attach.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TipDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\TipDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="star" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="loading" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Link" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="OpenRight" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OpenRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="OpenUp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OpenUp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Button2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Attach.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="star" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Splash" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Splash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TrashDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\TrashDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Link" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="OpenDown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OpenDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="home" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Profile" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Profile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Trash" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Trash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Friend" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Friend.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="loading" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="OpenInWeb" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OpenInWeb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added ADD/Resources/OpenInWeb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions ADD/Tools/WebBrowserHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ADD.Tools
{
public class WebBrowserHelper
{


public static int GetEmbVersion()
{
int BrowserVer;

// get the installed IE version
using (WebBrowser Wb = new WebBrowser())
BrowserVer = Wb.Version.Major;

// set the appropriate IE version
if (BrowserVer >= 11)
return 11001;
else if (BrowserVer == 10)
return 10001;
else if (BrowserVer == 9)
return 9999;
else if (BrowserVer == 8)
return 8888;
else
return 7000;
} // End Function GetEmbVersion

public static void FixBrowserVersion()
{
string appName = System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().Location);
FixBrowserVersion(appName);
}

public static void FixBrowserVersion(string appName)
{
FixBrowserVersion(appName, GetEmbVersion());
} // End Sub FixBrowserVersion

// FixBrowserVersion("<YourAppName>", 9000);
public static void FixBrowserVersion(string appName, int ieVer)
{
FixBrowserVersion_Internal("HKEY_LOCAL_MACHINE", appName + ".exe", ieVer);
FixBrowserVersion_Internal("HKEY_CURRENT_USER", appName + ".exe", ieVer);
FixBrowserVersion_Internal("HKEY_LOCAL_MACHINE", appName + ".vshost.exe", ieVer);
FixBrowserVersion_Internal("HKEY_CURRENT_USER", appName + ".vshost.exe", ieVer);
} // End Sub FixBrowserVersion

private static void FixBrowserVersion_Internal(string root, string appName, int ieVer)
{
try
{
//For 64 bit Machine
if (Environment.Is64BitOperatingSystem)
Microsoft.Win32.Registry.SetValue(root + @"\Software\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", appName, ieVer);
else //For 32 bit Machine
Microsoft.Win32.Registry.SetValue(root + @"\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", appName, ieVer);


}
catch (Exception)
{
// some config will hit access rights exceptions
// this is why we try with both LOCAL_MACHINE and CURRENT_USER
}
} // End Sub FixBrowserVersion_Internal




}
}

0 comments on commit ea60c46

Please sign in to comment.