Is
InstallShield 2020 » InstallScript Language Reference
The Is function retrieves information commonly needed in a script.
Syntax
Is ( nIsFlag, szIsData );
Parameters
Parameter |
Description |
|||||||||||||||||||||||||||||||||||||||||||||||||||
nIsFlag |
Specifies the type of information to retrieve. Pass one of the following predefined constants in this parameter:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
nIsFlag (cont.) |
During maintenance mode or during uninstallation, Is(SETUP_PACKAGE, szIsData) returns TRUE if the original installation was a self-extracting executable file (although maintenance or uninstallation runs not from the self-extracting executable file, but from the copy of Setup.exe in the DISK1TARGET folder).
A valid URL string meets the following criteria: (1) It begins with http://, https://, or file://. (2) It contains only numbers, letters, and the following characters: ! $ % & ' ( ) * + - . / \ _ |
|||||||||||||||||||||||||||||||||||||||||||||||||||
nIsFlag (cont.) |
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 Add or Remove Programs, 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.
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 that is passed in nIsFlag, as shown below. Note that if the path or file name is enclosed in quotation marks, Is fails. To ensure that the path or file name 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:
Service Pack Number|.NET Version Registry Constant or Path Service Pack Number indicates the number of the minimum service pack. For the .NET Framework 1.0, the value can be 0 through 3. For the .NET Framework 1.1 and later, all numeric values are supported. Both the service pack number and the pipe character (|) delimiter must be included; otherwise, the function returns failure. .NET Version Registry Constant or Path indicates the registry constant or registry path that shows the version of the .NET Framework to check. For more information on the predefined values that are supported and to learn how the Is function performs the check, see the Additional Information section.
C:\\MyDLLFolder\\MyDLL.dll|MyFunction
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. The language ID should be a four-digit hexadecimal language code, including the 0x prefix. For example, if for English, the value should be 0x0409. To build a string with STANDARD_SELECTED_LANGUAGE in this format, use a statement such as: Sprintf (szLang, "0x%.04lx", STANDARD_SELECTED_LANGUAGE); |
|||||||||||||||||||||||||||||||||||||||||||||||||||
szIsData (cont.) |
|
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. |
.NET Framework Version and Service Details
The following predefined constants are supported for specifying a particular version of the .NET Framework using DOTNETFRAMEWORKINSTALLED or DOTNETSERVICEPACKINSTALLED:
• | REGDB_KEYPATH_DOTNET_40_CLIENT |
• | REGDB_KEYPATH_DOTNET_40_FULL |
• | REGDB_KEYPATH_DOTNET_35 |
• | REGDB_KEYPATH_DOTNET_30_SP—Use this variable to detect whether the SP1 (or a later service pack) of the .NET Framework 3.0 is installed. |
• | REGDB_KEYPATH_DOTNET_30—Use this variable to detect whether the RTM version of the .NET Framework 3.0 is installed. |
• | REGDB_KEYPATH_DOTNET_20 |
• | REGDB_KEYPATH_DOTNET_11 |
• | REGDB_KEYPATH_DOTNET_10 |
Tip:Since each of these predefined constants correspond to the appropriate registry path under HKEY_LOCAL_MACHINE, you can also specify a registry path directly in szIsData for DOTNETFRAMEWORKINSTALLED or DOTNETSERVICEPACKINSTALLED.
The installation of the .NET Framework 3.0 writes the registry value InstallSuccess, with 1 as the value data, in the following registry location:
HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.0\Setup\
Therefore, REGDB_KEYPATH_DOTNET_30 is set to that location.
The installations of all other versions of the .NET Framework write the registry value Install with a value data of 1 in the following registry location:
HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\Version Number\
The REGDB_KEYPATH_DOTNET_35, REGDB_KEYPATH_DOTNET_20, REGDB_KEYPATH_DOTNET_11, and REGDB_KEYPATH_DOTNET_10 constants are set to the appropriate values, based on that path.
Note that the installation of the .NET Framework 3.0 SP1 also writes the registry value Install with a value data of 1 in the following registry location:
HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.0\
Therefore, REGDB_KEYPATH_DOTNET_30_SP is set to that location.
If you use the Is function with the DOTNETFRAMEWORKINSTALLED constant, the function automatically checks for both the Install and InstallSuccess values. If the Install or InstallSuccess value exists and its value data is set to 1, Is returns TRUE. Otherwise, Is returns FALSE.
The .NET Framework 1.0 service pack installations do not create registry values that indicate the service pack number. Therefore, if you use DOTNETSERVICEPACKINSTALLED to test for the .NET Framework 1.0, the Is function compares the version of the mscorlib.dll file in FOLDER_DOTNET_10 against known version numbers to determine the service pack:
• | SP3 is present if the version of mscorlib.dll is 1.0.3705.6018 or later. |
• | SP2 is present if the version of mscorlib.dll is 1.0.3705.288 or later, but earlier than 1.0.3705.6018. |
• | SP1 is present if the version of mscorlib.dll is 1.0.3705.209 or later, but earlier than 1.0.3705.288. |
• | The original RTM version is present if the version of mscorlib.dll is 1.0.3705.0 or later, but earlier than 1.0.3705.209. |
If you use DOTNETSERVICEPACKINSTALLED to test for any of the other .NET Framework versions, the function compares the REGDB_VALUENAME_SP value under the .NET version registry constant or path that is specified in szIsData with the service pack number that is specified in szIsData. Note that the comparison is an equal-to-or-later-than version comparison; therefore, if you specify a service pack of 2 in szIsData, the function returns true whenever service pack 2 or later is installed.
.NET Framework Language Pack Details
Version 1.1 and later of the .NET Framework includes support for language packs; version 1.0 does not. For version 1.1 and later of the .NET Framework, you can test whether a particular .NET language pack is installed through the DOTNETFRAMEWORKINSTALLED constant by specifying the appropriate .NET version constant and the locale identifier (LCID) of the language (converted to a string). Separate the .NET version constant and the LCID with the caret operator. For example, use the following syntax to test whether the German language pack for .NET Framework 1.1 is installed:
NumToStr( szLang, ISLANG_GERMAN_STANDARD );
REGDB_KEYPATH_DOTNET_11 ^ szLang;
As documented by Microsoft, the .NET Framework 1.1 supports the following LCIDs:
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