Pre-Defined Variables
Each InstallAware project contains pre-defined variables. These variables are automatically initialized when setup begins based on the state of the target system, your project settings, and whether the application has been previously installed or not. The full list of pre-defined variables and the values they contain is displayed below:
- ABORT: TRUE if the Cancel button has been clicked, FALSE if not. Setting this variable has no effect on the state of the Cancel button. Setting this variable back to when setup has been cancelled will permit the installation to continue executing tasks which normally check for setup cancellation and abort when setup is cancelled.
- web media block download error) or a user abort occurs. You should exercise care in overriding the default value of this variable. For instance, when a web media block download fails, setup normally aborts; if setup is permitted to continue after a web media block download failure, certain plug-in calls in the corresponding web media block region may fail, violating any assumptions you may have made about script execution. This variable is distinct from the variable in that while exclusively signals user cancellation, this variable signals any kind of setup cancellation or error, including low-level setup errors that are innate to the setup engine. : Initially . Set this variable to if you still need the MSIcode script to continue executing in order to perform any custom logic when a low-level setup error (such as a
- web media block download; or the user cancelled the installation. Test this variable to see if an error occured when setting to (this variable is not updated by the engine otherwise). While the variable indicates user cancellations only, this variable indicates low-level setup engine errors or cancellations as well. Somewhat unlike what the name suggests, this variable does not mean setup has been cancelled, but that a setup cancelling-level event has occured. : Initially . The setup engine sets this variable to if an error occured, such as a failed
- ADVERTISE: TRUE if an advertised install has been requested, FALSE if not. The value of this pre-defined variable is typically set from the command line.
- ALLUSERS: Initially TRUE if platform is NT, FALSE if not. Set to TRUE to perform an installation for all users and FALSE to perform an installation for the current user only.
- CHARSET_OVERRIDE: This variable is no longer necessary in Unicode versions of InstallAware.
- CMDLINE: The command line string passed to the installation program.
- COMPANY: The company manufacturing the product, as set in the field of the project options dialog.
- COMPLETE: Initially TRUE. Indicates whether a complete installation will be performed.
- COPYWEBLOCK: This variable has effect only when a web build is being installed. If empty, downloaded web media blocks are processed normally. If non-empty, the installer will copy each downloaded web media block, including the main file in case of the pre-defined web media block, to the path specified by this variable. This allows data that is downloaded by setups from the web to be saved in any arbitrary folder for re-use after the original installation has been removed, or for archival purposes.
- CUSTOM_TASKBAR_PROGRESS_ENABLED: Initially . By default, the taskbar progress shown on the new Windows 7 Taskbar is the main installation progress, as reflected by the variable. Set this variable to to display custom progress instead. If you are using web builds for your deployment mode, this can be useful to provide an overall installation progress to your end-users during the download phase of your individual web media blocks: since InstallAware updates the global installation progress during each individual web media block download and extraction, your end-users may find the new Windows 7 Taskbar progress confusing with web builds.
- CUSTOM_TASKBAR_PROGRESS_MAX: Initially . Has no effect unless CUSTOM_TASKBAR_PROGRESS_ENABLED is . Set to the maximum progress value that you desire. Note that you may not set the minimum, which is always assumed to be .
- CUSTOM_TASKBAR_PROGRESS_PERCENT: Initially . Has no effect unless CUSTOM_TASKBAR_PROGRESS_ENABLED is . Set to the current progress value that you desire.
- DARK: Initialized to TRUE when the active theme is in and FALSE otherwise. When set to TRUE, enables on Windows 10 October 2018 Update and newer. With any other value, is disabled. May also be used together with $MICA$ to create combined effects.
- DATADIR: The root of the directory containing the files to be installed.
- DATE: The current date, reported in human readable textual form in the current locale.
- DATEFORMAT: The comprehensive formatting used to report the current date in $DATE$ above. Overrides $DATESEPARATOR$ below. The default value of this variable varies by the Windows locale, so override the default when consistency is important across locales. Use y or yy to report double digit years, and yyy or yyyy to report quadruple digit years. Use m to report months as digits without a leading zero, and mm to report months with a leading zero. Use mmm to report months using abbreviated month names and mmmm to report months using full month names. Use d to report days as digits without a leading zero, and dd to report days with a leading zero. Use ddd to report days using abbreviated day names and dddd to report days using full day names. All other string literals used (such as separators) are transcribed verbatim into the reported value.
- DATESEPARATOR: A single character which is used to separate the date, month, and year fields in $DATE$ above. The default value of this variable varies by the Windows locale, so override the default when consistency is important across locales. Assigning an empty value to this variable has no effect and does not override the default value, even when the variable is now an empty string. When a string containing more than one character is assigned to this variable, all characters beyond the first are ignored, even when the variable is now the full assigned string.
- DELAYUNTIL_APPLYCHANGES: This variable has no effect unless the native code setup engine is being used. Initially FALSE. If this variable is set to TRUE, the native code setup engine will attempt to emulate the behavior of the Windows Installer setup engine by deferring the execution of setup actions until Apply Install has been called. While this may reduce some setup agility, it may be useful in circumstances when emulating setup behavior found in older InstallAware versions is necessary. One additional benefit of delaying changes is guaranteed correct progress calculation over the entire set of setup actions which have been queued for installation - since native progress is initially calculated over the entire set of setup actions available in the script, it can be inaccurate based on the extent of setup actions that have actually executed. This variable also affects how errors and cancellations in installation actions are treated: If this variable is set to FALSE, the setup engine will consider errors or cancellations in individual setup actions as fatal, since each action is being applied atomically and immediately. If this variable is set to TRUE, the setup engine will not consider errors and cancellations in individual setup actions as fatal, since they will all be applied all at once. Setting ABORTONERROR to FALSE will enable setup to continue even when setup is not delaying installation actions; however in this case the setup script should periodically poll the value of the ABORTEDONERROR variable to ensure setup is still not continuing despite intentions of the end-user to abort.
- ENGINECACHE: The folder for the locally cached copy of the setup executable. The setup executable is always locally cached for use during uninstallation of the product. In addition, this folder will also contain cached web media block downloads when a web build is installed. This folder's location will change when the value of the ALLUSERS variable changes. This folder may not yet exist before the product has been installed. This folder may be empty or deleted after the product has been uninstalled. This folder is always removed after uninstallation, although a reboot may be necessary for the removal to finalize.
- EXEDIR: The folder containing the setup executable itself.
- EXEFILE: The full path and file name of the setup executable.
- Hide Dialog command, instead of directly showing the entering dialog using the Display Dialog command. : Initially . When set to , each new setup dialog slides in from the right (when the variable is not set to ), or the left (when the variable is set to ), at any time a new setup dialog is being shown. When set to , each new setup dialog pixel-fades in to replace the old, across the entire dialog at once. Set to any other value to disable dialog transition effects. Dialog transitions are not shown when an exiting dialog has been explicitly hidden using the
- : Initially . Any dialog transition enabled by the variable above happens with both the entering and exiting dialogs in a deselected state during the lifetime of the transition. Set to any other value to enact transitions while dialogs are in a selected state instead; however this may induce flicker during the transition on less powerful systems.
- : Initially . Specifies the number of milliseconds allocated for a dialog transition effect enabled by the variable above.
- GLASS: TRUE if the theme or the theme is available and enabled on the target system, FALSE otherwise. Requires at least Windows Vista for a positive evaluation.
- GPOPATH: If an uncompressed directory layout is used, this variable is empty. If setup has not been deployed through Group Policy, this variable is empty. Otherwise set to the full path of the folder containing the Single File MSI that started the current installation.
- IA_VERSION: Contains the version of InstallAware, beginning with the value 26.16 representing the first version of the product offering this compiler variable.
- IISHOST: Initially . Indicates the host name to use for all IIS commands. Override to get/set the IIS metabase properties of a remote host.
- LANGUAGE: Set to an empty string in non multi-lingual installs. In multi-lingual installs, holds the active language. Assign a new value to this variable to change the active language from within your setup script in multi-lingual installs.
- LASTERROR: Initially an empty string. After Windows Installer executes, set to the last error that occured during execution, if any.
- LICENSE: Initially FALSE. Indicates acceptance of the EULA.
- LOGGED: Initially set to the full path for the log file requested in the command line. If an empty string, indicates no logging has been requested at the command line. Set to a valid path name to enable logging from script.
- MAINTENANCE: Initially TRUE if the same version of the application has been installed before, FALSE otherwise.
- MICA: Initialized to TRUE when the platform is Windows 11 and FALSE otherwise. When set to TRUE, enables on Windows 11 and newer. May also be used together with $DARK$ to create combined effects. On Windows 11 22H2, you may also set this variable to MICA (equivalent to TRUE), DISABLE (equivalent to FALSE), AUTO (typically equivalent to TRUE), ACRYLIC (as per the typical implementation), or UNTINTED (typically heavily blurred wallpaper). Any other value disables .
- MINIMUM: Initially . Indicates whether a minimum installation will be performed.
- MODIFY: Initially . Indicates if the existing installation should be modified.
- MSIFILE: The full path and file name of the setup installation database.
- : Initially . Indicates if the installer cache location for the setup engine should be compressed on NTFS volumes. Set to to enable installer cache compression.
- : Initially . Indicates whether Windows Installer's built-in rollback functionality should be disabled during setup. Set to to disable rollback and improve runtime performance; however if setup is cancelled, this will leave the target system in an inconsistent state.
- : Initially . Indicates whether the Restart Manager on Windows Vista should be disabled. Set to to disable the Restart Manager and improve runtime performance; however this may necessitate a reboot at the end of the installation if some files are in use by applications that the Restart Manager could have shut down.
- MYAH_TIMEOUT: Indicates how many seconds InstallAware should wait for web downloads before concluding that the remote server is not responding and aborting the connection. Initially 10 seconds. If set to a non-numeric value, the initial value of 10 seconds will be assumed. This value is stored in the system registry and may affect other applications using the Internet Explorer download engine. InstallAware updates this shared registry value only during the time of an actual download and restores the former registry value after completing the download. The standard registry value is typically 3600 seconds or 60 minutes, which is a very long timeout delay and may unnecessarily stall your setups. However, you may still prevent InstallAware from changing this value at all by setting the variable to 0 before calling any script commands that may initiate a download.
- MYAHLOGO: Initially an empty string. Setting this variable to TRUE will hide the InstallAware Wizard text appended to setup dialog captions.
- NATIVE_ENGINE: Initially FALSE. Setting this variable to TRUE instructs InstallAware to perform setups using its own native code setup engine. This variable may be changed multiple times in your script to enter and exit native code installation mode on an as-needed basis. Native code installations perform much faster than Windows Installer installations. Native code installations can also immediately execute each setup action, without having to wait for a call to Apply Install - dramatically increasing your flexibility in building setups.
- NATIVE_ERROR: Initially PROMPT. With the initial value, when setup errors occur during a native engine installation, the end-user will be prompted with an error description and the option to retry the operation, skip the operation, or abort the installation. Set to ABORT to automatically abort the installation any time an error occurs. Set to RETRY to automatically retry the failed operation when an error occurs (this setting is not recommended since setup may stall indefinitely retrying the same operation, without any indication of why it has hung there). Set to IGNORE to automatically skip failed operations. Setting this variable to any other value will be treated as the initial PROMPT value. This variable is also automatically updated when the end-user makes the choice to apply an error prompt decision to all further actions, so the setup script remains aware of the current choices made by the end-user (and may override such changes).
- web media block source, a cached setup source, or any build/installation mode with its source files on the same disk as the target installation disk) will result in a hard link being created to that file instead; dramatically accelerating Native Engine installation speeds. Set to to disable this behavior and create duplicate copies of files instead. Creating duplicate copies of files enables successful setup repair operations only when the contents installed files have been corrupted, and setup sources were cached during an installation. Creating hard links, instead of duplicate copies of files, has no negative impact on setup repair when setup sources are not cached, and/or when installed files are deleted (repairs will complete successfully in either case). : Initially . With the initial value, when the Native Engine is being used, any file operation which would ordinarily result in a copy of a file being made (from a self-extracting executable source, a
- NATIVE_LOGGING: Initially an empty string. Has no effect unless the native engine is being used. Set to FALSE to prevent the logging of setup actions undertaken by the native engine. This will prevent such actions from being undone during an uninstallation or rollback. Stopping logging does not commit the in-memory log to disk (the log is committed when Apply Install is called). This variable may also be used to bind setup to an external (new or existing) setup log. When bound to an external log, all new setup actions executed by the native engine will be injected to the external log, instead of the default setup log. Any setup actions that have already been executed will be committed to the original log at the time of binding to the external log. Set back to an empty string or to an invalid path to revert to the original log for the installation being run. Set to the full path (without any file extensions) of an existing, valid InstallAware installation log to bind the running setup instance to an existing log. Any uninstall/rollback actions undertaken by a setup bound to an external log will use the external log as their basis, facilitating the removal of applications installed by InstallAware setups other than the current running instance (such as the automated uninstallation of the older version of an application that a newer setup is installing). To create a brand new setup log at a custom location instead, set to the full path (without file extensions) of the new log name to use. Note that brand new setup logs created at custom locations may not be detected by the MAINTENANCE, NATIVE_OLDLOG or the RECOMMENDEDUPGRADE variables; disabling your setup from automatically entering maintenance mode, and automatically detecting (and removing) older versions of your products on target systems. Bind to new setup logs when you wish to manually manage a list of setup log stores, such as to facilitate a multiple-instance installation experience with the native engine.
- NATIVE_OLDLOG: If an old version of the product has been detected that was installed using the native code setup engine, this variable will hold the full valid path to the old installation log (otherwise, the variable will be an empty string). The NATIVE_LOGGING variable may be set to the value of this variable to bind the installation to the old installation log and uninstall the old version of the product directly from the new version installer.
- : Initially . With any value other than , the native setup engine will not attempt to acquire ownership and other necessary permissions with file and registry objects; resulting in potentially failed updates (and failed installations - based on the designated severity of the objects that failed to install due to missing permissions). When , the native setup engine will acquire ownership to update file and registry objects. Original ownership will typically be restored with both file objects and registry objects, however original ownership may not be restorable in certain extreme circumstances. The behavior of the native setup engine in those rare circumstances is controlled by the variable.
- : Initially . With any value other than , the native setup engine will not attempt to acquire the ownership of files and registry keys, if it determines that such acquisition will make it impossible to restore the original ownership. When , the native setup engine will still acquire ownership even if it determines that the original ownership is not restorable, guaranteeing that your changes are applied to the system, but potentially creating an attack surface on the target system.
- NATIVE_OVERWRITE: Initially PROMPT. With the initial value, when setup is about to overwrite a file during a native engine installation, the end-user will be prompted with an overwrite dialog displaying the file dates and versions for both the new file and the old file, as well as the options to overwrite or skip the file. Set to ALWAYS to automatically overwrite files. Set to NEVER to automatically skip installing files that already exist on the target. Any other value will be interpreted as PROMPT. If the end-user makes the choice to apply the overwrite decision in the prompt dialog to all files, this variable will also be automatically updated, keeping the setup script aware of end-user choices and providing it with the ability to override them.
- NATIVE_OVERWRITE_OLDER: Initially FALSE. Determines whether the native setup engine is allowed to replace files that have been determined to be newer with older files that are included in the installation. Set to TRUE to permit the native setup engine to replace files that are newer with older copies (this is not recommended). This variable overrides the value of the NATIVE_OVERWRITE variable when FALSE, and the file being installed by setup is determined to be older than the file already present on the target system. The native engine compares files as follows: If both files are versioned, the decision is based on the comparison of the file versions (the installed file has to be a newer version than the present file). If none of the files are versioned, the decision is based on the comparison of file dates (the installed file has to be modified more recently than the present file). If the file being installed lacks version information but the present file contains version information, the file being installed is assumed to be older. If the file being installed contains version information but the present file lacks version information, file dates are compared.
- NATIVE_ROLLBACK: Initially TRUE. Has no effect unless the native engine is being used. Set to FALSE to prevent the rollback of changes made by setups that have been cancelled at runtime. Only first-time installations can be rolled back (setups running in maintenance/repair mode cannot be rolled back, but uninstalled).
- TRUE, a new version of the product should not be installed using the Windows Installer engine until the old version has been removed successfully. This variable is never TRUE if the previous version of the product was installed using the native code setup engine, and there is no subsequent removal requirement on the old version; however the variable RECOMMENDEDUPGRADE indicates whether a previous version of the product installed with the native engine has been detected (and its removal is recommended). : if a previous version of the product was found installed using the Windows Installer engine, otherwise. When this variable is
- : if a new instance of the product may be spawned, otherwise. New product instances cannot be spawned when maintaining an existing installation from the , or when no instances of the product have yet been installed (at least the default instance must be installed before new instances can be created).
- : This is not a real variable, but indicates a new line character.
- web build. If the override is unsuccessful, the variable will again hold an empty value, indicating that the desired cache location is not writable. If the override is successful, the installer will use the specified cache location as the new installer cache. However, after an override, the installer does NOT move any already-existing files/folders found in in the old cache (such as previously downloaded web media blocks) into the new cache. Additionally, after an override, the setup engine is re-initialized, which has side effects such as the loss of previously declared setup features. For these reasons, if you are planning to change the location of the installer cache, it is recommended to do so early on in your setup script - before any features have been defined, persistent variable values have been assigned, and so forth. If setup is aborted before installation is complete, the overridden value of the installer cache will be volatile. If setup completes normally, the overridden value of the installer cache is persistent. The setup cache should not be overridden when setup is running in maintenance mode. Initially an empty string. Overriding the value of this variable allows changing the installer cache location, which can be of significant size when working with a
- PERSONALIZED: Initially . Indicates whether a custom setup should be performed.
- PRODUCTCODE: Set to the full GUID of the product code, as set in the installation database and configured at the project options dialog.
- PROGRESS: Initially 0. A numerical representation of the current position in installation progress, where 0 is nothing and 100 is complete. This value is displayed in progress dialogs.
- PROGRESSMODE: Initially an empty string. If set to MARQUEE, the standard control will move like a marquee, ideal for use with tasks whose completion times are indeterminate. On Windows 7, two more progress modes are available: ERROR and PAUSE. Setting this variable to ERROR will display installation progress on the taskbar in red color, alerting the end-user that a possibly fatal error has occured. Setting this variable to PAUSE will display installation progress on the taskbar in yellow color, alerting the end-user that their attention is required for installation to resume. While you may set and use these progress modes at any time to change the installation taskbar progress color from the default green color to red or yellow, it is recommended to do so only when end-user attention is actually required to continue (or abort) setup. These additional progress modes have no effect earlier than Windows 7.
- PROGRESSTEXT: Initially an empty string. A string description of the current installation task. This value is displayed in progress dialogs.
- REBOOTCOMPUTER: Initially FALSE. After Windows Installer executes, indicates whether the computer needs to be rebooted for the changes to take effect.
- REBOOTNOW: Initially OK. When setup is running in silent mode, automatically reboots the computer as necessary to pass through pre-requisite installations that may require reboots. Change the default value to prevent automatic reboots in silent mode.
- RECOMMENDEDUPGRADE: if a previous version of the product was found installed using the native code setup engine, otherwise. When this variable is TRUE, if a new version of the product is installed using the native engine before the old version has been removed successfully, the only guaranteed way to uninstall the old version will be to run the original setup file for the old version: Future installations may not detect the old version for as long as the same GUID is used for the product code between the old and new setups. The applet may no longer point to the old version as long as the same product name is used between the old and new setups.
- REMOVE: Initially FALSE. Indicates whether the product should be uninstalled.
- REPAIR: Initially FALSE. Indicates whether the existing product installation should be repaired.
- REVISIONCODE: Set to the full GUID of the revision code, as set in the installation database and configured at the project options dialog.
- ROOTDIR: The folder containing the setup executable itself.
- RUNAPP: Initially TRUE. Indicates whether the application should be executed at the end of the installation.
- SAVEDATA: Initially FALSE. Indicates whether saved installation data (such as already downloaded web media blocks and component selections) should be preserved when the product is being uninstalled. Normally, when a product is removed using a call to Apply Uninstall, all saved installation data is removed. In special cases, such as removing a partially completed installation for a later re-installation, you may want to set this variable to TRUE such that already downloaded installation files and feature selections survive an uninstall.
- SELECTED: By convention, this variable is used to retrieve feature selection states in the setup script. It is pre-defined with an empty string value and may be used for any general purpose, including retrieving feature selection states.
- : This variable provides a convenient mechanism to detect the outermost folder containing the executable program or setup database that initiated the installation. In other words, this value is set to the value of the variable , or , or in that order of priority - until the first variable containing a non-empty value is found.
- SFXFILE: If an uncompressed directory layout is used, this variable is empty. Otherwise set to the file name of the self extracting executable which bootstrapped the installer.
- SFXPATH: If an uncompressed directory layout is used, this variable is empty. Otherwise set to the full path of the folder containing the self extracting executable which bootstrapped the installer.
- SILENT: Initial value set on the command line. TRUE if a silent install should be performed, and FALSE if not. Set the value of this variable from the script to change silent installation mode.
- STARTMENU: Initial value set to the name of the product being installed, as set in the project options dialog.
- SUPPORTDIR: Points to the full path of the temporary folder that support files are extracted to before installation beings.
- TARGETDIR: Initial value set to <Program Files Directory>\Application Title, using the name of the product being installed as the application title.
- TEMPDIR: Full path to the temporary folder location on the target system.
- TIME: The current time, reported in human readable textual form in the current locale.
- TIMEFORMAT: The comprehensive formatting used to report the current time in $TIME$ above. Overrides $TIMESEPARATOR$ below. The default value of this variable varies by the Windows locale, so override the default when consistency is important across locales. Use h to report hours as digits without a leading zero, and hh to report hours with a leading zero. Use n to report minutes as digits without a leading zero, and nn to report minutes with a leading zero. Use s to report seconds as digits without a leading zero, and ss to report seconds with a leading zero. Use z to report milliseconds as digits without a leading zero, and zz or zzz to report milliseconds with a leading zero. All other string literals used (such as separators) are transcribed verbatim into the reported value.
- TIMESEPARATOR: A single character which is used to separate the hour, minute, second, and millisecond fields in $TIME$ above. The default value of this variable varies by the Windows locale, so override the default when consistency is important across locales. Assigning an empty value to this variable has no effect and does not override the default value, even when the variable is now an empty string. When a string containing more than one character is assigned to this variable, all characters beyond the first are ignored, even when the variable is now the full assigned string.
- TITLE: Initial value set to the name of the product being installed, as set in the field of the project options dialog.
- USERCOMPANY: Initial value set to the name of the company that licensed Windows on the system the product is being installed. To improve user experience with setup themes requiring a valid company name, at setup initialization time this field will be replaced with a single space character when it is empty. The Get System Settings command may be used to obtain the company name verbatim (including as an empty string) where required.
- USERNAME: Initial value set to the name of the person that licensed Windows on the system the product is being installed.
- UNINSTALLLINK: Initial value set to the full path of the uninstallation setup program.
- VERSION: Set to the version number of the running setup.
- WINDOWHANDLE: Value set to the handle of the active installation window.
- WIZARD: Initial value set to NEXT.
Please note that variables are de-referenced in the script using the form $VARIABLE$.
Also review the list of pre-defined compiler variables.