7Zip WTF



  • I'm a fan of the Half Life series, so I thought I'd go and install the Cinematic Mod. When you run its installer, it unpacks a 7Zip decompressor and a bunch of 7Zip archives, and then proceeds to run the decompressor to unpack the archives.

    Now, this thing, despite its size, is just someone's hobby project so I'll forgive the archives-within-archives WTF. (Though the mods themselves look like something a big studio would put out - euh, optional new Alyx notwithstanding - good thing she's optional - and this guy did it all by himself, so why he then decided to half-ass the installer after all that is a mystery to me.)

    7Zip, however, does not deserve a pass. For what does 7Zip do? You'd expect an unarchiving utility, when told to decompress an archive into a certain folder, to decompress the archive and put the files into that folder.

    7Zip does not do this. 7Zip creates a temporary folder, unpacks the archive into there, copies the unpacked files one-by-one into the destination folder, and then deletes the temporary folder. For why would you do something the easy way if you can take the data on a tour of the system instead? It's not like you could just write to any old folder, after all. And we've got plenty of time and disk space anyway.


  • ♿ (Parody)

    @marinus said:

    7Zip creates a temporary folder, unpacks the archive into there, copies the unpacked files one-by-one into the destination folder, and then deletes the temporary folder.

    I've always assumed this was to stop the user from fucking around with files that aren't done yet (since the names look weird and weren't what they were expecting). Just like what browsers do when you download a big file.



  • Download breaks half way through (as in browser)? Oh no... a single file (normally), with a weird extension.

    I would also assume that the "temp directory" detour is a defense against polluting the destination folder in case of "whoops, archive is broken... half of the files are now in your destination folder". Breaks, and it's in a temp folder? No harm, no foul. I'd rather have THAT than a half finished unzip in the destination folder.



  • @WernerCD said:

    I'd rather have THAT than a half finished unzip in the destination folder.

    Especially, when you are replacing the files in the destination folder.



  • @WernerCD said:

    I would also assume that the "temp directory" detour is a defense against polluting the destination folder in case of "whoops, archive is broken... half of the files are now in your destination folder".

    Except that's not what it's doing. It decompresses a file, copies it to the destination folder, decompresses the next file...



  • It also makes it compatible with drag&drop, since they were too lazy to implement that correctly. It decompresses into a temp folder, then instructs Windows to do the drag&drop from there, where it's simpler code because it's files-to-files.

    A correct app would expose the selected files as virtual files to the drag&drop system. But of course any open source project can be guaranteed to get little details like this (a.k.a. "quality") wrong.



  • I though 7zip does everything to temp THEN temp to destination... your saying that it's 1 file to temp THEN that file to destination, rinse, lather, repeat?

    Granted, I don't pay a whole lot of attention... but my experience has been the former (7zip running in background for ages then files start moving over). Is there optional run time parameters? Did they change the default?


  • FoxDev

    It's definitely all-into-temp then copy-to-destination.


  • FoxDev

    Even better: when you do the drag-drop, and close the target window during the extraction, the copy-to-destination fails, as 7-zip can no longer get the target folder.


  • Banned

    You know, many archivers do that - use temporary folder and then move to destination. 7-Zip's fail here is minor here - copying and deleting instead of moving; almost the same thing, except if you have single file that is 20GB or so - then, instead of just creating one inode, you have to duplicate whole content.

    Fun fact: last time I checked (few years ago), 7-Zip was actually the only archiver that let you extract files directly into destination folder. You just have to use "copy" command instead of "extract". Yay open-source naming schemes.



  • @Gaska said:

    You know, many archivers do that - use temporary folder and then move to destination. 7-Zip's fail here is minor here - copying and deleting instead of moving; almost the same thing, except if you have single file that is 20GB or so - then, instead of just creating one inode, you have to duplicate whole content.

    Unless you're careful to use a temp folder on the same volume as the final destination (and good luck always finding one you can use, other than perhaps where you're instructed to unzip to anyway), extract-to-temp/move itself is already a moderate WTF.

    I'd go so far as to say the difference in WTFery between extract-to-destination and extract-then-move is bigger than extract-then-move to extract-copy-delete.



  • @Gaska said:

    Fun fact: last time I checked (few years ago), 7-Zip was actually the only archiver that let you extract files directly into destination folder. You just have to use "copy" command instead of "extract".

    At least from the Windows Explorer right-click menu, which is about the only way I ever use it, it's 7-Zip -> Extract Here. Whether it extracts them directly there, or to a temp directory, I don't know. The kinds of things I tend to extract are small, so they appear in the destination folder "instantly."


  • Banned

    Well, my typical use case is downloading something via browser, opening the archive via browser, clicking "copy" and selecting the destination from directory tree. Expect small-things-I'll-delete-in-a-second-so-it's-okay-if-they'll-land-on-desktop, it's more convenient than opening the right directory and drag'n'dropping.


  • kills Dumbledore

    My favourite 7Zip WTFs:

    The Add button. First button in the toolbar, pride of place. (supplimentary WTF, the tooltip gives no indication of what it does, just says "Add"). When you click on it you get an "Operation is not supported" popup. Here's an idea, why not only add the button when it is supported?

    Have you ever looked in the Edit menu? The keyboard shortcuts refer to "Grey +", "Grey *", etc. A bit of experimentation determines that they mean numpad +/- etc. My only guess here is that the developer who added the text for the shortcuts had a keyboard where the numpad is grey? I've never seen those keys called grey before.



  • @marinus said:

    7Zip does not do this. 7Zip creates a temporary folder, unpacks the archive into there, copies the unpacked files one-by-one into the destination folder, and then deletes the temporary folder. For why would you do something the easy way if you can take the data on a tour of the system instead? It's not like you could just write to any old folder, after all. And we've got plenty of time and disk space anyway.

    I believe winrar behaves the same



  • @marinus said:

    and this guy did it all by himself, so why he then decided to half-ass the installer after all that is a mystery to me

    Installers are a PITA and you have to pay for the good ones. Even then, the developer is good with game stuff, but sucks with system and doesn't care about learning a thing he'll probably forget in a day and doesn't provide any motivation for him.



  • When I needed to build an installer for our inhouse application I was totally floored by the amount of time I needed to build one.
    I was forced to use WiX because Clickonce did not work for some reason and spend a week or so crafting the installer file. And that was an easy "copy files, create shortcut" installer - I shudder when I think about more complicated projects.
    Clickonce is easier to build, but it's errors are arcane as hell and debugging it is a total pain, so I am still on the look for an easy installer-



  • @blakeyrat said:

    A correct app would expose the selected files as virtual files to the drag&drop system. But of course any open source project can be guaranteed to get little details like this (a.k.a. "quality") wrong.

    But the [url=http://www.7-zip.org/faq.html]FAQ[/url] says Explorer only works with files. Are you suggesting they lied or are incompetent?


  • Banned

    @jaloopa said:

    Have you ever looked in the Edit menu? The keyboard shortcuts refer to "Grey +", "Grey *", etc. A bit of experimentation determines that they mean numpad +/- etc. My only guess here is that the developer who added the text for the shortcuts had a keyboard where the numpad is grey? I've never seen those keys called grey before.

    I'd guess it's just a bad translation. Apparently, Russian term for numpad is серый, fuck knows why.



  • @HdS said:

    When I needed to build an installer for our inhouse application I was totally floored by the amount of time I needed to build one.

    WiX has a bit of a learning curve, but it's not bad after you do your first one. Most things that are hard in WiX are hard because the Windows Installer doesn't like them - usually because said thing makes uninstalls difficult.



  • @jaloopa said:

    Have you ever looked in the Edit menu? The keyboard shortcuts refer to "Grey +", "Grey *", etc. A bit of experimentation determines that they mean numpad +/- etc. My only guess here is that the developer who added the text for the shortcuts had a keyboard where the numpad is grey? I've never seen those keys called grey before.

    I have, a very long time ago (around 1990 or so). Of course, on my current main keyboard, those keys are the same shade of black as all the other keys...

    Back in the day, the non-numeric keys around the edge of the keypad were indeed a darker shade of grey than the number keys. On my desk I have a couple of spare keyboards (plugged into my spare firewalls), and one (a Logitech) has all the keys the same off-white colour, while the other (Dell QuietKey) follows a "grey" colour scheme (pale off-white for letters, F1-F4 and F9-F12 keys, space, main-keyboard number keys, and numeric keys on the numpad; darker brownish grey for numpad edge keys, F5-F8, shift/alt/ctrl/altgr, tab, capslock, Windows, right-click-menu, backspace, Esc, Enter, arrows, non-numpad home/end/pgup/pgdn/ins/del, sysreq, pause, scroll-lock).



  • @HdS said:

    When I needed to build an installer for our inhouse application I was totally floored by the amount of time I needed to build one.
    I was forced to use WiX because Clickonce did not work for some reason and spend a week or so crafting the installer file. And that was an easy "copy files, create shortcut" installer - I shudder when I think about more complicated projects.
    Clickonce is easier to build, but it's errors are arcane as hell and debugging it is a total pain, so I am still on the look for an easy installer-

    I use InnoSetup 5.something for my personal stuff. It's pretty straightforward for the copy-files-create-shortcut type installers.



  • @Zemm said:

    But the FAQ says Explorer only works with files. Are you suggesting they lied or are incompetent?

    Well they might be incompetent enough that they don't know it's a lie.

    I wonder if they ever stop to think about how Outlook does the exact same goddamned thing as them, but without any temp folder?


  • kills Dumbledore

    @blakeyrat said:

    I wonder if they ever stop to think about how Outlook does the exact same goddamned thing as them, but without any temp folder?

    M$ using super secret internal Windows details that they're not allowed access to. It's a conspiracy to kill open source


  • ♿ (Parody)

    @blakeyrat said:

    I wonder if they ever stop to think about how Outlook does the exact same goddamned thing as them, but without any temp folder?

    Why would anyone know what Outlook is doing?



  • Well they don't know what Outlook is doing, but at least it indicates that what they want to do is possible. And it turns that little blurb from their FAQ from being wrong to being "provably wrong by almost anybody anywhere ever in like 4 seconds".


  • BINNED

    @boomzilla said:

    Why would anyone know what Outlook is doing?

    I have a strong impression even Outlook doesn't know what it is doing most of the time. Except for hogging memory and spamming notifications.
    Memory hogging and notification spamming ... sounds a lot like discourse too.



  • @jaloopa said:

    M$ using super secret internal Windows details that they're not allowed access to. It's a conspiracy to kill open source

    Actually, it's more like 'Outlook jumping through 30 annoying COM hoops to use Explorer's public interface for this job, because that's the only way to talk to Explorer'.


  • ♿ (Parody)

    @blakeyrat said:

    Well they don't know what Outlook is doing, but at least it indicates that what they want to do is possible. And it turns that little blurb from their FAQ from being wrong to being "provably wrong by almost anybody anywhere ever in like 4 seconds".

    Yeah, I can see how that works. Very similar to most blakeyrants.





  • Yeah, it's as I said above: the only way to get Explorer to do this is through COM, which is probably why 7-Zip etal don't implement it, because COM is an absolute bastard to get right, AIUI.


  • Discourse touched me in a no-no place

    @tarunik said:

    because COM is an absolute bastard to get right, AIUI.

    Less than you think if you follow the rules.


  • Discourse touched me in a no-no place

    @FrostCat said:

    Less than you think if you follow the rules.

    But you're here


  • Discourse touched me in a no-no place

    The rules are different here.



  • @tarunik said:

    Yeah, it's as I said above: the only way to get Explorer to do this is through COM, which is probably why 7-Zip etal don't implement it, because COM is an absolute bastard to get right, AIUI.

    So the 7-Zip FAQ should read “because we can’t be assed to implement a COM interface”, right?



  • @FrostCat said:

    Less than you think if you follow the rules.

    It's more that the rules have dark corners the experts are still discovering to this day.



  • Right. Being too fucking lazy to do it correctly isn't a very good excuse.


  • Discourse touched me in a no-no place

    @tarunik said:

    It's more that the rules have dark corners the experts are still discovering to this day.

    Yeah, kind of how the Old New Thing post referenced above was ninjaed recently in spite of being 6 years old.



  • @FrostCat said:

    The rules are different here.

    More what you call guidelines than actual rules.


  • Discourse touched me in a no-no place

    @Arantor said:

    More what you call guidelines than actual rules.

    Classical reference.



  • @FrostCat said:

    Classical reference.

    Indeed, I just CBA to find a YouTube link for it.


  • Discourse touched me in a no-no place

    Lol. It's not rocket science. I generally don't spend more'n about 10 seconds doing these.

    Youtube's so smart you can sometimes type the line before a quote you're looking for or "raj says poodle" or something and it'll find the quote you wanted.

    Now, bizarrely, sometimes it can't find something there's no reason it shouldn't be able to find, like Homer Simpson going "in case you couldn't tell, I was being sarcastic."



  • That's 10 seconds I could be thinking up more ways to be snarky 😛


  • Discourse touched me in a no-no place

    @Arantor said:

    That's 10 seconds I could be thinking up more ways to be snarky

    This tells me you don't always click the link, because they're not always to the obvious thing.



  • I usually click the link, I just CBA with the 10 seconds of me doing it. My time really is that valuable *laughs*



  • Mrs Scab, you have twelve hours to beat the clock.

    Find that video, win a pound.

    <You've given me the video before I've given you the pound, and that's not good business.>

    <Off you go.>


  • @tarunik said:

    Yeah, it's as I said above: the only way to get Explorer to do this is through COM, which is probably why 7-Zip etal don't implement it, because COM is an absolute bastard to get right, AIUI.

    I just took a quick look through 7zip source code. Guess what I found...

    So not only they use COM, but they also reimplement COM wrapper libraries.



  • @ben_lubar said:

    Mrs Scab, you have twelve hours to beat the clock

    Find that video, win a pound.

    nude mop



  • @HdS said:

    I am still on the look for an easy installer-

    NSIS.



  • I'd imagine this falls under a WTF, because it [i]does[/i] expand (don't you love the plethora of ways of saying the same thing?) files directly into the directory.


Log in to reply