From ad5954eb658988cb56f1fe7589ffa0c2cf3ad2d3 Mon Sep 17 00:00:00 2001 From: Jeremy Sinclair <4016293+snickler@users.noreply.github.com> Date: Thu, 24 Jul 2025 19:07:48 -0400 Subject: [PATCH] [Build][Launcher] Use GeneratedRegexAttribute for InternetShortcutURLPrefix --- .../Microsoft.Plugin.Program/Programs/Win32Program.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs index d16d0e32ca..2d64010a51 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs @@ -28,7 +28,7 @@ using DirectoryWrapper = Wox.Infrastructure.FileSystemHelper.DirectoryWrapper; namespace Microsoft.Plugin.Program.Programs { [Serializable] - public class Win32Program : IProgram + public partial class Win32Program : IProgram { public static readonly Win32Program InvalidProgram = new Win32Program { Valid = false, Enabled = false }; @@ -420,7 +420,8 @@ namespace Microsoft.Plugin.Program.Programs } } - private static readonly Regex InternetShortcutURLPrefixes = new Regex(@"^steam:\/\/(rungameid|run|open)\/|^com\.epicgames\.launcher:\/\/apps\/", RegexOptions.Compiled); + [GeneratedRegex(@"^steam:\/\/(rungameid|run|open)\/|^com\.epicgames\.launcher:\/\/apps\/", RegexOptions.Compiled)] + private static partial Regex InternetShortcutURLPrefixes(); // This function filters Internet Shortcut programs private static Win32Program InternetShortcutProgram(string path) @@ -450,7 +451,7 @@ namespace Microsoft.Plugin.Program.Programs } // To filter out only those steam shortcuts which have 'run' or 'rungameid' as the hostname - if (InternetShortcutURLPrefixes.Match(urlPath).Success) + if (InternetShortcutURLPrefixes().IsMatch(urlPath)) { validApp = true; }