Hi,
Here is a script that modifies the "ModuleSignature" table for these merge modules. It must be invoked twice (for each merge module) - thus, a batch file may be useful:
Note that this script is provided mainly as an example and I do
not recommend using it (the same applies to modifying the MSMs with Orca).
Batch file "msxmlmod.bat":
Code: Select all
@echo off
cscript msxmlmod.vbs msxml4sxs32.msm msxml4sxs32_mod.msm
cscript msxmlmod.vbs msxml4sys32.msm msxml4sys32_mod.msm
Script file "msxmlmod.vbs":
Code: Select all
' msxmlmod.vbs
'
' Script that modifies the `ModuleSignature` table for these 2 MSMs:
' `msxml4sxs32.msm` and `msxml4sys32.msm`
'
' Run it with: cscript msxmlmod.vbs <origfile.msm> <modfile.msm>
' Example: cscript msxmlmod.vbs msxml4sxs32.msm msxml4sxs32_mod.msm
Option Explicit
Const msiOpenDatabaseModeDirect = 2
Const msiViewModifyReplace = 4
Const PID_TEMPLATE = 7
' Show help if no arguments or if argument contains ?
Dim argCount:argCount = Wscript.Arguments.Count
If argCount > 0 Then
If InStr(1, Wscript.Arguments(0), "?", vbTextCompare) > 0 Then
argCount = 0
End If
End If
If argCount < 2 Then
Wscript.Echo "Script that modifies the default langauge for " &_
"`msxml4sxs32.msm` and `msxml4sys32.msm`" &_
vbLf & " The 1st argument is the path to the source MSM to modify" &_
vbLf & " The 2nd argument is the path to the modified MSM"
Wscript.Quit 1
End If
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
' Open database
Dim originalPath : originalPath = Wscript.Arguments(0)
Dim databasePath : databasePath = Wscript.Arguments(1)
fso.CopyFile originalPath, databasePath
' Connect to Windows installer object
On Error Resume Next
Dim installer
Set installer = CreateObject("WindowsInstaller.Installer") : CheckError
Dim database
Set database = installer.OpenDatabase(databasePath, msiOpenDatabaseModeDirect) : CheckError
' Make the changes to the `ModuleSignature` table
Dim thecommand,view,record
thecommand = "SELECT `ModuleID`,`Language`,`Version` FROM `ModuleSignature`"
Set view = database.OpenView(thecommand) : CheckError
view.Execute : CheckError
Set record = view.Fetch : CheckError
record.StringData(2) = "0"
view.Modify msiViewModifyReplace,record
database.Commit
' Also update the Summary Information Stream
Dim sumInfo
Set sumInfo = database.SummaryInformation(20) : CheckError
sumInfo.Property(PID_TEMPLATE) = "Intel;0" : CheckError
sumInfo.Persist
Set installer = Nothing
Wscript.Quit 0
Sub CheckError
Dim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description & vbcrlf & query
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then message = message & vbLf & errRec.FormatText
End If
Fail message
End Sub
Sub Fail(message)
Wscript.Echo message
Wscript.Quit 2
End Sub
Regards,
Denis