/build/static/layout/Breadcrumb_cap_w.png

Change File in Cab

Hi,

I've got an msi that comes with a Cab file that contains all neccesary files for the installation.
Now I need to modify a file inside the CAB to create a silent installation with the correct config parameters.
I can do an Administrative install, modify the file, then it works fine.
But I would like to put all the extracted files ( including the modified config file) back into the CAB, like the original installation.
Is that possible? is there and inverse msiexec /a command ?
Thanks.

0 Comments   [ + ] Show comments

Answers (12)

Posted by: anonymous_9363 15 years ago
Red Belt
0
If this is a vendor MSI, you should use a transform. NEVER mess with vendor MSIs unless it's unavoidable (a scenario I have yet to encounter.)

Note that the two main MSI authoring tools use bizarre naming conventions for transforms but it's a simple exercise to rename the file created and then alter the corresponding name in the Media table. Of course, you don't *have* to rename them: I do because it makes life with my maintenance routines easier to have all my files named with the same prefix: FooBar.MSI, FooBar.MST, FooBar.CAB. I'm sure you get the idea.
Posted by: timmsie 15 years ago
Fourth Degree Brown Belt
0
You could use one of the CAB tools (that have been discussed in this thread http://itninja.com/question/dev-studio-users8)

Then extract the files from the cab file , change the config file that you need and then regenerate the cab file. If you do this you need to be very carefull that the order the files are added to the cab is the same as in the file table sequence.

the cabsdk is here
http://support.microsoft.com/kb/310618

As vbscab has said if it's a vendor app you should use a transform. You could create a new cabfile with your updated file in it. Update the file sequence of the affected file and the media table to point to your new cab.

hope that makes sense
Posted by: nheim 15 years ago
10th Degree Black Belt
0
Hi Marcel,
use 'WiMakCab.vbs' from the installer SDK.
You need the following command from the directory, where you put the admin installation.
cscript wimakcab.vbs "YourAdmin.msi" NameOfCABFile /L /C /U /E
It needs makecab.exe, which is part of the OS on XP and Vista.
Regards, Nick
Posted by: AngelD 15 years ago
Red Belt
0
Why overdue it.

I would just add the modified file to its own cab, change the sequence for the existing file entry and either have the cab as external or internal.

Marz28,
You already got the original MSI with existing CAB(s) so no need to re-cab the files again.
Posted by: zafar.khan 15 years ago
Yellow Belt
0
Hi,

There is a very simple solution.
Dont change anything in tha cab file.
Convert your msi in to WSI.
Change the respective file in the extracted folders
Compile your WSI to get the updated cab file and updated MSI.

Regards,
Zafar
Posted by: anonymous_9363 15 years ago
Red Belt
0
ORIGINAL: zafar.khan
There is a very simple solution.
Dont change anything in tha cab file.
Convert your msi in to WSI.
Change the respective file in the extracted folders
Compile your WSI to get the updated cab file and updated MSI.
So, if it's a vendor-supplied MSI, you now have a new ProductCode and UpgradeCode, meaning that none of the vendor's supplied updates would work.

I think that would best be described as 'sub-optimal'...
Posted by: instedit 15 years ago
Orange Belt
0
I second AngelD's solution. Add a Media table entry with a LastSequence value of one higher than the previous highest.

Change the File table entry for the relevant file to have a Sequence number the same as the newly created Media entry's LastSequence number. Then build the cab for the file and embed it or leave it external.

If you don't want to build a cab for the file, just put it in the relevant source folder (correction: put it in the same folder as the msi) and add the 0x002000 (non-compressed) attribute to the File table entry.

You can do all this with a transform (except embed the cab internally), or directly to the msi (frowned upon for vendor msi's).

For what it's worth, InstEd will quickly show you the source folder for the file by double clicking it's component in the relationships view, and then the component's directory in the relationships view. (The next version will show the target and source folders directly in the File table).

Additionally, the next version of InstEd will (for example) let you right click on the newly created Media table entry and select Rebuild cabs.
It will then build the cab from the source folders, and embed it or copy it externally, as the Media entry specifies.
Posted by: timmsie 15 years ago
Fourth Degree Brown Belt
0
Wasn't that my solution [;)]
Posted by: AngelD 15 years ago
Red Belt
0
You're absolutly correct Richard.

My response was to Nick as I was a little surprised he didn't suggested that in the first place [:D]
Posted by: instedit 15 years ago
Orange Belt
0
Sorry timmsie, I see it now.
Posted by: nheim 15 years ago
10th Degree Black Belt
0
Hi folks,
there are, as in most cases, several approaches, to solve this problem.
My answer to Marcel is solving his specific whish, to hold all files together in one place.
And because, i have used this not so well known way to alter a package, my self a few times, i suggested it to Marcel.
I find it relatively easy, as it is fully scriptable and reproduceable.
IMHO: For a MSI novice, this approach is easier to fulfill, as it needs no alteration of tables.
Regards, Nick
Posted by: AngelD 15 years ago
Red Belt
0
ORIGINAL: nheim

My answer to Marcel is solving his specific whish, to hold all files together in one place.

Been there and done it just recently.
However we sometimes forgett to maybe suggest another approach that may fit better.
As a beginner I think he/she will be glad for any advice + learn the ropes in the process.

Cheers Nick!

/Kim
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