Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"blockmap" with "deflate" and no output file creates invalid ZIP #24

Open
garrettjstevens opened this issue Nov 18, 2019 · 2 comments
Open

Comments

@garrettjstevens
Copy link

I'm using electron-builder to create ZIP files, which uses app-builder internally. Specifically, it calls app-builder with the "blockmap" and "deflate" options and no output file. Sometimes when I run command-line unzip on the generated ZIP files, they give an error like:

Archive:  MyApp-2.0.0-mac.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.

I'm not a Go developer, but it looks to me like when blockmap is run with no output file, pkg/blockmap/blockmap.go is simply appending the compressed blockmap data to the end of the existing ZIP file. I found a really great comment at thejoshwolfe/yauzl#48 (comment) that discusses why appending data to the end of a ZIP file isn't valid.

I'd suggest using the end-of-central-directory comment to store the blockmap data, but it looks like the data can be longer than the max allowed comment length, so I'm not sure what would be the best approach.

Also xref electron-userland/electron-builder#3779, which helped me track this down.

@BotellaA
Copy link

BotellaA commented Jun 3, 2020

Any update on this issue?

@harshitsilly
Copy link

@BotellaA @garrettjstevens - u can use this gist after electron builder is done with the zip thingy.
https://gist.github.com/harshitsilly/a1bd5a405f93966aad20358ae6c4cec5
Check this space also which fix this + with other features - https://imjselectron.github.io/electron-differential-updater

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

No branches or pull requests

3 participants