Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi!

Anyone know how to replace files in a selfextracting CAB archive?

I'd like to tweak an installation but I can't write the cahnges back neither with WinZip or WinRar.

 

TIA

/Kejpa

Posted

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.

Posted
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

Posted

I don't 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. You'd 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, I'm afraid...

Posting Guidelines

 

Avatar by Lebb

Posted
... the only reasonable approach is de-compress' date=' edit, and then re-compress, I'm afraid[/quote']

I'm 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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...