Applied Property

Determine the status of the last package applied on the local system.

Syntax

object.Applied

The object is an expression that evaluates to a Package object. The property returns a long integer value.

Remarks

This property is updated after the Apply method has been used to apply a package on the local system. A value of zero indicates that the package was not successfully applied, while a non-zero value indicates success. The actual property value may be one or more of the following values:

Value Description
apApplyCompleted The package application process has completed successfully.
apApplyDelayed The package application completed, however one or more files were in use. The system should be restarted to complete the update process.

Example

On Error Resume Next
Package1.Apply strInstallPath

' The Applied property returns zero if the package has not been
' applied, or a non-zero value if it has been applied; in this
' case, the actual value is a combination of bit flags which
' provide additional status information

If Package1.Applied = 0 Then
    MsgBox "Unable to apply this package", vbExclamation
Else
    bRestart = CBool(apPackage.Applied And apApplyDelayed)
    If bRestart Then
        MsgBox "One or more files were in use when this package " & _
               "was applied." & vbCrLf & "The system must be " & _
               "restarted to complete the update.", vbInformation
    End If
End If

See Also

Apply Method