System Conditions
System Conditions
The following conditions are available in the "System" tab of the dialog for the If command to create the expression:
- CheckService / Test-Service
Checks the specified service for existence, state or startup type. - CheckMicrosoftUpdate / Test-MicrosoftUpdate
Checks whether the specified Microsoft Update is installed on the current system or not. Enter the KB number in the format "KB<6-digit number>" or select the update you want to check for using the "..." button. - CheckWindowsFeature / Test-WindowsFeature
Checks whether or not the specified Windows feature(s) are present and enabled on the current system. Specify the name or select the feature you want to check for from the drop-down list. You can also use wildcards at this point, in which case all features matching the filter will be checked and the condition will return true only if all features are installed. - DiskFree / Get-DriveFreeKB (free disk space)
Checks the free space on the specified drive (in MB). - Exist / Test-FileExists (existence of a file)
Checks if a specific file exists. - FileDate / Get-FileDate (file date)
Checks whether the specified file corresponds to the specified change date. - FileVersion / Get-FileVersion (file version)
Checks the version of the specified file.
When creating the condition you can select the file you want to check in the Product Version dialog. Packaging PowerBench automatically enters the correctly formatted product version number of the selected file.
You can also enter the product version number manually or use a variable. Note when entering the version number manually: The specified version value needs to be specified in correctly formatted way e.g. 1.0.0.0 or 4.3.1. - IsComputerLocked / Test-ComputerLocked
Checks if the local computer is locked (the lock screen or the login screen is displayed). - IsFileInUse / Test-FileInUse (File in use)
Checks if a file is locked and can therefore neither be modified, nor renamed, moved or deleted. - IsProcessRunning / Test-ProcessRunning (check for process)
Checks if a Windows process is running either by window name or filename. Allows the use of ? and * wildcards. - IsRestartFlagSet / Test-SystemRestart (System restart necessary)
Checks if a system restart flag was set using the Install-FileList command. Using the command Unregister-SystemRestart, a system restart flag can be cleared. - MSIIsProductInstalled / Test-MsiProduct (installation status of an MSI package)
Checks if a specific MSI Package is installed. - RegKeyExists / RegKeyExistsEx / Test-RegistryKey (existence of a registry key)
Checks if a registry key exists. - RegValue / Get-RegistryValue (checks a registry key value)
Compares the value of a registry key within an IF statement. Supported parameters are: the name of the key, an operator and the value. - RegValueExists / RegValueExistsEx / Test-RegistryValue (existence of a registry value)
Checks if a specific registry value exists (string, binary or DWORD value). The value name is the parameter. - RunningAsService / Test-RunningAsService
Checks whether the current installation process is running in the context of a service (in session 0). - WinVersion / Get-WindowsVersion
Checks the current Windows version against the specified value. By default, only major and minor version are compared, optionally the build number and the so-called "Update Build Revision" (UBR), the revision number of the currently installed last cumulative update, can be taken into account. - XMLItemExists / Test-XmlNode (the value exists in an XML file)
Checks if a value exists in a specific XML file. Apart from specifying the actual XML file, you also have to specify which entry you want to check in the XML file. For this reason, specify the entry type and an XPath query. This query works like the Read-XmlNode command.
In addition, you must specify the search string. The wildcards * and ? can be used. If you leave the field empty, the system checks for empty contents