Creating Thinapp Scripts; Callback Functions - VMware THINAPP 4.6 Manual

Hide thumbs Also See for THINAPP 4.6:
Table of Contents

Advertisement

9

Creating ThinApp Scripts

Scripts modify the behavior of virtual applications dynamically. You can create custom code before starting an 
application packaged with ThinApp or after an application exits. You can use scripts to authenticate users and 
load configuration files from a physical to virtual environment.
Callback functions run code during specific events. If applications create child processes, use callback 
functions to run code only in the main parent process.
API functions run ThinApp functions and interact with the ThinApp runtime. API functions can authenticate 
users and prevent the start of applications for unauthorized users.
Adding scripts to your application involves creating an ANSI text file with the .vbs file extension in the root 
application project directory. The root project directory is the same directory that contains the Package.ini 
file. During the build process, ThinApp adds the script files to the executable file and runs each of the script 
files at runtime.
ThinApp uses VBScript to run script files. For information about VBScript, see the Microsoft VBScript 
documentation. You can use VBScript to access COM controls registered on the host system or within the 
virtual package.
This information includes the following topics: 
"Callback Functions" on page 115
"Implement Scripts in a ThinApp Environment" on page 116
"API Functions" on page 119

Callback Functions

Callback functions can run under certain conditions. For example, callback functions run script code only 
when an application starts or quits. 
Callback function names include the following names:
OnFirstSandboxOwner – Called only when an application first locks the sandbox. This callback is not 
called if a second copy of the same application uses the same sandbox while the first copy runs. If the first 
application spawns a subprocess and quits, the second subprocess locks the sandbox and prevents this 
callback from running until all subprocesses quit and the application runs again.
OnFirstParentStart – Called before running a ThinApp executable file regardless of whether the 
sandbox is simutaneously owned by another captured executable file.
OnFirstParentExit – Called when the first parent process exits. If a parent process runs a child process 
and quits, this callback is called even if the child process continues to run.
OnLastProcessExit – Called when the last process owning the sandbox exits. If a parent process runs a 
child process and quits, this callback is called when the last child process exits.
VMware, Inc.
9
115

Advertisement

Table of Contents
loading

Table of Contents