MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: Uninstall Fails (Don't Panic)[Next]: User Interface Tips
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->Using ORCA and MSIDIFF to Automate MSI Updates

Using ORCA and MSIDIFF to Automate MSI Updates

This section describes how you can make use of "MsiDiff.VBS" and "ORCA" (or any other msi editor) to easily automate any changes to an MSI (or any other Windows Installer database type) that you already know how to make.

The steps are:

  1. Make a copy of your msi, lets call this "before.msi".

  2. Call the msi we will change "after.msi".

  3. Manually change "after.msi" with "ORCA" or a similar tool.

  4. Use the "Compare -> MAKEMSI Format" shortcut by right clicking on "after.msi", saying "NO" to template and choosing "before.msi". You could of course also use the MsiDiff.VBS command line.

  5. You might then end up with output similar to (minus a few comment lines):
    #include "OpenMsi.MMH"
    <$Msi 'out\Tweek.mm\Msi\After.msi' Template='out\Tweek.mm\Msi\Before.msi'>
        <$Table "Property">
           #(
               <$Row
                   Property="SOME_NEW_PROPERTY"
                      Value="SomePropertyValue"
               >
           #)
        <$/Table>
    
        <$Summary   "LastAuthor"  Value="Dennis">      ;;Previous value = My Name
        <$Summary "LastSave_DTM"  Value='cdate("17/10/2006 5:41:14 PM")'>
    <$/Msi>

  6. Changes you may want to make to the generated output shown above (after renaming the file to ".mm"):

    1. You will note that the MSIDIFF tool doesn't try to rebuild higher level MAKEMSI commands such as "property". You could manually make these changes to the result if you wish.

    2. The "MSI" command generated above makes a copy of the msi and applies changes to this copy (as you also did), for an example of updating an msi:
      <$Msi '.\BEFORE.msi'>

    3. It is possible to get unexpected validation errors or warnings as the MAKEMSI update framework may hide some of these for you, find (in "company.mmh", "uisample.mmh" etc) and duplicate this. Search for significant text of the message or for "MsiValFilter".

    4. You typically get some "summary" information changes that have nothing to do with you changes (last saved time etc), just delete these.

    5. Items which may currently be hardcoded could be changed to "#define" commands or even passed on the "PPWIZARD" command line from a batch file (see its "/define" switch).

    6. Other hard coded items you may need to tweek are "@where" clauses, but MSIDIFF will have done most of the hard work for you.

    An example of what the end result might look like:

    #include "OpenMsi.MMH"         ;;Better to use "MyMsiUpdate.MMH" and remove the common "stamping" below...
    <$Msi '.\Before.msi'>          ;;Change original (instead of creating a copy with changes applied)
        ;--- Make the changes ---------------------------------------------------
        <$Property "SOME_NEW_PROPERTY" Value="SomePropertyValue">
    
        ;--- "Stamp" MSI --------------------------------------------------------
        <$Summary   "LastAuthor"  Value="Dennis Bareis">
        <$Summary "LastSave_DTM"  Value='now()'>
    <$/Msi>


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Uninstall Fails (Don't Panic)[Next]: User Interface Tips


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.