Archive for the 'MSI' Category

04
Feb

Updating file inside MSI for major upgrade

 This post describes how to create a new msi that can be installed as a major upgrade based on an existing one (that support major upgrades), whilst patching/updating some files. This is useful when it’s easier to patch an existing msi than it is to create a new one.

Cabarc to create new cabinet containing the patched files:

CabArc.exe n mypatch.cab c:\patch\*.dll

MsiFiler to correct version information:

MsiFiler.exe -d myinstaller.msi -v -s c:\patch\

MsiDb to insert new cabinet in msi (optional):

MsiDb.exe -d myinstaller.msi -a mypatch.cab

Open myinstaller.msi in Orca and:

  • Insert a new Guid into PackageCode because we are changing the msi
    To do this in Orca, go to ‘View ->  Summary Information’ and click the ’New GUID’ button next to the Package Code. It’s also possible to configure Orca to always change the PackageCode when saving, under ‘Options -> Database’
  • Insert a new Guid into ProductCode to allow major upgrade
  • Change the ProductVersion to a higher version number, and change the Upgrade table accordingly.
  • Change sequence in the File table for the patched file(s)
  • Add reference to mypatch.cab in Media table:
    • DiskId should be a new unique number
    • Cabinet should be ’#mypatch.cab’ because the cabinet was inserted in the msi.
      It’s also possible to keep the cabinet file external, in that case call it ‘mypatch.cab’
    • LastSequence should correspond to the highest sequence number of the file in the File table
      For example, if the highest number before patching is 72, and we added 3 files, LastSequence should be 75, and 3 entries in the File table should use Sequence 73, 74 and 75. LastSequence and Sequence is the only link between files and cabinets

 Orca, MsiDb, MsiFiler and CabArc are all part of the Windows Platform SDK

 




Contact

Project statistics

Ads