From 3d9cd992974845ddde8560fcebaa92013bb02e97 Mon Sep 17 00:00:00 2001 From: Marco Franzen Date: Tue, 25 Feb 2025 22:45:50 +0100 Subject: [PATCH] fix did you delete this folder dialog after update --- src/Files.App/MainWindow.xaml.cs | 5 ++++- src/Files.App/Utils/CommandLine/CommandLineParser.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Files.App/MainWindow.xaml.cs b/src/Files.App/MainWindow.xaml.cs index e607b8abfa8e..6dcfc8b56310 100644 --- a/src/Files.App/MainWindow.xaml.cs +++ b/src/Files.App/MainWindow.xaml.cs @@ -6,7 +6,9 @@ using Microsoft.UI.Windowing; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media.Animation; +using System.IO; using System.Runtime.InteropServices; +using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Storage; using IO = System.IO; @@ -63,7 +65,8 @@ public async Task InitializeApplicationAsync(object activatedEventArgs) case ILaunchActivatedEventArgs launchArgs: if (launchArgs.Arguments is not null && (CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev.exe", StringComparison.OrdinalIgnoreCase) - || CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev", StringComparison.OrdinalIgnoreCase))) + || CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev", StringComparison.OrdinalIgnoreCase) + || CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].Equals(Path.Join(Package.Current.InstalledLocation.Path, "Files.App", "Files.exe"), StringComparison.OrdinalIgnoreCase))) { // WINUI3: When launching from commandline the argument is not ICommandLineActivatedEventArgs (#10370) var ppm = CommandLineParser.ParseUntrustedCommands(launchArgs.Arguments); diff --git a/src/Files.App/Utils/CommandLine/CommandLineParser.cs b/src/Files.App/Utils/CommandLine/CommandLineParser.cs index 62948ea37822..77164b60e829 100644 --- a/src/Files.App/Utils/CommandLine/CommandLineParser.cs +++ b/src/Files.App/Utils/CommandLine/CommandLineParser.cs @@ -17,7 +17,7 @@ public sealed class CommandLineParser /// A collection of parsed command. public static ParsedCommands ParseUntrustedCommands(string cmdLineString) { - var parsedArgs = Parse(SplitArguments(cmdLineString, true)); + var parsedArgs = Parse(SplitArguments(cmdLineString.TrimEnd(), true)); return ParseSplitArguments(parsedArgs); }