Tips: MSI: Save differences between two msi as MST file using ruby & python


Ruby

require ‘win32ole’
msiClass = WIN32OLE.new(“WindowsInstaller.Installer”)
msidb = msiClass.OpenDatabase(“C:\\temp\\MountPointGenerator.msi”,0)
newmsidb = msiClass.OpenDatabase(“C:\\temp\\updatedMountPointGenerator.msi”,0)
transform = newmsidb.GenerateTransform(msidb,”c:\\temp\\newtest.mst”)

Python

import win32com.client
import os
import sys

msiOpenDatabaseModeReadOnly=0
msidb=r”c:\temp\MountPointGenerator.msi”
msiupdb=r”c:\temp\updatedMountPointGenerator.msi”
mstdb=r”C:\temp\MNPtrans.mst”

installer = win32com.client.Dispatch(“WindowsInstaller.Installer”)
database = installer.OpenDatabase(msidb, msiOpenDatabaseModeReadOnly)
updatedDB= installer.OpenDatabase(msiupdb , msiOpenDatabaseModeReadOnly)
updatedDB.GenerateTransform(database, mstdb)

Advertisements

One thought on “Tips: MSI: Save differences between two msi as MST file using ruby & python

  1. Hello, perhaps you can help me… I’m trying to port a VBS script to Python 2.6.1, using “WindowsInstaller.Installer” like your msiClass; msiClass.Products returns a list of product codes that I can iterate, but I can’t seem to be able to call msiClass.Patches(myProductCode). “msiClass.Patches” succeeds and returns a “<bound method CDispatch.Patches of >” but when I call it or try “msiClass.Patches(myProductCode)” I get “pywintypes.com_error: (-2147352573, ‘Member not found.’, None, None)”. All attempts at variants of msiClass.Patches(myProductCode) failed miserably. Any hint ? Thanks…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s