INSTALLSHIELD internal library function 3 information functions
The following information functions provide data for effective resources in an operating environment: disk space, memory, and mode of operation:
GetDiskSpace
Returns the number of valid bytes (unused) (up to 2GB) of the specified disk.
GetDiskSpaceex
Returns a disk free space with bytes, kilebytes, megabytes or gigabytes,.
Getenvvar
Returns the current value of an environment variable.
GetExtents
Returns the screen size.
GetMemfree
Returns the available memory running on a application under Microsoft Windows.
GetSystemInfo
Retrieve system information.
GetValiddriveSlist
Returns all valid drives in the target system.
GetWindowhandle
Returns the handle of the main installation window.
IS
Provide file and path check service, find a mathematical coprocessor, detect the management status under Windows NT, determine if Microsoft Windows runs from the shared version of the network.
3.1 GetDiskSpace
Grammar: getDiskSpace (szdrive);
Note: The getDiskSpace function returns the idle disk space on the specified drive.
parameter:
Szdrive
Specify a drive indicator (with a colon after the drive character). You can also specify a generic navigation computer path in this parameter location.
return value:
XXXX: The number of idle bytes on the specified drive. The maximum return value is 2GB. 2GB is also returned to the idle space of more than 2GB. When you need to detect more than 2GB free space, you need to call GetDiskSpaceEx.
<0: Indicates that getDiskSpace failed to get free disk space values.
3.2 GetDiskSpaceex
Grammar: getDiskSpaceEx (Szdrive, NUnits);
Description: The getDiskSpaceEx function returns the idle disk space value of the specified drive. Value to NUNITS determines that the return value of GetDiskSpaceEx is by BYTES, KILOBYTES, Megabytes or Gigabytes metrics.
parameter:
Szdrive
Specify a drive indicator (with a colon after the drive character). Users can also specify a universal navigation computer (UNC) path in this parameter location.
NUnits
Pass one of the following predefined constants to indicate the measurement unit:
BYTES: Indicates that getDiskSpaceEx must return the number of idle BYTE.
KBYTES: Indicates that getDiskSpaceEx must return to the number of idle kilobyte.
MBYTES: Indicates that getDiskSpaceEx must return the number of idle megabyte.
Gbytes: Indicates that getDiskSpaceEx must return to the idle Gigabyte.
return value:
XXXX: Number of idle Bytes, Kilobytes, Megabytes or Gigabytes, and measure units depend on the NUnits value on the specified drive.
<0: Indicates that getDiskSpaceEx failed to get an idle disk space value.
3.3 Getenvvar
Syntax: Getenvvar (Szparameter, SvValue);
Description: The getENVVAR function retrieves the current value of an environment variable.
parameter:
Szparameter
Specify the name of the environment variable to be retrieved.
svvalue
Returns the current value of the environment variable.
return value:
0: Indicates that the function retrieves the value of the environment variable.
<0: Indicates that the function cannot retrieve the value of the environment variable.
annotation:
· InstallShield does not provide a mechanism for changing an environmental variable value. In Microsoft Windows 3.x and 95 environments, it is recommended that users do not change environment variables. If the user needs to set a new environment variable, set the system in the autoexec.bat file and then restart the system. For Windows NT, see how to set up environment variables under Windows NT. 3.4 getExtents
Grammar: getExtents (NVDX, NVDY);
Description: The getExtents function retrieves the screen size. The screen width is returned to NVDX in units of pixel points, and the high is returned to NVDY in units of pixel points. Such as: a standard VGA monitor returns NVDX to 640, NVDY is 480.
parameter:
NVDX
Returns the width of the screen as a pixel point.
NVDY
Returns the high of the screen as a pixel point.
return value:
0: Indicates that the function successfully retrieves the size of the screen.
<0: Indicates that the function failed to retrieve these values.
3.5 GetMemfree
Grammar: getMemfree ();
Description: The getMemFree function returns a memory size that runs in Microsoft Windows. Because Microsoft Windows is a virtual memory system that does not return actual physical memory (called RAM) but the memory available for Windows applications. To determine the actual physical memory size available on the target system, you can call GetSystemInfo.
parameter:
GetMemfree without parameters. Call the function with an empty parameter table, as shown below:
GetMemfree ();
return value:
XXXX: XXXX is the number of bytes of idle memory available for applications.
<0: getMemFree failed to return the size of the idle memory.
annotation:
· The script performs a function, INSTALLSHIELD returns a value to indicate the function of the function. If you want to use the return value of the function after this script, you assign the value to a numeric variable.
3.6 GetSystemInfo
Grammar: getSysteminfo (Nitem, NVResult, SvResult);
Description: The getSystemInfo function retrieves the information of the target system.
parameter:
The first parameter, NITEM, is used to specify the type of information to retrieve. Referring to this constant list you can pass to this parameter to retrieve system information. Note When using specific constants (such as disk_totalspace_ex), you must specify additional information for parameters nvresult and / or svresult before calling this function.
System information is returned to NVRESULT and / or SVRESULT. Numerical data is returned to NVRESULT. String data is returned to SvResult. The following table lists the return value types that you can pass to NITEM.
-------------------------------------------------- ------------------------------
NItem: bootupdrive
NVRESULT: Start the ID, 1 = A: 2 = B: 3 = C :. The number can be converted to the corresponding drive character by adding 64 (decimal), and then sets a string variable to the value. Use the following syntax to convert:
SvResult [0] = 64 NVRESULT;
SvResult: Returns the drive indicator of the boot drive (with a colon after the drive character).
-------------------------------------------------- ------------------------------ NITEM: CDROM
NVRESULT: TRUE or FALSE indicates whether the CD ROM is available.
SvResult: N / A
-------------------------------------------------- ------------------------------
NItem: Colors
NVRESULT: Returns the number of colors available by the user system. The result is obtained from the video driver of the target system, not from the video card. If the card supports 256 colors but the drive can only process 16 colors, the returned color value is 16.
Svresult :: N / A
-------------------------------------------------- ------------------------------
NIITEM: CPU
NVRESULT: Returns one of the following constants:
IS_UNKNOWN User CPU is unknown.
IS_386 users have a 386 processor.
IS_486 users have a 486 processor.
The is_pentium user has a Pentium processor.
Is_alpha users have an alpha processor.
SvResult: N / A
-------------------------------------------------- ------------------------------
NItem: Date
NVRESULT: N / A
SvResult: SvResult: The current system time format is mm-dd-yyyy. The first zero in the month and the day is deleted.
-------------------------------------------------- ------------------------------
NItem: disk_totalsspace
NVRESULT:: Returns the total capacity of the disk drive specified by SvResult. The maximum return value is 2GB. The total capacity is still returned to 2GB.
SVRESULT: Drive characters. Note that this parameter is passed to the function; that is, you must assign the svresult to the svresult before calling getSystemInfo. Also note that you must add a colon after the drive character; otherwise the function will fail. You can also specify a general navigation computer (UNC) path in this parameter location.
-------------------------------------------------- ------------------------------
NITEM: DISK_TOTALSPACE_EX
NVRESULT: Specifies the unit of measure; one of the following predefined constants in this parameter location: bytes, kbytes, mbytes or gbytes. Returns the total capacity of the specified disk drive at SvResult.
SVRESULT: Drive characters. Note that this parameter is passed to the function; that is, the user must assign the svresult to the svresult before calling GetSystemInfo. Also note that you must add a colon after the drive character; otherwise the function will fail. Users can also specify a general navigation computer (UNC) path in this parameter location.
-------------------------------------------------- ------------------------------
NITEM: Drive
NVRESULT:: Returns the type of specified drive at SvResult. One of the following constants will be returned: is_unknown - the target drive is unknown.
Is_removable - Target Drive is a floppy drive.
IS_FIXED - Target drive is a hard drive.
IS_CDROM - Target drive is a disc drive.
The IS_REMOTE -The Target Drive is a network drive.
SvResult: The driver character follows the colon. Note that this parameter is passed to the function; that is, the user must assign the svresult to the svresult before calling GetSystemInfo. Users can also specify a general navigation computer (UNC) path in this parameter location.
-------------------------------------------------- ------------------------------
NItem: ExtendedMemory
NVRESULT: NVRESULT: Returns the memory size installed on the machine. Due to the limitations of the operating system, the return value may be slightly different from the actual physical memory size installed on the machine. This value is usually less than 100K more than the actual value. Note that the return value is measured in KB.
SvResult: N / A
-------------------------------------------------- ------------------------------
NItem: Language
NVRESULT: NVRESULT: This parameter returns the installshield language constant of the target system. The returned constant can be used to determine which language-specific file groups are loaded in the installation of the ComponentFilterLanguage function.
For Information About Determining The Default Language of The Target System, Click Here.
InstallShield International supports 21 languages, and Windows supports more than 100 languages. If you want to filter file groups according to NVRESult Value, you must use a switch statement to determine the installshield language identification number of INSTALLSHIELD in this function. The performance of the function is highly dependent on the system when taking this parameter.
SvResult: This parameter returns a language name string that returns the language constant returns returned by NVresutl.
-------------------------------------------------- ------------------------------
NITEM: OS
NVRESULT: Returns the target operating system platform. Returns one of the following constants:
The IS_WINDOWSNT - the operating system is Windows NT.
The IS_WINDOWS9X-operating system is Windows 95 or Windows 98. To determine which, with Winminor call GetSystemInfo to detect the version of the monitor. If less than 10, the operating system is Windows 95; otherwise it is Windows 98.
SvResult: N / A
-------------------------------------------------- ------------------------------
NITEM: Parallel
NVRESULT: Returns the number of effective physical parallel ports.
SvResult: N / A
-------------------------------------------------- ------------------------------
NITEM: Serial
NVRESULT: Returns the number of effective physical serial ports.
SvResult: N / A
-------------------------------------------------- ------------------------------ NITEM: TIME
NVRESULT: N / A
SvResult: Returns the current system time in hh: mm: SS format.
-------------------------------------------------- ------------------------------
NITEM: VIDEO
NVRESULT: NVRESULT: Returns the installed video adapter type. (InstallShield cannot detect CGA or monochrome video drive). Returns one of the following constants:
IS_UNKNOWN - Unknown user video adapter.
IS_EGA - EEGA resolution.
IS_VGA - VGA resolution.
IS_SVGA - SVGA (800 × 600) resolution.
IS_XVGA - XVGA (1024 × 768) resolution.
IS_UVGA - greater than 1024 × 768 resolution.
SvResult: N / A
-------------------------------------------------- ------------------------------
NITEM: Volumelabel
NVRESULT: N / A
SvResult: Pass the drive indicator of the drive you want to retrieve its volume marks (with the colon after the drive characters). This parameter returns the volume mark of the specified drive. If the drive does not have a volume mark, return an empty string.
-------------------------------------------------- ------------------------------
NITEM: Winmajor
NVRESULT: Returns the home version of Windows.
SvResult: Returns a string in ##. ### format, indicating the main and secondary version of Windows.
-------------------------------------------------- ------------------------------
NITEM: Winminor
NVRESULT: Returns the secondary version of Windows.
SvResult: Returns a string in ##. ### format, indicating the main and secondary version of Windows.
-------------------------------------------------- ------------------------------
return value:
0: Indicates that the function successfully returns the specified information.
<0: Indicates that the function failed to return to the specified information.
3.7 GetValiddriveSlist
Grammar: getValiddriveSlist (ListID, NDriveType, NMindriveSpace);
Note: The getValidDriveSlist function retrieves all drive lists that meet specific conditions of the target system. This condition includes the type of drive type and the minimum space of the drive. If a drive is not closed, the drive name still adds a list.
You can specify the type (ndriveType) of the drive to look for before the drive row, and the available minimum disk space (NMIndriveSpace).
parameter:
ListID
Returns a list of valid drive characters. A list of strings identified by the ListID must be initialized by calling the ListCreat.
NDRIVETYPE
Specifies the type of drive to find. One of the predefined constants in this parameter location: -1: Find all drive types.
Fixed_Drive: Only the hard drive is found.
Remote_Drive: Only the remote drive is found. Remote drives are usually in the network.
Removeable_Drive: Only the discostable drive is found. The floppy drive is a removable drive.
CDROM_DRIVE: Only the disc drive is found.
NMIndriveSpace
Specifies the number of bytes that must be included in the returned list. If NMINDRIVESPACE is less than 0, GetValiddDriveSlist will not detect the smallest space of the drive. This is useful for floppy drives.
return value:
0: The function successfully retrieves the required list.
<0: The function cannot retrieve the required sequence.
annotation:
• The network mapping drive can also be returned as a remote drive. This function does not return a drive on all networks, only returns those drivers identified as mapping drives.
3.8 GetWindowHandle
Grammar: getWindowHandle (NHWNDFLAG);
Note: The getWindowHandle function gets the handle of the installation main window.
parameter:
NHWNDFLAG
Specifies the window handle of the INSTALLSHIELD main window. The predefined constant hwnd_install is transmitted in this parameter location.
return value:
X: x is a window handle.
<0: The function failed to retrieve the handle.
3.9 IS
Syntax: IS (Nisflag, Szisdata);
Description: The IS function retrieves the public information required in the script.
parameter:
Nisflag
Specifies the type of information to retrieve. One of the following predefined constants in this parameter location:
DIR_WRITEABLE: Can I write to the directory specified by SZISData?
FILE_EXISTS: Is there any file specified by SZISDATA?
File_locked: Is the file lock?
File_Writeable: Can I write a file specified by SZISDATA?
MATH_COPROCESSOR: Is there a mathematical coprocessor in the target system?
PATH_EXISTS: Is there a path specified by the szisdata exist?
User_administrator: When the target operating system is Windows NT, is the current user owns administrator privilege? The installer running under Windows 95 or later is usually returned when the parameter nflag is User_administrator.
Valid_path: Is the path specified by the szisdata a legal path? It does not have the presence or absence of the path, but only detects its syntax. This constant can be used when you retrieve the path information obtained from the user. The function then detects whether the input path information is correct.
WINDOWS_SHARED: Does Microsoft Windows share the version from a network?
Szisdata
Specify information, which relies on the constant passed to Nisflag, as shown below:
If Nisflag is Dir_Writeable, SZISDATA specifies the fully qualified path to be detected.
If nisflag is file_exists, SZISDATA specifies a fully qualified file name.
If nisflag is file_locked, SZISDATA specifies a fully qualified file name.
If nisflag is file_writeable, SZISDATA specifies a fully qualified file name.
If nisflag is Math_Coprocessor, the content specified by SZISDATA is ignored.
If nisflag is path_exists, SZISDATA specifies a fully qualified path.
If Nisflag is User_administrator, SZISDATA is ignored.
If Nisflag is Valid_Path, SZISDATA specifies a fully qualified path.
If nisflag is Windows_Shared, Szisdata is ignored.
return value:
True (1): Indicates that the answer is true.
False (0): Indicates the reply to leave.
<0: The function failed to reply.
annotation:
· Constant Windows_Shared can only be applied to Microsoft Windows. A Shared version of a Microsoft Windows is installed in the network and has a public file that can be shared by many users.