Built-in variables are automatically provided for you by Setup Factory. They are used to represent common values that might differ between systems, like the location of the user's temp directory (%TempDir%) or the width of the user's display screen in pixels (%ScreenWidth%). These variables serve as pre-defined constants that you can use in the paths and conditional expressions within your Setup Factory project.
There are also built-in variables for things like your product name (%ProductName%) and copyright notice (%Copyright%). These variables are automatically defined to match the information you provide in the various fields on the Product Info tab of the General Design dialog. You only have to change these values in one place (in this case, on the Product Info tab), and wherever those variables are used in your setup, the new values will be shown automatically.
Finally, there are built-in variables you can use in action lists to get information about the last action that was performed (%LastCommand%), and in the case of an error, to get information about the type of error that occurred (%LastErrorNum%, %LastErrorMsg% and %LastErrorDetails%).
NOTE |
|
|
|
|
There are also built-in design-time constants. Design-time constants are special variables that are converted to values at build time, instead of at run time. |
TIP |
|
|
|
|
You can insert built-in variables into most text entry fields in Setup Factory by right-clicking on the field and selecting Insert | Variable from the context menu. |
Your application's main directory, where all of your files and
folders will be installed. For example, by default Setup Factory's
main directory is C:\Program
Files\Setup Factory 6.0.
%AppDir% is initially set to the default value that you give it on the Settings tab of the General Design dialog (in the Variable Defaults section). However, in most installations, the value of %AppDir% will ultimately be set by the user on the Select Install Folder screen, overriding the default value.
The drive letter of %AppDir%. You should not set this variable explicitly. It is reset every time that %AppDir% is re-assigned. For example, if %AppDir% is C:\Program Files\My Program, %AppDrv% will be C:.
The user's BDE (Borland Database Engine) directory.
The color depth of the user's video display, in bits per pixel.
The user's Common Files directory. Typically, this is something like:
C:\Program
Files\Common Files
Your companys name. The value of this variable is set in the Company name field on the Product Info tab of the General Design dialog.
The copyright message for your product. The value of this variable is set in the Copyright notice field on the Product Info tab of the General Design dialog.
A number representing the current day of the month, calculated when the setup begins.
A number representing the current hour in 24-hour time (e.g. 4:00 PM is 16), calculated when the setup begins.
The current minute, calculated when the setup begins. This number is always expressed with two digits, so 4 minutes into the hour will be "04".
A number representing the current month, calculated when the setup begins. January is represented by "1" and December is represented by "12".
The current second, calculated when the setup begins. This number is always expressed with two digits, so 4 seconds into the minute will be "04".
The four-digit number representing the current year, calculated when the setup begins.
The path to the user's DAO (Data Access Objects) directory.
The current date on the user's system when the setup executable is run. It is in the format MM/DD/YY. So, if the user ran the installer on May 23, 2002, %Date% would be "05/23/02".
The path to the user's Desktop directory. On Windows NT, this is the path from the per-user profile.
The path to the user's Desktop directory. On Windows NT, this is the path from the All Users profile.
Whether or not Setup Factory should restart the system at the end of the installation process. If set to "TRUE", the system will be rebooted, if anything else it will not be.
Note: This variable is also used by the uninstaller. So, if %DoReboot% is set to "TRUE" during the uninstall, the user's system will be rebooted after the uninstall is complete.
The current date in the the European dating format: DD/MM/YY. For example, if the user ran the installer on May 23, 2002, %EuropeanDate% would be "23/05/02".
The path to the users font directory (e.g. "C:\Windows\Fonts").
The URL to a web site where the user can find more information about your product. The value of this variable is set in the Information URL field on the Product Info tab of the General Design dialog.
The current date in the ISO format: YYYY-MM-DD. For example, if the user ran the installer on May 23, 2002, %ISODate% would be "2002-05-23".
This variable is set to "TRUE" if the user running the setup is currently logged into Windows NT/2000/XP with Administrator permissions. It's set to "FALSE" otherwise. On systems that aren't running some version of Windows NT, this variable is always set to "FALSE".
These variables have a value of "TRUE" or "FALSE" depending on whether the setup is running on the respective operating system.
An integer value representing the number of days since midnight on January 1, 4713 B.C. Very useful when comparing dates or performing arithmetic to determine the number of days between two dates.
The domain that the user is logged in to. If the user's system is not connected to a LAN, this variable will default to "UNKNOWN".
The user's local computer name. If the user's system is not connected to a LAN, this variable will default to "UNKNOWN".
The user's IP address on the local network. If the user's system is not connected to a LAN, this variable will default to "UNKNOWN".
The MAC address of the user's NIC (network interface card). If the user's system does not contain a network card, this variable will default to "UNKNOWN".
The user name that the user is currently logged in as. If the user's system is not connected to a LAN, this variable will default to "UNKNOWN".
The ID of the last action that was performed. (See the specific actions in this help file for their respective action IDs.) This number can be useful when building a custom error-handling routine with server file actions.
If an error is generated at run time, this variable is set to the "verbose" error message for the last action that was performed (the action that generated the error).
When an action doesn't generate an error, this variable is empty ("").
SEE ALSO |
|
|
|
? |
For a complete list of the verbose error messages which can be generated by each action, see the specific actions in this help file. |
If an error is generated at run time, this variable is set to the "simple" error message for the last action that was performed (the action that generated the error).
When an action doesn't generate an error, this variable is empty ("").
SEE ALSO |
|
|
|
? |
For a complete list of the simple error messages which can be generated by each action, see the specific actions in this help file. |
If an error is generated at run time, this variable is set to an action-specific error number that identifies the last error that occurred.
When an action does not generate an error, this variable is set to 0.
SEE ALSO |
|
|
|
? |
For a complete list of the error numbers associated with each action, see the specific actions in this help file. |
Whether or not a user has a mouse connected to their system. This variable is set to "True" if the user has a mouse connected to their system; otherwise, it's set to "False".
The user's personal (My Documents) folder on their system. Usually this is something like "C:\Documents and Settings\YourName\My Documents" on Windows 2000/XP and "C:\My Documents" on Windows 98/ME. Note that Windows 95 did not have the My Documents folder and this variable will return "C:" if run on such a system.
Whether or not the system needs to be restarted at the end of the setup process in order to install files that were in use. This is set to "TRUE" when the system needs to be restarted, and set to "FALSE" when the system doesn't.
This is a special variable that can be set on a screen's Before or After action tabs. If this variable is set to TRUE, the installer will not allow the user to proceed to the next screen when the Next button is clicked; instead, the user will remain on the current screen. If set to FALSE, the installer will allow the user to proceed normally when they click Next.
This variable is useful if you want to validate the data entered by the user on a screen. If the data is incorrect, you could display an error message and set %PreventNextPage% to "true" to make the user go back and enter valid data.
The value of %PreventNextPage% is reset to FALSE every time a screen is displayed.
The name of the product that you are installing. The value of this variable is set in the Product name field on the Product Info tab of the General Design dialog.
The tagline for the product that you are installing. The value of this variable is set in the Product tagline field on the Product Info tab of the General Design dialog.
The version of the product that you are installing. The value of this variable is set in the Version field on the Product Info tab of the General Design dialog.
The path to the user's Program Files directory. Typically, this is "C:\Program Files".
The name of the registered user of the system.
The organization of the registered user of the system.
The full path and name of the shortcut folder on the Start menu where your application's shortcuts will be stored.
The name of the shortcut folder on the Start menu where your application's shortcuts will be stored.
The users screen height in pixels.
The users screen width in pixels.
The command line arguments that were passed to the setup executable in their full form. In other words, a string consisting of everything after the filename and extension of the setup executable on the command line.
For example, if the following was run:
C:\setup.exe /L:12 /MYARG
%SetupCmdLineArgs% would contain:
/L:12 /MYARG
This variable controls whether or not the Action Progress dialog is visible. If this variable is set to TRUE, the Action Progress dialog will be visible. If it's set to FALSE, the Action Progress dialog won't be visible.
Note: This variable has no affect during the uninstall.
This variable controls whether or not the Calculating File Information dialog is visible. If this variable is set to TRUE, the Calculating File Information Progress dialog will be visible. If it's set to FALSE, the Calculating File Progress dialog won't be visible.
Whether or not the installer (or uninstaller) is running in silent mode. This variable is set to "TRUE" when the installer (or uninstaller) is running in silent mode; otherwise, it's set to "FALSE".
The full path to the folder that the setup executable was run from (e.g. "C:\Downloads").
The drive that the setup executable was run from (e.g. "C:").
The full path, including the filename, for the current setup executable.
For example, if the user was running "setup.exe" from "C:\Downloads", %SrcFile% would be expanded to "C:\Downloads\Setup.exe".
Whether there is a sound card installed on the user's system. Set to either "TRUE" or "FALSE".
The path to the user's Start menu directory. On Windows NT, this is the path from the per-user profile.
The path to the user's Start menu directory. On Windows NT, this is the path from the All Users profile. On a non-Windows NT system, this will simply be the path to the user's Start menu directory.
The path to the Programs folder in the user's Start menu. On Windows NT, this is the path from the per-user profile.
The path to the Programs folder in the user's Start menu. On Windows NT, this is the path from the All Users profile. On a non-Windows NT system, this will simply be the path to the Programs folder in the user's Start menu.
The path to the user's Startup folder. On Windows NT, this is the path from the per-user profile.
The path to the user's Startup folder. On Windows NT, this is the path from the All Users profile. On a non-Windows NT system, this will be the path to the user's Startup folder.
The path to the users Windows System directory (e.g. "C:\Windows\System").
The drive that the user's Windows System directory is located on (usually "C:").
The user's system language ID. A complete list of language IDs can be found in the "Langids.ini" file in the "Data" sub-directory of your Setup Factory 6.0 directory. This value determines which language file and which screens will be displayed during the setup. If your setup does not support the user's language, %SysLanguage% will be set to the ID of your default language as set on the Languages tab of the General Design dialog.
The amount of physical memory on the user's system in megabytes.
The path to the user's Temp directory.
The path to the temporary directory where Setup Factory extracts the files it will need for the installation. (For example, this is the directory where Primer files are extracted to.)
Usually this directory will be the user's temporary directory, unless the user overrides the temporary directory with the /T command line option.
The path to the users Windows directory (e.g. "C:\Windows").
Design-time constants are similar to variables, but instead of being converted to values at run time, design-time constants get converted at build time. We call them design-time constants because the names you give them only exist at design time. At build time, the name of each design-time constant is replaced by the value that was assigned to it.
This is a special set of design-time constants. When a constant's name starts with "#ASC", Setup Factory interprets the value assigned to that constant as the ASCII value of a character. Wherever you use that constant, Setup Factory replaces the constant's name with the corresponding character.
For example, if you create a design-time constant named #ASC_QUOTE# and assign the value "34" to it, Setup Factory would replace each occurence of #ASC_QUOTE# in your project with the character whose ASCII number is 34, i.e., a quotation mark ("). Or, you could create a design-time constant to represent the null character (ASCII value 0) by assigning the value "0" to "#ASCNULL#".
A number representing the current day of the month, calculated when the setup executable is built.
A number representing the current hour in 24-hour time (e.g. 4:00 PM is 16), calculated when the setup executable is built.
The current minute, calculated when the setup executable is built. This number is always expressed with two digits, so 4 minutes into the hour will be "04".
A number representing the current month, calculated when the setup executable is built. January is represented by "1" and December is represented by "12".
A two-digit number representing the current month, calculated when the setup executable is built. January is represented by "01" and December is represented by "12".
The current second, calculated when the setup executable is built. This number is always expressed with two digits, so 4 seconds into the minute will be "04".
The four-digit number representing the current year, calculated when the setup executable is built.
The current date on your development system when the setup executable is built. It's in the format MM/DD/YY. So, if you built the installer on May 23, 2002, #DATE# would be "05/23/02".
The current date on your development system when the setup executable is built, in the the European dating format: DD/MM/YY. For example, if you built the installer on May 23, 2002, #EUROPEANDATE# would be "23/05/02".
The current date on your development system when the setup executable is built, in the ISO format: YYYY-MM-DD. For example, if you built the installer on May 23, 2002, #ISODATE# would be "2002-05-23".
The current date on your development system when the setup executable is built, in the form of an integer value representing the number of days since midnight on January 1, 4713 B.C.
You can use #JULIANDATE# along with the built-in variable %JulianDate% to build setups that expire a certain number of days after they are created. To calculate the number of days that have elapsed since the setup executable was generated, use the formula %JulianDate% - #JULIANDATE#.
This is path to the Setup Factory 6.0 project (.SF6) file that you are currently editing. Your project file must be saved in order for this variable to be properly set. If you have not saved your document, this constant will be set to "C:" by default.
This constant is useful if you want to keep your project (.SF6) file and the files in your setup in the same directory. That way you can set #PROJECTFILEDIR# as the files' source directory and your project will be portable to different development systems where paths and drives may change.
The path to the directory where Setup Factory is installed on your development system. Usually this will be "C:\Program Files\Setup Factory 6.0".
The path to the system directory on your development system.
The path to the Windows directory on your development system.
See Also: General Design, Actions