Script variables hold information about the installation that is being performed. You use these variables to retain the information that is gathered from users about where to place files. They are also used to hold information about which files that users want to install. In addition, a number of predefined variables contain information about the target computer on which you are installing software.
In script commands, variables have two roles: destination variables and variable references.
When a script command places information into a variable, the variable is a destination variable. You must specify the name of the variable to use. The variable name must:
When you want to use the value that is in a variable, place the variable name within percent signs (%). This is called a variable reference.
For example, if you want to set the value of the variable DEFAULTDIR to C:\Temp, use the Set Variable script command. Make sure that the Variable field contains DEFAULTDIR and set the New Value field to C:\Temp.
To set the value of DEFAULTDIR to be the same as the WIN variable (which contains the Windows directory name), set the Variable field to DEFAULTDIR and the New Value field to %WIN%. The percent signs indicate that you are using the value of the WIN variable.
SMS Installer creates and defines variables at the beginning of installation. You can use the variables in your installation scripts.
Table 7.6 lists and describes the function of the predefined variables.
During the installation, you can create variables that SMS uses to perform certain functions. Use the Set Variable action in the Script Editor Actions list to create such variables or use the prompt command. For example, you can create the following useful variables.
Specifies the Help file that is displayed during installation when the user clicks Help.
Restarts Windows at the end of an installation. It is set automatically.
Creates a backup of all files that changed during an installation.
Specifies the directory in which to place backed-up files.
|
Option
|
Description
|
MSI compatible
|
|
Add Device to System.ini
|
Adds or modifies entries in the [386Enh] section.
|
Yes
|
|
Add Directory to Path
|
Appends the specified directory to the PATH environment variable.
|
Yes
|
|
Add ProgMan Icons
|
Manages icons and groups in Program Manager and on the Start menu.
|
Yes
|
|
Add Text to Installation Log
|
Adds remarks to the installation log file.
|
No
|
|
Add to Autoexec.bat
|
Adds or replaces commands and environment variables in the Autoexec.bat file, except for the PATH environment variable.
|
Yes
|
|
Add to Config.sys
|
Adds device drivers to Config.sys.
|
Yes
|
|
Allow Floppy Disk Change
|
Changes the floppy disk so that you can run another executable file during the installation process.
|
No
|
|
Browse for Directory
|
Provides a generic directory browse dialog box.
|
Yes
|
|
Call DLL Function
|
Calls Win16 and Win32 DLLs.
|
Yes
|
|
Check Configuration
|
Checks a finite set of configurable items on the target computer, such as the operating system and amount of memory.
|
Yes
|
|
Check Disk Space
|
Verifies that enough disk space is available on the target computer to complete the installation.
|
Yes
|
|
Check If File/Dir Exists
|
Verifies that a file or directory exists on the target computer.
|
Yes
|
|
Compiler Variable
|
Provides if/then/else logic for compiler variables.
|
Yes
|
|
Configure ODBC Data Source
|
Creates and configures an Open Database Connectivity (ODBC) data source.
|
Yes
|
|
Copy Local Files
|
Copies uncompressed files from your installation disk to the target computer.
|
Yes
|
|
Create Directory
|
Creates an empty directory on the target computer.
|
Yes
|
|
Create Service
|
Creates a service on a target computer that is running Windows NT.
|
Yes
|
|
Create Shortcut
|
Creates a shortcut on the Desktop or Start menu for target computers that are running Windows NT.
|
Yes
|
|
Custom Dialog Box
|
Use to create custom dialog boxes to display and request information during the installation.
|
Yes
|
|
Custom Graphics
|
Use to create and edit graphics that are displayed during the installation.
|
Yes
|
|
Delete File(s)
|
Deletes files and directories on the target computer.
|
Yes
|
|
Display Graphic
|
Displays bitmap files in the background during the installation.
|
Yes
|
|
Display Message
|
Displays a message to the user and captures the user's response.
|
Yes
|
|
Display Readme File
|
Creates a dialog box that is used to display the contents of any text file.
|
Yes
|
|
Edit .ini File
|
Creates or edits an .ini file on the target computer.
|
Yes
|
|
Edit Registry
|
Edits the system registry.
|
Yes
|
|
Else Statement
|
Provides the FALSE condition to your script's logic.
|
Yes
|
|
End Block
|
Ends a logical block of script items that begin with a start block (if/else) or a WHILE loop.
|
Yes
|
|
Execute Program
|
Helps you execute another program (outside of the installation) during the installation process.
|
Partial. DDE functionality in SMS Installer is not supported through Windows Installer.
|
|
Exit Installation
|
Terminates and exits the installation.
|
Partial. MIF generation is handled internally in Windows Installer, so no customization is possible.
|
|
Find File in Path
|
Finds the first occurrence of a file in a directory tree or in the PATH environment variable on the target computer.
|
Yes
|
|
Get Environment Variable
|
Loads the value of the environment variable into a script variable.
|
Yes
|
|
Get Name/Serial Number
|
Creates a dialog box to request up to three pieces of information from the user.
|
Yes
|
|
Get ProgMan Group
|
Creates a dialog box that displays a list of Program Manager groups on the target computer and helps the user to select from the list or enter a new group.
|
Yes
|
|
Get Registry Key Value
|
Retrieves data values from the system registry.
|
Yes
|
|
Get System Information
|
Retrieves system information from the target computer, such as Windows version number and file size.
|
Yes
|
|
Get Temporary Filename
|
Creates a unique temporary file name in the \temp directory on the target computer. You must create the file yourself by using the variable to which the file name is assigned.
|
Yes
|
|
If/While Statement
|
Controls the flow of logic in your script.
|
Partial. The Windows Installer service does not reproduce timing or delay loops. Using complex If/While statements force the use of MSI nesting, which does not allow Windows Installer's advertisement
|
|
Include Script
|
Incorporates other scripts into your script at compile time.
|
Yes
|
|
Insert Line into Text File
|
Adds lines of text to new or existing text files.
|
Yes
|
|
Install DirectX
|
Installs DirectX® drivers on the target computer.
|
No
|
|
Install File(s)
|
Compresses files that are installed on the target computer into the installation executable file.
|
Yes
|
|
Install MMC Snap-in
|
Compresses the Microsoft Management Console snap-in DLL into the SMS Installer-generated executable file.
|
Yes
|
|
Install ODBC Driver
|
Adds a driver name and driver attributes to the Odbcinst.ini file and to the system registry.
|
Yes
|
|
Modify Component Size
|
Modifies the amount of space that SMS Installer calculates for a given component.
|
No
|
|
Open/Close INSTALL.LOG
|
Opens, closes, or resumes writing to the log file.
|
No
|
|
Parse String
|
Searches a string for a pattern and splits the string into two new strings based on the position of the pattern.
|
Yes
|
|
Play a Multimedia File
|
Plays audio and video files during the installation.
|
Yes
|
|
Prompt for Text
|
Creates a dialog box to prompt the user for a single line of text.
|
Yes
|
|
Radio Button Dialog Box
|
Creates a dialog box that prompts the user to select from a set of options.
|
Yes
|
|
Read INI Value
|
Reads an item entry from an existing .ini file on the target computer.
|
Yes
|
|
Read/Update Text File
|
Reads and updates lines of text in a text file on the target computer.
|
Yes
|
|
Read/Write Binary File
|
Reads from a file and writes to a file in binary mode.
|
Yes
|
|
Register Font
|
Registers fonts that you have copied to the target computer.
|
Yes
|
|
Remark
|
Adds comments and white space to your script.
|
No
|
|
Remove From System.ini
|
Removes (comments) entries in the [386Enh] section.
|
Yes
|
|
Rename File/Directory
|
Renames a file or directory on the target computer.
|
Yes
|
|
Search for File
|
Locates a file on the target computer.
|
Yes
|
|
Select Components
|
Creates a component selection dialog box.
|
Yes
|
|
Self-Register OCXs/DLLs
|
Registers .ocx and DLL files.
|
Yes
|
|
Set File Attributes
|
Sets the file attributes of a file or group of files.
|
Yes
|
|
Set Files/Buffers
|
Modifies the FILE and BUFFER settings in the file.
|
Yes
|
|
Set Variable
|
Creates a script variable and modifies the content of a script variable.
|
Yes
|
|
Sleep
|
Pauses the installation process for a specified amount of time.
|
Yes
|
|
Start/Stop Service
|
Starts or stops a service.
|
Yes
|
|
Win32 System Directory
|
Gets the path to the target computer's system directory.
|
Yes
|
|
Wizard Block
|
Controls the logical flow of wizard dialog boxes in your script.
|
Yes
|