mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Peek]Fix using the correct Monaco assets at runtime (#36890)
This commit is contained in:
@@ -38,7 +38,11 @@ namespace Microsoft.PowerToys.FilePreviewCommon
|
|||||||
{
|
{
|
||||||
string baseDirectory = AppContext.BaseDirectory ?? string.Empty;
|
string baseDirectory = AppContext.BaseDirectory ?? string.Empty;
|
||||||
|
|
||||||
|
// AppContext.BaseDirectory returns a stray \\ so we want to remove that.
|
||||||
|
baseDirectory = Path.TrimEndingDirectorySeparator(baseDirectory);
|
||||||
|
|
||||||
// If the executable is within "WinUI3Apps", correct the path first.
|
// If the executable is within "WinUI3Apps", correct the path first.
|
||||||
|
// The idea of GetFileName here is getting the last directory in the path.
|
||||||
if (Path.GetFileName(baseDirectory) == "WinUI3Apps")
|
if (Path.GetFileName(baseDirectory) == "WinUI3Apps")
|
||||||
{
|
{
|
||||||
baseDirectory = Path.Combine(baseDirectory, "..");
|
baseDirectory = Path.Combine(baseDirectory, "..");
|
||||||
|
|||||||
Reference in New Issue
Block a user