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)