buildactions icon indicating copy to clipboard operation
buildactions copied to clipboard

Fix for ZIP File Creation on MacOS Using System.IO.Compression

Open cosformula opened this issue 2 years ago • 0 comments

There is a known issue where creating a ZIP file using the ZipFileOperation action on MacOS results in a non-functional archive when opened with the MacOS default "Archive Utility." Users encounter an error: "The application 'xxx' can’t be opened."

image

The underlying issue is that UNIX executable permissions are not retained when the ZIP file is created. Addressing this requires setting the "external attributes" in the ZIP file's metadata, a feature not supported by Ionic.Zip.

To solve this, the pull request implements ZIP file creation using System.IO.Compression.ZipArchive which allows for updating the "ExternalAttributes" to preserve the necessary permissions.

System.IO.Compression has been supported in Unity since version 2017.1 with the availability of .NET 4.6.

For further reference, please see: https://github.com/rtouk/macifyZip

cosformula avatar Jan 08 '24 07:01 cosformula