2
' When the dll name of the driver is not of 8.3-format
3
' the modification of the FileName is needed
7
Const msiOpenDatabaseModeTransact = 1
9
Const msiViewModifyInsert = 1
10
Const msiViewModifyUpdate = 2
12
Dim msiPath : msiPath = Wscript.Arguments(0)
15
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
17
Set database = installer.OpenDatabase(msiPath, msiOpenDatabaseModeTransact)
20
query = "Select * FROM File"
22
Set view = database.OpenView(query)
25
Set record = view.Fetch
27
Do While not record Is Nothing
28
gFile = record.StringData(1)
29
If Left(gFile, 8) = "psqlodbc" Then
30
gFile = record.StringData(3)
31
' Check if the FileName field is ShortName|LongName
32
pos = InStr(record.StringData(3), "|")
34
' Omit the ShortName part
35
gFile = Mid(record.StringData(3), pos + 1)
36
WScript.echo record.StringData(3) & " -> " & gFile
37
' And update the field
38
record.StringData(3) = gFile
39
view.Modify msiViewModifyUpdate, record
42
Set record = view.Fetch
2
' When the dll name of the driver is not of 8.3-format
3
' the modification of the FileName is needed
7
Const msiOpenDatabaseModeTransact = 1
9
Const msiViewModifyInsert = 1
10
Const msiViewModifyUpdate = 2
12
Dim msiPath : msiPath = Wscript.Arguments(0)
15
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
17
Set database = installer.OpenDatabase(msiPath, msiOpenDatabaseModeTransact)
20
query = "Select * FROM File"
22
Set view = database.OpenView(query)
25
Set record = view.Fetch
27
Do While not record Is Nothing
28
gFile = record.StringData(1)
29
If Left(gFile, 8) = "psqlodbc" Then
30
gFile = record.StringData(3)
31
' Check if the FileName field is ShortName|LongName
32
pos = InStr(record.StringData(3), "|")
34
' Omit the ShortName part
35
gFile = Mid(record.StringData(3), pos + 1)
36
WScript.echo record.StringData(3) & " -> " & gFile
37
' And update the field
38
record.StringData(3) = gFile
39
view.Modify msiViewModifyUpdate, record
42
Set record = view.Fetch