PreviousNext
Help Library

Is

InstallShield 12 » InstallScript Language Reference

The Is function retrieves information commonly needed in a script.

Syntax

Is ( nIsFlag, szIsData );

Parameters

Is Parameters 

Parameter

Description

nIsFlag

Specifies the type of information to retrieve. Pass one of the following predefined constants in this parameter:

  • BACKBUTTON—Is the Back button that is displayed in some built-in dialog boxes enabled?
  • CANCELBUTTON—Is the Cancel button that is displayed in some built-in dialog boxes enabled?
  • DOTNETFRAMEWORKINSTALLED—Determines whether a particular version of the .NET Framework or language pack is installed. For more information on the predefined values that are supported, see the Additional Information section.
  • DIR_WRITEABLE—Can I write to the directory specified in szIsData?
  • FILE_EXISTS—Does the file specified in szIsData exist?
  • FILE_LOCKED—Is the file locked?
  • FILE_WRITEABLE—Can I write to the file specified in szIsData?
  • FONT_AVAILABLE—Is the font with the title that is specified in szIsData installed? Note that the function searches for the font in all character sets. To search in a single character set, call the Windows API function EnumFontFamiliesEx; for details on this function, see Microsoft's Windows API documentation.
  • FUNCTION_EXPORTED—Does the DLL specified in szIsData export the function specified in szIsData? Is returns TRUE if the DLL exists and can be loaded, and the function is exported, and FALSE otherwise.
  • LANG_SUPPORTED—(InstallScript and InstallScript MSI projects) Does the installation support the language that is specified in szlsData?
  • LOGGING—(InstallScript projects only) Is logging of uninstallation information enabled?
  • MATH_COPROCESSOR—Does a math coprocessor exist in the target system?
  • NEXTBUTTON—Is the Next button that is displayed by some built-in dialog boxes enabled? On most dialog boxes, the Next button is enabled by default.
  • PATH_EXISTS—Does the path specified in szIsData exist?
  • REGDBREMOTEREGCONNECTED—Is a remote registry currently connected?
  • REBOOTED—Is the setup running after a reboot?

nIsFlag (cont.)

  • SETUP_PACKAGE—(InstallScript projects only) Is the setup running from a self-extracting executable?
  • During a maintenance setup or uninstallation, Is(SETUP_PACKAGE, szIsData) returns TRUE if the original setup was a self-extracting executable (although the maintenance setup or uninstallation runs not from the self-extracting executable but from the copy of Setup.exe in the DISK1TARGET folder).

  • SKIN_LOADED—Is a dialog box skin loaded?
  • URL—Is the string specified in szIsData a Uniform Resource Locator (URL)? (That is, does the string begin with "http://" or "https://" or "file://" or "ftp://"?)
  • USER_ADMINISTRATOR—When the target operating system is Windows NT, does the current user have administrator privileges? In a setup running under Windows 95 or later, Is will always return TRUE when USER_ADMINISTRATOR is passed in nFlag.
  • USER_POWERUSER—When the target operating system is Windows 2000, XP, or later, does the current user belong to the power user group? In a setup running under Windows NT 4, Is will always return FALSE when USER_POWERUSER is passed in nFlag, since Windows NT 4 does not support power users. In a setup running under Windows 95, 98, or Me, Is will always return TRUE when USER_POWERUSER is passed in nFlag.
  • VALID_PATH—Is the path specified in szIsData a legal path? This will not confirm the existence of a path, it will only check its syntax. You can use this constant when you retrieve path information from the user. The function will then check to see if the path information was entered correctly.
  • A valid URL string meets the following criteria:

  • begins with "http://", "https://", or "file://"
  • contains only numbers, letters, and the following characters:
    ! $ % & ' ( ) * + - . / \ _
  • WEB_BASED_SETUP—(InstallScript projects only) Is the setup being run from the Internet?
Note

Is(WEB_BASED_SETUP,szIsData) checks whether the current instance of the installation is being run from the Web. For this reason, when the installation is run from Windows' Add/Remove Programs dialog box, Is(WEB_BASED_SETUP,szIsData) always returns FALSE, since in that case the installation is always being run from the local files even if the original installation was run from the Web.

  • WINDOWS_SHARED—Is Microsoft Windows running a shared copy from a network?
  • A shared copy of Microsoft Windows is installed on a network and has common files that are shared by many users.

szIsData

