While reviewing some sample code I noticed the use of ":" in the script. Once in the first DIM statement and then again in the "Set products" statement. I can not find any documentation on the use of ":". See Code below. And ideas?
Code:
' Connect to Windows Installer object
On Error Resume Next
Dim installer : Set installer = Nothing
Dim product
Dim products
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError
'Enumerate through all registered products, checking the installstate
Set products = installer.Products : CheckError
For Each product In products
' Only apps that have nothing installed will pass this check.
If (installer.ProductState(product) = msiInstallStateAdvertised) Then
Wscript.echo installer.ProductInfo( product, "ProductName") & " Is Advertised"
InstallLocal product
Else
Wscript.echo installer.ProductInfo( product, "ProductName") & " Is Installed"
End If
Next
Wscript.Quit 0
Sub InstallLocal( Product )
Wscript.echo "Installing " & installer.ProductInfo( product, "ProductName")
'Set Basic UI, wiht no modal dialogs
installer.UILevel = msiInstallUILevelBasic + msiInstallUILevelProgressOnly: CheckError
'Install the product fully (max feature level)
installer.ConfigureProduct product, 65535, msiInstallStateLocal : CheckError
End Sub
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 & vbNewLine & errRec.FormatText
Wscript.Echo message
Exit Sub
End If
End If
Wscript.Echo message
'Wscript.Quit 2
End Sub