From cc30214d31ea50fd8822cae85f9d43e5eded941f Mon Sep 17 00:00:00 2001 From: John Date: Tue, 6 Dec 2016 16:32:12 +0000 Subject: [PATCH] Additional logic to try to start up the equation editor, modified message box and added to error log if it could not be started. B2016-278 --- PROMS/Volian.Controls.Library/StepTabRibbon.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 4f96a1c4..2b33b37a 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -1027,7 +1027,10 @@ namespace Volian.Controls.Library // launch equation editor string EqnEdt = GetEqnEdt(); if (EqnEdt == null) - MessageBox.Show("Equation Editor is not correctly configured in the registry.", "Warning", MessageBoxButtons.OK); + { + _MyLog.WarnFormat("Equation Editor is not correctly configured in the registry."); + MessageBox.Show("The Equation Editor needs to be started.", "Reminder", MessageBoxButtons.OK); + } else Process.Start(EqnEdt); _MyEditItem.AddChild((E_FromType)fromtype, contenttype); @@ -1051,6 +1054,17 @@ namespace Volian.Controls.Library } catch (Exception ex) { + string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); + folderPath += @"\Common Files\Microsoft Shared\EQUATION\EQNEDT32.EXE"; + System.IO.FileInfo fi = new System.IO.FileInfo(folderPath); + if (fi.Exists) return fi.FullName; + folderPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles).Replace(" (x86)", ""); + folderPath += @"\Common Files\Microsoft Shared\EQUATION\EQNEDT32.EXE"; + fi = new System.IO.FileInfo(folderPath); + if (fi.Exists) return fi.FullName; + folderPath = @"C:\Program Files\Common Files\Microsoft Shared\EQUATION\EQNEDT32.EXE"; + fi = new System.IO.FileInfo(folderPath); + if (fi.Exists) return fi.FullName; return null; } return retval;