Applies to RayPack versions: 1.3, 1.4
When working with MSI/MST files, it is very often that a small update is required, which requires replacing only a few files with their newer sources. This on the other hand requires adjusting the meta-data for each file, including but not limited to
- A new correct size,
- A new correct file signature, hash, file version etc.
Additionally, the file sequences and references have to be handled with a great care so that the package remains internally consistent and valid according to the packaging standards. This means that removing older version and adding a new one is under normal circumstances not an opion, because it may break the internal references if any formatted string, a database foreign key or a Custom Action is pointing to the deleted file.
Instead of manually replacing the files, RayPack provides an easy way to do it semi-automatically. The functionality updates necessary fields, but preserves the file identifier and makes sure the sequences are adjusted as required.
The steps below demonstrate how to replace a simple PDF file with its newer version – the scenario involves:
- Changed name of the new file (ReadMe_v.1.0.pdf -> ReadMe_v.1.1pdf)
- Different file contents (resulting in different file hashes and file sizes)
To quickly replace the file:
1. Open the MSI/MST/RPP file in RayPack and navigate to the Files and Folders view.
2. Select the new version of the file (it is recommended to have the new sources in a subfolder of the project location, as it enables RayPack to de-hardcode the paths)
3. RayPack will automatically:
a) Rename the file in the Files and Folders view and make sure the name is valid
b) Update the file hashes
c) Update file versions, size and attributes if required
d) update the source path to point to the new location in the RPSourcePath table. If possible a relative path will be used:
In RPP mode, RayPack will use -1 as a new sequence for the new version of the file. The next time the project is built, a new valid sequence will be calculated automatically.
In MSI/MST mode, the changes will be applied when the edited file is saved. RayPack will assign a new sequence to updated files so that the other CAB files do not have to be recreated. However, this may result in a growing total package size, because the old version of the file will be still present in original CAB file. In order to flush the package and get rid of unnecessary older versions, use FILE > BUILD functionality. This will provide a precise control over media layout and ensure that only necessary files are included and distributed.