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.
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)
Please log in to answer
Posted by:
anonymous_9363
16 years ago
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.
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
16 years ago
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
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
16 years ago
Posted by:
AngelD
16 years ago
Posted by:
zafar.khan
16 years ago
Posted by:
anonymous_9363
16 years ago
ORIGINAL: zafar.khanSo, 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.
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.
I think that would best be described as 'sub-optimal'...
Posted by:
instedit
16 years ago
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.
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:
AngelD
16 years ago
Posted by:
nheim
16 years ago
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
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
16 years ago
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.
so that the conversation will remain readable.