Reference: Applicability rule syntax

In a software package, you can configure applicability rules to determine whether software packages are Install Eligible, Update Eligible, or Installed. Use applicability rules to evaluate whether a deployment applies to a managed endpoint. Software package applicability rules consist of software attributes. Operators evaluate and determine relationships between attributes. The following tables list attribute usage and operator descriptions, respectively.

Attributes of applicability rules

Attribute

Usage

Installed Application Name

Check if the name of the installed application and type meets the operator value and the other values. The attribute is case insensitive, even with regular expression operators.

For more information, see (Windows) Installed Application attribute usage.

Note:
  • (Windows) The Type value is only supported on endpoints running Software Management 10.5 or later, which is included in Toolset 2.12. To maintain compatibility with older tools, select exactly Type equals any of 32-bit HKLM, 64-bit HKLM, Active User. Older tools always behave as if these types were specified and do not support detection of MSIX applications.

    deploy-type-attribute
  • (macOS) The Path value is only supported on endpoints running Software Management 10.9 or later, which is included in Toolset 2.15. To maintain compatibility with older tools, ensure that you clear the field and that the field shows any path.

    deploy-any-path
  • For more information about upgrading endpoint toolsets, see Managing installed endpoint tools.

Installed Application Version

Check if the name, version, and type of the installed application meets the operator value and the other values. The attribute is case insensitive, even with regular expression operators.

For more information, see (Windows) Installed Application attribute usage.

Note:
  • (Windows) The Type value is only supported on endpoints running Software Management 10.5 or later, which is included in Toolset 2.12. To maintain compatibility with older tools, select exactly Type equals any of 32-bit HKLM, 64-bit HKLM, Active User. Older tools always behave as if these types were specified and do not support detection of MSIX applications.

    deploy-type-attribute
  • (macOS) The Path value is only supported on endpoints running Software Management 10.9 or later, which is included in Toolset 2.15. To maintain compatibility with older tools, ensure that you clear the field and that the field shows any path.

    deploy-any-path
  • For more information about upgrading endpoint toolsets, see Managing installed endpoint tools.

Registry Path

(Windows only) Check if a registry key or value exists at the specified path. For more information, see Registry and file path attribute usage.

Registry Data

(Windows only) Check if the data of the registry value path meets criteria. If a registry key is specified, the data of the key default value is checked. The rule always evaluates false if the specified path does not exist. For more information, including an Acrobat Reader example, see Registry and file path attribute usage.

Review the following items:

  • Enter REG_DWORD values as decimals.

  • If you enter a version number as a REG_SZ string value, use the MAJOR.MINOR.PATCH format. Be sure to include the PATCH version, for example, 2.2.0. Including the PATCH version allows the full version number to be properly evaluated.

File Path

Check if the file path exists. For more information, see Registry and file path attribute usage.

File Version

(Windows only) Check if the file version of the file at the specified path meets criteria. The rule always evaluates false if the specified path does not exist. For a related example, review the Acrobat Reader example in Registry and file path attribute usage.

File Hash

Check if the file hash of the file at the specified path meets criteria. The rule always evaluates false if the specified path does not exist. For a related example, review the Acrobat Reader example in Registry and file path attribute usage.

CAUTION: Determining file hashes has a high cost on system resources. For best performance results, use only MD5 rules, where possible, and only use file hash rules for file sizes less than 100 MB.

File Size

Check if the file size of the file at the specified path meets criteria. The rule always evaluates false if the specified path does not exist. For a related example, review the Acrobat Reader example in Registry and file path attribute usage.

Folder Contents

Check if the contents (file or subfolder) in a folder meet the specified criteria. The rule always evaluates false if the specified path does not exist.

Note: The Folder Contents attribute is only supported on endpoints running Software Management 10.15 or later, which is included in Toolset 2.18.

Service Name

(Windows only) Check if the Windows service name meets criteria. Enter the service short name.

System Uptime

Check if the system uptime meets criteria. The rule is evaluated in milliseconds.

For example, the System Uptime is less than or equal to 1 Hour(s) rule evaluates as false at one hour and one millisecond.

WMI Query

(Windows only) Perform a Windows Management Instrumentation (WMI) query to check if a value is returned.

You can query information from WMI classes for any of the detection rules within a software package. If you use a WMI query, you cannot query against the Win32_Product WMI class. For more information about using WMI queries, see Microsoft Documentation: Windows Management Instrumentation and Microsoft Documentation: WQL (SQL for WMI).

