BzvMA2$}!OZvB%Ls3XM1VYopfGKsU+pJ#MB)8|$8`tgVkCvF&nfQYgJKSTE)#nA
z7Y3n++gA9gxIh9F!{Q#;_7&l*T@(wmD}wngg&ch3Zp2k3_k%Ewg^mqoT~P%y*)W52
zK`M{DlAMJto=zI9KO7;%g5fwEHd3Pvs=I5DdGK
z9ruzEz6n0eq5U$ndyAVDFYN>TAdC^PZ^WeDiC2T5=`vjlop&_nilI%)a7sjupa
zi8uq8&|-w=ey2cUGIx$;q(I%{Vr3{;j!fk2p!I>AyhQP}hrmwxllE?rjiTkdMczXD
zoe;AHDYN|Mm=4;t;Y{sDB9gCqhYzsB0PO}Ly(Ol6+DdCg0v!*ea{GF(aPX5*k1QZXaYUTK|3v&B6|>G^pWsACKWB*
zW4irUOjI49d(1mg7%QP~)n
zBE@cXWQ!NBbMPAI(CuHGEg@gu0OKe6Q56IK^$M_@XfB{z09%cLI|swx!r3t=LfP6-
zK+#(S%-K#|%~ES*4Ix$N?TGD6t`ej^RpbccL)`lHFeJ4-yhFFAKIz74tde_e*sd^x0
z#mYHwMaqgfr2YQ{Lm1Ac*j?@t{vDmKff06vJXl`oMbJ2;wFGNoPzX>!w^HaMQ36)A
z5t$+HR4E(RqqdljjGu3EuXOX7^P&pwOrM%EAK5zJIMzfXLT4xJ7Rmf8S;F#ptW%o-
z`ta4Atyv0;TJq$84d)
z`p7Kx8vt1SSUMwpm{l-HlyKc3^R@^1CN@KDrL2K!gesJ=Bww4b*E;s=&m}}>KZI~=
z)vdqDqxJq}0(!*O?)$V+6r1&NMn_ILO~7aP0+r6eLnYQkacHTyo~G5Wwk+2Sm=AiU
zd*(^aA4L6LrCy+#n-rlIFDYDDDeYoKQ&g18QQXqY@S#N~%BE-hrQ!zaS<*pRXiKKG
oUhciP;KR0+X;$h*QOjg)h1j7wxyqW{gsdOdyRv}Y{}#3X2Mo0v;Q#;t
literal 0
HcmV?d00001
diff --git a/Flow.Launcher.sln b/Flow.Launcher.sln
index e44b23232fb..a0eb09a89bb 100644
--- a/Flow.Launcher.sln
+++ b/Flow.Launcher.sln
@@ -53,8 +53,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE = LICENSE
Scripts\post_build.ps1 = Scripts\post_build.ps1
README.md = README.md
- SolutionAssemblyInfo.cs = SolutionAssemblyInfo.cs
Settings.XamlStyler = Settings.XamlStyler
+ SolutionAssemblyInfo.cs = SolutionAssemblyInfo.cs
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Shell", "Plugins\Flow.Launcher.Plugin.Shell\Flow.Launcher.Plugin.Shell.csproj", "{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}"
@@ -71,6 +71,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Plugin
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.WindowsSettings", "Plugins\Flow.Launcher.Plugin.WindowsSettings\Flow.Launcher.Plugin.WindowsSettings.csproj", "{5043CECE-E6A7-4867-9CBE-02D27D83747A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flow.Launcher.Command", "Flow.Launcher.Command\Flow.Launcher.Command.csproj", "{A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -81,8 +83,20 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x64.Build.0 = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x86.Build.0 = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x64.ActiveCfg = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x64.Build.0 = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x86.ActiveCfg = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x86.Build.0 = Release|Any CPU
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x64.ActiveCfg = Debug|Any CPU
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x64.Build.0 = Debug|Any CPU
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -105,18 +119,6 @@ Global
{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Release|x64.Build.0 = Release|Any CPU
{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Release|x86.ActiveCfg = Release|Any CPU
{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Release|x86.Build.0 = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x64.ActiveCfg = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x64.Build.0 = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x86.ActiveCfg = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x86.Build.0 = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.Build.0 = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x64.ActiveCfg = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x64.Build.0 = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x86.ActiveCfg = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x86.Build.0 = Release|Any CPU
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -286,6 +288,18 @@ Global
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.Build.0 = Release|Any CPU
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x86.ActiveCfg = Release|Any CPU
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x86.Build.0 = Release|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Debug|x64.Build.0 = Debug|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Debug|x86.Build.0 = Debug|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Release|x64.ActiveCfg = Release|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Release|x64.Build.0 = Release|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Release|x86.ActiveCfg = Release|Any CPU
+ {A9976C5C-B73A-4D29-B654-EF1C0C4C9C8C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
From 13b5012386a341986a038a472ff8ea3d894aafde Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 13 Jun 2025 13:11:27 +0800
Subject: [PATCH 057/124] Add command executer path
---
Flow.Launcher.Infrastructure/Constant.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs
index 13da9f79f3b..dd916845a95 100644
--- a/Flow.Launcher.Infrastructure/Constant.cs
+++ b/Flow.Launcher.Infrastructure/Constant.cs
@@ -16,6 +16,7 @@ public static class Constant
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location.NonNull()).ToString();
public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, FlowLauncher + ".exe");
+ public static readonly string CommandExecutablePath = Path.Combine(ProgramDirectory, "Flow.Launcher.Command.exe");
public static readonly string ApplicationDirectory = Directory.GetParent(ProgramDirectory).ToString();
public static readonly string RootDirectory = Directory.GetParent(ApplicationDirectory).ToString();
From b8a697c2668b00e89704570496a4a2bef7915205 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 13 Jun 2025 13:12:00 +0800
Subject: [PATCH 058/124] Fix running issue
---
Plugins/Flow.Launcher.Plugin.Shell/Main.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
index b2b7ab702de..6d469db6f5e 100644
--- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
@@ -500,7 +500,7 @@ public void Init(PluginInitContext context)
context.API.RegisterGlobalKeyboardCallback(API_GlobalKeyboardEvent);
// Search for all folders with Microsoft.WindowsTerminal_ prefix
- var windowsAppsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "WindowsApps");
+ /*var windowsAppsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "WindowsApps");
var windowsTerminalFolders = Directory.EnumerateDirectories(windowsAppsPath, "Microsoft.WindowsTerminal_*",
SearchOption.TopDirectoryOnly);
@@ -512,7 +512,7 @@ public void Init(PluginInitContext context)
{
possibleWindowsTerminalPaths.Insert(0, windowsTerminalPath);
}
- }
+ }*/
}
bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state)
From a0ebe2916f72e9f6ee0b5544f72d38b70b3a8045 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 13 Jun 2025 13:20:37 +0800
Subject: [PATCH 059/124] Improve api function
---
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 5 +++--
Flow.Launcher/PublicAPIInstance.cs | 14 +++++++++-----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
index 6382ecd0fbe..9e8e203b3e3 100644
--- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
+++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
@@ -590,9 +590,10 @@ public interface IPublicAPI
/// 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 run the process as administrator
+ /// 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 = "", string arguments = "", bool runAsAdmin = false);
+ public bool StartProcess(string filePath, string workingDirectory = "", string arguments = "", bool useShellExecute = true, string verb = "");
///
/// Displays a User Account Control (UAC) dialog to request elevated permissions for the specified application.
diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs
index 0746f374753..461f24aa719 100644
--- a/Flow.Launcher/PublicAPIInstance.cs
+++ b/Flow.Launcher/PublicAPIInstance.cs
@@ -577,16 +577,20 @@ public long StopwatchLogInfo(string className, string message, Action action, [C
public Task StopwatchLogInfoAsync(string className, string message, Func action, [CallerMemberName] string methodName = "") =>
Stopwatch.InfoAsync(className, message, action, methodName);
- public bool StartProcess(string filePath, string workingDirectory = "", string arguments = "", bool runAsAdmin = false)
+ public bool StartProcess(string filePath, string workingDirectory = "", string arguments = "", bool useShellExecute = true, string verb = "")
{
try
{
workingDirectory = string.IsNullOrEmpty(workingDirectory) ? Environment.CurrentDirectory : workingDirectory;
- // Deelevate process if it is running as administrator
- if (Win32Helper.IsAdministrator() && !runAsAdmin)
+ // Use command executer to run the process as desktop user if running as admin
+ if (Win32Helper.IsAdministrator())
{
- var result = Win32Helper.RunAsDesktopUser(filePath, workingDirectory, arguments, out var errorInfo);
+ var result = Win32Helper.RunAsDesktopUser(
+ Constant.CommandExecutablePath,
+ Environment.CurrentDirectory,
+ $"-StartProcess -FileName {filePath} -WorkingDirectory {workingDirectory} -Arguments {arguments} -UseShellExecute {useShellExecute} -Verb {verb}",
+ out var errorInfo);
if (!string.IsNullOrEmpty(errorInfo))
{
LogError(ClassName, $"Failed to start process {filePath} with error: {errorInfo}");
@@ -601,7 +605,7 @@ public bool StartProcess(string filePath, string workingDirectory = "", string a
WorkingDirectory = workingDirectory,
Arguments = arguments,
UseShellExecute = true,
- Verb = runAsAdmin ? "runas" : "",
+ Verb = verb,
};
Process.Start(info)?.Dispose();
return true;
From 3ed8af8c6c0e4539d8ae51fa5fb068c81b64dc40 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 13 Jun 2025 13:22:27 +0800
Subject: [PATCH 060/124] Use new api for program plugin
---
Plugins/Flow.Launcher.Plugin.Program/Main.cs | 10 ----------
.../Programs/Win32.cs | 17 ++++-------------
2 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs
index f220190e253..d2884599467 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs
@@ -3,7 +3,6 @@
using System.Diagnostics;
using System.IO;
using System.Linq;
-using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
@@ -33,8 +32,6 @@ public class Main : ISettingProvider, IAsyncPlugin, IPluginI18n, IContextMenu, I
internal static PluginInitContext Context { get; private set; }
- internal static bool IsAdmin = IsAdministrator();
-
private static readonly List emptyResults = new();
private static readonly MemoryCacheOptions cacheOptions = new() { SizeLimit = 1560 };
@@ -462,12 +459,5 @@ public void Dispose()
{
Win32.Dispose();
}
-
- private static bool IsAdministrator()
- {
- using var identity = WindowsIdentity.GetCurrent();
- var principal = new WindowsPrincipal(identity);
- return principal.IsInRole(WindowsBuiltInRole.Administrator);
- }
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
index 905fab91370..3a443df5022 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
@@ -8,7 +8,6 @@
using System.Text;
using System.Threading.Channels;
using System.Threading.Tasks;
-using System.Windows;
using System.Windows.Input;
using Flow.Launcher.Plugin.Program.Logger;
using Flow.Launcher.Plugin.Program.Views.Models;
@@ -206,18 +205,10 @@ public Result Result(string query, IPublicAPI api)
return result;
}
- private void Launch(bool elevated = false)
+ private void Launch(bool runAsAdmin = false)
{
- if (Main.IsAdmin && elevated)
- {
- // Since we are already elevated, we need to create UAC dialog manually
- if (Main.Context.API.ShowUACDialog(Name, IcoPath, LnkResolvedPath) != MessageBoxResult.Yes)
- {
- return;
- }
- }
-
- _ = Task.Run(() => Main.Context.API.StartProcess(LnkResolvedPath, runAsAdmin:elevated)).ConfigureAwait(false);
+ _ = Task.Run(() => Main.Context.API.StartProcess(
+ FullPath, ParentDirectory, string.Empty, true, runAsAdmin ? "runas" : ""));
}
public List ContextMenus(IPublicAPI api)
@@ -234,7 +225,7 @@ public List ContextMenus(IPublicAPI api)
FileName = FullPath, WorkingDirectory = ParentDirectory, UseShellExecute = true
};
- _ = Task.Run(() => Main.StartProcess(ShellCommand.RunAsDifferentUser, info)).ConfigureAwait(false);
+ _ = Task.Run(() => Main.StartProcess(ShellCommand.RunAsDifferentUser, info));
return true;
},
From 5551bdf9d07a754a8c0b773ceb42d746aef71866 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 13 Jun 2025 13:23:33 +0800
Subject: [PATCH 061/124] Remove uac dialog api function
---
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 15 --
Flow.Launcher/Languages/en.xaml | 5 -
Flow.Launcher/PublicAPIInstance.cs | 3 -
Flow.Launcher/UACDialog.xaml | 155 ------------------
Flow.Launcher/UACDialog.xaml.cs | 109 ------------
5 files changed, 287 deletions(-)
delete mode 100644 Flow.Launcher/UACDialog.xaml
delete mode 100644 Flow.Launcher/UACDialog.xaml.cs
diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
index 9e8e203b3e3..9e28a72bd68 100644
--- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
+++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
@@ -594,20 +594,5 @@ public interface IPublicAPI
/// 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 = "");
-
- ///
- /// Displays a User Account Control (UAC) dialog to request elevated permissions for the specified application.
- ///
- ///
- /// If Flow is running under administrator mode, executing elevated actions will not trigger UAC dialog.
- /// So this method is used to manually show the UAC dialog when needed.
- ///
- /// The name of the application requesting elevation. This will be displayed in the dialog.
- /// The file path to the icon that will be displayed in the dialog. Must be a valid path to an image file.
- /// The full file path of the executable requesting elevation. This is shown to the user for verification.
- /// A indicating the user's response to the dialog. Possible values include
- /// if the user grants permission,
- /// or if the user denies permission.
- public MessageBoxResult ShowUACDialog(string appName, string iconPath = "", string fullPath = "");
}
}
diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml
index aea9d4a6056..97f294b14cb 100644
--- a/Flow.Launcher/Languages/en.xaml
+++ b/Flow.Launcher/Languages/en.xaml
@@ -379,11 +379,6 @@
Flow Launcher has been updated to {0}
Click here to view the release notes
-
- User Account Control
- Do you want to allow this app to make changes to your device?
- Program location: {0}
-
Select File Manager
Learn more
diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs
index 461f24aa719..877e3feef06 100644
--- a/Flow.Launcher/PublicAPIInstance.cs
+++ b/Flow.Launcher/PublicAPIInstance.cs
@@ -617,9 +617,6 @@ public bool StartProcess(string filePath, string workingDirectory = "", string a
}
}
- public MessageBoxResult ShowUACDialog(string appName, string iconPath = "", string fullPath = "") =>
- UACDialog.Show(appName, iconPath, fullPath);
-
#endregion
#region Private Methods
diff --git a/Flow.Launcher/UACDialog.xaml b/Flow.Launcher/UACDialog.xaml
deleted file mode 100644
index 9d13a2c7b08..00000000000
--- a/Flow.Launcher/UACDialog.xaml
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Flow.Launcher/UACDialog.xaml.cs b/Flow.Launcher/UACDialog.xaml.cs
deleted file mode 100644
index 040f10328b2..00000000000
--- a/Flow.Launcher/UACDialog.xaml.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-using System;
-using System.IO;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Input;
-
-namespace Flow.Launcher
-{
- public partial class UACDialog : Window
- {
- private static readonly string ClassName = nameof(UACDialog);
-
- private static UACDialog msgBox;
- private static MessageBoxResult _result = MessageBoxResult.None;
-
- private UACDialog()
- {
- InitializeComponent();
- }
-
- public static MessageBoxResult Show(string appName, string iconPath, string fullPath)
- {
- if (!Application.Current.Dispatcher.CheckAccess())
- {
- return Application.Current.Dispatcher.Invoke(() => Show(appName, iconPath, fullPath));
- }
-
- try
- {
- msgBox = new UACDialog();
-
- // Set icon & app name & program location
- _ = msgBox.SetImageAsync(iconPath);
- msgBox.AppName.Text = appName;
- if (string.IsNullOrEmpty(fullPath))
- {
- msgBox.ProgramLocation.Text = string.Format(
- App.API.GetTranslation("userAccountControlProgramLocation"),
- appName);
- }
- else
- {
- msgBox.ProgramLocation.Text = string.Format(
- App.API.GetTranslation("userAccountControlProgramLocation"),
- fullPath);
- }
-
- // Focus No by default
- msgBox.btnNo.Focus();
- _result = MessageBoxResult.No;
-
- msgBox.ShowDialog();
- return _result;
- }
- catch (Exception e)
- {
- App.API.LogError(ClassName, $"An error occurred: {e.Message}");
- msgBox = null;
- return MessageBoxResult.None;
- }
- }
-
- private async Task SetImageAsync(string imagePath)
- {
- try
- {
- if (string.IsNullOrEmpty(imagePath) || !File.Exists(imagePath))
- {
- Img.Visibility = Visibility.Collapsed;
- return;
- }
- var imageSource = await App.API.LoadImageAsync(imagePath);
- Img.Source = imageSource;
- Img.Visibility = Visibility.Visible;
- }
- catch (Exception ex)
- {
- App.API.LogException(ClassName, $"Failed to load UAC dialog image: {imagePath}", ex);
- Img.Visibility = Visibility.Collapsed;
- }
- }
-
- private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
- {
- _result = MessageBoxResult.Cancel;
- DialogResult = false;
- Close();
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- if (sender == btnYes)
- _result = MessageBoxResult.Yes;
- else if (sender == btnNo)
- _result = MessageBoxResult.No;
- else
- _result = MessageBoxResult.None;
- msgBox.Close();
- msgBox = null;
- }
-
- private void Button_Cancel(object sender, RoutedEventArgs e)
- {
- _result = MessageBoxResult.Cancel;
- msgBox.Close();
- msgBox = null;
- }
- }
-}
From 2c0210c480f92fa67a7d1ff78900802d2d3793a1 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 13 Jun 2025 13:28:03 +0800
Subject: [PATCH 062/124] Revert unnecessary changes in solution file
---
Flow.Launcher.sln | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/Flow.Launcher.sln b/Flow.Launcher.sln
index a0eb09a89bb..eb607689320 100644
--- a/Flow.Launcher.sln
+++ b/Flow.Launcher.sln
@@ -53,8 +53,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE = LICENSE
Scripts\post_build.ps1 = Scripts\post_build.ps1
README.md = README.md
- Settings.XamlStyler = Settings.XamlStyler
SolutionAssemblyInfo.cs = SolutionAssemblyInfo.cs
+ Settings.XamlStyler = Settings.XamlStyler
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Shell", "Plugins\Flow.Launcher.Plugin.Shell\Flow.Launcher.Plugin.Shell.csproj", "{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}"
@@ -83,18 +83,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x64.ActiveCfg = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x64.Build.0 = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x86.ActiveCfg = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x86.Build.0 = Debug|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.Build.0 = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x64.ActiveCfg = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x64.Build.0 = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x86.ActiveCfg = Release|Any CPU
- {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x86.Build.0 = Release|Any CPU
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -119,6 +107,18 @@ Global
{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Release|x64.Build.0 = Release|Any CPU
{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Release|x86.ActiveCfg = Release|Any CPU
{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Release|x86.Build.0 = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x64.Build.0 = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|x86.Build.0 = Debug|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x64.ActiveCfg = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x64.Build.0 = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x86.ActiveCfg = Release|Any CPU
+ {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|x86.Build.0 = Release|Any CPU
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|x64.ActiveCfg = Debug|Any CPU
From 898dbb8402c26b4e653a82b4abc99e336f4339c1 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 13 Jun 2025 13:30:51 +0800
Subject: [PATCH 063/124] Use new api for uwp package opening
---
.../Programs/UWPPackage.cs | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs
index 182f3fed537..646079946a8 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Security.Principal;
@@ -516,14 +515,8 @@ private void Launch(bool elevated = false)
var command = "shell:AppsFolder\\" + UserModelId;
command = Environment.ExpandEnvironmentVariables(command.Trim());
- var info = new ProcessStartInfo()
- {
- FileName = command,
- UseShellExecute = true,
- Verb = elevated ? "runas" : ""
- };
-
- _ = Task.Run(() => Main.StartProcess(Process.Start, info)).ConfigureAwait(false);
+ _ = Task.Run(() => Main.Context.API.StartProcess(
+ command, string.Empty, string.Empty, true, elevated ? "runas" : ""));
}
internal static bool IfAppCanRunElevated(XmlNode appNode)
From 4ebfb3c5fdda26f9ff406b030e5ef1d0ee2700b1 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 13 Jun 2025 13:39:13 +0800
Subject: [PATCH 064/124] Add api function
---
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 17 ++++++++++++++++-
Flow.Launcher/PublicAPIInstance.cs | 4 ++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
index 9e28a72bd68..45424cccb17 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 @@ public interface IPublicAPI
/// 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 @@ public interface IPublicAPI
/// 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 877e3feef06..4275e36a195 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 @@ public bool StartProcess(string filePath, string workingDirectory = "", string a
}
}
+ 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
From a2be6e0d0e7690858bfaed1e9f94a5246c20b915 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 13 Jun 2025 13:39:36 +0800
Subject: [PATCH 065/124] Use new api for shell plugin
---
.../Languages/en.xaml | 4 -
Plugins/Flow.Launcher.Plugin.Shell/Main.cs | 157 +-----------------
2 files changed, 2 insertions(+), 159 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Shell/Languages/en.xaml
index 026f0b86fa0..941559cb53d 100644
--- a/Plugins/Flow.Launcher.Plugin.Shell/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Shell/Languages/en.xaml
@@ -17,8 +17,4 @@
Run As Administrator
Copy the command
Only show number of most used commands:
- Windows Command Processor
- Windows PowerShell
- Microsoft PowerShell 7
- Terminal