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

%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 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 Users profile 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.

%DesktopFolderCommon%

The path to the All Users profile Desktop folder.

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

%LaunchUserDomain%

The domain name associated with the launch user SID when Collect launch user information is selected.

%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 XP, and "C:\Users\YourName\Documents" on Windows Vista or later.

%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."

%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."

%LaunchUserName%

The account name associated with the launcher user SID when Collect launch user information is selected.

%LaunchUserStartFolder%

The path to the Start menu folder of the user who launched the setup when Collect launch user information is selected.

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

%LaunchUserStartupFolder%

The path to the Startup folder of the user who launched the setup when Collect launch user information is selected.

%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 XP, and "C:\Users\YourName\Documents" on Windows Vista or later.

%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."

%MyPicturesFolder%

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

%MyPicturesFolderCommon%

The path to the All User profile My Pictures folder, for example "C:\Documents and Settings\All Users\Documents\My Pictures."

%MyVideosFolder%

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

%MyVideosFolderCommon%

The path to the All User profile My Videos folder. For example "C:\Documents and Settings\All Users\Documents\My Videos."

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

%StartFolderCommon%

The path to the All Users profile Start menu folder.

%StartProgramsFolder%

The path to the Programs folder in the user's Start menu.

%StartProgramsFolderCommon%

The path to the All Users profile Programs folder in the user's Start menu.

%StartupFolder%

The path to the user's Startup folder.

%StartupFolderCommon%

The path to the All Users profile Startup folder.

%SystemFolder%

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

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