CAUTION: WMI queries against certain namespaces, such as Win32_QuickFixEngineering, have a higher cost to system resources. For best performance results, nest WMI queries after other rules to prevent unnecessary execution.

Example: The following install verification detects the installation status of a Windows update based on the file version of ntoskrnl.exe. The WMI query is not evaluated unless ntoskrnl.exe is less than the minimum value that it would be after installing this update or a future superseding update.

syntax_wmi_query

Attribute operators of applicability rules

Attribute operator

Description

contains

The value contains the specified string.

does not contain

The value does not contain the specified string.

starts with

The value starts with the specified string.

matches regex

The value matches the specified regular expression. Regular expression rules match if any part of the checked item matches the rule, similar to a contains rule. To search for a more exact match, include at least one of the ^ or $ anchors in the value.

does not match regex

The value does not match the specified regular expression. Regular expression rules match if any part of the checked item matches the rule, similar to a contains rule. To search for a more exact match, include at least one of the ^ or $ anchors in the value.

Example:

Installed Application Name does not match regex ^Google Chrome$

This example is better than Installed Application Name does not match regex Google Chrome because it excludes Google Chromecast from the results.

equals any of

The value is equal to any of the specified values.

is equal to

The value is equal to the specified value.

is not equal to

The value is not equal to the specified value.

is less than

The value is less than the specified value.

is less than or equal to

The value is less than or equal to the specified value.

is greater than

The value is greater than the specified value.

is greater than or equal to

The value is greater than or equal to the specified value.

is running

The value is running.

is not running

The value is not running.

exists

The value exists.

does not exist

The value does not exist.

(Windows) Installed Application attribute usage

The Installed Applications sensor and Installed Application rules search the subkeys of registry locations based on the selected Type. You can select one or multiple types.

  • 32-bit HKLM: Evaluates the results of HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall on 32-bit Windows. Evaluates the results of HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall on 64-bit Windows.

  • 64-bit HKLM: Evaluates the results of HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall on 64-bit Windows.

  • Active User: Evaluates the results of the subkeys of each Uninstall key in each loaded user hive in HKEY_USERS. For example, HKU\S-1-5-21-175372122-3884674885-3512333231-1001\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. If a subkey has a DisplayName and a DisplayVersion value, Deploy includes the subkey in the rule evaluation.

  • MSIX/APPX:Evaluates the results of Windows.Management.Deployment.PackageManager.FindPackage(), similar to the Get-AppxPackage cmdlet in PowerShell.

The following example shows how the DisplayName and DisplayVersion values are used in the Igor Pavlov 7-Zip (x86) software package rules. In this Registry Editor screenshot, notice the data for the DisplayName and DisplayVersion values.

7zip_display_name

The Update Detection rule specifies that any 7-Zip (x86) application version less than 23.01.00.0 should be updated. The endpoint with the Registry Editor screenshot will be updated because the DisplayVersion is less than 23.01.00.0.

7zip_update_detection

Note: The Installed Applications sensor searches for the same data but only returns results for keys that include an UninstallString or SilentUninstallString value. In rare situations, the Deploy Installed Application rules detect software installations that the Installed Applications sensor does not because Deploy returns results for keys that include a DisplayName or DisplayVersion value.

Registry and file path attribute usage

Review the following items before using registry and file paths in attributes:

  • Deploy automatically encloses file and registry paths in double quotation marks, so you do not need to use quotation marks for file or path names that contain spaces.

  • Use ||ACTIVEUSERREGISTRY|| instead of HKEY_CURRENT_USER to refer to a registry path within an active user hive. HKEY_CURRENT_USER key paths are in the system account hive, not the active user hive.

  • Use ||ACTIVEUSERPROFILE|| instead of %userprofile%, %appdata%, or %localappdata% environment variables. User-specific environment variables are populated by paths for the system account, not the active user.

  • Use ||PROGRAMFILES||, ||PROGRAMFILES32BIT||, or ||PROGRAMFILES64BIT|| instead of %programfiles% or C:\Program Files for software folders that vary based on the endpoint architecture.

  • To positively match a missing registry or file path, add an OR group to the rule. For example, Acrobat Reader DC (en-us) is 32-bit software and can be identified as 32-bit by the is64BitProduct value. Older software versions might not have the is64BitProduct value, so an OR Registry Path does not exist is added for the absence of the value. These two rules create a true check for all software versions.

    syntax_path_example

  • For more information on registry and file path variables, see Variables for Windows applicability scans and command-line operations.