# MSI_CheckEngineState

> Checks the MSI Engine state. If the state is 'Transaction' the installation is postponed.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/msi-functions/msi-checkenginestate/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Checks the MSI Engine state. If the state is 'Transaction' the installation is postponed. If the installation is being postphoned it is being retried a number of times with a given interval. The default values are: Retries: 30 times Interval: 60 seconds. The above values can be changed using the function MSI_SetRetryValues.

**NOTE:** The function will automatically be called if Shell_Execute is running msiexec.exe

### Syntax

MSI_CheckEngineState() As Boolean

### Return value

Result will be stored in gsValue

### Example

**VBScript**

```vb
If bStatus Then bStatus = MSI_SetRetryValues(45, 90)
If bStatus Then bStatus = MSI_CheckEngineState()
If bStatus And UCase(gsValue) = "TRANSACTION" Then 
  bStatus = Job_WriteLog("Custom", "MSI Engine is in transaction phase. Installation is being postponed", bStatus, True)
End If
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
