Skip to content

Commit

Permalink
Better select where to remove short file names
Browse files Browse the repository at this point in the history
Use the FileName column itself instead of the file ID. This is less
susceptible to changes in file IDs (and component IDs) that may happen
when relying more on default behaviors in future WiX versions.
  • Loading branch information
chrullrich committed Oct 12, 2024
1 parent f3541e2 commit 77b1205
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions installer/modify_msi.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,16 @@ Dim record
Set record = view.Fetch
Dim gFile, pos
Do While not record Is Nothing
gFile = record.StringData(1)
If Left(gFile, 8) = "psqlodbc" Then
gFile = record.StringData(3)
' Check if the FileName field is ShortName|LongName
pos = InStr(record.StringData(3), "|")
If pos > 0 Then
' Omit the ShortName part
gFile = Mid(record.StringData(3), pos + 1)
WScript.echo record.StringData(3) & " -> " & gFile
' And update the field
record.StringData(3) = gFile
view.Modify msiViewModifyUpdate, record
End If
' Check if the FileName field is ShortName|LongName
gFile = record.StringData(3)
pos = InStr(gFile, "|psqlodbc")
If (pos > 0) Then
' Omit the ShortName part
gFile = Mid(gFile, pos + 1)
WScript.echo record.StringData(3) & " -> " & gFile
' And update the field
record.StringData(3) = gFile
view.Modify msiViewModifyUpdate, record
End If
Set record = view.Fetch
Loop
Expand Down

0 comments on commit 77b1205

Please sign in to comment.