Files icon indicating copy to clipboard operation
Files copied to clipboard

Improve support for compressing and decompressing archives

Open yaira2 opened this issue 6 years ago • 20 comments
trafficstars

This is a probably a lot of work so take your time but a way to zip files and extract them would be great.

  • [ ] Add support for creating new archives from selected items
  • [ ] Keep timestamps from the .zip file
  • [x] Extract files
  • [x] Menu options to extract items quickly without the use of the dialog
  • [ ] Support password archives (current zip lib supports them, mostly needs a dialog)
  • [x] When pasting a file into an archive the file is fully currently loaded into memory first (bad)
  • [x] "Extract" command on toolbar when an archive is selected or being browsed #7639
  • [x] 7zip & other formats support (requires switching to SharpCompress or something)
  • [x] Specific icon to show when zip files are associated with Files?
  • [ ] Add shell extensions to File Explorer
  • [ ] Add dedicated progress view when using shell extensions in File Explorer
  • [x] 7z
  • [ ] gz
  • [x] tar
  • [x] rar
  • [x] zip
  • [ ] lzma
  • [ ] lzh
  • [ ] arj
  • [ ] bz2
  • [ ] cab
  • [ ] chm
  • [ ] deb
  • [ ] iso (known to have issues with files displaying)
  • [ ] rpm
  • [ ] wim
  • [ ] udf
  • [ ] mub
  • [ ] xar
  • [ ] hfs
  • [ ] dmg
  • [ ] Z
  • [ ] xz
  • [ ] flv
  • [ ] swf
  • [ ] exe
  • [ ] dll
  • [ ] vhd
  • [x] msix
  • [x] appx

yaira2 avatar Feb 17 '19 21:02 yaira2

This might be useful https://github.com/adamhathcock/sharpcompress.

yaira2 avatar Jul 28 '19 16:07 yaira2

Maybe also looking inside zip files and opening files from there should be supported? (it is working like that currently in the file explorer)

BTW: extracting should imo always result in creating a folder with the same name like the zip file inside the directory and putting the content into this newly created folder. (file explorer is doing this as well)

szaimen avatar Nov 08 '19 22:11 szaimen

Maybe we can use https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile?view=netcore-3.1 ?

ChihweiLHBird avatar Jul 16 '20 07:07 ChihweiLHBird

This is a recommend to be added to Files UWP, when possible

chuchanpr avatar Jul 17 '20 18:07 chuchanpr

@ChihweiLHBird Using System.IO will make it slower because UWP apps have limited access and you need to use StorageItems to get them. Instead we can use the native API: https://docs.microsoft.com/en-us/uwp/api/Windows.Storage.Compression?view=winrt-19041

jaigak avatar Sep 05 '20 03:09 jaigak

@Jaiganeshkumaran Does the native API support folder items? In my analysis, it appears support for that is lacking, but I'm still unsure.

lukeblevins avatar Oct 04 '20 19:10 lukeblevins

@duke7553 It seems to not support by default but System.IO should be sufficient. Explorer has a private implementation which is not exposed to other apps.

jaigak avatar Nov 18 '20 03:11 jaigak

Please add this. It really annoys me when File Explorer opens because I double click on a .Zip file. If the team implements this, I would like them to add support for XZ, BZIP2, GZIP, and TAR.

icarusinthewings avatar Jan 12 '21 22:01 icarusinthewings

Maybe also looking inside zip files and opening files from there should be supported? (it is working like that currently in the file explorer)

BTW: extracting should imo always result in creating a folder with the same name like the zip file inside the directory and putting the content into this newly created folder. (file explorer is doing this as well)

I happen to use 7zip, and that gives me the option to choose how I extract an archive. image

mdtauk avatar Jan 12 '21 23:01 mdtauk

Hmmm

d2dyno1 avatar Apr 05 '21 21:04 d2dyno1

@d2dyno1 Do you want to work on this? We will probably want to use 7zip or something similar to power the feature.

yaira2 avatar Apr 05 '21 21:04 yaira2

@d2dyno1 Do you want to work on this? We will probably want to use 7zip or something similar to power the feature.

@yaichenbaum This is not possible with current state of Files' codebase. I'll focus on this particular codebase sector first before taking any actions on this feature request. Though implementing zipping and extracting files is possible.

d2dyno1 avatar Apr 05 '21 21:04 d2dyno1

@d2dyno1 Do you want to work on this? We will probably want to use 7zip or something similar to power the feature.

@yaichenbaum This is not possible with current state of Files' codebase. I'll focus on this particular codebase sector first before taking any actions on this feature request. Though implementing zipping and extracting files is possible.

I think we can implement zip and unzip functions with System.IO.Compression first. Any plan to start working on that?

ChihweiLHBird avatar May 11 '21 08:05 ChihweiLHBird

@ChihweiLHBird I'm very busy this month. Feel free to start initial work on this if you want :)

d2dyno1 avatar May 11 '21 08:05 d2dyno1

I think we can implement zip and unzip functions with System.IO.Compression first. Any plan to start working on that?

@ChihweiLHBird We used that in the original implementation, but we weren't very happy with the results. Because of this, we decided to base the feature off an alternative such as the shell dialog (with a custom UI), or a custom UI for 7zip.

yaira2 avatar May 11 '21 13:05 yaira2

@gave92, @yaichenbaum Hello is it possible just like 7-Zip by default to keep the 3 timestamps from the .zip file: Modified, Created and Accessed when extracting for folders and files?

If so can you add that detail to your first post here?

ghost avatar Aug 20 '21 17:08 ghost

https://www.7-zip.org/sdk.html Don't know if this would help but 7zip has an SDK and from what I can see they support C# and it gives access to 7zip compressing and decompressing (maybe viewing too) of many archive types.

Josh65-2201 avatar Sep 04 '21 00:09 Josh65-2201

@d2dyno1 are you still working on this issue?

yaira2 avatar Oct 10 '21 17:10 yaira2

Not working on all of the issues but can work on some of them.

d2dyno1 avatar Oct 10 '21 18:10 d2dyno1

I think it would be great if it was possible to integrate those libraries instead of 7zip https://github.com/mcmilk/7-Zip-zstd https://github.com/jinfeihan57/p7zip

wise-gorilla avatar Feb 13 '22 06:02 wise-gorilla

Could support be added for .mcpack. its just a zip file renamed for Minecraft's use

Josh65-2201 avatar Aug 24 '22 18:08 Josh65-2201

Can you upload file to test with?

yaira2 avatar Aug 24 '22 18:08 yaira2

GitHub doesn't support uploading it but you can just change the .zip to .mcpack zResourcePackBedrock.zip

Josh65-2201 avatar Aug 24 '22 18:08 Josh65-2201

.jar file could also have viewing/extracting support they use zip for it compresion.

Josh65-2201 avatar Sep 01 '22 23:09 Josh65-2201