Compare commits

...

1 Commits

Author SHA1 Message Date
Mike Griese
fd287a5ace CmdPal: hotfix loading packaged apps
Regressed in #39678

This block of code just moved up too far. It needs to be after the first
attempt to load the resource.

closes: did we even file it yet
2025-06-30 15:56:29 -05:00

View File

@@ -6,8 +6,6 @@ using System;
using System.Collections.Generic;
using System.IO.Abstractions;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Xml;
using ManagedCommon;
using Microsoft.CmdPal.Ext.Apps.Commands;
@@ -15,7 +13,6 @@ using Microsoft.CmdPal.Ext.Apps.Properties;
using Microsoft.CmdPal.Ext.Apps.Utils;
using Microsoft.CommandPalette.Extensions.Toolkit;
using Windows.Win32;
using Windows.Win32.Foundation;
using Windows.Win32.Storage.Packaging.Appx;
using PackageVersion = Microsoft.CmdPal.Ext.Apps.Programs.UWP.PackageVersion;
using Theme = Microsoft.CmdPal.Ext.Apps.Utils.Theme;
@@ -74,7 +71,7 @@ public class UWPApplication : IProgram
public List<CommandContextItem> GetCommands()
{
List<CommandContextItem> commands = new List<CommandContextItem>();
List<CommandContextItem> commands = [];
if (CanRunElevated)
{
@@ -226,6 +223,16 @@ public class UWPApplication : IProgram
parsedFallback = prefix + "///" + key;
}
Span<char> outBuffer = stackalloc char[1024];
var source = $"@{{{packageFullName}? {parsed}}}";
var loaded = TryLoadIndirectString(source, outBuffer, resourceReference);
if (!string.IsNullOrEmpty(loaded))
{
return loaded;
}
if (string.IsNullOrEmpty(parsedFallback))
{
// https://github.com/Wox-launcher/Wox/issues/964
@@ -237,16 +244,6 @@ public class UWPApplication : IProgram
return string.Empty;
}
Span<char> outBuffer = stackalloc char[1024];
var source = $"@{{{packageFullName}? {parsed}}}";
var loaded = TryLoadIndirectString(source, outBuffer, resourceReference);
if (!string.IsNullOrEmpty(loaded))
{
return loaded;
}
var sourceFallback = $"@{{{packageFullName}?{parsedFallback}}}";
return TryLoadIndirectString(sourceFallback, outBuffer, $"{resourceReference} (fallback)");
}