Variables

Global variables are variables whose values are automatically set when your update starts. They are used in action script to represent common values that might differ between systems. These variables are all global which means you can use them anywhere in your project.

Tip: The built-in global variables are listed along with all of the actions and constants when you press Ctrl+Space in the action editor. Since all of the built-in variables start with an underscore, if you type _ and then press Ctrl+Space, you'll be taken right to the first built-in global variable in the list.

The following global variables are available in TrueUpdate:

_ClientRestarted

Whether or not the client has been restarted after the client executable or client .dat has been updated after downloading the server configuration files. If this variable contains true the client has been restarted, and if it contains false, it has not. This variable is useful if you would like to skip certain steps in the Client Script such as showing the Welcome screen.

_CommandLineArgs

A numerically indexed table that contains the command line arguments passed into the update executable.

_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).

_DisableCloseButton

Whether or not the close button (X) will be disabled on screens. If this boolean variable is set to true the close button will be disabled. If the value is false (by default), it will be enabled.

_IR_ProductID

This variable contains the string "TU30" when used in TrueUpdate. This allows you to identify the product being run from script.  This could be useful when making generic scripts that are used in several products, but that have different things to do based on the product being run from.

_MissingOledlgdll

This variable allows you to conditionally handle UI features that may fail when the system file 'oledlg.dll' is not present on the user's system (it's a system component required for some update screens). This boolean variable is set to true if 'oledlg.dll' is missing or false if it exists.

_ProgramFilesFolder

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

_SourceDrive

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

_SourceFilename

The full path and filename of the update executable (e.g. "C:\Downloads\update.exe").

_SourceFolder

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

_SuppressErrorDialogs

Whether or not dialog error messages will be shown from script errors. Initially this value is set to the boolean value false, but if set to true, script error dialogs will be suppressed.

Note: This only affects script errors and does NOT suppress action dialogs or screens.

_SystemFolder

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

_tblErrorMessages

A table indexed by error codes containing all of the possible error messages. For example, accessing the table index _tblErrorMessages[1000] will access the error code string "The specified file could not be found." The Application.GetLastError action is used to retrieve the last performed action's error code.

_TempFolder

The path to the user's Temp folder.

_UseAutoProxy

Controls whether or not TrueUpdate will use autoproxy support when accessing files from the Internet. If the /NOAUTOPROXY command line option is passed to the client executable _UseAutoProxy will be initialize to false. Setting _UseAutoProxy to true will override the /NOAUTOPROXY option. This variable can turn the autoproxy support on or off as needed.

Note: TrueUpdate will default to using a direct connection if attempts using the autoproxy fail, so it is not normally necessary to disable the autoproxy.

_UseSystemCharacterSet

If set to true, TrueUpdate will use the system's default character set (script) for text elements on screens when using custom fonts ("Use Custom Fonts" set to True), overriding it's font script setting. This makes the text font behave like TrueUpdate's default settings when working with multiple languages. If you wish to use this variable, it's recommended that you set it very early in the update. This variable defaults to false.

_WindowsFolder

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