Global Variable Reference
Global variables are pre-defined by Paquet Builder and initialized automatically at runtime. They provide essential information about the system environment, the logged-in user, and the package’s own state.
Profile Resolution
Section titled “Profile Resolution”In the tables below, the Profile column indicates whether the variable points to a user-specific or system-wide (common) location:
- User: Points to the profile of the user currently running the package.
- Common: Points to the “All Users” profile.
- Note: On systems without administrator rights, “Common” variables often resolve to the same location as “User” variables.
Package and Archive Information
Section titled “Package and Archive Information”These variables provide details about the installer file and its versioning.
| Variable | Description |
|---|---|
%APPTITLE% | The Package Title defined in your project. |
%ARCFILEVER% | The file version of the package (e.g., 1.2.0.0). |
%ARCPRODVER% | The product version of the package. |
%ARCNAME% | The full filename of the running self-extracting package. |
%ARCPATH% | The directory path where the package is currently located. |
Core Session Paths
Section titled “Core Session Paths”| Variable | Description |
|---|---|
%DESTPATH% | The final destination folder selected by the user. Note: This is only initialized after the file extraction process begins. |
%TMP% | Path to the current user’s temporary folder. |
%CUR% | Points to the current working directory of the package process. |
User Profile Folders (Current User)
Section titled “User Profile Folders (Current User)”| Variable | Description | Profile |
|---|---|---|
%APPDATADIR% | Path to the Roaming Application Data folder. | User |
%LOCALAPPDATADIR% | Path to the Local (non-roaming) Application Data folder. | User |
%LOCALAPPDATALOWDIR% | Path to the LocalLow Application Data folder. | User |
%DESKTOPDIR% | Path to the current user’s Desktop. | User |
%MYDOCDIR% | Path to the “My Documents” folder. | User |
%PROGMENUDIR% | Path to the “Programs” folder on the Start Menu. | User |
%STARTMENUDIR% | Path to the top level of the Start Menu. | User |
%STARTUPMENUDIR% | Path to the “Startup” folder on the Start Menu. | User |
%FAVORITESDIR% | Path to the Favorites folder. | User |
%TEMPLATESDIR% | Path to the Templates folder. | User |
%QUICKLAUNCHDIR% | Path to the Quick Launch folder. | User |
%SENDTOMENUDIR% | Path to the “Send To” context menu folder. | User |
%USERPROFILE% | Path to the root of the user’s profile (e.g., C:\Users\John). | User |
Common Folders (All Users)
Section titled “Common Folders (All Users)”| Variable | Description | Profile |
|---|---|---|
%COMAPPDATADIR% | Path to the common Application Data folder. | Common |
%COMLOCALAPPDATADIR% | Path to the common Local Application Data folder. | Common |
%COMDESKTOPDIR% | Path to the common (shared) Desktop. | Common |
%COMMYDOCDIR% | Path to the common “Documents” folder. | Common |
%COMPROGMENUDIR% | Path to the common “Programs” folder on the Start Menu. | Common |
%COMSTARTMENUDIR% | Path to the common Start Menu root. | Common |
%COMSTARTUPMENUDIR% | Path to the common “Startup” folder. | Common |
%COMFAVORITESDIR% | Path to the common Favorites folder. | Common |
%COMTEMPLATESDIR% | Path to the common Templates folder. | Common |
System Folders
Section titled “System Folders”| Variable | Description |
|---|---|
%WIN% | Path to the Windows directory (e.g., C:\Windows). |
%SYS% | Path to the Windows System32 directory. |
%SYSROOT% | The system drive (e.g., C:). |
%PROGFILESDIR% | Path to the “Program Files” directory. |
%COMFILESDIR% | Path to the “Common Files” directory. |
%FONTSDIR% | Path to the Windows Fonts folder. |
Operating System and Hardware
Section titled “Operating System and Hardware”| Variable | Description |
|---|---|
%IS64OS% | 1 if the OS is 64-bit (x64 or ARM64), 0 if 32-bit. |
%OSARCH% | Processor architecture: x86, x64, or ARM64. |
%OSVER% | Integer representing the OS name (see the OS Version Table below). |
Installation Scope
Section titled “Installation Scope”These variables are specifically useful when using the Installation Scope feature.
| Variable | Description |
|---|---|
%PBINSTALLSCOPE% | 0 = Per-user installation, 1 = All-users installation. |
%PBINSTALLSCOPEDIR% | Resolves to %LOCALAPPDATADIR%\Programs or %PROGFILESDIR% based on scope. |
%PBSHORTCUTROOT% | Resolves to the user or common Start Menu based on scope. |
%PBDESKTOPROOT% | Resolves to the user or common Desktop based on scope. |
%PBSCOPEELEVATED% | 1 if the installer re-launched with UAC elevation, 0 otherwise. |
Runtime State and Logic
Section titled “Runtime State and Logic”| Variable | Description |
|---|---|
%ISADMIN% | 1 if the user has administrative rights, 0 otherwise. |
%ISPOWERUSER% | 1 if the user belongs to the Power Users group, 0 otherwise. |
%NEEDREBOOT% | 1 if a file replacement requires a system restart, 0 otherwise. |
%SILENT% | 1 if the installer was launched in silent mode, 0 otherwise. Can be manually toggled. |
%EXITCODE% | The integer value returned by the package process upon closing. |
%CURDATE% | Current date in yyyyMMdd format. |
%CURDATETIME% | Current date and time in yyyyMMdd hh:mm:ss format. |
%TOTALEXTFILE% | The total number of files successfully unpacked during this session. |
%SHORTCUTPATH% | Path to the Start Menu folder selected by the user (when prompted). Available after file extraction. |
%PBSFXPATH% | Path to the temporary folder where the SFX overhead files are extracted at startup. |
%PBUNINSTREGKEY% | The unique registry key used by the Package Uninstaller to store uninstall information. |
%PBDLGNEXTC% | Caption of the “Next” button on the current dialog page. Can be changed at runtime. |
%PBLASTDLG% | Returns the dialog page ID of the previous dialog shown to the user. |
Command-line Parameters
Section titled “Command-line Parameters”| Variable | Description |
|---|---|
%PARAMCOUNT% | The number of parameters passed to the installer. |
%PARAMS% | The entire command-line string passed to the package. |
%PARAM% | The first parameter (argument) in the command line. |
%PARAM2%, %PARAM3% | Specific parameters by position. |
%PARAMx% | The parameter at position x (from 2 up to %PARAMCOUNT%). |
Localization
Section titled “Localization”| Variable | Description |
|---|---|
%PBLANGID% | The Locale ID (LCID) of the current display language. |
%SELLANG% | The display name of the selected language. |
OS Version Reference
Section titled “OS Version Reference”The %OSVER% variable returns an integer corresponding to the Windows version:
| Value | Windows Version |
|---|---|
0 | Unidentified (Future version) |
1 | Windows NT 3.5 |
2 | Windows NT 4.0 |
3 | Windows 2000 |
4 | Windows XP |
5 | Windows XP 64-Bit |
6 | Windows Server 2003 |
7 | Windows Home Server |
8 | Windows Server 2003 R2 |
9 | Windows Storage Server 2003 |
10 | Windows Vista Starter |
11 | Windows Vista |
12 | Windows Server 2008 |
13 | Windows 7 |
14 | Windows Server 2008 R2 |
15 | Windows 8 |
16 | Windows 8.1 |
17 | Windows Server 2012 |
18 | Windows Server 2012 R2 |
19 | Windows Server 2016 |
20 | Windows 10 |
21 | Windows 11 |
22 | Windows Server 2022 |
Special Formatting
Section titled “Special Formatting”Directory Slashing
Section titled “Directory Slashing”How to insert a carriage-return line-feed
Section titled “How to insert a carriage-return line-feed”The character sequence for a carriage-return line-feed (CRLF) is /$.
For example, if you want a message box to display two lines:
Line1/$Line2This will be rendered as:
Line1Line2Windows Known Folders
Section titled “Windows Known Folders”The variables above cover the most commonly used paths. However, if you need to access additional Windows paths that are not available as built-in variables, you can use the Get Full Path of a Windows Known Folder action template to retrieve any path identified by a KNOWNFOLDERID constant.
Regarding %ISADMIN% and %ISPOWERUSER%
Section titled “Regarding %ISADMIN% and %ISPOWERUSER%”The %ISADMIN% variable returns 1 if the current user has administrative rights, and 0 otherwise. The %ISPOWERUSER% variable returns 1 if the current user belongs to the Power Users group.
These variables are especially useful when you need to conditionally execute actions depending on the privilege level of the user running the package. For instance, you can use them in conditional expressions to show different messages or skip certain installation steps.