diff --git a/BismNormalizer/AlmToolkit/ComparisonForm.cs b/BismNormalizer/AlmToolkit/ComparisonForm.cs index 1578e1b..b80195d 100644 --- a/BismNormalizer/AlmToolkit/ComparisonForm.cs +++ b/BismNormalizer/AlmToolkit/ComparisonForm.cs @@ -48,37 +48,47 @@ namespace AlmToolkit /// private void InitializeChromium() { - // Check if the page exists - string page = string.Format(@"{0}\html-resources\dist\index.html", Application.StartupPath); - if (!File.Exists(page)) + try { - MessageBox.Show("Error html file doesn't exist : " + page); + // Check if the page exists + string page = string.Format(@"{0}\html-resources\dist\index.html", Application.StartupPath); + if (!File.Exists(page)) + { + MessageBox.Show("Error html file doesn't exist : " + page, Utils.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + CefSettings settings = new CefSettings(); + // Initialize cef with the provided settings + settings.CefCommandLineArgs.Add("disable-gpu", "1"); + + settings.BrowserSubprocessPath = @"x86\CefSharp.BrowserSubprocess.exe"; + //settings.BrowserSubprocessPath = string.Format(@"{0}\x86\CefSharp.BrowserSubprocess.exe", Application.StartupPath); ; + + Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null); + // Create a browser component + chromeBrowser = new ChromiumWebBrowser(page); + // Add it to the form and fill it to the form window. + this.Controls.Add(chromeBrowser); + chromeBrowser.Dock = DockStyle.Fill; + chromeBrowser.BringToFront(); + + CefSharpSettings.LegacyJavascriptBindingEnabled = true; + + // Initialize the interaction variable + _comparisonInter = new ComparisonJSInteraction(this); + + // Register C# objects + chromeBrowser.RegisterAsyncJsObject("chromeDebugger", new ChromeDebugger(chromeBrowser, this)); + chromeBrowser.RegisterAsyncJsObject("comparisonJSInteraction", _comparisonInter); + } + catch (FileNotFoundException) + { + MessageBox.Show("FileNotFoundException in InitializeChromium().\n\nPlease try to install C++ Redistributable Packages for Visual Studio x86, min version www.microsoft.com/download/details.aspx?id=40784", Utils.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (Exception exc) + { + MessageBox.Show(exc.Message, Utils.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Error); } - - CefSettings settings = new CefSettings(); - // Initialize cef with the provided settings - settings.CefCommandLineArgs.Add("disable-gpu", "1"); - - //settings.BrowserSubprocessPath = @"x86\CefSharp.BrowserSubprocess.exe"; - settings.BrowserSubprocessPath = string.Format(@"{0}\x86\CefSharp.BrowserSubprocess.exe", Application.StartupPath); ; - - Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null); - // Create a browser component - chromeBrowser = new ChromiumWebBrowser(page); - // Add it to the form and fill it to the form window. - this.Controls.Add(chromeBrowser); - chromeBrowser.Dock = DockStyle.Fill; - chromeBrowser.BringToFront(); - - CefSharpSettings.LegacyJavascriptBindingEnabled = true; - - // Initialize the interaction variable - _comparisonInter = new ComparisonJSInteraction(this); - - // Register C# objects - chromeBrowser.RegisterAsyncJsObject("chromeDebugger", new ChromeDebugger(chromeBrowser, this)); - chromeBrowser.RegisterAsyncJsObject("comparisonJSInteraction", _comparisonInter); - } private void ComparisonForm_Load(object sender, EventArgs e) diff --git a/BismNormalizer/BismNormalizer/BismNormalizer.IconSetup.exe b/BismNormalizer/BismNormalizer/BismNormalizer.IconSetup.exe index 3d75669..18e4a7c 100644 Binary files a/BismNormalizer/BismNormalizer/BismNormalizer.IconSetup.exe and b/BismNormalizer/BismNormalizer/BismNormalizer.IconSetup.exe differ diff --git a/BismNormalizer/BismNormalizer/BismNormalizer.exe b/BismNormalizer/BismNormalizer/BismNormalizer.exe index 21b2dcc..1e6316d 100644 Binary files a/BismNormalizer/BismNormalizer/BismNormalizer.exe and b/BismNormalizer/BismNormalizer/BismNormalizer.exe differ