Conditions

The Conditions is are predefined functions that can be used in the Condition Dialog. If condition not match, installation of package or action will be interrupted with the ConditionException.

AppInstalled()

Checks that the specified application with the given version (optional) is installed.

Parameters

  • appkey (string) The key to search for an installed application. Can be specified a full app name or a wildcard expression.
  • version (string) The version in format 0.0.0.0. May be prefixed with compare operators: >,>=,<,<=

Examples


    //Fails if Notepad++ v 7.6.3 is not installed
    AppInstalled("Notepad++", "7.6.3");
    //Fails if Microsoft Office version greather or equal 16.0 is not installed
    AppInstalled("Microsoft Office*", ">=16.0");
    //Fails if app with the name starts with 'Notepad' is not installed
    AppInstalled("Notepad*");

    //Fails if Notepad++ v 7.6.3 is installed
    AppNotInstalled("Notepad++", "7.6.3");
    //Fails if Microsoft Office version greather or equal 16.0 is installed
    AppNotInstalled("Microsoft Office*", ">=16.0");
    //Fails if app with the name starts with 'Notepad' is installed
    AppNotInstalled("Notepad*");

Is64bitOS()

Checks that Windows is 64-bit.

Examples


    //Fails on 32-bit OS
    Is64bitOS();

Is32bitOS()

Checks that Windows is 32-bit.

Examples


    //Fails on 64-bit OS
    Is32bitOS();

MinDotNetVersion()

Defines minimal required NET. Framework version.

Parameters

  • version (string) NET. Framework version in format 0.0.0

Examples


    //Required NET. Framework version 3.5 and above
    MinDotNetVersion("3.5");
    //Required NET. Framework version 4.6.2 and above
    MinDotNetVersion("4.6.2");

MinMemory()

Defines minimal required Installed memory (RAM).

Parameters

  • memoryMb (int) Memory size in MB

Examples


    //Required minimum 2GB RAM 
    MinMemory(2048);

MinWindowsVersion()

Defines minimal required Windows version.

Parameters

  • version (string) Windows version and OS build number in format 00.00.00000

Examples


    //Required Windows 7 and above
    MinWindowsVersion("6.1");
    //Required Windows 10 OS build 18362 and above
    MinWindowsVersion("10.0.18362");

FileExists()

Determines whether the specified file exists.

Parameters

  • path (string) The file to check.

Examples


    //Fails if file not exist
    FileExists("c:\\temp\\test.txt");
    //Fails if file exist
    FileNotExists("c:\\temp\\test.txt");

RegKeyExists()

Determines whether the specified registry key exists.

Parameters

  • name (string) Reg key name to check.

Examples


    //Fails if key not exist
    RegKeyExists("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft");
    //Fails if key exist
    RegKeyNotExists("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft");

RegValueExists()

Determines whether the specified registry value exists.

Parameters

  • key (string) Reg key name to check.
  • name (string) Reg value name to check.

Examples


    //Fails if Value not exist
    RegValueExists("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework", "Enable64Bit");
    //Fails if Value exist
    RegValueNotExists("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework", "Enable64Bit");

RegValueEqual()

Determines whether the specified registry value is equal to given value.

Parameters

  • key (string) Reg key name.
  • name (string) Reg value name.
  • value (object) Integer or string value to compare.

Examples


    //Fails if Value not equal 1
    RegValueEqual("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework", "Enable64Bit", 1);
    //Fails if Value equal
    RegValueNotEqual("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework", "InstallRoot", "C:\\Windows\\Microsoft.NET\\Framework\\");

RegValueGreaterOREqual()

Determines whether the specified registry value is greater or equal than given value.

Parameters

  • key (string) Reg key name.
  • name (string) Reg value name.
  • value (object) Integer or string value to compare.

Examples


    //Fails if Value is not greater or equal 1
    RegValueGreaterOREqual("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework", "Enable64Bit", 1);

RegValueLower()

Determines whether the specified registry value is lower than given value.

Parameters

  • key (string) Reg key name.
  • name (string) Reg value name.
  • value (object) Integer or string value to compare.

Examples


    //Fails if Value not lower than 1
    RegValueLower("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework", "Enable64Bit", 1);