Skip to content

Fix: Launch files from jar archives#18554

Open
marko1olo wants to merge 1 commit into
files-community:mainfrom
marko1olo:fix-jar-archive-file-launch
Open

Fix: Launch files from jar archives#18554
marko1olo wants to merge 1 commit into
files-community:mainfrom
marko1olo:fix-jar-archive-file-launch

Conversation

@marko1olo

@marko1olo marko1olo commented Jun 6, 2026

Copy link
Copy Markdown

Resolved / Related Issues

Summary

  • Launch files inside browsable archives through their streamed StorageFile representation instead of passing the virtual archive path to the Win32 shell path.
  • Initialize LauncherOptions with the Files window handle for the archive-entry launch path, matching the nearby user-initiated launcher flows.
  • Keep the existing Win32 fallback if the WinRT file launch fails.
  • Leave normal filesystem files and the existing image-specific neighboring-files flow unchanged.

Why

Files inside archives such as .jar have virtual paths like archive.jar\path\File.class. Passing that path to the Win32 shell does not point at a real filesystem item, so double-clicking non-image files inside .jar archives can do nothing. ZipStorageFile.ToStorageFileAsync() already materializes archive entries as streamed StorageFile objects, which is the launch path used for archive images.

Steps used to test these changes

  1. Ran git diff --check.
  2. Restored the missing server assets with dotnet restore src\Files.App.Server\Files.App.Server.csproj -p:Platform=x64 --nologo.
  3. Ran dotnet build src\Files.App\Files.App.csproj -c Debug -p:Platform=x64 --no-restore --nologo; the build reached the app XAML compilation stage, then failed with WMC9999 because the local XAML compiler package could not load Microsoft.UI.Xaml.Markup.Compiler.ErrorMessages.resources.
  4. Compared the new archive-entry launch path with the existing image and app-picker launch paths in NavigationHelpers.OpenFile.

@marko1olo marko1olo force-pushed the fix-jar-archive-file-launch branch from 14ca6bf to 904af74 Compare June 6, 2026 03:03
@marko1olo marko1olo changed the title Fix launching files from jar archives Fix: Launch files from jar archives Jun 6, 2026
@Josh65-2201

Josh65-2201 commented Jun 6, 2026

Copy link
Copy Markdown
Member

You should test your changes in Visual Studio https://files.community/docs/contributing/building-from-source what you put in the steps to test is not testing anything related to the change you have made

@Josh65-2201

Copy link
Copy Markdown
Member

This doesn't show the open with prompt for files with no program associated

@marko1olo marko1olo force-pushed the fix-jar-archive-file-launch branch from 904af74 to 26df283 Compare June 8, 2026 17:50
@marko1olo

Copy link
Copy Markdown
Author

Good catch. I pushed 26df283 to cover that case as well.

The archive branch now keeps the direct LaunchFileAsync(storageItem, options) path for entries that already have an association, but if that returns false, it retries the same extracted StorageFile with LauncherOptions.DisplayApplicationPicker = true before falling back to the old Win32 launch path. That should make unassociated archive entries show the Windows app picker instead of trying to shell-launch the virtual archive.jar\entry path.

Suggested manual checks for this PR:

Local checks:

  • git diff --check passed.
  • dotnet build src\Files.App\Files.App.csproj --no-restore -p:Configuration=Debug -p:Platform=x64 did not finish within 5 minutes in this checkout, so I stopped it and checked that no repo build processes were left running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Cannot open files inside a .jar archive by double-clicking like in .zip archive

2 participants