private void OnShowExplorer(object sender, RoutedEventArgs e) { string filename; if (GetSelectedFileName(out filename)) { ProcessInfoTools.ShowExplorer(System.IO.Path.GetDirectoryName(filename)); } }
private void OnShowProperties(object sender, RoutedEventArgs e) { string filename; if (GetSelectedFileName(out filename)) { ProcessInfoTools.ShowFileProperties(filename); } }
public void ShowSystemProperties(object sender, RoutedEventArgs e) { if (HasFilenames) { foreach (DataObject o in MainListView.SelectedItems) { ProcessInfoTools.ShowFileProperties(o.FileName); } } }
private void OnShowDependencies(object sender, RoutedEventArgs e) { string dependencyViewer; if (ProcessInfoTools.FindExecutable("depends.exe", out dependencyViewer)) { string filename; if (GetSelectedFileName(out filename)) { Process.Start(dependencyViewer, string.Format("\"{0}\"", filename)); } } else { MessageBox.Show("Unable to find DEPENDS.EXE", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error); } }
/// <summary> /// This program finds an executable on the PATH. It can also find other stuff on the path, but /// mostly it finds the executable.s /// </summary> /// <param name="args"></param> private void Run(string[] args) { Console.OutputEncoding = Encoding.GetEncoding(Encoding.Default.CodePage); Args = new InputArgs("su", string.Format(resource.IDS_TITLE, AppVersion.Get()) + "\r\n" + resource.IDS_COPYRIGHT); Args.Add(InputArgType.Parameter, "cmd", "cmd.exe", Presence.Optional, resource.IDS_DOC_cmd_param); if (Args.Process(args)) { string command = Args.GetString("cmd"); if (command.Equals("cmd.exe", StringComparison.OrdinalIgnoreCase)) { if (!IsAdministrator()) { ProcessStartInfo startInfo = new ProcessStartInfo(Path.Combine(Environment.SystemDirectory, "cmd.exe")); startInfo.Verb = "runas"; startInfo.WorkingDirectory = Environment.CurrentDirectory; startInfo.Arguments = string.Format("/K \"cd /d {0}\"", startInfo.WorkingDirectory); System.Diagnostics.Process.Start(startInfo); } else { Console.WriteLine(resource.IDS_ERR_AlreadyRunningAsAdministrator); } } else { string exe; if (ProcessInfoTools.FindExecutable(command, out exe)) { ProcessStartInfo startInfo = new ProcessStartInfo(exe); startInfo.Verb = "runas"; startInfo.WorkingDirectory = Environment.CurrentDirectory; System.Diagnostics.Process.Start(startInfo); } else { Console.WriteLine(resource.IDS_ERR_UnableToFindFile, command); } } } }
public bool BringUpTerminalInInstallLocation() { return(ProcessInfoTools.ShowTerminal(InstallLocation)); }
public bool BringUpExplorerInInstallLocation() { return(ProcessInfoTools.ShowExplorer(InstallLocation)); }
private void OnBrowseFilename(object sender, RoutedEventArgs e) { ProcessInfoTools.ShowExplorer(TbInstallLocation.Text); }
public bool ShowRegistryEditor() { return(ProcessInfoTools.ShowRegistryEditor(RegistryKey)); }
public bool ShowRegistryEditor() { return(ProcessInfoTools.ShowRegistryEditor(string.Format("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\{0}", InternalID))); }