From fbb78ae5ec36699529b7d68a1d348521ee2a55a6 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 12 Sep 2024 19:11:56 +0900 Subject: [PATCH 1/6] Init --- .github/scripts/Configure-AppxManifest.ps1 | 55 ++++++++++++++++++- src/Files.App (Package)/Package.appxmanifest | 6 +- src/Files.App.Launcher/FilesLauncher.cpp | 10 ++-- src/Files.App.OpenDialog/FilesOpenDialog.cpp | 4 +- src/Files.App.SaveDialog/FilesSaveDialog.cpp | 4 +- .../BaseOpenInNewWindowAction.cs | 2 +- .../Helpers/Application/AppLifecycleHelper.cs | 2 +- .../Helpers/Navigation/NavigationHelpers.cs | 7 +-- src/Files.App/MainWindow.xaml.cs | 6 +- src/Files.App/Program.cs | 4 +- src/Files.App/Utils/Taskbar/SystemTrayIcon.cs | 16 +++++- .../ViewModels/Settings/GeneralViewModel.cs | 2 +- 12 files changed, 90 insertions(+), 28 deletions(-) diff --git a/.github/scripts/Configure-AppxManifest.ps1 b/.github/scripts/Configure-AppxManifest.ps1 index 055a3dfb0fd2..abca500cd1c3 100644 --- a/.github/scripts/Configure-AppxManifest.ps1 +++ b/.github/scripts/Configure-AppxManifest.ps1 @@ -11,7 +11,17 @@ param( [string]$SecretGitHubOAuthClientId = "" ) +# Load Package.appxmanifest [xml]$xmlDoc = Get-Content $PackageManifestPath + +# Add namespaces +$nsmgr = New-Object System.Xml.XmlNamespaceManager($xmlDoc.NameTable) +$nsmgr.AddNamespace("pkg", "http://schemas.microsoft.com/appx/manifest/foundation/windows10") +$nsmgr.AddNamespace("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities") +$nsmgr.AddNamespace("uap", "http://schemas.microsoft.com/appx/manifest/uap/windows10") +$nsmgr.AddNamespace("uap5", "http://schemas.microsoft.com/appx/manifest/uap/windows10/5") + +# Update the publisher $xmlDoc.Package.Identity.Publisher = $Publisher if ($Branch -eq "Preview") @@ -21,6 +31,14 @@ if ($Branch -eq "Preview") $xmlDoc.Package.Properties.DisplayName="Files - Preview" $xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files - Preview" $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files - Preview" + + # Update app protocol and execution alias + $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']", $nsmgr) + $ap.Attributes["Name"]="files-pre"; + $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias", $nsmgr) + $aea.Attributes["Alias"]="files-pre.exe"; + + # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process ` @@ -28,6 +46,12 @@ if ($Branch -eq "Preview") (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | ` Set-Content $_ -NoNewline ` } + + Get-ChildItem $WorkingDir -Include *.cs, *.cpp -recurse | ForEach-Object -Process ` + { ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files-pre" }) | ` + Set-Content $_ -NoNewline ` + } } elseif ($Branch -eq "Stable") { @@ -36,6 +60,14 @@ elseif ($Branch -eq "Stable") $xmlDoc.Package.Properties.DisplayName="Files" $xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files" $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files" + + # Update app protocol and execution alias + $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']", $nsmgr) + $ap.Attributes["Name"]="files"; + $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias", $nsmgr) + $aea.Attributes["Alias"]="files.exe"; + + # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process ` @@ -43,6 +75,12 @@ elseif ($Branch -eq "Stable") (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` Set-Content $_ -NoNewline ` } + + Get-ChildItem $WorkingDir -Include *.cs, *.cpp -recurse | ForEach-Object -Process ` + { ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files" }) | ` + Set-Content $_ -NoNewline ` + } } elseif ($Branch -eq "Store") { @@ -53,11 +91,16 @@ elseif ($Branch -eq "Store") $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files" # Remove an capability that is used for the sideload - $nsmgr = New-Object System.Xml.XmlNamespaceManager($xmlDoc.NameTable) - $nsmgr.AddNamespace("pkg", "http://schemas.microsoft.com/appx/manifest/foundation/windows10") - $nsmgr.AddNamespace("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities") $pm = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Capabilities/rescap:Capability[@Name='packageManagement']", $nsmgr) $xmlDoc.Package.Capabilities.RemoveChild($pm) + + # Update app protocol and execution alias + $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']", $nsmgr) + $ap.Attributes["Name"]="files"; + $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias", $nsmgr) + $aea.Attributes["Alias"]="files.exe"; + + # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process ` @@ -65,6 +108,12 @@ elseif ($Branch -eq "Store") (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` Set-Content $_ -NoNewline ` } + + Get-ChildItem $WorkingDir -Include *.cs, *.cpp -recurse | ForEach-Object -Process ` + { ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files" }) | ` + Set-Content $_ -NoNewline ` + } } Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process ` diff --git a/src/Files.App (Package)/Package.appxmanifest b/src/Files.App (Package)/Package.appxmanifest index 36a4c2852eca..34c873984c1d 100644 --- a/src/Files.App (Package)/Package.appxmanifest +++ b/src/Files.App (Package)/Package.appxmanifest @@ -119,12 +119,14 @@ - + + - + + diff --git a/src/Files.App.Launcher/FilesLauncher.cpp b/src/Files.App.Launcher/FilesLauncher.cpp index 4873f8ee563a..f766e4aa842b 100644 --- a/src/Files.App.Launcher/FilesLauncher.cpp +++ b/src/Files.App.Launcher/FilesLauncher.cpp @@ -65,7 +65,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine LocalFree(szArglist); WCHAR szBuf[MAX_PATH]; - ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\Microsoft\\WindowsApps\\files.exe", szBuf, MAX_PATH - 1); + ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\Microsoft\\WindowsApps\\files-dev.exe", szBuf, MAX_PATH - 1); std::wcout << szBuf << std::endl; if (_waccess(szBuf, 0) == -1) { @@ -172,7 +172,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine swprintf(args, _countof(args) - 1, L"\"%s\" -select \"%s\"", szBuf, item.c_str()); } - std::wstring uriWithArgs = L"files-uwp:?cmd=" + str2wstr(wstring_to_utf8_hex(args)); + std::wstring uriWithArgs = L"files-dev:?cmd=" + str2wstr(wstring_to_utf8_hex(args)); std::wcout << L"Invoking: " << args << L" = " << uriWithArgs << std::endl; @@ -187,7 +187,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine { std::wcout << L"Protocol error: " << GetLastError() << std::endl; - //ShExecInfo.lpFile = L"files.exe"; + //ShExecInfo.lpFile = L"files-dev.exe"; //ShExecInfo.lpParameters = args; //if (!ShellExecuteEx(&ShExecInfo)) //{ @@ -202,13 +202,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine SHELLEXECUTEINFO ShExecInfo = { 0 }; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.fMask = SEE_MASK_NOASYNC | SEE_MASK_FLAG_NO_UI; - ShExecInfo.lpFile = L"files-uwp:"; + ShExecInfo.lpFile = L"files-dev:"; ShExecInfo.nShow = SW_SHOW; if (!ShellExecuteEx(&ShExecInfo)) { std::wcout << L"Protocol error: " << GetLastError() << std::endl; - //ShExecInfo.lpFile = L"files.exe"; + //ShExecInfo.lpFile = L"files-dev.exe"; //if (!ShellExecuteEx(&ShExecInfo)) //{ //std::wcout << L"Command line error: " << GetLastError() << std::endl; diff --git a/src/Files.App.OpenDialog/FilesOpenDialog.cpp b/src/Files.App.OpenDialog/FilesOpenDialog.cpp index f1dec80b6568..261f68ca9468 100644 --- a/src/Files.App.OpenDialog/FilesOpenDialog.cpp +++ b/src/Files.App.OpenDialog/FilesOpenDialog.cpp @@ -162,7 +162,7 @@ STDAPICALL CFilesOpenDialog::Show(HWND hwndOwner) PWSTR pszPath = NULL; WCHAR szBuf[MAX_PATH]; TCHAR args[1024] = { 0 }; - ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\Microsoft\\WindowsApps\\files.exe", szBuf, MAX_PATH - 1); + ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\Microsoft\\WindowsApps\\files-dev.exe", szBuf, MAX_PATH - 1); HANDLE closeEvent = CreateEvent(NULL, FALSE, FALSE, TEXT("FILEDIALOG")); @@ -177,7 +177,7 @@ STDAPICALL CFilesOpenDialog::Show(HWND hwndOwner) swprintf(args, _countof(args) - 1, L"\"%s\" -outputpath \"%s\"", szBuf, _outputPath.c_str()); } - std::wstring uriWithArgs = L"files-uwp:?cmd=" + str2wstr(wstring_to_utf8_hex(args)); + std::wstring uriWithArgs = L"files-dev:?cmd=" + str2wstr(wstring_to_utf8_hex(args)); ShExecInfo.lpFile = uriWithArgs.c_str(); ShExecInfo.nShow = SW_SHOW; ShellExecuteEx(&ShExecInfo); diff --git a/src/Files.App.SaveDialog/FilesSaveDialog.cpp b/src/Files.App.SaveDialog/FilesSaveDialog.cpp index b17d018e78f9..49dddc8fcfb7 100644 --- a/src/Files.App.SaveDialog/FilesSaveDialog.cpp +++ b/src/Files.App.SaveDialog/FilesSaveDialog.cpp @@ -438,7 +438,7 @@ HRESULT __stdcall CFilesSaveDialog::Show(HWND hwndOwner) PWSTR pszPath = NULL; WCHAR szBuf[MAX_PATH]; TCHAR args[1024] = { 0 }; - ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\Microsoft\\WindowsApps\\files.exe", szBuf, MAX_PATH - 1); + ExpandEnvironmentStringsW(L"%LOCALAPPDATA%\\Microsoft\\WindowsApps\\files-dev.exe", szBuf, MAX_PATH - 1); HANDLE closeEvent = CreateEvent(NULL, FALSE, FALSE, TEXT("FILEDIALOG")); @@ -460,7 +460,7 @@ HRESULT __stdcall CFilesSaveDialog::Show(HWND hwndOwner) swprintf(args, _countof(args) - 1, L"\"%s\" -outputpath \"%s\"", szBuf, _outputPath.c_str()); } - std::wstring uriWithArgs = L"files-uwp:?cmd=" + str2wstr(wstring_to_utf8_hex(args)); + std::wstring uriWithArgs = L"files-dev:?cmd=" + str2wstr(wstring_to_utf8_hex(args)); ShExecInfo.lpFile = uriWithArgs.c_str(); ShExecInfo.nShow = SW_SHOW; ShellExecuteEx(&ShExecInfo); diff --git a/src/Files.App/Actions/Navigation/OpenInNewWindow/BaseOpenInNewWindowAction.cs b/src/Files.App/Actions/Navigation/OpenInNewWindow/BaseOpenInNewWindowAction.cs index fbd023ed5c58..83da54c7a8df 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewWindow/BaseOpenInNewWindowAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewWindow/BaseOpenInNewWindowAction.cs @@ -50,7 +50,7 @@ public virtual async Task ExecuteAsync(object? parameter = null) foreach (ListedItem listedItem in items) { var selectedItemPath = (listedItem as ShortcutItem)?.TargetPath ?? listedItem.ItemPath; - var folderUri = new Uri($"files-uwp:?folder={@selectedItemPath}"); + var folderUri = new Uri($"files-dev:?folder={@selectedItemPath}"); await Launcher.LaunchUriAsync(folderUri); } diff --git a/src/Files.App/Helpers/Application/AppLifecycleHelper.cs b/src/Files.App/Helpers/Application/AppLifecycleHelper.cs index 8c2926268ea5..062a74a9edd1 100644 --- a/src/Files.App/Helpers/Application/AppLifecycleHelper.cs +++ b/src/Files.App/Helpers/Application/AppLifecycleHelper.cs @@ -340,7 +340,7 @@ public static void HandleAppUnhandledException(Exception? ex, bool showToastNoti // Try to re-launch and start over MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(async () => { - await Launcher.LaunchUriAsync(new Uri("files-uwp:")); + await Launcher.LaunchUriAsync(new Uri("files-dev:")); }) .Wait(100); } diff --git a/src/Files.App/Helpers/Navigation/NavigationHelpers.cs b/src/Files.App/Helpers/Navigation/NavigationHelpers.cs index e441f6688dc9..9cc563d104e3 100644 --- a/src/Files.App/Helpers/Navigation/NavigationHelpers.cs +++ b/src/Files.App/Helpers/Navigation/NavigationHelpers.cs @@ -286,14 +286,14 @@ public static Task OpenPathInNewWindowAsync(string? path) if (string.IsNullOrWhiteSpace(path)) return Task.FromResult(false); - var folderUri = new Uri($"files-uwp:?folder={Uri.EscapeDataString(path)}"); + var folderUri = new Uri($"files-dev:?folder={Uri.EscapeDataString(path)}"); return Launcher.LaunchUriAsync(folderUri).AsTask(); } public static Task OpenTabInNewWindowAsync(string tabArgs) { - var folderUri = new Uri($"files-uwp:?tab={Uri.EscapeDataString(tabArgs)}"); + var folderUri = new Uri($"files-dev:?tab={Uri.EscapeDataString(tabArgs)}"); return Launcher.LaunchUriAsync(folderUri).AsTask(); } @@ -307,8 +307,7 @@ public static void OpenInSecondaryPane(IShellPage associatedInstance, ListedItem public static Task LaunchNewWindowAsync() { - var filesUWPUri = new Uri("files-uwp:?window="); - return Launcher.LaunchUriAsync(filesUWPUri).AsTask(); + return Launcher.LaunchUriAsync(new Uri("files-dev:?window=")).AsTask(); } public static async Task OpenSelectedItemsAsync(IShellPage associatedInstance, bool openViaApplicationPicker = false) diff --git a/src/Files.App/MainWindow.xaml.cs b/src/Files.App/MainWindow.xaml.cs index 34f4aed86bb6..da4d1bd1247f 100644 --- a/src/Files.App/MainWindow.xaml.cs +++ b/src/Files.App/MainWindow.xaml.cs @@ -52,8 +52,8 @@ public async Task InitializeApplicationAsync(object activatedEventArgs) { case ILaunchActivatedEventArgs launchArgs: if (launchArgs.Arguments is not null && - (CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files.exe", StringComparison.OrdinalIgnoreCase) - || CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files", StringComparison.OrdinalIgnoreCase))) + (CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev.exe", StringComparison.OrdinalIgnoreCase) + || CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev", StringComparison.OrdinalIgnoreCase))) { // WINUI3: When launching from commandline the argument is not ICommandLineActivatedEventArgs (#10370) var ppm = CommandLineParser.ParseUntrustedCommands(launchArgs.Arguments); @@ -82,7 +82,7 @@ public async Task InitializeApplicationAsync(object activatedEventArgs) break; case IProtocolActivatedEventArgs eventArgs: - if (eventArgs.Uri.AbsoluteUri == "files-uwp:") + if (eventArgs.Uri.AbsoluteUri == "files-dev:") { rootFrame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo()); diff --git a/src/Files.App/Program.cs b/src/Files.App/Program.cs index a0239827dc27..d78c950d08f6 100644 --- a/src/Files.App/Program.cs +++ b/src/Files.App/Program.cs @@ -220,8 +220,8 @@ static bool ProcessPathPredicate(Process p) var cmdLaunchArgs = activatedArgs.Data is ILaunchActivatedEventArgs launchArgs && launchArgs.Arguments is not null && CommandLineParser.SplitArguments(launchArgs.Arguments, true).FirstOrDefault() is string arg0 && - (arg0.EndsWith($"files.exe", StringComparison.OrdinalIgnoreCase) || - arg0.EndsWith($"files", StringComparison.OrdinalIgnoreCase)) ? launchArgs.Arguments : null; + (arg0.EndsWith($"files-dev.exe", StringComparison.OrdinalIgnoreCase) || + arg0.EndsWith($"files-dev", StringComparison.OrdinalIgnoreCase)) ? launchArgs.Arguments : null; var cmdProtocolArgs = activatedArgs.Data is IProtocolActivatedEventArgs protocolArgs && protocolArgs.Uri.Query.TrimStart('?').Split('=') is string[] parsedArgs && parsedArgs.Length == 2 && parsedArgs[0] == "cmd" ? Uri.UnescapeDataString(parsedArgs[1]) : null; diff --git a/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs b/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs index 9ddc38f1f279..cbf803977755 100644 --- a/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs +++ b/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs @@ -27,7 +27,19 @@ public sealed class SystemTrayIcon : IDisposable // Fields - private readonly static Guid _trayIconGuid = new("684F2832-AC2B-4630-98C2-73D6AEBD46B7"); + private readonly static Guid _trayIconGuid = new( +#if DEBUG + "e6fc16c1-e6e2-40a2-9c4e-1bf3b54684ad" +#elif PREVIEW + "8bd7e317-ee80-405e-8c90-f4d9866ff9bc" +#elif STABLE + "96b3455b-16bf-454e-ada5-191ba32f2f8e" +#elif STORE + "01966f57-00cf-471f-b2d5-55f227e0dfe6" +#else + "e77abbd8-8721-4d50-a4d2-743d28cdc37b" +#endif + ); private readonly SystemTrayIconWindow _IconWindow; @@ -264,7 +276,7 @@ private void OnLeftClicked() { _lastLaunchDate = DateTime.Now; - _ = Launcher.LaunchUriAsync(new Uri("files-uwp:")); + _ = Launcher.LaunchUriAsync(new Uri("files-dev:")); } else MainWindow.Instance.Activate(); diff --git a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs index 6713d39dd31e..821a54cb6fc0 100644 --- a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs +++ b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs @@ -126,7 +126,7 @@ private async void DoRestartAsync() AppLifecycleHelper.SaveSessionTabs(); // Launches a new instance of Files - await Launcher.LaunchUriAsync(new Uri("files-uwp:")); + await Launcher.LaunchUriAsync(new Uri("files-dev:")); // Closes the current instance Process.GetCurrentProcess().Kill(); From 663e1d3888c069cd210788216cbf9fb98ed67ba2 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:37:32 +0900 Subject: [PATCH 2/6] Update Configure-AppxManifest.ps1 --- .github/scripts/Configure-AppxManifest.ps1 | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/scripts/Configure-AppxManifest.ps1 b/.github/scripts/Configure-AppxManifest.ps1 index abca500cd1c3..dd28549e143f 100644 --- a/.github/scripts/Configure-AppxManifest.ps1 +++ b/.github/scripts/Configure-AppxManifest.ps1 @@ -33,10 +33,10 @@ if ($Branch -eq "Preview") $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files - Preview" # Update app protocol and execution alias - $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']", $nsmgr) - $ap.Attributes["Name"]="files-pre"; - $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias", $nsmgr) - $aea.Attributes["Alias"]="files-pre.exe"; + $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']/uap:Protocol", $nsmgr) + $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias/uap5:ExecutionAlias", $nsmgr) + $ap.SetAttribute("Name", "files-pre"); + $aea.SetAttribute("Alias", "files-pre.exe"); # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) @@ -62,10 +62,10 @@ elseif ($Branch -eq "Stable") $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files" # Update app protocol and execution alias - $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']", $nsmgr) - $ap.Attributes["Name"]="files"; - $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias", $nsmgr) - $aea.Attributes["Alias"]="files.exe"; + $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']/uap:Protocol", $nsmgr) + $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias/uap5:ExecutionAlias", $nsmgr) + $ap.SetAttribute("Name", "files"); + $aea.SetAttribute("Alias", "files.exe"); # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) @@ -95,10 +95,10 @@ elseif ($Branch -eq "Store") $xmlDoc.Package.Capabilities.RemoveChild($pm) # Update app protocol and execution alias - $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']", $nsmgr) - $ap.Attributes["Name"]="files"; - $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias", $nsmgr) - $aea.Attributes["Alias"]="files.exe"; + $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']/uap:Protocol", $nsmgr) + $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias/uap5:ExecutionAlias", $nsmgr) + $ap.SetAttribute("Name", "files"); + $aea.SetAttribute("Alias", "files.exe"); # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) From 9cdb048a9beaebbb881350758dd9e96efe64c15d Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 12 Nov 2024 06:57:50 +0000 Subject: [PATCH 3/6] Keep backward compat --- src/Files.App (Package)/Package.appxmanifest | 7 +++++++ src/Files.App/Utils/Taskbar/SystemTrayIcon.cs | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Files.App (Package)/Package.appxmanifest b/src/Files.App (Package)/Package.appxmanifest index 34c873984c1d..ceb000dde3eb 100644 --- a/src/Files.App (Package)/Package.appxmanifest +++ b/src/Files.App (Package)/Package.appxmanifest @@ -118,6 +118,11 @@ + + + + + @@ -127,6 +132,8 @@ + + diff --git a/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs b/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs index cbf803977755..4187600b6d5c 100644 --- a/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs +++ b/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs @@ -29,15 +29,15 @@ public sealed class SystemTrayIcon : IDisposable private readonly static Guid _trayIconGuid = new( #if DEBUG - "e6fc16c1-e6e2-40a2-9c4e-1bf3b54684ad" + "684F2832-AC2B-4630-98C2-73D6AEBD4001" #elif PREVIEW - "8bd7e317-ee80-405e-8c90-f4d9866ff9bc" + "684F2832-AC2B-4630-98C2-73D6AEBD4002" #elif STABLE - "96b3455b-16bf-454e-ada5-191ba32f2f8e" + "684F2832-AC2B-4630-98C2-73D6AEBD4003" #elif STORE - "01966f57-00cf-471f-b2d5-55f227e0dfe6" + "684F2832-AC2B-4630-98C2-73D6AEBD4004" #else - "e77abbd8-8721-4d50-a4d2-743d28cdc37b" + "684F2832-AC2B-4630-98C2-73D6AEBD4005" #endif ); From 8261fe66a15e7c0acd365b4b385782ae9de03127 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:05:18 +0900 Subject: [PATCH 4/6] Update .github/scripts/Configure-AppxManifest.ps1 Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com> --- .github/scripts/Configure-AppxManifest.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/Configure-AppxManifest.ps1 b/.github/scripts/Configure-AppxManifest.ps1 index dd28549e143f..46326051ef7e 100644 --- a/.github/scripts/Configure-AppxManifest.ps1 +++ b/.github/scripts/Configure-AppxManifest.ps1 @@ -90,7 +90,7 @@ elseif ($Branch -eq "Store") $xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files" $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files" - # Remove an capability that is used for the sideload + # Remove capability that is only used for the sideload package $pm = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Capabilities/rescap:Capability[@Name='packageManagement']", $nsmgr) $xmlDoc.Package.Capabilities.RemoveChild($pm) From abb93345ca763a336dda028e30d565bea807677a Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 14 Nov 2024 03:00:46 +0000 Subject: [PATCH 5/6] Avoid duplication --- .github/scripts/Configure-AppxManifest.ps1 | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/scripts/Configure-AppxManifest.ps1 b/.github/scripts/Configure-AppxManifest.ps1 index 46326051ef7e..b1ef92c20cfc 100644 --- a/.github/scripts/Configure-AppxManifest.ps1 +++ b/.github/scripts/Configure-AppxManifest.ps1 @@ -20,6 +20,9 @@ $nsmgr.AddNamespace("pkg", "http://schemas.microsoft.com/appx/manifest/foundatio $nsmgr.AddNamespace("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities") $nsmgr.AddNamespace("uap", "http://schemas.microsoft.com/appx/manifest/uap/windows10") $nsmgr.AddNamespace("uap5", "http://schemas.microsoft.com/appx/manifest/uap/windows10/5") +$ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']/uap:Protocol", $nsmgr) +$aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias", $nsmgr) +$ea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias/uap5:ExecutionAlias", $nsmgr) # Update the publisher $xmlDoc.Package.Identity.Publisher = $Publisher @@ -33,10 +36,8 @@ if ($Branch -eq "Preview") $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files - Preview" # Update app protocol and execution alias - $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']/uap:Protocol", $nsmgr) - $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias/uap5:ExecutionAlias", $nsmgr) $ap.SetAttribute("Name", "files-pre"); - $aea.SetAttribute("Alias", "files-pre.exe"); + $ea.SetAttribute("Alias", "files-pre.exe"); # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) @@ -62,10 +63,8 @@ elseif ($Branch -eq "Stable") $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files" # Update app protocol and execution alias - $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']/uap:Protocol", $nsmgr) - $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias/uap5:ExecutionAlias", $nsmgr) $ap.SetAttribute("Name", "files"); - $aea.SetAttribute("Alias", "files.exe"); + $aea.RemoveChild(aea.FirstChild); # Avoid duplication # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) @@ -95,10 +94,8 @@ elseif ($Branch -eq "Store") $xmlDoc.Package.Capabilities.RemoveChild($pm) # Update app protocol and execution alias - $ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']/uap:Protocol", $nsmgr) - $aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias/uap5:ExecutionAlias", $nsmgr) $ap.SetAttribute("Name", "files"); - $aea.SetAttribute("Alias", "files.exe"); + $aea.RemoveChild(aea.FirstChild); # Avoid duplication # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) From 033026f06751c479705c017124a6d9838aaea9ca Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 4 Dec 2024 22:22:06 +0000 Subject: [PATCH 6/6] Update --- .github/scripts/Configure-AppxManifest.ps1 | 12 ++++++------ src/Files.App (Package)/Package.appxmanifest | 15 ++++++++++----- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/scripts/Configure-AppxManifest.ps1 b/.github/scripts/Configure-AppxManifest.ps1 index b1ef92c20cfc..3d07f781f615 100644 --- a/.github/scripts/Configure-AppxManifest.ps1 +++ b/.github/scripts/Configure-AppxManifest.ps1 @@ -36,8 +36,8 @@ if ($Branch -eq "Preview") $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files - Preview" # Update app protocol and execution alias - $ap.SetAttribute("Name", "files-pre"); - $ea.SetAttribute("Alias", "files-pre.exe"); + $ap.SetAttribute("Name", "files-preview"); + $ea.SetAttribute("Alias", "files-preview.exe"); # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) @@ -50,7 +50,7 @@ if ($Branch -eq "Preview") Get-ChildItem $WorkingDir -Include *.cs, *.cpp -recurse | ForEach-Object -Process ` { ` - (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files-pre" }) | ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files-preview" }) | ` Set-Content $_ -NoNewline ` } } @@ -63,8 +63,8 @@ elseif ($Branch -eq "Stable") $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files" # Update app protocol and execution alias - $ap.SetAttribute("Name", "files"); - $aea.RemoveChild(aea.FirstChild); # Avoid duplication + $ap.SetAttribute("Name", "files-stable"); + $ea.SetAttribute("Alias", "files-stable.exe"); # Save modified Package.appxmanifest $xmlDoc.Save($PackageManifestPath) @@ -77,7 +77,7 @@ elseif ($Branch -eq "Stable") Get-ChildItem $WorkingDir -Include *.cs, *.cpp -recurse | ForEach-Object -Process ` { ` - (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files" }) | ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files-stable" }) | ` Set-Content $_ -NoNewline ` } } diff --git a/src/Files.App (Package)/Package.appxmanifest b/src/Files.App (Package)/Package.appxmanifest index ceb000dde3eb..5099e7920273 100644 --- a/src/Files.App (Package)/Package.appxmanifest +++ b/src/Files.App (Package)/Package.appxmanifest @@ -119,21 +119,26 @@ - + - + + + + + + - - - + + +