Goner Doug Answer works good.
But the ProgressBar
BannerText
has not been removed.I guess instead of removing Attribute value in the BannnerText
control suggested by Goner Doug, If we could empty the BannerText
String then it might be good. We can also remove the Banner text of ProgressBar
window by doing the same. Note that removing attribute value wont work for ProgressBar
bannner text.
In Goner Doug answer,
replace the query
as
query = "UPDATE `Control` SET `Control`.`Text`='' WHERE `Control`.`Control`='InstalledBannerText' OR `Control`.`Control`='BannerText' OR `Control`.`Control`='RemoveBannerText'"
This will remove banner text in progress bar window too.
Option Explicit
If (Wscript.Arguments.Count < 1) Then
Wscript.Echo "Windows Installer utility to execute SQL queries against an installer database." & vbCRLf & " The 1st argument specifies the path to the MSI database, relative or full path"
Wscript.Quit 1
End If
Dim openMode : openMode = 1 'msiOpenDatabaseModeTransact
On Error Resume Next
Dim installer : Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError
' Open database
Dim database : Set database = installer.OpenDatabase(Wscript.Arguments(0), openMode) : CheckError
Wscript.Echo "Removing all BannerText..."
Dim query
query = "UPDATE `Control` SET `Control`.`Text`='' WHERE `Control`.`Control`='InstalledBannerText' OR `Control`.`Control`='BannerText' OR `Control`.`Control`='RemoveBannerText'"
Dim view : Set view = database.OpenView(query) : CheckError
view.Execute : CheckError
database.Commit
Wscript.Echo "Done."
Wscript.Quit 0
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 & vbCRLf & errRec.FormatText
End If
Wscript.Echo message
Wscript.Quit 2
End Sub