Skip to content

CMS_SetPackageStatusToNotCompliant

Will set the status of the running package to ‘Not Compliant’.
This function is intended to be used before the package has been downloaded and/or before the user has been prompted to allow installation of the package.

The function returns FALSE, so the remaining steps of the job are skipped. When the job ends, the package status is set to ‘Not Compliant’ instead of ‘Failed’.

The function isn’t available in PowerShell.

CMS_SetPackageStatusToNotCompliant() As Boolean

None. The function applies to the running package.

Boolean. The function always returns FALSE.

The example below shows how this function could be used in a real world situation. The CompliancyCheck function could be included in the package itself or provided via CustomLib.cis and will prevent a package from running on 64 bit OS in this case.

' this function will set bStatus to FALSE in order to skip the Job execution.'
Function CompliancyCheck()
Dim bStatus : bStatus = True
If gbx64 Then
If bStatus Then bStatus = Job_WriteLog("CompliancyCheck", "Package is not allowed to run on 64 bit OS", bStatus, True)
If bStatus Then bStatus = CMS_SetPackageStatusToNotCompliant()
End If
CompliancyCheck = bStatus
End Function

Scripting Guidelines

CMS_SetPackageStatusToInstalled Constants Package Property Variables Business Unit support