MSI_CheckEngineState
Description
Section titled “Description”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.
Syntax
Section titled “Syntax”MSI_CheckEngineState() As Boolean
Return value
Section titled “Return value”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.
Example
Section titled “Example”If bStatus Then bStatus = MSI_SetRetryValues(45, 90)If bStatus Then bStatus = MSI_CheckEngineState()