I am trying to modify the contents of an MSI file using Powershell. To do this, I create an instance of WindowsInstaller.Installer, then use $ installer.OpenDatabase and $ database.OpenView. Similar functionality works in VBScript, and I saw samples online that seem to work.
$installer = new-object -comobject "WindowsInstaller.Installer" $database = $installer.OpenDatabase("C:\Temp\Setup.msi", 1)
For the above code, I get the error message "Method call failed because [System .__ ComObject] does not contain a method called" OpenDatabase. "
$installer = new-object -comobject "WindowsInstaller.Installer" $database = $installer.InvokeMethod("OpenDatabase","C:\Temp\Setup.msi", 1)
If I try to use $ installer.InvokeMethod, I get the same "Method Error" error because [System .__ ComObject] does not contain a method called "InvokeMethod".
Any help would be greatly appreciated.
Thanks.
Matth source share