Specifies information that is dependent on the constant passed in nIsFlag, as shown below. Note that if the path or filename is enclosed in quotation marks, Is will fail. To ensure that the path or filename is not enclosed in quotation marks, call LongPathToQuote(szIsData, FALSE) before calling Is. The following list provides an explanation of what szIsData should contain when each nIsFlag option is specified:

  • DIR_WRITEABLE—szIsData specifies the fully qualified path to be checked.
  • DOTNETFRAMEWORKINSTALLED—szIsData specifies the version of the .NET Framework or language pack to check. For more information on the predefined values that are supported, see the Additional Information section.
  • FILE_EXISTS—szIsData specifies the fully qualified file name. You can specify a valid URL in this parameter. To check the validity of a URL, call Is(VALID_PATH, szIsData).
  • FILE_LOCKED—szIsData specifies the fully qualified file name.
  • FILE_WRITEABLE—szIsData specifies the fully qualified file name.
  • FONT_AVAILABLE—szIsData specifies the font title.
  • FUNCTION_EXPORTED—szIsData specifies the fully qualified filename of the DLL followed by a pipe character (|) and the name of the function; for example, "C:\\MyDLLFolder\\MyDLL.dll|MyFunction".
  • LANG_SUPPORTED—szlsData specifies the path to the Setup.ini file and the language ID, in the following format:
  • Path to Setup.ini|Language ID

    If the path to Setup.ini is not specified, the current installation is used. If the language ID is not specified, SELECTED_LANGUAGE is used.

  • LOGGING—szIsData is ignored.
  • MATH_COPROCESSOR—szIsData specifies szIsData is ignored.
  • PATH_EXISTS—szIsData specifies the fully qualified path. You can specify a valid URL in this parameter. To check the validity of a URL, call Is(VALID_PATH, szIsData).
  • REGDBREMOTEREGCONNECTED—szIsData is ignored.
  • SETUP_PACKAGE—szIsData is ignored.
  • SKIN_LOADED—szIsData is ignored.
  • USER_ADMINISTRATOR—szIsData is ignored.
  • USER_POWERUSER—szIsData is ignored.
  • VALID_PATH—szIsData specifies the fully qualified path.
  • WEB_BASED_SETUP—szIsData is ignored.
  • WINDOWS_SHARED—szIsData is ignored.

Return Values

Is Return Values 

Return Value

Description

TRUE (1)

Indicates that the answer is true.

FALSE (0)

Indicates that the answer is false.

< 0

The Is function was unable to answer the question.

Additional Information

The following predefined values are supported for specifying a particular version of the .NET Framework using DOTNETFRAMEWORKINSTALLED:

For .NET version 1.1 and later (.NET 1.0 does not support language packs), you can also test whether a particular .NET language pack is installed by specifying the appropriate .NET version constant and List of Locale ID (LCID) language code (converted to a string) separated by the caret operator. For example, use the following syntax to test whether the German language pack for .NEt 1.1 is installed:

NumToStr( szLang, ISLANG_GERMAN_STANDARD );

REGDB_KEYPATH_DOTNET_11 ^ szLang;

As documented by Microsoft, .NET 1.1 supports the following LCIDs:

Tip

TIP

Since these predefined constants correspond to the registry path under HKEY_LOCAL_MACHINE, you can also specify a registry path directly in szIsData. The function looks for a value named "Install" under the specified registry path. If the value exists and has a value of "1", TRUE is returned. Otherwise, FALSE is returned.

Supported .NET LCID Language Codes

Language

LCID

Corresponding IS Constant

Chinese (Simplified)

2052 (0x0804)

ISLANG_CHINESE_SIMPLIFIED

Chinese (Traditional)

1028 (0x0404)

ISLANG_CHINESE_TRADITIONAL

Czech

1029 (0x0405)

ISLANG_CZECH_STANDARD

Danish

1030 (0x0406)

ISLANG_DANISH_STANDARD

Dutch

1043 (0x0413)

ISLANG_DUTCH_STANDARD

Finnish

1035 (0x040B)

ISLANG_FINNISH_STANDARD

French

1036 (0x040C)

ISLANG_FRENCH_STANDARD

German

1031 (0x0407)

ISLANG_GERMAN_STANDARD

Greek

1032 (0x0408)

ISLANG_GREEK_STANDARD

Hungarian

1038 (0x040E)

ISLANG_HUNGARIAN_STANDARD

Italian

1040 (0x0410)

ISLANG_ITALIAN_STANDARD

Japanese

1041 (0x0411)

ISLANG_JAPANESE_STANDARD

Korean

1042 (0x0412)

ISLANG_KOREAN_STANDARD

Norwegian

1044 (0x0414)

ISLANG_NORWEGIAN_BOKMAL

Polish

1045 (0x0415)

ISLANG_POLISH_STANDARD

Portuguese (Brazilian)

1046 (0x0416)

ISLANG_PORTUGUESE_BRAZILIAN

Portuguese (Portugal)

2070 (0x0816)

ISLANG_PORTUGUESE_STANDARD

Russian

1049 (0x0419)

ISLANG_RUSSIAN_STANDARD

Spanish

3082 (0x0C0A)

ISLANG_SPANISH_MODERNSORT

Swedish

1053 (0x041D)

ISLANG_SWEDISH_STANDARD

Turkish

1055 (0x041F)

ISLANG_TURKISH_STANDARD

See Also




Macrovision Corporation
copyright
contact