Variables

Session variables are special types of variables that are expanded at runtime when they are used. When they are used on screens, their values are automatically expanded for you, however if a session variable is used in an action script, it must be manually expanded using the SessionVar.Expand action.

While there are predefined session variables available to use, you can also create custom session variables at design time and run time. At design time, they can be defined on the Session Variables tab of the Project Settings dialog. At run time, you can create and manipulate session variables using the available SessionVar actions.

Note: If a session variable used on a screen needs to be set to a different value, it must be set prior to the screen's displaying, and all of its events. Another option is to set the text of the screen control using the appropriate Dlg***.SetProperties action. Any changes made to a session variable on a screen after the screen has been created (just before the On Preload event) will have no effect.

The following pre-defined session variables are available in Setup Factory:

%AppFolder%

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 8.0.

%AppFolder% is initially set to the default value that you give it on the Session Variables tab of the Project Settings dialog. However, in most installations, the value of %AppFolder% will ultimately be set by the user on the Select Install Folder screen, overriding the default value.

%ApplicationDataFolder%

The path to the per-user Application Data folder on the user's system. This folder serves as a common repository for application-specific data. Typically, this path is something like "C:\Documents and Settings\YourName\Application Data." On Windows Vista or later, it would return something like "C:\Users\YourName\AppData\Roaming."

%ApplicationDataFolderCommon%

The path to the all-user Application Data folder on the user's system. This folder servers as a common repository for application-specific data. Typically this is something like "C:\Documents and Settings\All Users\Application Data." On Windows Vista or later, this returns "C:\ProgramData."

%AppShortcutFolderName%

The name of the shortcut folder on the Start menu where your application's shortcuts will be stored.

%AppShortcutFolderName% is initially set to the default value that you give it on the Session Variables tab of the Project Settings dialog. However, in many installations, the value of %AppShortcutFolderName% will ultimately be set by the user on the Select Shortcut Folder screen, overriding the default value %ProductName%.

%AppDrive%

The drive letter of %AppFolder%. You should not set this variable explicitly. It is reset every time that %AppFolder% is re-assigned. For example, if %AppFolder% is C:\Program Files\My Program, %AppDrive% will be C:.

%CommonDocumentsFolder%

The path to the documents folder common to all users. Usually this is something like "C:\Documents and Settings\All Users\Documents."

%CommonFilesFolder%

The user's Common Files folder. Typically, this is something like: C:\Program Files\Common Files.

%CommonFilesFolder64%

The user's Common Files folder on 64-bit operating systems. On 32-bit systems, the value is equal to %CommonFilesFolder%.

%CompanyName%

Your company’s name. The value of this variable is set on the Session Variables tab of the Project Settings dialog.

%CompanyURL%

Your company’s URL. The value of this variable is set on the Session Variables tab of the Project Settings dialog.

%Copyright%

The copyright message for your product. The value of this variable is set on the Session Variables tab of the Project Settings dialog.

%DAOPath%

The path to the user's DAO (Data Access Objects) directory.

%DesktopFolder%

The path to the user's Desktop folder. On Windows NT/2000/XP/Vista or later, this is the path from the per-user profile.

%DesktopFolderCommon%

The path to the user's Desktop folder. On Windows NT/2000/XP,Vista or later 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 Desktop folder (the same as _DesktopFolder).

%FontsFolder%

The path to the user’s font directory (e.g. "C:\Windows\Fonts").

%LaunchUserApplicationDataFolder%

The path to the Application Data folder of the user who launched the setup when Collect launch user information is selected. This folder serves as a common repository for application-specific data. Typically, this path is something like "C:\Documents and Settings\YourName\Application Data." On Windows Vista or later, it would return something like "C:\Users\YourName\AppData\Roaming."

%LaunchUserDesktopFolder%

The path to the Desktop folder of the user who launched the setup when Collect launch user information is selected. On Windows NT/2000/XP/Vista or later, this is the path from the per-user profile.

%LaunchUserMyDocumentsFolder%

The personal (My Documents) folder of the user who launched the setup when Collect launch user information is selected. Usually this is something like "C:\Documents and Settings\YourName\My Documents" on Windows 2000/XP, "C:\My Documents" on Windows 98/ME, and "C:\Users\YourName\Documents" on Windows Vista or later.

Note: Windows 95 did not have the My Documents folder and this variable will return "C:" if run on such a system.

%LaunchUserMyMusicFolder%

The path to the My Music folder of the user who launched the setup when Collect launch user information is selected. For example "C:\Documents and Settings\User\My Documents\My Music."

%LaunchUserMyPicturesFolder%

The path to the My Pictures folder of the user who launched the setup when Collect launch user information is selected. For example "C:\Documents and Settings\username\My Documents\My Pictures." Only available on Windows 98 SE or later with minimum IE 5.0 installed.

