When extracting multiple self extracting .EXEs with 7-Zip, how do I specify to only overwrite if newer?

0

I have a bunch of self extracting .EXE files that I'm using 7-Zip to extract. I only want files to be overwritten with newer versions. The 7-Zip extract dialog only gives me the option to overwrite files without asking, not about which file wins. The dialog seems to imply that the newly extracted file will always overwrite the existing file, regardless of timestamp.

Howiecamp

Posted 2010-12-12T17:21:02.057

Reputation: 1 438

Answers

1

I doubt that any of the sfx front ends allow for this. You'll probably have to use the archive's extraction utility to do this. 7-zip does have some alternate sfx modules available from it's SourceForge project page, maybe one of those will give you that feature.

afrazier

Posted 2010-12-12T17:21:02.057

Reputation: 21 316

I see what you mean - do you know if the file overwrite mode behavior is a function of the tool that creates the archive (whether it's a .zip or sfx) or the extraction tool? Id have to assume that an extraction tool could support this regardless of the packaging method? – Howiecamp – 2010-12-12T18:30:35.397

Your assumption is correct -- it's part of the extraction tool. In the case of an SFX, the extraction tool is simply added to the beginning of the archive, but that doesn't prevent you from using 7-Zip (or any other archive utility) directly to extract the file. – afrazier – 2010-12-13T14:04:32.150

@afrazier - Nuts. So given this here's my thoughts - I have a ton of these self extracting .EXEs I need to extract - they are a backup of a file system which has a common root, and these .EXEs each contain portions of the directory tree. If I wanted to build this tree and have the most recent version of a file overwrite an older version, might the easiest way to do this to extract all the .EXEs (I could script this) into their own dedicated directories and then use another script to do the copying of the data into a common root? – Howiecamp – 2010-12-13T16:23:53.333

That would work. You're going to have to make sure that your extraction tool correctly restores modification timestamps -- most do, but it's something that needs verified. – afrazier – 2010-12-13T17:05:17.180

@afrazier - Good point about the modification timestamp. Not to mention I have to make sure that the modification timestamps are preserved in the zip file in the first place! – Howiecamp – 2010-12-13T17:17:21.737

If these SFXs ever need rebuilt, check out the modified SFX modules by Oleg Scherbakov. It looks like it has options for only overwriting older files.

– afrazier – 2010-12-13T21:25:48.697