Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add app execution aliases and URL schemes for each build channel #13112

Open
hishitetsu opened this issue Jul 31, 2023 · 14 comments · May be fixed by #16182
Open

Feature: Add app execution aliases and URL schemes for each build channel #13112

hishitetsu opened this issue Jul 31, 2023 · 14 comments · May be fixed by #16182

Comments

@hishitetsu
Copy link
Member

What feature or improvement do you think would benefit Files?

Currently all Files builds have the same app execution alias (Files.exe) and URL scheme (files-uwp:). But it is inconvenient when multiple Files builds are installed at the same time.

  • From the command line, only one build can be launched, as specified in the Windows settings.
  • Auto restart feature doesn't work well.

Requirements

  • The app execution alias should have a build-specific one in addition to Files.exe.
    (Files-sta.exe, Files-pre.exe, Files-dev.exe)
  • URL scheme should be build-specific instead of generic files-uwp:.
    (files-app:, files-app-pre:, files-app-dev:)

Files Version

2.5.21.0

Windows Version

10.0.22621.1992

Comments

No response

@yaira2
Copy link
Member

yaira2 commented Jul 31, 2023

We'll have to consider this and see if there are any downsides.

@yaira2
Copy link
Member

yaira2 commented Sep 27, 2023

Do you have a list of places that will need updating?

@hishitetsu
Copy link
Member Author

As far as I have been able to find out, here is.

Files.App (Package)\Package.appxmanifest(118):<uap:Protocol ReturnResults="none" Name="files-uwp" />
Files.App (Package)\Package.appxmanifest(123):<uap5:ExecutionAlias Alias="files.exe" />
Files.App.Launcher\FilesLauncher.cpp(175):std::wstring uriWithArgs = L"files-uwp:?cmd=" + str2wstr(wstring_to_utf8_hex(args));
Files.App.Launcher\FilesLauncher.cpp(190)://ShExecInfo.lpFile = L"files.exe";
Files.App.Launcher\FilesLauncher.cpp(205):ShExecInfo.lpFile = L"files-uwp:";
Files.App.Launcher\FilesLauncher.cpp(211)://ShExecInfo.lpFile = L"files.exe";
Files.App.OpenDialog\FilesOpenDialog.cpp(124):ShExecInfo.lpFile = L"files.exe";
Files.App\Actions\Navigation\OpenInNewWindowItemAction.cs(43):var folderUri = new Uri($"files-uwp:?folder={@selectedItemPath}");
Files.App\App.xaml.cs(312):!Process.GetProcessesByName("Files").Any(x => x.Id != Process.GetCurrentProcess().Id))
Files.App\App.xaml.cs(538):await Launcher.LaunchUriAsync(new Uri("files-uwp:"));
Files.App\Helpers\Navigation\NavigationHelpers.cs(23):var folderUri = new Uri($"files-uwp:?folder={Uri.EscapeDataString(path)}");
Files.App\Helpers\Navigation\NavigationHelpers.cs(29):var folderUri = new Uri($"files-uwp:?tab={Uri.EscapeDataString(tabArgs)}");
Files.App\Helpers\Navigation\NavigationHelpers.cs(43):var filesUWPUri = new Uri("files-uwp:");
Files.App\MainWindow.xaml.cs(82):(CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files.exe", StringComparison.OrdinalIgnoreCase)
Files.App\MainWindow.xaml.cs(83):|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files", StringComparison.OrdinalIgnoreCase)))
Files.App\MainWindow.xaml.cs(109):if (eventArgs.Uri.AbsoluteUri == "files-uwp:")
Files.App\Program.cs(94):!tileArgs.Arguments.Contains($"files.exe", StringComparison.OrdinalIgnoreCase) &&
Files.App\Utils\Storage\StorageItems\ZipStorageFolder.cs(107):|| assoc.EndsWith("Files.App\\Files.exe", StringComparison.OrdinalIgnoreCase)
Files.App\ViewModels\MainPageViewModel.cs(105):var filesUWPUri = new Uri("files-uwp:");
Files.App\ViewModels\Settings\GeneralViewModel.cs(120):await Launcher.LaunchUriAsync(new Uri("files-uwp:")); // Launches a new instance of Files

Note that FilesLauncher will not be able to select an item at startup unless the GPL code deletion is reverted.

@yaira2
Copy link
Member

yaira2 commented Sep 28, 2023

Files.App (Package)\Package.appxmanifest(118):<uap:Protocol ReturnResults="none" Name="files-uwp" />
Files.App (Package)\Package.appxmanifest(123):<uap5:ExecutionAlias Alias="files.exe" />

These will need to be updated from the pipeline, but I think everything else can be done with variables that are set based on the environment.

@0x5bfa

This comment was marked as outdated.

@0x5bfa
Copy link
Member

0x5bfa commented Oct 26, 2023

And the ApplicationService or #if #endif directives can determine what alias should be used in the platform projects.

@yaira2 what do you think?

@heftymouse
Copy link
Contributor

ApplicationService sounds good 👍

@yaira2
Copy link
Member

yaira2 commented Oct 26, 2023

STABLE

This approach would work, but it means duplicating every change to those files. Alternatively, we could have a build script that automates copying the changes but at that point it's not much better than doing it from the pipeline.

@0x5bfa
Copy link
Member

0x5bfa commented Dec 26, 2023

This approach would work, but it means duplicating every change to those files. Alternatively, we could have a build script that automates copying the changes but at that point it's not much better than doing it from the pipeline.

I made it in #14218 - Configure-AppxManifest.ps1


Let me work on this.

  • App execusion alias (in Package.appxmanifest)
    • files.exe
    • files-pre.exe
    • files-dev.exe
  • App URI scheme (in Package.appxmanifest)
    • files-app
    • files-app-pre
    • files-app-dev

The most important part of this work would be replace all hardcoded strings with constants.

@Josh65-2201
Copy link
Member

The set as default option would also have to be updated to use the new names as the reg file just assumes files.exe right now

@0x5bfa
Copy link
Member

0x5bfa commented Dec 26, 2023

@yaira2 Do you think app URI scheme can be just files.exe instead of files-app.exe?

@yaira2
Copy link
Member

yaira2 commented Dec 26, 2023

The app reduces the chance that another app will have the same scheme but we can try without.

@0x5bfa
Copy link
Member

0x5bfa commented Sep 12, 2024

Does this look ok main...0x5bfa:5bfa/CQ-SeparatedAppAlias

I think we should also update system tray icon guid to be unique per.

@yaira2
Copy link
Member

yaira2 commented Sep 12, 2024

@0x5bfa we need to make some adjustments as well as update the Azure Pipeline, but your branch looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Planning stage
5 participants