Skip to content

Commit e921b40

Browse files
Fix: Fixed error dialog from appearing after updates (#16864)
1 parent 7bffa1c commit e921b40

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Files.App/MainWindow.xaml.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
using Microsoft.UI.Windowing;
77
using Microsoft.UI.Xaml.Controls;
88
using Microsoft.UI.Xaml.Media.Animation;
9+
using System.IO;
910
using System.Runtime.InteropServices;
11+
using Windows.ApplicationModel;
1012
using Windows.ApplicationModel.Activation;
1113
using Windows.Storage;
1214
using IO = System.IO;
@@ -63,7 +65,8 @@ public async Task InitializeApplicationAsync(object activatedEventArgs)
6365
case ILaunchActivatedEventArgs launchArgs:
6466
if (launchArgs.Arguments is not null &&
6567
(CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev.exe", StringComparison.OrdinalIgnoreCase)
66-
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev", StringComparison.OrdinalIgnoreCase)))
68+
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev", StringComparison.OrdinalIgnoreCase)
69+
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].Equals(Path.Join(Package.Current.InstalledLocation.Path, "Files.App", "Files.exe"), StringComparison.OrdinalIgnoreCase)))
6770
{
6871
// WINUI3: When launching from commandline the argument is not ICommandLineActivatedEventArgs (#10370)
6972
var ppm = CommandLineParser.ParseUntrustedCommands(launchArgs.Arguments);

src/Files.App/Utils/CommandLine/CommandLineParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public sealed class CommandLineParser
1717
/// <returns>A collection of parsed command.</returns>
1818
public static ParsedCommands ParseUntrustedCommands(string cmdLineString)
1919
{
20-
var parsedArgs = Parse(SplitArguments(cmdLineString, true));
20+
var parsedArgs = Parse(SplitArguments(cmdLineString.TrimEnd(), true));
2121

2222
return ParseSplitArguments(parsedArgs);
2323
}

0 commit comments

Comments
 (0)