Common Conditions

The following conditions are available in the "Common" tab of the dialog for the If command to create the expression:

  • Compare Strings



    Checks if a package variable or an environment variable has the specified value.

  • CheckInstallMode / Test-InstallMode (check for installation or execution mode)



    Checks the mode the current installation is executed with. 

    The following modes are available:
    • user portion
    • computer portion
    • repair
    • reinstallation
    • modification
    • update
    • uninstallation

Due to compatibility with older scripts, a check for reinstallation will also return "true" if the actual execution mode is modification or update. In a script with more than one CheckInstallMode, make sure to check for modification or update before checking for reinstallation.

  • CheckPlatform / Test-Platform (check OS version)



    Checks if the operating system and the type of computer correspond to the specified value.

  • IsInstalled / Test-PackageInstalled (executed installation of a package)



    Checks if the selected package has been executed already. The check is performed by checking the logging of the package in the registry of the target system using the package-specific GUID.

  • IsRebootPending / Test-PendingReboot

    Checks whether a reboot is pending for the computer (see also https://adamtheautomator.com/pending-reboot-registry-windows/).

  • IsRunningOnServerOS / Test-RunningOnServerOS (computer with server OS)

    Checks, if a server OS is running on the computer. 

  • IsRunningOnX64 / Test-RunningOnX64 (computer with 64bit OS)

    Checks, if a 64bit OS is running on the computer.

  • IsSwPackageRevInstalled / Test-PackageRevisionInstalled (executed installation of a package)



    Checks if the selected package has been executed already. You can define a specific revision. The check is performed by checking the logging of the package in the registry of the target system using the package-specific GUID.

  • LineExists / Test-Line (existence of a line)



    Checks whether a specific line exists in the specified file. Wildcards can be used also. Moreover, it can be selected whether on 64-bit computers the 32-bit branch of the system folder should be used or not.

  • ProductVersion / Get-ProductVersion (product version)



    Checks the product 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.