Combining File Rules

The list of files for a package can be combined together using the AND and the OR operators. If no operator is specified between adjacent files, the AND operator is used. AND has precedence over OR.

An AND clause is true when both expressions connected by the AND are true. An OR clause is true when either (or both) of the expressions connected by the OR are true.

The Inventory Agent and Software Audit program search for the files connected in an AND clause in a single directory. Therefore, in order for an AND clause to evaluate to true, all files specified in the AND clause must be found in the same directory. For example, the following package rule specifies two files connected by an AND operator:


PACKAGE 1 "Configuration Files"
  FILE "CONFIG.SYS"
  AND
  FILE "SYSTEM.INI"

When SMS evaluates this rule, if the two files are not found, or they are found but they exist in different directories, then the rule is evaluated to false, and the package is not detected. The example package would be found if CONFIG.SYS and SYSTEM.INI existed in the same directory (for example, in C:\BACKUP).

For files connected by an OR operator, one or both must exist in a directory for the package to be detected. For example, if a package is defined as two files connected by an OR operator and the two files exist in the same directory, one instance of the package is detected:


PACKAGE 1 "Configuration Files"
  FILE "CONFIG.SYS"
  OR
  FILE "SYSTEM.INI"

In the preceding example, if CONFIG.SYS is detected in C:\BACKUP and SYSTEM.INI is detected in C:\WINDOWS, two instances of the example package are detected, because the file rule evaluates to true in both directories.

As another example, consider the following package rule:


PACKAGE 1 "Corporate Accounting Application"
  FILE "CORAPP.EXE"
  OR 
  FILE "CORAPP.DLL"
  FILE "COR3D.DLL"

Because there is no operator specified between the files CORAPP.DLL and COR3D.DLL, SMS uses the AND operator between these files. The package rule is evaluated as follows:

    1. First, SMS processes the AND clause. It looks for the files COR3D.DLL and CORAPP.DLL. If found in the same directory, this clause evaluates as true. If the files are not found, or they are found in different directories, then this clause is false.

    2. Next, SMS processes the OR clause. If the AND clause was true, then the OR clause is also true. If the AND clause was false, then SMS looks for the file CORAPP.EXE. If it finds this file in any directory, the OR clause is true. If the AND clause was false and the file CORAPP.EXE is not found, then the OR clause is false.