Zipping is hard
-
Bernie tried to create a map for OsmAnd. He downloaded OsmAndMapCreator, unzipped it, started the Windows batch file, as described. He was greated by a Java error: the file
OsmAndMapCreator.jar
was not found.
Bernie investigated the case. Nowhere in the folder of the batch file, nor in some sub-folders was a file with that name.
Well, it turned out that the file actually existed in the zip archive. But with a stupid directory:.\OsmAndMapCreator.jar
(see also https://github.com/osmandapp/Osmand/issues/7420 ).
The built-in zip utility of Windows does nothing with that file (also no error message - WTF?). WinRAR places it it in the main folder - and voilà, the program works.
How is it possible to create such a crappy zip file? Obviously, there are no limits to Open Source Software.
-
@BernieTheBernie said in Zipping is hard:
How is it possible to create such a crappy zip file?
If WinRAR handles it correctly, is it the zip that has the issue or Windows unzip utility?
-
@BernieTheBernie said in Zipping is hard:
The built-in zip utility of Windows does nothing with that file (also no error message - WTF?).
It used to be that the built in zip support was a very light version, with lots of unsupported cases.
A real app to dealing with compressed files was needed (winzip, winrar, 7-zip), usually installed short after a fresh windows installation to help with subsecuent sw installations.
I guess in 2019 is the same?
-
@Dragoon said in Zipping is hard:
If WinRAR handles it correctly, is it the zip that has the issue or Windows unzip utility?
@cabrito said in Zipping is hard:
A real app to dealing with compressed files was needed (winzip, winrar, 7-zip), usually installed short after a fresh windows installation to help with subsecuent sw installations.I guess in 2019 is the same?
Yes. You still really need WinRar or 7-zip. The built-in .zip handling of Windows is rudimentary at best, and not even worth bothering with.
-
-
@TimeBandit said in Zipping is hard:
@El_Heffe said in Zipping is hard:
You still really need WinRar or 7-zip
WinRar
What's the problem? Works perfectly fine and handles everything.
-
-
@TimeBandit said in Zipping is hard:
@El_Heffe said in Zipping is hard:
What's the problem?
Mainly the price $29
Oh, now I get it. You're one of THOSE guys.
-
-
@TimeBandit I'd like 7-zip a lot more if Explorer integration actually worked. For at least 15 years now, they've had a bug where double-clicking on a .7Z file brings up a useless error message rather than opening the archive. Given that actually opening the archive from the context menu works just fine, it's not as if this is an intractable problem, but somehow they've never gotten around to getting off their lazy and fixing it!
-
@Mason_Wheeler said in Zipping is hard:
they've never gotten around to getting off their lazy and fixing it!
It's open source, what's your excuse for not fixing it?
-
@Mason_Wheeler said in Zipping is hard:
@TimeBandit I'd like 7-zip a lot more if Explorer integration actually worked. For at least 15 years now, they've had a bug where double-clicking on a .7Z file brings up a useless error message rather than opening the archive. Given that actually opening the archive from the context menu works just fine, it's not as if this is an intractable problem, but somehow they've never gotten around to getting off their lazy and fixing it!
Maybe that's why they've never made the installer associate the file extension... (but then I'm normally just using the 'extract here' command instead...)
-
@dcon said in Zipping is hard:
Maybe that's why they've never made the installer associate the file extension...
After installing 7-Zip, double-clicking attempts to open 7-Zip. If the installer's not doing that, what is
-
@BernieTheBernie The ZIP format has some... idiosyncrasies. I was trying to figure out why my plugins were getting rejected due to an invalid manifest, until I opened it up in a different ZIP viewer and saw two manifests, with the exact same name, in the exact same directory.
-
@Mason_Wheeler said in Zipping is hard:
@dcon said in Zipping is hard:
Maybe that's why they've never made the installer associate the file extension...
After installing 7-Zip, double-clicking attempts to open 7-Zip. If the installer's not doing that, what is
They must have changed it. It never used to. And I've been conditioned from when it didn't to not even try...
Edit: No, I just tried on my system here, and Windows pops up the "How do you want to open this file?" dialog.
-
@BernieTheBernie said in Zipping is hard:
built-in zip utility of Windows
sucks donkey balls. Not sure why you're trying to use it, it's not even a last-resort for me...
-
@dcon It's possible I'm misremembering. If so, that's an even bigger . The installer should associate it, and it should work as expected.
-
@Mason_Wheeler said in Zipping is hard:
they've had a bug where double-clicking on a .7Z file brings up a useless error message rather than opening the archive.
E_NO_REPRO
. Do you even have it associated?
-
@Mason_Wheeler said in Zipping is hard:
@dcon It's possible I'm misremembering. If so, that's an even bigger . The installer should associate it, and it should work as expected.
Maybe you tried to make the association? (I seem to remember trying that years ago and failing. And then mucking thru regedit to break that association)
Edit: Just associated it to 7zfm.exe - hey, it works!
-
@dcon said in Zipping is hard:
@Mason_Wheeler said in Zipping is hard:
@dcon It's possible I'm misremembering. If so, that's an even bigger . The installer should associate it, and it should work as expected.
Maybe you tried to make the association? (I seem to remember trying that years ago and failing. And then mucking thru regedit to break that association)
Yeah, if you associated it to
7z.exe
, you did it wrong, it's7zfm.exe
.Edit: Retroactively
-
@Tsaukpaetra said in Zipping is hard:
@BernieTheBernie said in Zipping is hard:
built-in zip utility of Windows
sucks donkey balls. Not sure why you're trying to use it, it's not even a last-resort for me...
It's not that bad although it does sometimes irritate me that Windows can only handle zip files out of the box and not other types of archive.
-
@loopback0 What's so irritating about optimizing for the most common case (by far) and leaving it to third party extensions to implement support for archive formats that are orders of magnitude less popular?
-
@Dragoon said in Zipping is hard:
@BernieTheBernie said in Zipping is hard:
How is it possible to create such a crappy zip file?
If WinRAR handles it correctly, is it the zip that has the issue or Windows unzip utility?
Almost certainly the latter.
-
@Mason_Wheeler you just don't get it, they shouldn't have any support for anything. Don't even get me started on how Notepad doesn't support ODT.
-
@BernieTheBernie said in Zipping is hard:
I love how they closed the issue immediately without any investigation, but later when it was shown that there is actually a problem, they acknowledged it in a comment, but haven't reopened the issue.
-
Since its release in Windows XP, Zip folders has not been actively developed. The reason is the usual: Because adding features requires engineering resources, and engineering resources are limited.
IOW, they prefer to spend engineering resources on adding ads to your start menu
-
@Mason_Wheeler said in Zipping is hard:
@loopback0 What's so irritating about optimizing for the most common case (by far) and leaving it to third party extensions to implement support for archive formats that are orders of magnitude less popular?
At work I spent my time largely dealing with macOS, Windows, RHEL and Solaris. 3 out of 4 of them support more than zip out of the box.
-
@dcon said in Zipping is hard:
@Mason_Wheeler said in Zipping is hard:
@dcon said in Zipping is hard:
Maybe that's why they've never made the installer associate the file extension...
After installing 7-Zip, double-clicking attempts to open 7-Zip. If the installer's not doing that, what is
They must have changed it. It never used to. And I've been conditioned from when it didn't to not even try...
Edit: No, I just tried on my system here, and Windows pops up the "How do you want to open this file?" dialog.
I got that, too, but the first time it occurs, I find 7zfm.exe, set the flag to "always use this program," and voila: I never have to bother with it again.
-
@loopback0 This is true. It's also true that Zip is ubiquitous to a degree that other archive formats can only dream of, and has been for decades now. Heck, it was true waaaaaaaay back in 1995, when Java (which was hardly designed for primarily DOS/Windows development!) made their JAR archives Zip files rather than some other format.
-
@TimeBandit said in Zipping is hard:
Since its release in Windows XP, Zip folders has not been actively developed. The reason is the usual: Because adding features requires engineering resources, and engineering resources are limited.
IOW, they prefer to spend engineering resources on adding ads to your start menu
As a business owner, wouldn't you?
-
@Gąska As a business owner, I wouldn't, because I'm familiar with research showing that overly in-your-face advertising is of negative value.
-
@Mason_Wheeler as an engineer, you probably also know that adding a fairly non-trivial piece of code that will be used approximately never is also negative value.
-
@Gąska True enough, but I'm a bit surprised by Raymond's article, given that Microsoft has their own working and well-tested ZIP implementation already. If they've got old third-party code that's bitrotted, unmaintained and poorly understood... why not just replace the implementation with their own system that they already have?
-
@Mason_Wheeler if Windows Explorer is anything like any other legacy GUI application in existence (and I bet you it's 10 times worse than most), replacing it would itself be a significant effort (especially since ZipFile is part of .Net Framework, ie. a different tech stack than Explorer). Also, there are approximately 436,734,724 other, more important things to take care of.
-
I'm not sure about zip, but I recall for
tar
any/./
and/../
components in the path name indicate the file is malicious.
-
I'm way more of a power user than most (except those here), and I've never run into a limitation of the built-in Windows Zipped Folder implementation (except not handling non-zip files). So personally, making it better is way down the priority list.
-
@Gąska said in Zipping is hard:
there are approximately 436,734,724 other, more important things to take care of.
IOW, Windows is full of bugs
-
@Benjamin-Hall said in Zipping is hard:
I'm way more of a power user than most (except those here), and I've never run into a limitation of the built-in Windows Zipped Folder implementation (except not handling non-zip files). So personally, making it better is way down the priority list.
I agree. I can zip a folder or a selection of items, and I can easily unzip as well. I basically never need to password protect a zip file I've created and I don't even know what other advanced features there are
-
@Mason_Wheeler said in Zipping is hard:
@TimeBandit I'd like 7-zip a lot more if Explorer integration actually worked. For at least 15 years now, they've had a bug where double-clicking on a .7Z file brings up a useless error message rather than opening the archive. Given that actually opening the archive from the context menu works just fine, it's not as if this is an intractable problem, but somehow they've never gotten around to getting off their lazy and fixing it!
, both explorer integration and opening files.
-
@Jaloopa said in Zipping is hard:
@Benjamin-Hall said in Zipping is hard:
I'm way more of a power user than most (except those here), and I've never run into a limitation of the built-in Windows Zipped Folder implementation (except not handling non-zip files). So personally, making it better is way down the priority list.
I agree. I can zip a folder or a selection of items, and I can easily unzip as well. I basically never need to password protect a zip file I've created and I don't even know what other advanced features there are
For anything fancy I can just use 7-zip.
-
@TimeBandit said in Zipping is hard:
Since its release in Windows XP, Zip folders has not been actively developed. The reason is the usual: Because adding features requires engineering resources, and engineering resources are limited.
IOW, they prefer to spend engineering resources on adding ads to your start menu
Microsoft has 144,000 employees and revenue of $125 Billion a year.
"But we can't work on that feature because resources are limited".
-
@El_Heffe And they have like five hundred products and other random shit to do.
-
@pie_flavor said in Zipping is hard:
random shit to do.
Including spending a few man-days sprucing up random products like Notepad?
-
@BernieTheBernie said in Zipping is hard:
.\OsmAndMapCreator.jar
I had a very similar problem the other day. I’ve been playing WoW Classic and wanted to install the Questie addon for it. Downloaded it, unzipped it and chucked the folder into WoW’s AddOns folder. Started the game, and it didn’t even show up in the addon list. It turned out the folder had 174 files in it, all with names like
QuestieDev-master\.github\ISSUE_TEMPLATE\bug_report.md
andQuestieDev-master\Libs\AceConfig-3.0\AceConfigCmd-3.0\AceConfigCmd-3.0.lua
.Downloaded it from another site, and that unzipped into a couple of files plus subdirectories, and of course it worked fine then.
Reading this thread, I’m starting to wonder which Windows zip utility has recently had a bug introduced into it?
-
@Gurth said in Zipping is hard:
Downloaded it,
Sounds like you downloaded source, not release. Yeah yeah, sometimes there's no difference...
-
@Tsaukpaetra Nope, something was definitely wrong with the filenames as they came from the zip:
It also looks like the zip included dev files that weren’t supposed to make it into the release, sure, but that was not the main problem.
-
@Gurth Ah, looks like they indeed violated the zip specification:
4.4.17 file name: (Variable)
4.4.17.1 The name of the file, with optional relative path.
The path stored MUST NOT contain a drive or
device letter, or a leading slash. All slashes
MUST be forward slashes '/' as opposed to
backwards slashes '' for compatibility with Amiga
and UNIX file systems etc. If input came from standard
input, there is no file name field.
-
@JBert Looks like whatever library they used to create the zip file violated the specification; invalid filenames, especially something so authoritatively invalid as to be marked with a MUST NOT in the spec, should be rejected as erroneous rather than put into the archive.
-
@loopback0 said in Zipping is hard:
@Mason_Wheeler said in Zipping is hard:
@loopback0 What's so irritating about optimizing for the most common case (by far) and leaving it to third party extensions to implement support for archive formats that are orders of magnitude less popular?
At work I spent my time largely dealing with macOS, Windows, RHEL and Solaris. 3 out of 4 of them support more than zip out of the box.
But none of them have as much engineering resources as Microsoft!
EDIT: I wanted to write this the other way around to make it sarcastic, now it’s just factual.
-
@pie_flavor said in Zipping is hard:
@El_Heffe And they have like five hundred products and other random shit to do.
And what's one of their biggest, most well-known products? One that brings in a substantial amount of money?
Oh, that's right . . . . Windows.
Sorry, but "engineering resources are limited" is a bullshit argument in this case.