private static void OpenLogViewer(string pLogFile, string pProcessName)
{
if (!File.Exists(pLogFile)) {
MessageBox.Show("File does not exist:\n" + pLogFile, "File not found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
RegistryKey preferencesKey = RegistryUtil.GetUserKey("Preferences");
string logViewer = (string)preferencesKey.GetValue("LogViewer", "notepad.exe");
string executable = logViewer;
string arguments = "\"" + pLogFile + "\"";
int pos = executable.IndexOf(" ");
if (pos>=0) {
arguments = executable.Substring(pos + 1) + " " + arguments;
executable = executable.Substring(0, pos);
}
string workdir = null;
try {
workdir = Path.GetDirectoryName(executable);
}
catch (Exception) {
// ignore
}
ExecuteCommand(workdir, executable, arguments, pProcessName, true, "log.ico", AEMManager.Properties.Settings.Default.ProcessNameViaShortcut, null);
}