/build/static/layout/Breadcrumb_cap_w.png

Reading filenames and paths from MSI file

We have a policy that no information is to be entered into the selfreg, typelib, class, progid etc. tables due to problems with Active Directory.

It is often necessary for us to move data from these tables directly into the registry table. This is fine but when there are hundreds of files this is wasting a lot of time and it is easy to miss something.

I have now created a script which will generate a regfile for import into wise and this works fine but it is still necessary to hunt each file down and run a script to generate the regfiles. If I could somehow extract all of the filenames from the selfreg table, get the paths to these files and export this information to a text file I could incorporate this into the script to automatically grab all selfreg information and create a regfile to be imported into wise.

How can I extract all of the filenames from the selfreg table, get the paths to these files and export this information to a text file from OUTSIDE of the MSI?

0 Comments   [ + ] Show comments

Answers (1)

Posted by: Garrett 19 years ago
Orange Belt
0
Maybe a place to start...

From [link]http://www.serverwatch.com/tutorials/article.php/1548261[/link]...

' File Export v 1.0

' Export File Table from a given MSI Database to an Excel Spreadsheet
' J.Loomes Nov 2000



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
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

View more:

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