Skip to content

Commit 7c8349e

Browse files
authored
Fix: Fixed issue with opening files from jar archives (#18554)
1 parent 74e29fc commit 7c8349e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/Files.App/Helpers/Navigation/NavigationHelpers.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,24 @@ private static async Task<FilesystemResult> OpenFile(string path, IShellPage ass
763763
if (!launchSuccess)
764764
await Win32Helper.InvokeWin32ComponentAsync(path, associatedInstance, args);
765765
}
766+
else if (childFile.Item is ZipStorageFile zipStorageFile)
767+
{
768+
var options = InitializeWithWindow(new LauncherOptions());
769+
var storageItem = (StorageFile)await FilesystemTasks.Wrap(() => zipStorageFile.ToStorageFileAsync().AsTask());
770+
if (storageItem is null)
771+
{
772+
await Win32Helper.InvokeWin32ComponentAsync(path, associatedInstance, args);
773+
}
774+
else if (!await Launcher.LaunchFileAsync(storageItem, options))
775+
{
776+
var pickerOptions = InitializeWithWindow(new LauncherOptions
777+
{
778+
DisplayApplicationPicker = true
779+
});
780+
if (!await Launcher.LaunchFileAsync(storageItem, pickerOptions))
781+
await Win32Helper.InvokeWin32ComponentAsync(path, associatedInstance, args);
782+
}
783+
}
766784
else
767785
{
768786
await Win32Helper.InvokeWin32ComponentAsync(path, associatedInstance, args);

0 commit comments

Comments
 (0)