diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index 9e28a72bd..45424cccb 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.ComponentModel; using System.IO; using System.Runtime.CompilerServices; @@ -585,7 +586,7 @@ namespace Flow.Launcher.Plugin /// Start a process with the given file path and arguments /// /// - /// It can help to start a deelevated process when Flow is running as administrator. + /// It can help to start a deelevated process and show user account control dialog when Flow is running as administrator. /// /// Absolute file path. It can be an executable file or a script file /// Working directory. If not specified, the current directory will be used @@ -594,5 +595,19 @@ namespace Flow.Launcher.Plugin /// The verb to use when starting the process, e.g. "runas" for elevated permissions. If not specified, no verb will be used. /// Whether process is started successfully public bool StartProcess(string filePath, string workingDirectory = "", string arguments = "", bool useShellExecute = true, string verb = ""); + + /// + /// Start a process with the given file path and arguments + /// + /// + /// It can help to start a deelevated process and show user account control dialog when Flow is running as administrator. + /// + /// Absolute file path. It can be an executable file or a script file + /// Working directory. If not specified, the current directory will be used + /// Optional arguments to pass to the process. If not specified, no arguments will be passed + /// Whether to use shell to execute the process. + /// The verb to use when starting the process, e.g. "runas" for elevated permissions. If not specified, no verb will be used. + /// Whether process is started successfully + public bool StartProcess(string filePath, string workingDirectory = "", Collection argumentList = null, bool useShellExecute = true, string verb = ""); } } diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 877e3feef..4275e36a1 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics; @@ -617,6 +618,9 @@ namespace Flow.Launcher } } + public bool StartProcess(string filePath, string workingDirectory = "", Collection argumentList = null, bool useShellExecute = true, string verb = "") => + StartProcess(filePath, workingDirectory, argumentList == null ? string.Empty : string.Join(" ", argumentList), useShellExecute, verb); + #endregion #region Private Methods