Let’s step back in time – before Windows Installer, and setups had no special security issues. In this situation I had to modify an existing installation – essentially frozen with no ability to recreate the application setup. I needed to replace an executable with a newer version, but leave intact the ability for the setup to work properly.
The CAB file associated with InstallShield v6x does not use the same Zip/Archive technique as PKZip or Microsoft. Consequently you cannot modify a CAB file unless you use the special batch command line tools provided by InstallShield.
Tools
ISCab.exe – command line tool used to add/modify/delete files
ISCabVu.exe – GUI tool used to view contents of a CAB file
Process
- Create a INI file listing of the CAB contents
We need to use the ISCab.exe in batch mode to create an INI file of the existing CAB file. Note we are only going to specify the DATA1.CAB – all other CAB files (Data2/Data3, ect) will be included in the INI file.
- Modify the INI file listing to reflect the revised or new files
Clone the output INI file from Step #1 and modify it. Look for all occurrences of the file we need to replace (in this sample it is “Archiver.exe”. To add or replace a file, we will use the same convention. Identify the File Group and signify which file is to be added. Here is a sample of Archiver.exe which was found in only one location.
[ISCAB Info]
Product=ISCAB
Version=2.0
[[Archiver]NS_NSR_NPL_1___<TARGET_DIR_ARCHIVER>_1]
File1=”Archiver.exe”
- Update the CAB contents
We need to use the ISCab.exe in batch mode to read the modified INI file and point to the CAB file we want to update.. Note the tool is relative stupid – we need to store the new/replacement files in the same directory as the ISCab.exe. The CAB will be updated in place – so copy it elsewhere if needed.
- Verify the CAB has been successfully changed
There are two methods we need to verify that the change was successful”
- Run step #1 again and specify a different output INI name. Use this to compare against the original INI – very that all of the other files are still within the CAB. The match should be perfect if you are replacing a file.
- Use the GUI CAB viewer “ISCabVu.exe” (in Expert Mode) to open up the DATA1.CAB that was modified. Using the File Group, look for the file with an altered TimeStamp and size. Sometimes the Version number does not get reflected. You can Extract the File to compare the file more closely.
Sample Batch Command file
The contents are from the file “AlterCab.bat” in which I have demonstrated how to handle CAB modification with the same revised executable “Archiver.exe”
REM ************************************************
REM ** Replacing Files in INSTALLSHIELD v6.x CAB
REM ** These are notes on how to replace individual
REM ** files within an InstallShield v6.x CAB file
REM ** Remember, only deal with DATA1.CAB – other cab
REM ** files (Data2, Data3) are handled when you
REM ** change DATA1.cab
REM ************************************************
REM ************************************************
REM ** First need to obtain INI listing of CAB
REM ************************************************
REM “c:\Archiver781_HotFix\iscab.exe” “c:\Archiver781_HotFix\Setups\DVD2 – Recorder\data1.cab” -i”Recorder_Witness_datacab.ini” -lx
REM ************************************************
REM ** Clone INI file “Datacab.ini” and only
REM ** leave in the entry for files to be replaced
REM ** The new files should be in the same directory
REM ** as the ISCAB.exe file..
REM ************************************************
REM “c:\Archiver781_HotFix\iscab.exe” “c:\Archiver781_HotFix\Setups\DVD2 – Recorder\data1.cab” -i”Revised_Recorder_Witness_datacab.ini” -a
REM ************************************************
REM ** To ensure correct updating, obtain another
REM ** INI listing of CAB after replacement and
REM ** use Text Compare tool to verify all files
REM ************************************************
REM “c:\Archiver781_HotFix\iscab.exe” “c:\Archiver781_HotFix\Setups\DVD2 – Recorder\data1.cab” -i”AfterRevised_Recorder_Witness_datacab.ini” -lx
REM ************************************************
REM ** To ensure correct updating of the File Size
REM ** and timestamp, you need to use ISCabVu.exe
REM ** (in Expert Mode)to view the Data1.cab
REM ** contents to verify the files changed
REM ************************************************



























