/build/static/layout/Breadcrumb_cap_w.png

msi table conversion

Is there a utility I can use to export all of the tables in 1 shot from an MSI file?

Thank You

0 Comments   [ + ] Show comments

Answers (7)

Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
If you download the Windows Installer SDK from the Microsoft website, it contains several scripts (in VBScript) to export tables from a MSI file to txt files.
Posted by: Secondlaw 18 years ago
Third Degree Blue Belt
0
Thank You. I should have mentioned that I'm using Win2k. The SDK has a bunch of scripts, but as far as I can tell, none to actually extract the tables. :(

Thanks anyway.
Posted by: AngelD 18 years ago
Red Belt
0
Have a look at Msidb.exe,
The "-e" option will:
Export selected tables from database into text archive files in folder. Table names for export are table names. Only the wildcard specification, "*", may be used. Tables may be exported from a read only database.
Posted by: Secondlaw 18 years ago
Third Degree Blue Belt
0
Thanks a lot! I'll give this a try tomorrow morning!
Posted by: knight 18 years ago
Orange Senior Belt
0
Hi Secondlaw,

Try this VBScript, just add your preferred table

' Export File Table from a given MSI Database to an Excel Spreadsheet

Option Explicit

Const msiOpenDatabaseModeReadOnly = 0


On Error Resume Next
Dim installer : Set installer = Nothing
Dim szMSI

szMSI = InputBox("Enter MSI File (including full path)", "Select MSI", "")
DIM folder : folder = InputBox("Enter Folder to Write Table to...", "Select Export Folder","")

Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError

Dim database : Set database = installer.OpenDatabase(szMSI, msiOpenDatabaseModeReadOnly) : CheckError

Dim table, view, record

table = "File"

Set view = database.OpenView("SELECT 'Name' FROM _Tables")
view.Execute : CheckError
Do
Set record = view.Fetch : CheckError
If record Is Nothing Then Exit Do
Export table, folder : CheckError
Loop
Set view = Nothing


Export table, folder : CheckError


Wscript.Quit(0)

Sub Export(table, folder)
Dim file :file = table & ".xls"
database.Export table, folder, file
End Sub


Sub CheckError
Dim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then message = message & vbNewLine & errRec.FormatText
End If
Wscript.Echo message
Wscript.Quit 2
End Sub


Hope this helps,
knight
Posted by: Secondlaw 18 years ago
Third Degree Blue Belt
0
Knight,

Thanks! That script is just about perfect. How would I configure that so I can run it from a command line...

cscript export.vbs <table> "<msipath>" "<outputfilepath>"
Posted by: nheim 18 years ago
10th Degree Black Belt
0
Hi folks,
one quick way to do this, is using ORCA. Load the MSI in ORCA, go to 'Tables' - 'Export Tables...' 'Select All'.
This is also an easy Editing method, if you have to edit tables in a vendor MSI.
Regards, Nick
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