[RELEASED] zip / gzip native multiplatfrom plugin

Hi @elias_t ,

I have just updated to version 2.9.2. I found that lzip.getTotalFiles returns the same value as lzip.getTotalEntries. Both includes the folder counts. I compared the codes, both are identical. It looks like a bug.

Per the document in the code, getTotalFiles should only return the file counts, excluding the folder counts right?

Thank you!

Hello. Yes this is an issue that will be resolved in the next update.

But you can call lzip.getFileInfo on a zip file and use the lzip.zipFiles and lzip.zipFolders global vars to get these numbers.

1 Like

OK, cool! I will try that. Thank you for your tips and quick response.

Update version 2.3

  • Added a function to extract multiple entries to multiple byte buffers.
  • Added a function to decompress a gzip from a buffer to disk.
  • UnGzip2 function fix.
  • zipGetTotalFiles fix
  • iOS plugins compiled with xcode 14 for amr64 and xcode 13.4 for arm64/armv7 support.

Update version 2.4

  • Android: added x86 and armv7 plugins that will support files larger than 2GB. (Minimum api=24, 7.0 Nougat)
  • Fixed an issue with creation of tar archives when a file path would be larger than 100 characters.

Hi there,

Iā€™m running into the same issue. I imported the plugin into a Unity2021 project, and Webgl wonā€™t compile. Thereā€™s no .a file extension files in the webGL plugins folder; only .bc. I tried making a brand new 2021 project to try and see if it imported well, but it didnā€™t work. Same compile error as that guy.

WebGL/zipw.bc: machine type must be wasm32 or wasm64

How to proceed?

Hello.

Last time I checked Unity supposed to download the asset according to unity version. It seems something does not work right in this scope.
I will send you a private message with the .a WebGL plugins.

(I will include these also in every version update from now on.)

Hi elias,
I also have this problem, can you send me a webgl plugins?

Check your pm.

Thank you for the great asset! I have one request: I would like support for the Apple Vision Pro (visionOS). Please consider this. Thank you!

Hi there, we bought the plugin today for our unity game launcher, which downloads zipped game build from our internet site and should decompress it in the background on the client/local machine. However, the launcher gets absolutely stuck in the ā€œapplication not respondingā€ during the local decompression process. Any ideas, what is causing the launcher app to freeze during the decompression and how to solve it?

Once the decompression is finished, the launcher application de-freezes and functions properly. It does not do this freezing sh*t when decompressing smaller files (round 500MB), but does it in your build case (round 4GB of compressed file size).

Thanks!

Have you run the unzip command in a separate thread?
This is the recommended way of doing it.

Thanks for a quick response, it seems like that was the issue. Kudos and thanks again!:slight_smile:

Hi! in testZip.cs you can see something like:

float percentage = (float)(totalBytes / progress[0]);

but this leads to Operator ā€˜/ā€™ is ambiguous on operands of type ā€˜ulongā€™ and ā€˜intā€™

How do I properly get the percentage in time of the extraction?

Hello.

Just initialize progress as Ulong or UInt64.

Casting progress[0] to UInt64 and uLong doesnā€™t show the progress properly. Should I directly set the type to those?

Btw, other issue, I canā€™t seem to get setEncoding working for Android. But I still need to download UTF-8 encoded files, any idea?

  1. Yes.

  2. setEncoding is only for windows. On nix systems there should be no issue. If you have any send me a sample zip to test.

Sent by pm

Hi Elias,

Been using this for a while on OSX and iOS without issue, but recently using it in my Windows x64 project (not UWP and not even doing a x86 build). However, I keep getting DllNotFoundException in the Editor when I try to start the project. On Windows 11, first Unity project in Windows, and Iā€™ve double checked that zip\Plugins\x86_64 is only enabled for x64.

Other plugins like FMOD are ok, so I am puzzled and out of ideas. I checked permissions and everyone had read and execute permission.

Thanks!

UPDATE:

Ok, so the .dll in question was pulled from a git repo. To troubleshoot, I installed zip from the Package Manager (on top of what I had which was all the same / latest version), and the DLL loaded. I check git and it shows the ā€œnewā€ DLL and corresponding .meta was unchanged (as expected). I then delete them both and then reload it from my git repoā€¦and it works?

Any ideas on what is going on? Perhaps there is a flag (in Windows or the project) that was affected when I reinstalled from the Package Manager. I donā€™t like mysteries like these.