Replacing files in CAB archives

kejpa

Well-known member
Joined
Oct 10, 2003
Messages
320
Hi!
Anyone know how to replace files in a selfextracting CAB archive?
Id like to tweak an installation but I cant write the cahnges back neither with WinZip or WinRar.

TIA
/Kejpa
 
What you want to do is to change the files while they are inside the CAB file? Why dont you just make the CAB file again?

... but now that you say that, I remember thinking how cool it would be if one could change the contents of a compressed file without compressing it again.
 
Why would you want to do this? Are you trying to doctor the original Windows OS files?
 
Mike_R said:
Why would you want to do this? Are you trying to doctor the original Windows OS files?
No not Windows OS,
I want to install Adobe Reader silently and without the user needing to interfer. In order to do that I need to change a few properties in one of the files (abcpy.ini) inside the selfextracting CAB archive.

Currently it looks like I have to extract all files, make the changes and ship all of the files instead of just a single one. Takes a whole lot of more place too :(

/Kejpa
 
I dont think you can get around that realistically. Compression works by substituting values with much-shorter-length tokens (just a few bits per token) The most frequent values get the shorter tokens.

The data you are adding likely is using some new values not already present in the table/dictionary, so they would need to be added to the table in addition to your data. Youd have to know where this table is and how it is setup. And then even "inserting" your data would be a very, very sensitive concept, slip on one bit and the entire file beyond the insertion point is completely corrupted.

Even if this were your own compression algorithm and you therefore knew how it worked extensively, you would still find it extremely hard to insert data like this, I think. I do think the only reasonable approach is de-compress, edit, and then re-compress, Im afraid...
 
Mike_R said:
... the only reasonable approach is de-compress, edit, and then re-compress, Im afraid
Im not afraid of that, what I need to know is which program to use. I can extract the file I want to change with Winzip but how do I write the changed file back?

/Kejpa
 
Back
Top