%LaunchUserMyVideosFolder%

The path to the My Videos folder of the user who launched the setup when Collect launch user information is selected. For example "C:\Documents and Settings\username\My Documents\My Videos." Only available on Windows XP/Vista or later.

%LaunchUserStartFolder%

The path to the Start menu folder of the user who launched the setup when Collect launch user information is selected. On Windows NT/2000/XP/Vista or later, this is the path from the per-user profile.

%LaunchUserStartProgramsFolder%

The path to the Programs folder in the user's Start menu of the user who launched the setup when Collect launch user information is selected. On Windows NT/2000/XP/Vista or later, this is the path from the per-user profile.

%LaunchUserStartupFolder%

The path to the Startup folder of the user who launched the setup when Collect launch user information is selected. On Windows NT/2000/XP/Vista or later, this is the path from the per-user profile.

%MyDocumentsFolder%

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, "C:\My Documents" on Windows 98/ME, and "C:\Users\YourName\Documents" on Windows Vista or later.

Note: Windows 95 did not have the My Documents folder and this variable will return "C:" if run on such a system.

%MyMusicFolder%

The path to the user's My Music folder. For example "C:\Documents and Settings\User\My Documents\My Music."

%MyMusicFolderCommon%

The path to the All Users profile My Music folder, for example "C:\Documents and Settings\All Users\Documents\My Music." Only available on Windows XP/Vista or later.

%MyPicturesFolder%

The path to the user's My Pictures folder. For example "C:\Documents and Settings\username\My Documents\My Pictures." Only available on Windows 98 SE or later with minimum IE 5.0 installed.

%MyPicturesFolderCommon%

The path to the All User profile My Pictures folder, for example "C:\Documents and Settings\All Users\Documents\My Pictures." Only available on Windows XP/Vista or later.

%MyVideosFolder%

The path to the user's My Videos folder. For example "C:\Documents and Settings\username\My Documents\My Videos." Only available on Windows XP/Vista or later.

%MyVideosFolderCommon%

The path to the All User profile My Videos folder. For example "C:\Documents and Settings\All Users\Documents\My Videos." Only available on Windows XP/Vista or later.

%ProductName%

The name of the product that you are installing. The value of this variable is set on the Session Variables tab of the Project Settings dialog.

%ProductVer%

The version number of the product that you are installing. The value of this variable is set on the Session Variables tab of the Project Settings dialog.

%ProgramFilesFolder%

The user's Program Files folder (typically, this is something like "C:\Program Files").

%ProgramFilesFolder64%

The user's Program Files folder on 64-bit operating systems. On 32-bit systems, the value is equal to %ProgramFilesFolder%.

%RegOwner%

The name of the registered user of the system.

%RegOrganization%

The organization of the registered user of the system.

%SourceDrive%

The drive that the installation executable was run from (e.g. "C:" or "D:").

%SourceFolder%

The full path to the folder that the installation executable was run from (e.g. "C:\Downloads" or "D:\").

%SourceFilename%

The full path, including the filename, for the current setup executable.

For example, if the user was running "setup.exe" from "C:\Downloads", %SourceFilename% would be expanded to "C:\Downloads\Setup.exe".

%StartFolder%

The path to the user's Start menu folder. On Windows NT/2000/XP/Vista or later, this is the path from the per-user profile.

%StartFolderCommon%

The path to the user's Start menu folder. On Windows NT/2000/XP/Vista or later, 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 folder (the same as %StartFolder%).

%StartProgramsFolder%

The path to the Programs folder in the user's Start menu. On Windows NT/2000/XP/Vista or later, this is the path from the per-user profile.

%StartProgramsFolderCommon%

The path to the Programs folder in the user's Start menu. On Windows NT/2000/XP/Vista or later, 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 same as %StartProgramsFolder%).

%StartupFolder%

The path to the user's Startup folder. On Windows NT/2000/XP/Vista or later, this is the path from the per-user profile.

%StartupFolderCommon%

The path to the user's Startup folder. On Windows NT/2000/XP/Vista or later, 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 same as %StartupFolder%).

%SystemFolder%

The path to the user’s Windows System folder (e.g. "C:\Windows\System" on non-NT systems, and "C:\Windows\system32" on NT-based OS's).

%SystemDrive%

The drive that the user's Windows System directory is located on (usually "C:").

%TempFolder%

The path to the user's Temp folder.

%TempLaunchFolder%

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.) During the uninstall, this variable contains the path to the uninstall files folder. This is the folder that the uninstall configuration file is located.

Usually this directory will be the user's temporary directory, unless the user overrides the temporary directory with the /T command line option.

%WindowsFolder%

The path to the user’s Windows folder (e.g. "C:\Windows").

%WindowTitle%

The text that will appear on the windows task bar while the installation is running. The value of this variable is set on the Session Variables tab of the Project Settings dialog.