Read MST file with vbscript

I am trying to make a script that gets information from some MSI and MST files and writes them to a text file. I have achieved reading MSI files. However, I get the following message.

Msi API Error 80004005: OpenDatabase, DatabasePath, OpenMode
1: 2219 2: 3: 4:

I open the file as follows

Set installer = Wscript.CreateObject ("WindowsInstaller.Installer"): CheckError
Dim database: Set database = installer.OpenDatabase (FileName, msiOpenDatabaseModeReadOnly): CheckError

It works great with MSI files. I think MST files should be read differently.

How to read MST file using vbscript?

+3
source share
1 answer

, , MSDN, (MST) MSI, ApplyTransform msiTransformErrorViewTransform. _TransformView, , .

, :

Const msiOpenDatabaseModeReadOnly    = 0
Const msiTransformErrorViewTransform = 256
Dim installer, database

Set installer = CreateObject("WindowsInstaller.Installer") : CheckError
Set database = installer.OpenDatabase(MSIFileName, msiOpenDatabaseModeReadOnly) : CheckError
database.ApplyTransform MSTFileName, msiTransformErrorViewTransform : CheckError
+3

Source: https://habr.com/ru/post/1731399/


All Articles