~ubuntu-branches/ubuntu/wily/psqlodbc/wily-proposed

« back to all changes in this revision

Viewing changes to installer/modify_msi.vbs

  • Committer: Package Import Robot
  • Author(s): Christoph Berg
  • Date: 2014-05-29 23:17:25 UTC
  • mfrom: (16.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20140529231725-nhpolx85545e4rk8
Tags: 1:09.03.0300-1
* New upstream release.
* Patch bogus expected output of test catalogfunctions.
* Set team as maintainer.
* Bump to dh 9.
* Use /usr/share/cdbs/1/rules/autoreconf.mk. Closes: #744650.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
'
2
 
'       When the dll name of the driver is not of 8.3-format
3
 
'               the modification of the FileName is needed
4
 
'
5
 
option Explicit
6
 
 
7
 
Const msiOpenDatabaseModeTransact = 1
8
 
 
9
 
Const msiViewModifyInsert = 1
10
 
Const msiViewModifyUpdate = 2
11
 
 
12
 
Dim msiPath : msiPath = Wscript.Arguments(0)
13
 
 
14
 
Dim installer
15
 
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
16
 
Dim database
17
 
Set database = installer.OpenDatabase(msiPath, msiOpenDatabaseModeTransact)
18
 
 
19
 
Dim query
20
 
query = "Select * FROM File"
21
 
Dim view
22
 
Set view = database.OpenView(query)
23
 
view.Execute
24
 
Dim record
25
 
Set record = view.Fetch
26
 
Dim gFile, pos
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), "|")
33
 
        If pos > 0 Then
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 
40
 
        End If 
41
 
End If
42
 
Set record = view.Fetch
43
 
Loop
44
 
 
45
 
database.Commit
 
1
'
 
2
'       When the dll name of the driver is not of 8.3-format
 
3
'               the modification of the FileName is needed
 
4
'
 
5
option Explicit
 
6
 
 
7
Const msiOpenDatabaseModeTransact = 1
 
8
 
 
9
Const msiViewModifyInsert = 1
 
10
Const msiViewModifyUpdate = 2
 
11
 
 
12
Dim msiPath : msiPath = Wscript.Arguments(0)
 
13
 
 
14
Dim installer
 
15
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
 
16
Dim database
 
17
Set database = installer.OpenDatabase(msiPath, msiOpenDatabaseModeTransact)
 
18
 
 
19
Dim query
 
20
query = "Select * FROM File"
 
21
Dim view
 
22
Set view = database.OpenView(query)
 
23
view.Execute
 
24
Dim record
 
25
Set record = view.Fetch
 
26
Dim gFile, pos
 
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), "|")
 
33
        If pos > 0 Then
 
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
 
40
        End If
 
41
End If
 
42
Set record = view.Fetch
 
43
Loop
 
44
 
 
45
database.Commit