Skip to content

MSI_CheckEngineState

Checks whether Windows Installer is busy with another installation (the transaction state). The check is made on the Windows Installer service: if the service is running and can’t be stopped, an installation is in progress.

If Windows Installer is busy, the function waits and checks again. The default values are: Retries: 30 times Interval: 60 seconds. The above values can be changed using the function MSI_SetRetryValues. If Windows Installer is still busy after the last retry, the function cancels the job with CMS_JobRetryLater, so it runs again at the next agent run.

NOTE: The function will automatically be called if Shell_Execute or Shell_ExecuteWithTimeout runs msiexec.exe.

MSI_CheckEngineState() As Boolean

TRUE when Windows Installer is ready. FALSE if the job was postponed because Windows Installer was still busy, so the rest of the script is skipped.

If bStatus Then bStatus = MSI_SetRetryValues(45, 90)
If bStatus Then bStatus = MSI_CheckEngineState()

Scripting Guidelines

MSI_SetRetryValues Constants Package Property Variables