ThinApp User's Guide (Manual)
ThinApp User's Guide (Manual)
ThinApp User's Guide (Manual)
ThinApp 5.0
EN-000400-02
Title
You can find the most up-to-date technical documentation on the VMware Web site at:
http://www.vmware.com/support/
The VMware Web site also provides the latest product updates.
If you have comments about this documentation, submit your feedback to:
docfeedback@vmware.com
Copyright 2014 VMware, Inc. All rights reserved. Copyright and trademark information
VMware, Inc.
3401 Hillview Ave.
Palo Alto, CA 94304
www.vmware.com
VMware, Inc.
Contents
1 Installing ThinApp 9
ThinApp Requirements 9
Operating Systems, Applications, and Systems That ThinApp Supports 9
Applications That ThinApp Cannot Virtualize 10
Recommendations for Installing ThinApp 10
Using a Clean Computer 10
Using the Earliest Operating System Required for Users 11
Install ThinApp Software 11
Checking ThinApp Installation Files 11
2 Capturing Applications 13
Phases of the Capture Process 13
Preparing to Capture Applications 13
Capturing Applications with the Setup Capture Wizard 14
Create a System Image Before the Application Installation 14
Rescan the System with the Installed Application 14
Defining Entry Points as Shortcuts into the Virtual Environment 15
Set Entry Points 15
Manage with VMware Horizon Application Manager 15
Set User Groups 16
Defining Isolation Modes for the Physical File System 16
Set File System Isolation Modes 18
Storing Application Changes in the Sandbox 18
Customize the Sandbox Location 18
Send Anonymous Statistics to VMware 18
Customize ThinApp Project Settings 19
Defining Package Settings 19
Customize Package Settings 20
Opening Project and Parameter Files 20
Build Virtual Applications 21
Advanced Package Configuration 21
Modifying Settings in the Package.ini File 21
Modifying Settings in the ##Attributes.ini File 22
Capturing Internet Explorer 6 on Windows XP 22
Requirements for Capturing Internet Explorer 6 on Windows XP 23
Capture Internet Explorer 6 on Windows XP by Using the Setup Capture Wizard 23
Extracting and Registering ThinDirect 24
Capturing Multiple Application Installers with ThinApp Converter 24
ThinApp Converter Process 24
System Requirements for Running ThinApp Converter 25
Preparing the Configuration File for ThinApp Converter 25
Predefined Environment Variables 31
3 Deploying Applications 33
ThinApp Deployment Options 33
Deploying ThinApp with Deployment Tools
VMware, Inc.
33
3
63
VMware, Inc.
Contents
Glossary
93
95
Index 99
VMware, Inc.
The ThinApp Users Guide provides information about how to install ThinApp, capture applications, deploy
applications, and upgrade applications. You can refer to this guide to customize parameters and perform
scripting.
Intended Audience
This book is intended for anyone who installs ThinApp and deploys captured applications. Typical users are
system administrators responsible for the distribution and maintenance of corporate software packages.
ThinApp Users Guide. Conceptual and procedural information to help you complete a task.
ThinApp 4.6 Release Notes. Late-breaking news and descriptions of known issues and workarounds.
Migrating Applications with ThinApp During an Upgrade from Microsoft Windows XP to Windows 7.
Procedural information for using ThinApp to migrate applications from Windows XP to Windows 7.
Document Feedback
VMware welcomes your suggestions for improving our documentation. If you have comments, send your
feedback to docfeedback@vmware.com.
Support Offerings
To find out how VMware support offerings can help meet your business needs, go to
http://www.vmware.com/support/services.
VMware, Inc.
Legal Notice
ThinApp uses the regular expression library originally written by Henry Spencer.
Copyright (c) 1986, 1993, 1995 by University of Toronto.
Written by Henry Spencer. Not derived from licensed software.
Permission is granted to anyone to use this software for any purpose on any computer system, and to
redistribute it in any way, subject to the following restrictions:
The author is not responsible for the consequences of use of this software, no matter how awful, even if
they arise from defects in it.
The origin of this software must not be misrepresented, either by explicit claim or by omission.
Altered versions must be plainly marked as such, and must not be misrepresented (by explicit claim or
omission) as being the original software.
VMware, Inc.
Installing ThinApp
You can use ThinApp to isolate applications, simplify application customization, deploy applications to
different operating systems, and eliminate application conflict.
This information includes the following topics:
ThinApp Requirements
Review the requirements for operating systems and captured applications before installing ThinApp.
32-bit platforms include Windows 8, Windows 2000, Windows XP, Windows XPE, Windows 2003 Server,
Windows Vista, Windows Server 2008, Windows 7
64-bit platforms include Windows 8, Windows XP 64 bit, Windows 2003 64 bit, Windows Vista 64 bit,
Windows Server 2008 64 bit, Windows Server 2008 R2 64 bit, Windows 7 64 bit
ThinApp supports Japanese applications captured and run on Japanese operating systems.
Certain operating systems and applications are not supported by ThinApp.
VMware, Inc.
Device Drivers
Applications that require device drivers do not work when packaged with ThinApp. You must install those
device drivers in their original format on the host computer. Because ThinApp does not support virtualized
device drivers, you cannot use ThinApp to virtualize antivirus, VPN clients, personal firewalls, and disk and
volume mounting-related utilities.
If you capture Adobe Acrobat, you can modify and save PDF files, but you cannot use the PDF printer driver
that enables you to save documents to PDF format.
Shell Integration
Some applications that provide shell integration have reduced functions when they exist in a ThinApp
package. For example, a virtual application that integrates with Windows Explorer cannot add specific entries
to the Windows Explorer context menus.
10
VMware, Inc.
Application installers skip files that already exist on the computer. If the installer skips files, the ThinApp
package does not include them during the application capture process. The application might fail to run on
other computers where the files do not exist. A clean computer enables the capture process to scan the
computer file system and registry quickly.
If you install ThinApp and capture an application on a computer that has Microsoft.NET 2.0 already installed,
.NET 2.0 is not included in the ThinApp package. The captured application runs only on computers that have
.NET 2.0 already installed.
Accept the license, type the serial number, and type a license display name that appears when you open
applications that ThinApp captures.
Click Install.
ThinApp is installed.
AppSync.exe Keeps captured applications up to date with the latest available version.
dll_dump.exe Lists all captured applications that are currently running on a system.
relink.exe Updates existing packages to the latest ThinApp version installed on the system.
VMware, Inc.
11
sbmerge.exe Merges runtime changes recorded in the application sandbox with the ThinApp project
and updates the captured application.
snapshot.exe Compares the preinstallation environment and postinstallation environment during the
application capture process. ThinApp starts this utility during the setup capture process.
snapshot64.exe - Compares the preinstallation environment and postinstallation environment during the
application capture process on a 64-bit operating system.
snapshot.ini Stores entries for the virtual registry and virtual file system that ThinApp ignores during
the process of capturing an application.
The snapshot.exe file references the snapshot.ini file. Advanced users might modify the
snapshot.ini file to ensure that ThinApp does not capture certain entries when creating an application
package.
12
tlink.exe Links key modules during the build process of the captured application.
vftool.exe Compiles the virtual file system during the build process of the captured application.
vregtool.exe Compiles the virtual registry during the build process of the captured application.
VMware, Inc.
Capturing Applications
VMware, Inc.
13
Close any applications, such as virus scans, that might change the file system during the capture process.
From the desktop, select Start > Programs > VMware > ThinApp Setup Capture.
(Optional) In the Ready to Prescan dialog box, click Advanced Scan Locations to select the drives and
registry hives to scan.
You might want to scan a particular location other than the C:\ drive if you install applications to a
different drive. In rare cases, you might want to avoid scanning a registry hive if you know that the
application installer does not modify the registry.
Click Prescan to establish a baseline system image of the hard drive and registry files.
The scanning process takes about 10 seconds for Windows XP.
When the Install Application page appears, minimize the Setup Capture wizard and install the
applications to capture.
For example, double-click Firefox Setup 2.0.0.3.exe to install Firefox. If the application needs to
restart after the installation, restart the system. The process restarts the Setup Capture wizard.
(Optional) If you are capturing Internet Explorer, in the Install Application page, click Internet Explorer,
to complete additional steps before installing the browser.
If you are capturing Internet Explorer 6 on Windows XP, see Capturing Internet Explorer 6 on Windows
XP on page 22.
For more information about entry points, see Defining Entry Points as Shortcuts into the Virtual
Environment on page 15.
(Optional) Make any necessary configuration changes to comply with your company policies, such as
using specific security settings or a particular home page.
If you do not make configuration changes at this time, each user must make changes.
(Optional) Start the application and respond to any messages for information before you continue with
the Setup Capture wizard.
If you do not respond to any messages at this time, each user who uses the application must do so during
the initial start.
14
VMware, Inc.
Maximize the Setup Capture wizard, click Postscan to proceed with another scan of the computer, and
click OK to confirm the postscan operation.
ThinApp stores the differences between the first baseline image and this image in a virtual file system and
virtual registry.
cmd.exe Starts a command prompt in a virtual context that enables you to view the virtual file system.
regedit.exe Starts the registry editor in a virtual context that enables you to view the virtual registry.
iexplore.exe Starts iexplore.exe in a virtual context that enables you to test virtualized
ActiveX controls.
Entry points start native executable files in a virtual context. Entry points do not create virtual packages of
cmd.exe, regedit.exe, or iexplore.exe.
If you cannot predict the need for debugging or troubleshooting the environment, you can use the Disabled
parameter in the Package.ini file at a later time to activate these entry points.
On the Entry Points page, select the check boxes for user-accessible entry points.
The wizard displays the executable files that were directly accessible through the desktop or Start menu
shortcuts.
(Optional) To debug your environment, select the Show entry points used for debugging check box to
display the iexplore.exe, regedit.exe, and cmd.exe troubleshooting options.
VMware, Inc.
15
Option
Description
Object Types
Specifies objects.
Locations
Check Names
Advanced
(Optional) Change the message that appears for users that ThinApp cannot authorize.
ThinApp treats write operations to network drives according to the SandboxNetworkDrives parameter
in the Package.ini file. This parameter has a default value that directs write operations to the physical
drive. ThinApp treats write operations to removable disks according to the SandboxRemovableDisk
parameter in the Package.ini file. This parameter has a default value that directs write operations to the
physical drive.
If you save documents to the desktop or My Documents folder, ThinApp saves the documents to the
physical system. ThinApp sets the isolation mode in the ##Attributes.ini files in %Personal% and
%Desktop% to Merged even when you select WriteCopy isolation mode.
16
VMware, Inc.
When you select Merged isolation, ThinApp completes the following operations:
Sets up exceptions that apply WriteCopy isolation to the following directories and their subdirectories:
%AppData%
%Common AppData%
%Local AppData%
%ProgramFilesDir%
%SystemRoot%
%SystemSystem%
ThinApp retains Merged isolation mode for the %SystemSystem%\spool subdirectory by creating an
exception to the %SystemSystem% parent directory isolation mode.
Between the prescan and postscan capture operations, assigns Full isolation mode to any directories that
the application creates during the installation. This process is unrelated to the isolation mode of any new
directories that the running virtual application creates.
Merged isolation mode in the Setup Capture wizard has the same effect as Merged isolation mode in the
Package.ini file, including the directory exceptions that specify WriteCopy isolation mode. The Setup
Capture wizard and manual capture process with the snapshot.exe utility configure the directory
exceptions for you with the ##Attributes.ini files within the directories.
%Personal%
%Desktop%
%SystemSystem%\spool
Between the prescan and postscan capture operations, assigns Full isolation mode to any directories that
the application creates during the installation. This process is unrelated to the isolation mode of any new
directories that the running virtual application creates.
WriteCopy isolation mode in the Setup Capture wizard has the same effect as WriteCopy isolation mode in the
Package.ini file, including the directory exceptions that specify Merged isolation mode. The Setup Capture
wizard and snapshot.exe utility configure the directory exceptions for you with the ##Attributes.ini files
within the directories.
VMware, Inc.
17
Description
Allows the application to read resources on and write to the local machine.
18
VMware, Inc.
Change the directory where you want to save the ThinApp project.
If you keep the default directory and capture Firefox 2.0.0.3, the path might appear as C:\Program
Files\VMware\VMware ThinApp\Captures\Mozilla Firefox (2.0.0.3).
VMware, Inc.
19
On the Package Settings page, select the primary data container from the list that is based on your
executable file entry points.
If the size of the primary container is smaller than 200MB, ThinApp creates a .exe file as the primary
container. For a small application such as Firefox, any .exe file can serve as the main data container.
If the size of the primary container is larger than 200MB, ThinApp creates a separate.dat file as the
primary container because Windows XP and Windows 2000 cannot show shortcut icons for large
.exe files. Generating separate small .exe files together with the .dat file fixes the problem.
If the size of the primary container is between 200MB and 1.5GB, ThinApp creates the default .dat
file unless you select a .exe file to override the default .dat file.
(Optional) If you select a .exe file to override the default .dat file when the size of the primary container
is between 200MB and 1.5GB, ignore the generated warning.
Selecting a .exe file enables all applications to work properly but might prevent the proper display of
icons.
(Optional) If you cannot select a primary data container, type a primary data container name to generate
a .dat file.
If you plan to use the Application Sync utility to update a captured application, ThinApp uses the primary
data container name during the process. You must use the same name across multiple versions of the
application. You might not be able to select the same primary data container name from the list.
For example, Microsoft Office 2003 and Microsoft Office 2007 do not have common entry point names.
(Optional) Select the Generate MSI package check box and change the MSI filename.
(Optional) To create a smaller executable package for locations such as a USB device, select the Compress
virtual package check box.
Click Save.
20
VMware, Inc.
(Optional) On the Ready to Build page, scan or change the project files.
Option
Description
Edit Package.ini
(Optional) To prevent a build from taking place, select the Skip the build process check box.
You can build the package at a later time with the build.bat file in the virtual application folder. For
example, a Firefox 2.0.0.3 path to the build.bat file might be C:\Program Files\VMware\VMware
ThinApp\Captures\Mozilla Firefox 2.0.0.3\build.bat.
Click Build to build an executable package or MSI package containing the files you installed during the
capture process.
(Optional) Deselect the Open folder containing project executables after clicking Finish check box to
view the executable files and MSI files at a later time.
Click Finish.
You can rebuild the package at any time after you click Finish to make changes.
PermittedGroups Restricts use of an application package to a specific set of Active Directory users.
SandboxNetworkDrives Specifies whether to redirect write operations on the network share to the
sandbox.
RequiredAppLinks Specifies a list of external ThinApp packages to import to the current package at
runtime.
OptionalAppLinks Specifies a list of external ThinApp packages to import to the current package at
runtime.
For information about all Package.ini parameters, download a copy of the ThinApp Package.ini Reference from
the ThinApp download site
VMware, Inc.
21
Activate the parameter to edit by removing the semicolon at the beginning of the line.
For example, activate the RemoveSandboxOnExit parameter for Firefox.
RemoveSandboxOnExit=1
Delete or change the value of the parameter and save the file.
Double-click the build.bat file in the captured application folder to rebuild the application package.
For example, a Firefox 2.0.0.3 path to the build.bat file might be C:\Program Files\VMware\VMware
ThinApp\Captures\Mozilla Firefox 2.0.0.3\build.bat.
Double-click the build.bat file in the captured application folder to rebuild the application package.
22
VMware, Inc.
Create a system image using the Prescan process of the Setup Capture wizard.
Select Include entry point for virtualized Internet Explorer 6 in the virtual package and click OK.
This option captures both the files that changed during setup capture and other required files and registry
settings.
Install any plug-ins for Internet Explorer that you want to be included in the package.
Rescan the system using the Postscan process of the Setup Capture wizard.
In the Setup Capture Entry Points dialog box, select the default, VirtIE6.exe.
Follow the prompts until the Native Browser Redirect dialog box appears.
Create a list of the Web sites and pages that you want to redirect to the virtual Internet Explorer 6 package.
Each entry must be on a separate line.
You can specify a site so that all pages on that site are redirected, for example, www.example.com.
You can specify a site name followed by a page name, so that the specific page is redirected, for
example javatester.org/version.html.
(Optional) When you have saved the package, open the ThinDirect.txt file, which contains the entry
point to Internet Explorer 6 and the list of redirect addresses, and edit the file.
This file only exists after you create entries in the Native Browser Redirect dialog box.
The redirection list is located in %appdata%\roaming\Vmware\VMware Thinapp\Thindirect.
10
VMware, Inc.
23
24
Installs an application from the network share specified in the configuration file
Runs a postscan
Generates a ThinApp project on the network share specified in the configuration file
The silent capture agent then returns control to the ThinApp Converter, which reverts the virtual machines to
their precapture state, using their original snapshot.
The process is then repeated for the next application installation process that needs to be converted. When
multiple virtual machines are specified, the capture agent runs on the machines simultaneously. As a virtual
machine becomes available, it is once again used for converting the next application
Not all application installation processes support silent installation mode. ThinApp Converter does not
support automatic capture for an installation process that does not support silent installation.
The installer directory name must not contain the equals symbol (=).
The virtual machines that are used in the conversion process must have the following items installed:
ThinApp Converter includes a private copy of the VMware VIX API library. If a more recent version of the
library already exists on the host machine, ThinApp Converter tries to use the newest version.
VMware recommends that you use Windows 2003 or Windows 2008 as a file server for network share. The file
server needs to have sufficient system resources to handle a large quantity of file operations. Do not use the
host machine that runs the ThinApp Converter executable file as the file server for the network share.
When using a VMware Workstation environment, ensure that the network settings are in bridged mode.
[Settings] contains parameters that provide global control of the capture process.
HostEnvironment
The HostEnvironment section of the configuration file contains the connection parameters for connecting to
VMware ESX Server, VMware vCenter Server, or VMware Workstation on a local machine.
[HostEnvironment] parameters are mandatory.
VMware, Inc.
You can only specify a single endpoint at a time in the configuration file. For example, if you plan to use
a single VMware ESX Server, you can have ThinAppConverter.exe directly connect to that server.
25
You cannot specify more than one ESX server. To use more than one ESX server, configure
ThinAppConverter.exe to connect to VMware vCenter Server, which manages multiple ESX servers.
VirtualMachineHost
The name of the virtual machine to which ThinApp Converter is to connect.
To connect a single VMware ESX Server, use the IP address or host name of the ESX server.
To connect to VMware vCenter Server, use the IP address or HOST name of the vCenter server.
For VMware ESX Server or VMware vCenter Server, if you are not using standard HTTPS with port 443,
you can specify the entire URL.
Examples
The following example shows a virtual machine specified by ESX server hostname.
[HostEnvironment]
VirtualMachineHost=MyEsx.vmware.com
HostLoginUserName
The login user name for the host machine.
Use the same login user name for connecting to the server as you use for logging in to the VMware vSphere
Client. You must have sufficient privileges to turn on and off virtual machines, take virtual machine snapshots,
and so on.
You can use UPN format when you specify a user name for vCenter. For example, user@domain.com.
HostLoginUserName is ignored when logging into VMware Workstation.
HostLoginPassword or HostLoginPasswordBase64
The login password for the host machine. You have the following options when you specify passwords:
You can specify a base64 encoded password for the HostLoginPasswordBase64 parameter. Specifying
an encoded password does not increase security. You need to protect the actual INI file.
VMware, Inc.
HostLoginUserName=root
HostLoginPassword=secret
HostLoginPasswordPrompt=true
VirtualMachineN
The VirtualMachineN section of the configuration file contains a list of the Windows-based virtual machines
that will be utilized in the conversion process.
Create a VirtualMachineX section for each virtual machine that you want to include, and specify their
parameters. X is 1, and subsequent virtual machine sections are numbered sequentially.
[VirtualMachineN] parameters are mandatory.
VmxPath
Specify the configuration path of the virtual machine.
For ESX Server or vCenter Server, you can identify the virtual machine configuration file path using the
vSphere Client.
Identify the virtual machine configuration path using the vSphere Client
1
Click the Options tab, and copy the string from the Virtual Machine Configuration File field.
For Workstation, specify the entire file path on the host on which the VMX configuration file resides. For
example, C:\MyVMs\Windows XP\Windows XP.vmx. Do not place the path in quotation marks, even if the path
contains a space.
UserName
A valid user name for the virtual machine guest operating system. The user must have administrator
privileges for the virtual machine guest operating system.
You can use UPN format when you specify a user name. For example, user@domain.com.
Password or PasswordBase64
A valid password for the virtual machine guest operating system. You have the following options when you
specify passwords:
You can specify a base64 encoded password for the PasswordBase64 parameter.
Specifying an encoded password does not increase security strength. You need to protect the actual INI
file.
27
UserName=administrator
Password=secret
PasswordPrompt=false
NOTE Do not place the path in quotation marks, even if the path contains a space.
Settings
The Settings section of the configuration file contains the parameters for the application installation directory
and ThinApp project output directory, in the form of UNC. It also contains several parameters controlling the
conversion process behavior.
ThinApp Converter only requires read-only permissions for the network share that contains the application
installers. It requires read/write permissions for the network share that contains the ThinApp projects.
If input and output directories are on the same file server, you must use the same user account to connect them.
InputUncPath
Specify the network share UNC path for the application installers. For example: \\fileserver\sharename,
or \\fileserver\sharename\dirname.
InputMountUserName
Specify the user name used for connecting to that network share. UPN format can be used when you specify
a domain user, for example user@domain.com
InputMountPassword or InputMountPasswordBase64
Specify the password for connecting to the network share. You have the following options when you specify
passwords:
You can specify a base64 encoded password for the PasswordBase64 parameter.
InputMountPasswordPrompt
Specifies that the user be prompted to enter a password.
If you do not want to store the network share password in the configuration file, specify the value as true.
When set to true, a prompt always appears, even if a password is specified in the configuration file.
OutputUncPath
Specify the network share UNC path to the location of the generated ThinApp projects.
For example: \\fileserver\sharename, or \\fileserver\sharename\dirname
OutputMountUserName
Specify the user name used for connecting to the OutputUncPath network share. UPN format can be used to
specify a domain user, for example, user@domain.com.
OutputMountPassword or OutputMountPasswordBase64
28
VMware, Inc.
Specify the password for connecting to the network share. You have the following options when you specify
passwords:
You can specify a base64 encoded password for the PasswordBase64 parameter.
OutputMountPasswordPrompt
Specifies that the user be prompted to enter a password.
If you do not want to store the network share password in the configuration file, specify the value as true.
When set to true, a prompt always appears, even if a password is specified in the configuration file.
Example
Following is an example of network share specifications.The user for the application installation directory has
only read permissions. For both the input and output network shares, a prompt will display, requiring a user
to enter a password.
[Settings]
InputUncPath=\\AppInstallerServer\AppInstallers\ThinAppMigration
InputMountUserName=readonlyUser
InputMountPassword=secret
InputMountPasswordPrompt=true
OutputUncPath=\\DeploymentServer\ThinAppProj
OutputMountUserName=readwriteUser
OutputMountPassword=secret
OutputMountPasswordPrompt=true
Attempts to find a file named install.cmd or install.bat. If successful, ThinApp Converter runs that
file.
If ThinApp Converter finds a single .cmd or .bat file, it runs that file.
If ThinApp Converter finds a single .mst file, it runs that file and adds the necessary silent installation
switches.
If ThinApp Converter finds a single .msi file, it runs that file and adds the necessary silent installation
switches.
If none of the steps enable ThinApp Converter to find a correct installation command, the subdirectory is
skipped. A warning is logged in the log file.
You must remove all network connections to the file server referenced in the INI file from the host on which
you run ThinApp Converter, to prevent conflict between user credentials.
PackageIniOverrideFile
Specify the file path to the global Package.ini override file.
This optional parameter enables you to specify a global override file for Package.ini that is generated for
each ThinApp project. The values in the override file are merged into Package.ini in the ThinApp project
that is generated for each application.
Global overrides are useful when you have a global policy setting, for example, PermittedGroup in
Package.ini.
VMware, Inc.
29
A Package.ini override file is formatted like a standard Windows INI file. You can add INI parameters and
values that are relevant to the Package.ini file.
The path is relative to the application installers network share. Using the example for specifying the network
shares for the application installers and ThinApp projects, if you specify
PackageIniOverrideFile=override.ini, ThinApp Converter will try to find the file under
\\AppInstallerServer\AppInstaller. You can provide a more explicit value by using predefined
variables. For more information, see Predefined Environment Variables on page 31.
You can specify a Package.ini file for each application. This process is described as part of the
[AppSettings:AppName] section.
ExclusionList
Specify a comma- or semicolon-separated list of application directories that ThinApp will skip when searching
for application installers.
The list is case insensitive.
You can specify wildcards for DOS-style file names. For example, Microsoft*. ? and * are supported.
Example
Following is an example of an exclusion specification using a wildcard.
[Settings]
ExclusionList=App?.old;FireFox1.0
ProjectPostProcessingCommand
Specify the file path to the project post processing command.
The file path is relative to the application installers network share. Using the example for specifying the
network shares for the application installers and ThinApp projects, if you specify
ProjectPostProcessingCommand=addscript.bat, ThinApp Converter will try to find the file under
\\AppInstallerServer\AppInstaller. You can provide a more explicit value by using predefined
variables. For more information, see Predefined Environment Variables on page 31.
StopOnError
Specify whether ThinApp Converter should stop converting an application if it encounters an error, or
continue with the other applications. The default value is false.
BuildAfterCapture
Specify whether the ThinApp Converter should build the ThinApp Projects into packages following capture.
The default value is true.
DetectIdle
Specify whether ThinApp Converter should try to detect if an application installer is stalled, for example when
the application is waiting for user input on the guest virtual machine because incorrect silent installation
switches were specified.
The default value is true. ThinApp Converter might not be able to detect all situations in which the installer
is idle.
InstallerTimeout
Specify how long ThinApp Converter should wait for an application installer to finish before it quits.
By default, the value is 7200 seconds.
AppSettings:AppName
This optional section provides parameters that you can use to add settings that are specific to an application.
AppName is the actual name of the subdirectory that contains the application installer. These parameters can
be added to each AppSettings section. In most circumstances, you will not need to configure this section.
30
VMware, Inc.
InstallationCommand
Specify how ThinApp Converter should start the application installer. If there is no value, ThinApp Converter
attempts to select one installation command using the logic described in ThinApp Converter Logic for
Detecting the Application Installation Processes on page 29.
PackageIniOverrideFile
The Package.ini override file that is applied to a single application installer. When this parameter has a value,
the global override file is processed first, followed by this application-specific override file.
The file path is relative to the application installer subdirectory. Using the example at the bottom of this section,
if you specify PackageIniOverrideFile=override.ini, ThinApp Converter will try to find the file under
\\AppInstallerServer\AppInstaller\Adobe. You can provide a more explicit value by using predefined
variables. For more information, see Predefined Environment Variables on page 31.
ProjectPostProcessingCommand
Specify the project post processing command for the specific application.
When this parameter has a value, the global override file is processed first, followed by this
application-specific post processing command.
Example
Following is an example of how to apply an application-specific override during post processing.
[AppSettings:Adobe]
InstallationCommand=AdbeRdr920_en_US.exe /sAll
PackageIniOverrideFile=override.ini
[AppSettings:TextPad]
InstallationCommand=silent_install.bat
ProjectPostProcessingCommand=%AppInstallerDir%\addscript.bat
%ThinAppProjectsRootDir% - The UNC path for the generated ThinApp projects that is specified in
OutputUncPath in the [Settings] section.
Example
Following is an example of how predefined variables can be used in the PackageIniOverrideFile,
ProjectPostProcessingCommand, and InstallationCommand parameters.
[Settings]
PackageIniOverrideFile=%AppInstallersRootDir%\AppSyncSettings.ini
;will resolve to \\AppInstallerServer\AppInstaller\AppSyncSettings.ini
[AppSettings:Adobe]
InstallationCommand=AdbeRdr920_en_US.exe /sAll
PackageIniOverrideFile=%AppInstallerDir%\override.ini
;will resolve to \\AppInstallerServer\AppInstaller\Adobe\AppSyncSettings.ini
VMware, Inc.
31
32
VMware, Inc.
Deploying Applications
Deploying captured applications involves working with deployment tools, the thinreg.exe utility, MSI files,
and Active Directory.
This information includes the following topics:
VMware, Inc.
33
Creating a login script that queries applications entitled to the user and runs the thinreg.exe utility with
the option that registers the applications on the local machine. Login scripts are useful for nonpersistent
desktops. See Establishing File Type Associations with the thinreg.exe Utility on page 34.
Controlling user access to fileshares. IT administrators might control access by organizing network shares
based on function and associating permissions with network shares based on those functional
boundaries.
34
VMware, Inc.
C:\<absolute_path_to_.exe>
\\<server>\<share>\<path_to_.exe>
As a variation, you can use a wildcard specification, such as *.exe.
If the path or filename contains spaces, enclose the path in double quotation marks. The following
command shows the use of double quotation marks.
thinreg.exe "\\DEPLOYSERVER\ThinApps\Microsoft Office Word 2007.exe"
For information about thinreg.exe parameters, see Optional thinreg.exe Parameters on page 35.
Run the thinreg.exe utility
1
Determine the executable files that ThinApp must register with the local environment.
If the server name is DEPLOYSERVER and the share is ThinApps, use the following example to register
Microsoft Word for the logged-in user.
ThinReg.exe "\\DEPLOYSERVER\ThinApps\Microsoft Office 2007 Word.exe"
Use the following example to register all Microsoft Office applications in the specified directory for the
logged-in user.
ThinReg.exe "\\DEPLOYSERVER\ThinApps\Microsoft Office *.exe"
VMware, Inc.
35
Purpose
Sample Usage
/a, /allusers
thinreg.exe /a
"\\<server>\<share>\Microsoft Office
2007 Word.exe"
thinreg.exe /q <unknown_option>
/u, /unregister,
/uninstall
Unregisters a package.
thinreg.exe /u
"\\<server>\<share>\Microsoft Office
2007 Word.exe"
Unregister all Microsoft Office applications for
the current user and remove the Add/Remove
Programs entry.
thinreg.exe /u
"\\server\share\Microsoft Office *.exe"
If a user registers the package with the /a
parameter, you must use the /a parameter when
unregistering the package.
thinreg.exe /u /a *.exe
/r, /reregister
Reregisters a package.
Under typical circumstances, the
thinreg.exe utility can detect whether a
package is already registered and skips it.
The /r option forces the thinreg.exe
utility to reregister the package.
thinreg.exe /r
"\\<server>\<share>\Microsoft Office
2007 Word.exe"
If a user registers the package with the /a
parameter, you must use the /a when
reregistering the package.
thinreg.exe /r /a *.exe
/k,
/keepunauthorized,
/keep
thinreg.exe /k
"\\<server>\<share>\Microsoft Office
2007 Word.exe"
thinreg.exe /q /noarp
"\\<server>\<share>\Microsoft Office
2007 Word.exe"
/norelaunch
thinreg.exe /q /norelaunch
"\\<server>\<share>\Microsoft Office
2007 Word.exe"
36
VMware, Inc.
The MSIInstallDirectory parameter sets the installation directory for the package.
For example, include MSIInstallDirectory=C:\Program Files\ in the Package.ini file.
The MSIDefaultInstallAllUsers parameter sets whether to install the package for all or individual
users. ThinApp installs the package in the %AppData% user directory.
For example, include MSIDefaultInstallAllUsers=0 in the Package.ini file.
For more information about this parameter, see Specifying a Database Installation for Individual Users
and Machines on page 38.
The MSIProductCode parameter makes it easier to install a new version of the application. An MSI
database contains a product code and an upgrade code. When you update a package, keep the original
value of the MSIUpgradeCode parameter.
If the parameter value of the new version is the same as the value of the old version, the installation
prompts you to remove the old version. If the values for the parameter are different, the installation un
installs the old version and installs the new version.
VMware recommends that you avoid specifying an MSIProductCode value and allow ThinApp to
generate a different product code for each build.
Regardless of the parameter values specified at build time, you can override the settings at deployment time.
See Force MSI Deployments for Each User or Each Machine on page 38.
VMware, Inc.
37
For example, the filename for Firefox might be Mozilla Firefox 2.0.0.3.msi.
2
Double-click the build.bat file in the captured application folder to rebuild the application package.
To create a database installation for individual users, use a value of 0 for the
MSIDefaultInstallAllUsers parameter in the Package.ini file. This value creates msiexec
parameters for each user.
To allow administrators to create a database installation for all users on a machine, or to allow an
individual user without administrator rights to create an installation only for that user, use a value of 2
for the MSIDefaultInstallAllUsers parameter. Administrators belong to the Administrators Active
Directory group.
For more information about the MSIDefaultInstallAllUsers parameter, refer ThinApp Package.ini
Parameters Reference Guide.
Force MSI Deployments for Each User or Each Machine
Regardless of the parameter values specified at build time, you can override MSI settings at deployment time.
For example, if you created the database with a value of 1 for the MSIDefaultInstallAllUsers parameter,
you can still force individual user deployments for Firefox 3.0 with the msiexec /i Firefox30.msi
ALLUSERS="" command.
If you use the ALLUSERS="" argument for the msiexec command, ThinApp extracts the captured executable
files to the %AppData% user directory.
Force MSI Deployments for Individual Users or for All Users on a Machine
(Optional) From the command line, type the msiexec /i <database>.msi ALLUSERS="" command to
force deployments for individual users.
(Optional) From the command line, type the msiexec /i <database>.msi ALLUSERS=1 command to
force deployments for all users on a machine.
38
VMware, Inc.
You must be connected to your Active Directory domain during the build process and the groups you
specify must exist. ThinApp looks up the SID value during the build.
If you delete a group and re-create it, the SID might change. In this case, rebuild the package to
authenticate against the new group.
When users are offline, ThinApp can authenticate them using cached credentials. If the users can log into
their machines, authentication still works. Use a group policy to set the period when cached credentials
are valid.
Cached credentials might not refresh on clients until the next Active Directory refresh cycle. You can force
a group policy on a client by using the gpupdate command. This command refreshes local group policy,
group policy, and security settings stored in Active Directory. You might log out before Active Directory
credentials are recached.
Certain groups, such as the Administrators group and Everyone group, have the same SID on every
Active Directory domain and workgroup. Other groups you create have a domain-specific SID. Users
cannot create their own local group with the same name to bypass authentication.
Active Directory Domain Services define security groups and distribution groups. If you use nested
groups, ThinApp can only support nested security groups.
VMware, Inc.
39
In the following entry, only users belonging to the App1users group can use the App1.exe file, and members
of the Everyone group can use the App2.exe file. The default message for denied users changes for App1.
[BuildOptions]
PermittedGroups=Everyone
[App1.exe]
PermittedGroups=App1Users
AccessDeniedMsg=Sorry, you cant run this application
..
[App2.exe]
...
...
After the postscan process is complete, in the Setup Capture - Ready to Build dialog, click
Edit Package.ini.
The Package.ini file opens in a text editor.
You can now register your virtual service so that it can be managed by using the native services management
tools.
Register the virtual service on a machine
1
40
VMware, Inc.
From the Start menu, select Programs > Administrative Tools > Services.
Your virtual service application appears in the list of services.
You can manage the service in the same way as any natively installed service.
Jills
Sandbox
shared folder
Sams
Sandbox
Joes
Sandbox
On the end-user desktop, you can create shortcuts that point to the centrally hosted executable file packages.
When the user clicks the shortcut, the application begins streaming to the client computer. During the initial
streaming startup process, the ThinApp status bar informs the user of the progress.
VMware, Inc.
41
local PC
128KB read request
virtual registry
compressed file
64KB (Block 1)
64KB (Block 2)
decompressed
(Block 1)
Ethernet
decompressed
(Block 2)
64KB (Block 3)
64KB (Block 4)
64KB (Block 5)
Use a desktop deployment solution to push the package to the background. Allow the application to run
only after the entire package downloads.
These solutions reduce failures and eliminate situations in which the application requires unstreamed
portions during a network outage. A company with many branch offices typically designates one application
repository that mirrors a central shared folder at each branch office. This setup optimizes local performance
for client machines located at each branch office.
42
VMware, Inc.
Pasting content from system installed applications to captured applications This paste operation is
unlimited. The virtual application can receive any standard clipboard formats, such as text, graphics, and
HTML. The virtual application can receive Object Linking and Embedding (OLE) objects.
Pasting from captured applications to system applications ThinApp converts OLE objects created in
virtual applications to system native objects when you paste them into native applications.
Accessing Printers
A captured application has access to any printer installed on the computer that it is running on. Captured
applications and applications installed on the physical system have the same printing ability.
You cannot use ThinApp to virtualize printer drivers. You must manually install printer drivers on a computer.
Accessing Drivers
A captured application has full access to any device driver installed on the computer that it is running on.
Captured applications and applications installed on the physical system have the same relationship with
device drivers. If an application requires a device driver, you must install the driver separately from the
ThinApp package.
Sometimes, an application without an associated driver might function with some limitations. For example,
Adobe Acrobat installs a printer driver that enables applications system wide to render PDF files using a print
mechanism. When you use a captured version of Adobe Acrobat, you can use it to load, edit, and save PDF
files without the printer driver installation. Other applications do not detect a new printer driver unless the
driver is installed.
Accessing the Local Disk, the Removable Disk, and Network Shares
When you create a project structure, ThinApp configures isolation modes for directories and registry sub trees.
The isolation modes control which directories the application can read and write to on the local computer.
Review the default configuration options described in Table 3-2.
Table 3-2. Default Configuration Options
Component
Description
Hard disk
Removable disk
By default, any user who has access rights can read or write to any
location on a removable disk.
VMware, Inc.
43
Description
By default, any user who has access rights can read or write to any
location on a network mapped disk.
By default, any user who has access rights can read or write to any
location on a UNC network path.
Starting Services
Captured applications can start and run system-installed services and virtual services. System services run in
the virtual environment that controls the modifications that the services can make.
44
VMware, Inc.
Solution
ThinApp makes copies of registry keys and files that the application writes
and performs all the modifications in a user-specific sandbox.
For directories and subkeys that have WriteCopy isolation, the application
recognizes the host computer files and virtual files. All write operations
convert host computer files into virtual files in the sandbox.
ThinApp makes copies of registry keys and files that the application writes
and performs all the modifications in a user-specific sandbox.
For directories and subkeys that have WriteCopy isolation, the application
recognizes the host computer files and virtual files. All write operations
convert host computer files into virtual files in the sandbox.
ODBC
Office
10.0
11.0
8.0
9.0
Common
Delivery
Live Meeting
Outlook
PowerPoint
Visio
When ThinApp runs a captured version of Microsoft Visio 2007, ThinApp sets the
HKLM\Software\Microsoft\Office registry subtree to full isolation. This setting prevents
Microsoft Visio 2007 from failing because of registry settings that might preexist on the host computer at the
same location.
VMware, Inc.
45
Figure 3-4 shows the registry from the perspective of the captured Microsoft Visio 2007.
Figure 3-4. Windows Registry as Seen by the Captured Microsoft Visio 2007
Office
12.0
Access Connectivity
Common
Registration
User Settings
Visio
10.0
11.0
8.0
9.0
Common
Delivery
Live Meeting
Outlook
PowerPoint
Visio
46
VMware, Inc.
You can update virtual applications with different utilities depending on the extent of change and
dependencies on other applications.
This information includes the following topics:
47
Verify that the primary data container name is the same for both packages.
The primary data container, determined during the setup capture process, is the file that contains the virtual
file system and virtual registry. If you have a Firefox 2.0.0.3 package that has Mozilla Firefox 2.0.0.3.exe
as the name of the primary data container, and you have a Firefox 3 package that has Mozilla Firefox 3.dat
as the name of the primary data container, change the name in the Shortcut parameter to a common
name. For example, you can use Firefox.exe as a name.
Uncomment the Application Sync parameters you want to edit by removing the semicolon at the
beginning of the line.
You must uncomment the AppSyncURL parameter to enable the utility.
In the captured application folder, double-click the build.bat file to rebuild the application package.
For example, a Firefox 2.0.0.3 path to the build.bat file might be C:\Program Files\VMware\VMware
ThinApp\Captures\Mozilla Firefox 2.0.0.3\build.bat.
To update Firefox 2.0.0.3 to Firefox 3, start the executable file, such as Mozilla Firefox 2.0.0.3.exe,
in the \bin directory.
When you start the application before the expiration time set in the AppSyncExpirePeriod parameter of
the Package.ini file, ThinApp downloads the update in the background as you work with the
application. The next time you start the application, you can see the updated version.
When you start the application after the package expires, ThinApp downloads the update in the
foreground and prevents you from working with the application. When the download is ready, ThinApp
restarts the application with the new version.
VMware, Inc.
Completing the Application Sync Process When Applications Create Child Processes
When a captured application creates child processes, ThinApp cannot complete the Application Sync process.
For example, you might create Microsoft Office 2003 and Microsoft Office 2007 packages, modify the
AppSyncURL parameter in the Package.ini file for both packages, and copy the Microsoft Office 2007 package
to a Web server and the Microsoft Office 2003 package to a client machine.
If you start the Microsoft Office 2003 package before the expiration time set in the AppSyncExpirePeriod
parameter of the Package.ini file, ThinApp can download the update in the background as you work with
the application but is unable to show the updated version the next time you start the application. If you start
the application after the package expires, ThinApp is unable to download the update in the foreground and
restart the application when the download is ready.
Microsoft Office 2003 and Microsoft Office 2007 are examples of applications that create child processes.
ThinApp cannot complete Application Sync updates until all child processes stop. You can perform one of the
following tasks to resolve the issue:
Log out and log in to the machine to stop the child processes.
Prevent the startup of the child process, such as the ctfmon.exe process associated with Microsoft Office
and Internet Explorer applications.
Prevent the Startup of the ctfmon.exe Process for Microsoft Office and Internet Explorer
Preventing the startup of the ctfmon.exe process requires knowledge of the ThinApp sandbox and
sbmerge.exe utility. For information about the sbmerge.exe utility, see Updating Applications with
Runtime Changes on page 55.
VMware, Inc.
49
If you did not activate the cmd.exe entry point during the capture process, set the Disabled parameter
for the cmd.exe entry in the Package.ini file to 0 and rebuild the package with the build.bat utility.
This generates an executable file for the cmd.exe entry point in the /bin directory.
Copy the /bin directory in the captured application directory to a clean virtual machine or delete the
sandbox for the Microsoft Office package.
In the Languages tab of the Regional and Languages dialog box, click Details.
In the Advanced tab of the Text Services and Input Languages dialog box, select the Turn off advanced
text services check box.
Click OK in all the open dialog boxes and leave the Windows command processor open.
Unregister the MSIMTF.dll and MSCTF.dll files with the REGSVR32.EXE/U <DLL_file> command.
See knowledge base article 282599 in the Microsoft Web site.
10
If the virtual machine does not reside on the same machine where ThinApp is installed, copy the sandbox
from the package to the packaging system.
The default sandbox location is %APPDATA%\Thinstall.
11
From the standard command prompt on the packaging system, use the sbmerge.exe utility to merge the
updated sandbox with the package.
A sample command is SBMERGE APPLY ProjectDir "C:\Program Files\VMware
\VMware ThinApp\Captures\Microsoft Office Professional 2007" SandboxDir
"%APPDATA%\Thinstall\Microsoft Office Pro 2007".
12
Rebuild the package and test the package on a clean virtual machine to confirm that the ctfmon.exe
process no longer exists.
Large shared libraries and frameworks Link runtime components, such as .NET, JRE, or ODBC drivers,
with dependent applications.
For example, you can link .NET to an application even if the local machine for the application prevents
the installation of .NET or already has a different version of .NET.
If you have multiple applications that require .NET, you can save space and make a single .NET package
and point the multiple applications to the .NET package. When you update .NET with a security fix, you
can update a single package rather than multiple packages.
Add-on components and plug-ins Package and deploy application-specific components and plug-ins
separately from the base application.
For example, you might separate Adobe Flash Player or Adobe Reader from a base Firefox application
and link the components.
You can deploy a single Microsoft Office package to all users and deploy individual add-on components
for each user.
50
VMware, Inc.
If you capture Microsoft Office and try to access a PDF attachment in the virtual Microsoft Outlook
environment, you can set up Microsoft Office to detect a linked Adobe Reader package on the network
when Adobe Reader is not available within the immediate virtual or physical environment.
Hot fixes and service packs Link updates to an application and roll back to a previous version if users
experience significant issues with the new version. You can deploy minor patches to applications as a
single file and reduce the need for rollbacks.
The Application Link utility provides bandwidth savings. For example, if you have Microsoft Office 2007
Service Pack 1 and you want to update to Service Pack 2 without Application Link, you would transfer
1.5Gb of data per computer with the deployment of a new Office 2007 Service Pack 2 package. The
Application Link utility transfers just the updates and not the whole package to the computers.
System Files
Base Application
Component Package
merged view of
System Files
+ Base Application
+ Component Package
VMware, Inc.
51
Capture the base application by using the same physical system or virtual machine with the .NET
framework already installed.
Open the Package.ini file in the captured application folder for the base application.
Enable the RequiredAppLinks parameter for the base application by adding the following line after the
[BuildOptions] entry.
RequiredAppLinks=dotnet.dat
Application Link parameters must reference the primary data container of the application you want to
link to. You cannot reference shortcut .exe files because these files do not contain any applications, files,
or registry keys.
8
Copy C:\Captures\MyApp\bin\MyApp.exe to
\\<end_user_desktop>\<Program_Files_share>\MyApp\MyApp.exe.
Copy C:\Captures\dotnet\bin\cmd.exe to
\\<end_user_desktop>\<Program_Files_share>\MyApp\dotnet.dat.
C:\AppFolder\AppA\AppA.exe
C:\AppFolder\AppB\AppB.exe
C:\AppFolder\AppC\AppC.exe
For information about setting up required and optional Application Link parameters in this procedure, refer
ThinApp Package.ini Parameters Reference Guide.
Set up nested links
1
Capture Application A.
52
VMware, Inc.
Capture Application B.
In the Package.ini file for Application B, specify Application C as a required or optional application link.
For example, add RequiredLinks=\AppFolder\AppC\AppC.exe to the file.
Capture Application C.
If you start Application A, it can access the files and registry keys of Application B and Application B can
access the files and registry keys of Application C.
Linked Package
Base application
a.exe
b.exe
For information about nested links, see Set Up Nested Links with Application Link on page 52.
VMware, Inc.
53
54
VMware, Inc.
Capturing an application.
Running a captured application and customizing the settings and virtual environment. ThinApp stores
the changes in the sandbox.
Running the sbmerge.exe utility to merge registry and file system changes from the sandbox into the
ThinApp project.
Double-click the build.bat file in the captured application folder to rebuild the application package.
For example, a Firefox 2.0.0.3 path to the build.bat file might be C:\Program Files\VMware\VMware
ThinApp\Captures\Mozilla Firefox 2.0.0.3\build.bat.
Create a Thinstall directory in the bin directory for the sandbox location.
From the command line, navigate to the directory where the ThinApp project folder resides.
For example, navigate to C:\Program Files\VMware\VMware ThinApp\Captures\Mozilla
Firefox 2.0.0.3.
From the command line, type the "C:\Program Files\VMware\VMware ThinApp\sbmerge" Print
command.
ThinApp prints the changes that affected the sandbox folder when using the captured application.
From the command line, type the "C:\Program Files\VMware\VMware ThinApp\sbmerge" Apply
command.
ThinApp empties the Thinstall folder and merges the sandbox changes with the application.
VMware, Inc.
55
sbmerge.exe Commands
The sbmerge.exe Print command displays sandbox changes and does not make modifications to the
sandbox or original project.
The sbmerge.exe Apply command merges changes from the sandbox with the original project. This
command updates the project registry and file system to reflect changes and deletes the sandbox directory.
Usage
"C:\Program Files\VMware\VMware ThinApp\sbmerge" Print [<optional_parameters>]
"C:\Program Files\VMware\VMware ThinApp\sbmerge" Apply [<optional_parameters>]
Optional Parameters
The optional sbmerge.exe parameters specify project and sandbox paths and block progress messages and
merging of sandbox files.
Table 4-2. Optional sbmerge.exe Parameters
Parameter
Description
-ProjectDir <project_path>
If you start the sbmerge.exe command from a location other than the application
project folder, use the absolute or relative path to the project directory using the
-ProjectDir <project_path> parameter. A sample command is "C:\Program
Files\VMware\VMware ThinApp\sbmerge" Print ProjectDir
"C:\<project_folder_path>"".
-SandboxDir <sandbox_path>
When you start a captured application, it searches for the sandbox in a particular
order. See Search Order for the Sandbox on page 61.
If you use a custom location for the sandbox, use the SandboxDir
<sandbox_path> parameter to specify the location.
-Quiet
-Exclude <excluded_file>.ini
56
VMware, Inc.
File Locks
Starting an application locks the executable file package. You cannot replace, delete, or move the application.
This file lock ensures that any computer or user who accesses a specific version of an application continues to
have that version available as long as the application processes and subprocesses are running.
If you store an application in a central location for many users, this file lock prevents administrators from
replacing a packaged executable file with a new version until all users exit the application and release their
locks.
VMware, Inc.
57
Create a desktop or Start menu shortcut to the users desktop that points to a shared executable file
location at \\<server>\<share>\Firefox.exe.
Assume two users start Firefox.exe and lock the application.
If you must deploy a more current update of Firefox, place it in the same directory with a higher number
at the end.
After both Firefox.exe and Firefox.exe.1 are unlocked, you can delete Firefox.exe and rename
Firefox.exe.1 to Firefox.exe. This permanently replaces the older version with the newer
version.ThinApp always uses the filename that has the highest version number. If you must roll back to an
earlier version and the most recent version is locked, copy the old version so that it has the highest version
number.
NOTE If you have a project with an.alt file, the .alt file from the new version must also be copied and
renamed. The number used in the filename must come before the .alt extension for example, Firefox.alt
becomes Firefox.1.alt. Changes to Package.ini will not be seen if the primary data container is a .dat
file. A workaround is to rebuild the project with an .exe primary data container if it is under 2GB in size.
relink Examples
The relink.exe utility has an optional -Recursive flag and can target a single package or multiple packages.
relink [-Recursive] <target> [<target> ...]
For example, you can update an Adobe Reader package to the latest installed ThinApp version.
relink AdobeReader.exe
The relink.exe utility can use directory names to process all ThinApp files in that directory.
relink C:MyPackages
If you specify the -Recursive flag, the relink.exe utility processes all ThinApp files in the directory and all
subdirectories. This flag is intended for use only with directory names.
If the target name contains spaces, you must use double quotes.
58
VMware, Inc.
VMware, Inc.
59
60
VMware, Inc.
The sandbox is the directory where all changes that the captured application makes are stored. The next time
you start the application, those changes are incorporated from the sandbox. When you delete the sandbox
directory, the application reverts to its captured state.
This information includes the following topics:
<sandbox_path> is Z:\sandboxes
The SandboxPath parameter in the Package.ini file determines the path. See SandboxPath on
page 97.
<computer_name> is JOHNDOE-COMPUTER
VMware, Inc.
61
ThinApp starts the sandbox search by trying to find the following environment variables in this order:
%<sandbox_name>_SANDBOX_DIR%
This environment variable changes the sandbox location for specific applications on the computer.
For example, if the Mozilla Firefox 3.0_SANDBOX_DIR environment variable exists, its value
determines the parent directory sandbox location. If the value is z:\FirefoxSandbox before you run the
application, ThinApp stores the sandbox in z:\FirefoxSandbox.JOHNDOE-COMPUTER if the directory
already exists. If the directory does not exist, ThinApp creates a sandbox in z:\FirefoxSandbox.
%THINSTALL_SANDBOX_DIR%
This environment variable changes the location of all sandboxes on a computer. For example, if the
THINSTALL_SANDBOX_DIR environment variable exists, its value determines the parent directory sandbox
location. If the value is z:\MySandboxes before you run the application, ThinApp creates a sandbox in
z:\MySandboxes.
<exe_directory>\<sandbox_name>.<computer_name>
For example, C:\Program Files\Firefox\Mozilla Firefox 3.0.JOHNDOE-COMPUTER
<exe_directory>\<sandbox_name>
For example, C:\Program Files\Firefox\Mozilla Firefox 3.0
<exe_directory>\Thinstall\<sandbox_name>.<computer_name>
For example, C:\Program Files\Firefox\Thinstall\Mozilla Firefox 3.0.JOHNDOE-COMPUTER
<exe_directory>\Thinstall\<sandbox_name>
For example, C:\Program Files\Firefox\Thinstall\Mozilla Firefox 3.0
<sandbox_path>\<sandbox_name>.<computer_name>
For example, Z:\sandboxes\Mozilla Firefox 3.0.JOHNDOE-COMPUTER
<sandbox_path>\<sandbox_name>
For example, Z:\sandboxes\Mozilla Firefox 3.0
%AppData%\Thinstall\<sandbox_name>.<computer_name>
For example, C:\Documents and Settings\JohnDoe\Application Data\Thinstall\Mozilla
Firefox 3.0.JOHNDOE-COMPUTER
%AppData%\Thinstall\<sandbox_name>
For example, C:\Documents and Settings\JohnDoe\Application Data\Thinstall\Mozilla
Firefox 3.0
If the SANDBOXPATH Package.ini parameter is set, the value determines the sandbox location.
If ThinApp completes the sandbox search without any results, ThinApp creates a sandbox in the default
%AppData%\Thinstall directory of the user.
NOTE Only one computer at a time can use a shared sandbox. If a computer is already using a sandbox,
ThinApp creates a new sandbox to allow you to continue working until the previous copy of the sandbox
closes.
62
VMware, Inc.
Under the SandboxName parameter, set the SandboxPath parameter to the network location.
SandboxName=Mozilla Firefox 3.0
SandboxPath=Z:\Sandbox
For example, if Mozilla Firefox 3.0 is the value of the SandboxName parameter, the captured Firefox
application creates the sandbox in Z:\Sandbox\Mozilla Firefox 3.0.
Under the SandboxName parameter, set the SandboxPath parameter to this value.
SandboxName=Mozilla Firefox 3.0
SandboxPath=.
For example, if Mozilla Firefox 3.0 is the value of the SandboxName parameter, the captured Firefox
application creates the Mozilla Firefox 3.0 sandbox in the same directory that Firefox runs from.
Store the Sandbox in a Thinstall Directory on a USB Drive at the Same Level as the
Executable File
The sandbox in a Thinstall directory located on a USB drive must be stored at the same level at which the
executable file is stored.
Store the sandbox in a Thinstall directory on a USB drive at the same level as the executable file
1
On the portable device, create a Thinstall directory in the same directory as your captured application.
The next time the packaged application starts from the portable device, the application creates a sandbox
in the Thinstall directory.
If the application and sandbox originally ran from another location, such as a computer local hard drive,
and you need the same sandbox on a portable device, copy the Thinstall directory from %AppData% to
the directory where the executable file resides on the device.
ThinApp no longer uses the sandbox in the original location.
VMware, Inc.
63
Sandbox Structure
ThinApp stores the sandbox using a file structure almost identical to the build project structure. ThinApp uses
macro names for shell folder locations, such as %AppData%, instead of hard coded paths. This structure enables
the sandbox to migrate to different computers dynamically when the application runs from new locations.
The sandbox includes virtual registry files that have been configured in a way that ensures that data corruption
does occur if an application intentionally or unintentionally terminates.
The sandbox contains the following registry files:
Registry.rw.lck Prevents other computers from simultaneously using a registry located on a network
share.
Registry.tvr.backup Contains a backup of the .tvr file that ThinApp uses when the original .tvr
file is corrupted.
Registry.rw.tvr.transact Real time cache that contains all transactions from the time that they are
written, irrespective of whether they have been committed to the real registry file.
Registry.tlog.cache Real time cache that contains all transactions that have not yet been committed
to the real registry file.
Registry.tlog Transaction log that contains all transactions during the period that they are being written to the
real registry log. Following successful writing to the real registry log, the transactions are removed from this file.
In addition to these registry files, the sandbox contains directories that include %AppData%,
%ProgramFilesDir%, and %SystemRoot%. Each of these folders contains modifications to respective folders
in the captured application.
64
VMware, Inc.
The snapshot.exe utility creates a snapshot of a computer file system and registry and creates a ThinApp
project from two previously captured snapshots. You do not have to start the snapshot.exe utility directly
because the Setup Capture wizard starts it. Only advanced users and system integrators who are building
ThinApp capability into other platforms might make direct use of this utility.
Creating a snapshot of a computer file system and registry involves scanning and saving a copy of the
following data:
The snapshot.ini configuration file specifies what directories and subkeys to exclude from a ThinApp
project when you capture an application. You might customize this file for certain applications.
This information includes the following topics:
Usage
snapshot.exe SnapshotFileName.snapshot [-Config ConfigFile.ini][BaseDir1][BaseDir2][BaseReg1]
VMware, Inc.
65
Examples
Snapshot My.snapshot
Snapshot My.snapshot Config MyExclusions.ini
Snapshot My.snapshot C:\MyAppDirectory HKEY_LOCAL_MACHINE\Software\MyApp
Options
The options specify the directories or subkeys in the snapshot.
Table 6-1. Snapshot Directories and Subkeys
Option
Description
-Config ConfigFile.ini
BaseDir1
Specifies one or more base directories to include in the scan. If you do not specify
base directories, the snapshot.exe utility scans C:\ and all subdirectories.
If you scan a machine where Windows or program files are installed on different
disks, include these drives in the scan.
If you know that your application installation creates or modifies files in fixed
locations, specify these directories to reduce the total time required to scan a
machine.
BaseReg1
Species one or more base registry subkeys to include in the scan. If you do not
specify registry subkeys, the snapshot.exe utility scans the
HKEY_LOCAL_MACHINE and HKEY_USERS keys.
Usage
snapshot.exe Snap1.snapshot -SuggestProject Snap2.snapshot OutputTemplate.ini
Examples
Snapshot Start.snapshot SuggestProject End.snapshot Template.ini
Usage
snapshot.exe Template.ini -GenerateProject OutDir [-Config ConfigFile.ini]
Examples
Snapshot Template.ini GenerateProject C:\MyProject
Snapshot Template.ini GenerateProject C:\MyProject Config MyExclusions.ini
-Config ConfigFile.ini is optional. The configuration file specifies directories or registry subkeys for
exclusion from the project. If you do not specify a configuration file, ThinApp uses the snapshot.ini file.
66
VMware, Inc.
Chapter 6 Creating ThinApp Snapshots and Projects from the Command Line
Usage
snapshot.exe SnapshotFileName.snapshot -Print
Examples
Snapshot Start.snapshot Print
Description
snapshot C:\Capture.snapshot
VMware, Inc.
Install the application and make any necessary manual system changes.
67
ThinApp uses the template file to generate the final Package.ini file. The template file contains a list of
all detected executable file entry points and Package.ini parameters. If you write your own script to
replace the Setup Capture wizard, use the template Package.ini file to select the entry points to keep or
customize Package.ini parameters such as InventoryName.
5
(Optional) To generate multiple projects with different configurations, reuse the original
Start.snapshot file and repeat the procedure from Step 2.
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\Components
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Connections
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware
Profiles\0001\Software\Microsoft\windows\CurrentVersion\Internet Settings
Application Data\Thinapp\snapshot.ini
This location is the AppData directory of the user.
68
VMware, Inc.
ThinApp stores the differences between snapshots during the setup capture process in a virtual file system and
virtual registry. The virtual file system uses folder macros to represent Windows shell folder locations.
This information about the virtual file system includes the following topics:
Build
The setup capture process generates this format from files found directly on the physical file system.
ThinApp uses folder macros to represent Windows shell folder locations.
Embedded
The build.bat file triggers a build process that embeds a read-only file system in executable files.
The executable files provide block-based streaming to client computers. ThinApp compresses the file
system.
Sandbox
Running the captured application generates the read-write directory structure that holds file data that the
application modifies. File modifications that prompt ThinApp to extract embedded virtual files to the
sandbox include the following operations:
Truncating a file
The embedded and sandbox file systems use folder macros to enable file paths to dynamically expand at
runtime.
VMware, Inc.
69
For example, you might capture an application on a system that has C:\WINNT as the Windows directory and
deploy the application on a system that has C:\Windows as the Windows directory. ThinApp transparently
converts C:\WINNT to %SystemRoot% during the capture process for that system and expands %SystemRoot%
to C:\Windows during runtime for that system.
If an application registers DLLs to C:\winnt\system32 while running on Windows 2000, the user can quit
the application and log in to a Windows XP machine. On the Windows XP machine, the files appear to exist at
C:\windows\system32 and all related registry keys point to C:\windows\system32.
On Windows Vista, ThinApp moves Windows SxS DLLs and policy information to match Windows Vista
instead of using Windows XP file path styles. This feature enables most applications to migrate to updated or
older operating systems.
ThinApp provides SxS support for applications running on Windows 2000 even though the underlying
operating system does not. This support enables most applications captured on Windows XP to run on
Windows 2000 without changes.
70
Macro Name
Typical Location
%AdminTools%
%AppData%
%CDBurn Area%
%Common AdminTools%
%Common AppData%
%Common Desktop%
%Common Documents%
%Common Favorites%
%Common Programs%
%Common StartMenu%
%Common Startup%
%Common Templates%
%Cookies%
%Desktop%
%Drive_c%
C:\
%Drive_m%
M:\
%Favorites%
%Fonts%
C:\Windows\Fonts
%History%
VMware, Inc.
Typical Location
%Internet Cache%
%Local AppData%
%My Pictures%
%My Videos%
%NetHood%
%Personal%
%PrintHood%
%Profile%
%Profiles%
%ProgramFilesDir%
C:\Program Files
%Programs%
%Recent%
%Resources%
C:\Windows\Resources
%Resources Localized%
C:\Windows\Resources\<language_ID>
%SendTo%
%Startup%
%SystemRoot%
C:\Windows
%SystemSystem%
C:\Windows\System32
%TEMP%
%Templates%
VMware, Inc.
71
72
VMware, Inc.
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
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 simultaneously 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.
73
The following callback example shows the OnFirstSandboxOwner and OnFirstParentExit functions.
------------------------example.vbs --------------------------------Function OnFirstSandboxOwner
msgbox "The sandbox owner is: " + GetCurrentProcessName
End Function
Function OnFirstParentExit
msgbox "Quiting application: " + GetCurrentProcessName
End Function
msgbox "This code will execute for all parent and child processes"
---------------------------------------------------------------------
Running a .bat file from a network share inside the virtual environment.
Copying an external system configuration file into the virtual environment on startup.
Implement a script
1
Save the script contents in a plain text file with the .vbs extension in the same directory as your
Package.ini file.
You can use any filename. ThinApp adds all .vbs files to the package at build time.
.bat Example
The following script runs an external .bat file from a network share inside the virtual environment. The .bat
file makes modifications to the virtual environment by copying files, deleting files, or applying registry
changes using regedit /s regfile.reg. Run this script only for the first parent process. If you run this script
for other processes, each copy of the cmd.exe utility runs the script and an infinite recursion develops.
Function OnFirstParentStart
Set Shell = CreateObject("Wscript.Shell")
Shell.Run "\\jcdesk2\test\test.bat"
End Function
Timeout Example
The following script prevents the use of an application after a specified date. The VBS date uses the
#mm/dd/yyyy# format, regardless of locale.
This check occurs upon startup of the parent process and any child processes.
if Date >= #03/20/2007# then
msgbox "This application has expired, please contact Administrator"
ExitProcess 0
end if
74
VMware, Inc.
Find the last slash in the path and obtain the characters that precede the slash.
LastSlash = InStrRev(Origin, "\")
SourcePath = Left(Origin, LastSlash)
Form a new path to the ODBC DLL file located outside of the package.
DriverPath=SourcePath + "tsodbc32.dll"
This modification causes the application to load the DLL from an external location.
.reg Example
The following script imports the registry values from an external .reg file into the virtual registry at runtime.
Function OnFirstParentStart
ExecuteVirtualProcess "regedit /s C:\tmp\somereg.reg"
End Function
VMware, Inc.
75
ThinApp sets up TS_ORIGIN to indicate the full path to a captured executable file package. A virtual
application sets the TS_ORIGIN variable to the physical path of the primary data container.If you have a virtual
application consisting of the main.exe and shortcut.exe files, both files reside in C:\VirtApp. When you
run the main.exe file, TS_ORIGIN var is set to C:\VirtApp\main.exe. When you run the shortcut.exe file,
the TS_ORIGIN environment variable is set to C:\VirtApp\main.exe. The environment variable is always set
to the primary data container, even when you create a shortcut. When you run VBScripts that are included in
the package, the variable is already set and available to the scripts.
Origin = GetEnvironmentVariable("TS_ORIGIN")
You can separate the filename from TS_ORIGIN by finding the last backslash and removing all of the characters
following it.
LastSlash = InStrRev(Origin, "\")
SourcePath = Left(Origin, LastSlash)
The source file to copy into the virtual environment is the package path plus config.ini.
SourceFile = SourcePath + "Config.ini"
The location to copy to might be a different location on different computers if the Program Files directory is
mapped to a location other than C:\. The following call lets ThinApp expand a macro to obtain the correct
location for the local computer.
DestFile = ExpandPath("%ProgramFilesDir%\MyApplication\Config.ini")
Use the file systemObject parameter to check the source file exists.
Set objFSO = CreateObject("Scripting.filesystemObject")
If objFSO.FileExists(SourceFile) Then
If the source file exists, copy it into the virtual file system. The %ProgramFilesDir%\MyApplication virtual
directory is in the package.
objFSO.CopyFile SourceFile, DestFile, TRUE
End if
End Function
Create a .reg file and run the regedit /s command as an external process that accesses the system
registry instead of the virtual registry.
Function OnFirstParentStart
Create the .reg file in a location that has the IsolationMode parameter set to Merged so that the virtual
environment can access it with this script and the physical environment can access it with the regedit
/s command.
RegFileName = ExpandPath("%Personal%\thin.reg")
Set fso = CreateObject("Scripting.filesystemObject")
Set RegFile = fso.CreateTextFile(RegFileName, true)
The %Personal% directory is a directory that has Merged isolation mode by default.
3
76
VMware, Inc.
API Functions
You can use API functions that instruct ThinApp to complete operations such as load DLLs as virtual DLLs,
convert paths from macro format to system format, and run commands inside of the virtual environment.
AddForcedVirtualLoadPath
The AddForcedVirtualLoadPath(Path) function instructs ThinApp to load all DLLs from the specified path
as virtual DLLs even if they are not located in the package.
Use this function if the application needs to load external DLLs that depend on DLLs located inside the
package.
You can use the ForcedVirtualLoadPaths parameter in the Package.ini file to achieve the same result as
this API function. See ForcedVirtualLoadPaths on page 71.
Parameters
Path
[in] The filename or path for DLLs to load as virtual.
Examples
You can load any DLL located in the same directory as the executable file as a virtual DLL.
Origin = GetEnvironmentVariable("TS_ORIGIN")
You can instruct ThinApp to load all DLLs in the same or lower directory from where the source executable
file resides.
AddForcedVirtualLoadPath(SourcePath)
This process enables you to drop additional files in the SourcePath tree and have them resolve import
operations against virtual DLLs.
ExitProcess
The ExitProcessExitCode function quits the current process and sets the specified error code.
Parameters
ExitCode
[in] The error code to set. This information might be available to a parent process. A value of 0 indicates no
error.
VMware, Inc.
77
Examples
You can exit the process and indicate success.
ExitProcess 0
When the process exits, the scripting system receives its OnLastProcessExist function callback. Any loaded
DLLs run termination code to clean up the environment.
ExpandPath
The ExpandPath(InputPath) function converts a path from macro format to system format.
Parameters
InputPath
[in] A path in macro format.
Returns
The expanded macro path in system format.
Examples
Path = ExpandPath("%ProgramFilesDir%\Myapp.exe")
Path = C:\Program Files\myapp.exe
All macro paths must escape the % and # characters by replacing these characters with #25 and #23.
Path = ExpandPath("%ProgramFilesDir%\FilenameWithPercent#25.exe")
This expands to C:\Program Files\FileNameWithPercent%.exe.
ExecuteExternalProcess
The ExecuteExternalProcess(CommandLine) function runs a command outside of the virtual
environment. You can use this function to make physical system changes.
Parameters
CommandLine
[in] Representation of the application and command-line parameters to run outside of the virtual
environment.
Returns
Integer process ID. You can use the process ID with the WaitForProcess function. See WaitForProcess on
page 83.
Examples
ExecuteExternalProcess("C:\WINDOWS\system32\cmd.exe /c copy C:\systemfile.txt
C:\newsystemfile.txt")
You can run a command that requires quotation marks in the command line.
ExecuteExternalProcess("regsvr32 /s " & chr(34) & "C:\Program Files\my.ocx" & chr(34))
78
VMware, Inc.
ExecuteVirtualProcess
The ExecuteVirtualProcess(CommandLine) function runs a command inside of the virtual environment.
You can use this function to make changes to the virtual environment.
Parameters
CommandLine
[in] Representation of the application and command-line parameters to run outside of the virtual
environment.
Returns
Integer process ID. You can use the process ID with the WaitForProcess function. See WaitForProcess on
page 83.
Examples
ExecuteVirtualProcess("C:\WINDOWS\system32\cmd.exe /c copy C:\systemfile.txt C:\virtualfile.txt")
You can run a command that requires quotation marks in the command line.
ExecuteVirtualProcess("regsvr32 /s " & chr(34) & "C:\Program Files\my.ocx" & chr(34))
GetBuildOption
The GetBuildOption(OptionName) function returns the value of a setting specified in the [BuildOptions]
section of the Package.ini file used for capturing applications.
Parameters
OptionName
[in] Name of the setting.
Returns
This function returns a string value. If the requested option name does not exist, the function returns an empty
string ("").
Examples
Package.ini contains:
[BuildOptions]
CapturedUsingVersion=4.0.1-2866
GetFileVersionValue
The GetFileVersionValue(Filename, Value) function returns version information value from files such
as a specific DLL, OCX, or executable file. You can use this function to determine the internal version number
of a DLL or retrieve DLL information about the copyright owner or a product name.
Parameters
Filename
[in] The name of the filename whose version information is being retrieved.
Value
[in] The name of the value to retrieve from the version information section of the specified file.
VMware, Inc.
79
Comments
InternalName
ProductName
CompanyName
LegalCopyright
ProductVersion
FileDescription
LegalTrademarks
PrivateBuild
FileVersion
OriginalFilename
SpecialBuild
Returns
This function returns a string value. If the requested filename does not exist, or the function cannot locate the
specified value in the file, the function returns an empty string ("").
Examples
FileVersion = GetFileVersionValue("C:\windows\system32\kernel32.dll," "FileVersion")
if FileVersion = "1.0.0.0" then
MsgBox "This is Version 1.0!"
End if
GetCommandLine
The GetCommandLine function accesses the command-line parameters passed to the running program.
Returns
This function returns a string that represents the command-line arguments passed to the current running
program, including the original executable file.
Examples
MsgBox "The command line for this EXE was " + GetCommandLine
GetCurrentProcessName
The GetCurrentProcessName function accesses the full virtual path name of the current process.
Returns
This function returns a string that represents the full executable path name inside of the virtual environment.
In most circumstances, this path is C:\Program Files\..., even if the package source runs from a network
share.
Examples
MsgBox "Running EXE path is " + GetCurrentProcessName
80
VMware, Inc.
GetOSVersion
The GetOSVersion() function returns information about the current version of Windows.
Parameters
This function has no parameters.
Returns
This function returns a string in the MAJOR.MINOR.BUILD_NUMBER.PLATFORM_ID OS_STRING format.
MAJOR is one the following values:
Windows Vista
Windows XP
Windows 2000
Windows NT 4.0
Windows XP
Windows 2000
Windows NT 4.0
Windows NT 3.51
51
Value = 1 for Windows Me, Windows 98, or Windows 95 (Windows 95 based OS)
Value = 2 for Windows Server 2003, Windows XP, Windows 2000, or Windows NT. (Windows NT
based OS)
OS_STRING represents information about the operating system such as Service Pack 2.
Examples
if GetOSVersion() = "5.1.0.2 Service Pack 2"
then MsgBox "You are running on Windows XP Service Pack 2!"
endif
VMware, Inc.
81
GetEnvironmentVariable
The GetEnvironmentVariable(Name) function returns the environment variable associated with the Name
variable.
Parameters
Name
[in] The name of the environment variable for which the value is retrieved.
Returns
This function returns the string value associated with the Name environment variable.
Examples
MsgBbox "The package source EXE is " + GetEnvironmentVariable("TS_ORIGIN")
RemoveSandboxOnExit
The RemoveSandboxOnExit(YesNo) function set toggles that determine whether to delete the sandbox when
the last child process exits.
If you set the RemoveSandboxOnExit parameter to 1 in the Package.ini file, the default cleanup behavior for
the package with is Yes. You can change the cleanup behavior to No by calling RemoveSandboxOnExit with
the value of 0. If you do not modify the RemoveSandboxOnExit=1 entry in the Package.ini file, the default
cleanup behavior for the package is No. You can change the cleanup behavior to Yes by calling
RemoveSandboxOnExit with the value of 1.
Parameters
Yes No
[in] Do you want to clean up when the last process shuts down? 1=Yes, 0=No
Examples
The following example turns on cleanup.
RemoveSandboxOnExit 1
SetEnvironmentVariable
The SetEnvironmentVariable(Name, Value) function set the value of an environment variable.
Parameters
Name
[in] The name of the environment variable to store the value.
Value
[in] The value to store.
Examples
SetEnvironmentVariable "PATH", "C:\Windows\system32"
82
VMware, Inc.
SetfileSystemIsolation
The SetfileSystemIsolation(Directory, IsolationMode) function sets the isolation mode of a
directory.
Parameters
Directory
[in] Full path of the directory whose isolation mode is to be set.
IsolationMode
[in] Isolation mode to set.
1 = WriteCopy
2 = Merged
3 = Full
Examples
You can set the Merged isolation mode for the temp directory.
Setfile systemIsolation GetEnvironmentVariable("TEMP"), 2
SetRegistryIsolation
The SetRegistryIsolation(RegistryKey, IsolationMode) function sets the isolation mode of a registry
key.
Parameters
RegistryKey
[in] The registry key on which to set the isolation mode. Start with HKLM for HKEY_LOCAL_MACHINE, HKCU for
HKEY_CURRENT_USER, and HKCR for HKEY_CLASSES_ROOT.
IsolationMode
[in] Isolation mode to set.
1 = WriteCopy
2 = Merged
3 = Full
Examples
You can set the Full isolation mode for HKEY_CURRENT_USER\Software\Thinapp\Test.
SetRegistryIsolation "HKCU\Software\Thinapp\Test," 3
WaitForProcess
The WaitForProcess(ProcessID, TimeOutInMilliSeconds) function waits until the process ID is
finished running.
Parameters
ProcessID
[in] The process ID to end. The process ID can come from ExecuteExternalProcess or
ExecuteVirtualProcess.
TimeOutInMilliSeconds
[in] The maximum amount of time to wait for the process to finish running before continuing. A value of 0
specifies INFINITE.
VMware, Inc.
83
Returns
This function returns an integer.
0 = Timeout fails
1 = Process exits
2 = Process does not exist or security is denied
Examples
id = ExecuteExternalProcess("C:WINDOWS\system32\cmd.exe")
WaitForProcess(id, 0)
84
VMware, Inc.
You can use Log Monitor to generate trace files and troubleshoot the ThinApp environment. Log Monitor is
compatible only with an application captured using the same version of ThinApp.
This information includes the following topics:
Step-by-step reproduction of the procedure that you performed when you encountered the problem.
Information on the host configuration. Specify the Windows operating system, the use of Terminal Server
or Citrix Xenapp, and any prerequisite programs that you installed on the native machine.
Copies of the Log Monitor trace files. See Log Monitor Operations on page 85.
Exact copy of the capture folder and all content. Do not include the compiled executable files from the
/bin subfolder.
(Optional) Copies of the applications that you captured. Include the server components configuration for
Oracle Server or Active Directory.
(Optional) Native or physical files or registry key settings that might be relevant to the problem.
(Optional) Virtual machine that reproduces the defect. VMware support might request this if the support
contact is unable to reproduce the problem.
Win32 API calls from applications running in the ThinApp virtual operating system.
VMware, Inc.
85
The generated log files can be large and over 100MB depending on how long the application runs with Log
Monitor and how busy an application is. The only reason to run Log Monitor for an application is to capture
trace files. Trace files are critical for troubleshooting problems by analyzing and correlating multiple entries
within the trace file.
On the computer where you captured the application, select Start > Programs > VMware > ThinApp Log
Monitor.
To start Log Monitor on a deployment machine, copy the log_monitor.exe, logging.dll, and Setup
Capture.exe files from C:\Program Files\VMware\VMware ThinApp to the deployment machine and
double-click the log_monitor.exe file.
(Optional) Open the .txt file with a text editor and scan the information. In some circumstances, the .txt
file is too large to open with the text editor.
Zip the .txt files and send the files to VMware support.
On the computer where you captured the application, select Start > Programs > VMware > ThinApp Log
Monitor.
To start Log Monitor on a deployment machine, copy the log_monitor.exe, logging.dll, and Setup
Capture.exe files from C:\Program Files\VMware\VMware ThinApp to the deployment machine and
double-click the log_monitor.exe file.
86
VMware, Inc.
Start the captured application and let it run to the point where the error occurs or the performance
problem starts.
In Log Monitor, deselect the Suspend check box to resume the logging process.
You can check the application behavior to isolate the issue.
(Optional) Select a file in the trace file list to delete and click Delete File.
(Optional) Click the Compress check box to decrease the size of a trace file.
This operation slows the performance of the application.
Select a trace file in the file list, type a trace filename, or click Browse to select a trace file on your
system.
Locating Errors
ThinApp logging provides a large amount of information. The following tips might help advanced users
investigate errors:
Review the Potential Errors Detected section of the .txt trace file.
Entries might not indicate errors. ThinApp lists each Win32 API call where the Windows error code
changed.
If you find an exception, scan the earlier part of the trace file for the source of the exception. Ignore the
floating point exceptions that Virtual Basic 6 applications generate during typical use.
When you run applications from a network share that generates two processes, ignore the first process.
ThinApp addresses the slow performance of Symantec antivirus applications by restarting processes.
VMware, Inc.
87
Narrow the focus on calls originating from a specific DLL and thread.
The log format specifies the DLL and thread that makes a call. You can often ignore the calls from system
DLLs.
Log Format
A trace file includes the following sections:
System configuration
This section includes information about the operating system, drives, installed software, environment
variables, process list, services, and drivers.
The information starts with a Dump started on string and ends with a Dump ended on string.
Header
This section shows contextual information for the instance of the process that Log Monitor tracks. Some
of the displayed attributes show logging options, address ranges when the operating system runtime is
loaded, and macro mapping to actual system paths.
ThinApp marks the beginning of the header section with sequence number 000001. In typical
circumstances, ThinApp marks the end of this section with a message about the Application Sync utility.
Body
This section includes trace activity as the application starts and performs operations. Each line represents
function calls that target executable files or one of the DLLs make.
The section starts with a New Modules detected in memory entry, followed by the SYSTEM_LOADED
modules list. The section ends with a Modules Loaded entry.
Summary
This section includes modules that the captured application loads, potential errors, a profile of the 150
slowest calls, and a profile of Win32 APIs.
The section starts with the Modules Loaded message.
88
000257 indicates the log entry number. Each log entry has a unique number.
0a88 indicates the current running thread ID. If the application has one thread, this number does not
change. If two or more threads record data to the log file, you might use the thread ID to follow
thread-specific sequential actions because ThinApp records log entries in the order in which they occur.
4ad0576d indicates the return address for the API call that mydll.dll makes. In typical circumstances,
the return address is the address in the code where the call originates.
-> indicates the process of entering the call. For the call entry log element, ThinApp displays the input
parameters. These parameters are in and in/out parameters.
VMware, Inc.
<- indicates the process of the call returning to the original caller. For call exit log entries, ThinApp
displays the output parameters. These parameters are out and in/out parameters.
7c81b1f0 indicates the address of the API inside kernel32 where the call lands. If you disassemble
kernel32.dll at the 7c81b1f0 address, you find the code for the SetConsoleMode function.
->BOOL=1h indicates the API returns the value of 1 and the return code has the BOOL type.
0a88
0a88
0a88
0a88
|start_env_var|
|start_env_var|
|start_env_var|
|start_env_var|
=::=::\
=C:=C:\test\cmd_test\bin
=ExitCode=00000000
ALLUSERSPROFILE=C:\Documents and Settings\All Users.WINDOWS
SYSTEM_LOADED indicates that Windows loads the DLL. The file must exist on the disk.
MEMORY_MAPPED_ANON indicates that ThinApp loads the DLL. ThinApp might load the file from the
virtual file system.
46800000-46873fff indicates the address range in virtual memory where the DLL resides.
PRELOADED_BY_SYSTEM and PRELOADED_MAP are duplicate entries and refer to the memory address range
where the executable image file is mapped into memory.
Potential Errors
The Potential Errors Detected section marks log entries that might post problems with three asterisks
(***). For information about interpreting this section, see Locating Errors on page 87.
VMware, Inc.
89
90
VMware, Inc.
For example, the following entry for the cmd.exe utility in the Potential Errors section might require a
more thorough examination throughout the Log Monitor trace file.
001550 *** FindFirstFileW C:\test\cmd_test\bin\foobar.*' -> INVALID_HANDLE_VALUE *** failed
[system probe
To determine why the cmd.exe utility probes c:\test\cmd_test\bin, scan the log for this log entry
number and determine what occurs before this call.
To determine the locations where the cmd.exe utility obtains the c:\test\cmd_test path, scan the log
for GetCurrentDirectoryW and GetFullPathNameW entries.
000861 0a88 cmd.exe :4ad01580->USERENV.dll :769c0396 GetCurrentDirectoryW (IN DWORD
nBufferLength=104h)
000862 0a88
GetCurrentDirectoryW -> 0x14 (C:\test\cmd_test\bin)
000863 0a88 cmd.exe :4ad01580<-USERENV.dll :769c0396 GetCurrentDirectoryW ->DWORD=14h
(OUT LPWSTR lpBuffer=*4AD34400h->L"C:\test\cmd_test\bin")
000864 0a88 cmd.exe :4ad05b74->ole32.dll :774e03f0 Getfile type (IN HANDLE hFile=7h)
000865 0a88
Getfile type 7 -> 0x2
000866 0a88 cmd.exe :4ad05b74<-ole32.dll :774e03f0 Getfile type ->DWORD=2h ()
.
.
001533 0a88 cmd.exe :4ad01b0d<-kernel32.dll:7c80ac0f SetErrorMode ->UINT=0h ()
001534 0a88 cmd.exe :4ad01b13->kernel32.dll:7c80ac0f SetErrorMode (IN UINT uMode=1h)
001535 0a88 cmd.exe
:4ad01b13<-kernel32.dll:7c80ac0f SetErrorMode ->UINT=0h ()
001536 0a88 cmd.exe :4ad01b24->IMM32.DLL :7639039b GetFullPathNameW (IN LPCWSTR
lpFileName=*1638C0h->L."," IN DWORD nBufferLength=208h)
001537 0a88
GetFullPathNameW . -> 20 (buf=C:\test\cmd_test\bin,
file_part=bin)
001538 0a88 cmd.exe :4ad01b24<-IMM32.DLL :7639039b GetFullPathNameW ->DWORD=14h
(OUT LPWSTR lpBuffer=*163D60h->L"C:\test\cmd_test\bin," OUT *lpFilePart=*13D8D4h
->*163D82h->L"bin")
.
.
001549 0a88 cmd.exe
:4ad01b5f->USERENV.dll :769c03fa FindFirstFileW (IN LPCWSTR
lpFileName=*1638C0h->L"C:\test\cmd_test\bin\foobar.*")
001550 0a88
FindFirstFileW C:\test\cmd_test\bin\foobar.* ->
INVALID_HANDLE_VALUE *** failed [system probe C:\test\cmd_test\bin\foobar.*
-> ffffffffh][no virtual or system matches]
The cmd.exe utility obtains the first location by calling GetCurrentDirectoryW and the second location
by calling GetFullPathNameW with "." as the path specifies. These calls return the path for the current
working directory. The log file shows that the cmd.exe utility creates the C:\test\cmd_test\bin>
prompt. The utility queries the PROMPT environment variable that returns $P$G and uses the
WriteConsoleW API function to print the prompt to the screen after internally expanding $P$G to
C:\test\cmd_test\bin>.
VMware, Inc.
91
Add a value to the HKEY_CURRENT_USER.txt file that sets the name of the attachment directory:
isolation_full
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security
Value=OutlookSecureTempFolder
REG_SZ~%Profile%\Local Settings\OutlookTempxxxx#2300
In this example, 11.0 in the key name is for Microsoft Outlook 2003.
2
Replace the last four xxxx characters with random alphanumeric entries to increase security.
Create a directory that is named in the OutlookSecureTempFolder registry key in your ThinApp project.
For example, create the %Profile%\Local Settings\OutlookTempxxxx directory.
92
VMware, Inc.
CommandLine=%ProgramFilesDir%\Internet Explorer\iexplore.exe -E
Use this method to browse the virtual file system with a familiar interface and enable accurate file type
associations without system changes, especially when using portable applications. You can access
shell-integrated components without system changes.
VMware, Inc.
93
94
VMware, Inc.
Glossary
Application Link
A utility that links dependent applications to a base application at runtime and starts all the applications
together when you start the base application. You can use the utility to deploy and update component
packages separately rather than capture all components in the same package.
Application Sync
A utility that updates an application by detecting a new packaged version on a server or network share.
You can configure update settings, such as the checking of an update server at certain intervals. ThinApp
detects the most recent application executable file and downloads the differences.
attributes.ini
The file that applies configuration settings at the directory level of the package rather than the entire
package. The ##Attributes.ini settings override the overall Package.ini settings.
build
To convert a ThinApp project into a package. You can build a package with the Setup Capture wizard or
with the build.bat utility.
capture
To package an application into a virtual environment and set initial application parameters. ThinApp
provides the Setup Capture wizard or the snapshot.exe utility to create a portable application package
that is independent of the operating system it runs on.
clean machine
The computer or virtual machine, installed with only the basic Windows operating system, on which you
capture the application. The Windows operating system version must be the earliest version of Windows
that you expect the application to run on.
entry point
An executable file that starts the captured application. An application might have multiple entry points.
For example, the Firefox.exe file might serve as an entry point for a Mozilla Firefox application. The
primary data container file can exist within an entry point or as a .dat file.
inventory name
A name that ThinApp uses for internal tracking of the application. The inventory name sets the default
project directory name and appears in the Add or Remove Programs dialog box for Windows.
isolation mode
A package setting that determines the read and write access to the physical environment. ThinApp has
WriteCopy, Merged, and Full isolation modes.
VMware, Inc.
95
logging.dll
A utility that generates .trace files.
Log Monitor
A utility that captures chronological activity for executable files that the captured application starts.The
log_monitor.exe file is compatible only with applications captured using the same version of ThinApp.
MSI
A Windows Installer container that is useful for application deployment tools. You can deliver the
captured application as an MSI file instead of an executable file.
native
Refers to the physical environment rather than the virtual environment. See also physical.
network streaming
The process of running a package from a central server. ThinApp downloads blocks of the application as
needed to ensure quick processing and display.
package
The virtual application files that the ThinApp build process generates. The package includes the primary
data container file and entry point files to access the application.
package.ini
The file that applies configuration settings to the package and that resides in the captured application
folder. The Setup Capture wizard sets the initial values of the configuration settings.
physical
Refers to the computer memory and file system in which all standard Windows processes run. Depending
on ThinApp isolation mode settings, processes in the virtual environment can access the physical
environment. See also native, virtual.
postscan
To establish an image or snapshot of a machine after you install the application you want to capture. The
capture process stores in a virtual file system and virtual registry the differences between the prescan and
postscan images. See also prescan, snapshot.
prescan
To establish a baseline image or snapshot of a machine before you install the application you want to
capture. The capture process stores in a virtual file system and virtual registry the differences between the
prescan and postscan images. See also postscan, snapshot.
primary data container
The main virtual application file. The file is a .exe file or a .dat file that includes the ThinApp runtime
and the read-only virtual file system and virtual registry. The primary data container must reside in the
same /bin directory with any subordinate application executable files because entry points use the
information in the primary data container.
project
The data that the capture process creates before you build a package. The capture process uses the
inventory name as the default project directory name. You can customize parameters in the project files
before you build an application package. You cannot deploy a captured application until you build a
package from the project.
96
VMware, Inc.
Glossary
sandbox
The physical system folder that stores runtime user changes to the virtual application. When you start the
application, ThinApp incorporates changes from the sandbox. When you delete the sandbox, ThinApp
reverts the application to its captured state. The default location of the sandbox is
%APPDATA%\Thinstall\<application_name>.
sbmerge.exe
A utility that makes incremental updates to applications, such as the incorporation of a plug-in or a
change in a browser home page. The sbmerge.exe utility merges runtime changes recorded in the
sandbox back into a ThinApp project.
snapshot
A recording of the state of the Windows file system and registry during the application capture process.
The Setup Capture process uses the snapshot.exe utility to take a snapshot before and after the
application is installed and stores the differences in a virtual file system and virtual registry. See also
postscan, prescan.
snapshot.exe
A utility that creates the snapshots of a computer file system and registry and facilitates the prescan and
postscan operations during the capture process. Only advanced users who build ThinApp functionality
into other platforms might make direct use of this utility. See also postscan, prescan, snapshot.
snapshot.ini
A configuration file that specifies the directories and subkeys to exclude from a ThinApp project when
you capture an application. You can customize this file for applications.
template.msi
A template for MSI files that you can customize to adhere to company deployment procedures and
standards. For example, you can add registry settings for ThinApp to add to client computers as part of
the installation.
thinreg.exe
A utility that establishes file type associations, sets up Start menu and desktop shortcuts, and facilitates
the opening of files. You must run the thinreg.exe utility to register executable files. MSI files automate
the thinreg.exe registration process.
tlink.exe
A utility that links key modules during the build process.
vftool.exe
A utility that compiles the virtual file system during the build process.
virtual
Refers to the logical file and memory within which a captured application runs. Processes in a physical
environment cannot access the virtual environment. See also physical.
virtual application
An application that you capture to make it portable and independent of the operating system it runs on.
virtual file system
The file system as the captured application sees it.
virtual registry
The registry as the captured application sees it.
vregtool.exe
A utility that compiles the virtual registry during the build process.
VMware, Inc.
97
98
VMware, Inc.
Index
Symbols
##Attributes.ini
comparing to Package.ini 22
editing 22
A
Active Directory
authorizing group access 16
controlling access to applications 39
using Package.ini parameters 39
API parameters
AddForcedVirtualLoadPath 77
ExecuteExternalProcess 78
ExecuteVirtualProcess 79
ExitProcess 77
ExpandPath 78
GetBuildOption 79
GetCommandLine 80
GetCurrentProcessName 80
GetEnvironmentVariable 82
GetFileVersionValue 79
GetOSVersion 81
RemoveSandboxOnExit 82
SetEnvironmentVariable 82
SetfileSystemIsolation 83
SetRegistryIsolation 83
WaitForProcess 83
Application Link
defining 47, 50
defining access with the PermittedGroups
parameter 53
effect on isolation modes 53
file and registry collisions 54
linking packages to base applications and using
Application Sync 54
sample workflow 51
setting up nested links 52
storing multiple versions of linked
applications 54
view of 51
Application Sync
clashing with automatic update capabilities 47
defining 47
editing parameters 48
effect on entry point executable files 49
effect on thinreg.exe 34
VMware, Inc.
C
capturing applications
IE6 on Windows XP 22
phases of 13
requirements and dependencies 13
using ThinApp Converter 24
with the Setup Capture wizard 1421
with the snapshot.exe utility 67
cmd.exe, defining 15
compression
for executable files 20
for trace files 87
computers
defining a clean system 10
using virtual machines for clean systems 11
cut and paste operations, ThinApp limitations 43
D
data container, See primary data container
DCOM services, access for captured
applications 10
deploying
applications on network share 34
applications with deployment tools 33
executable files 34
99
MSI files 33
deployment tools, using MSI files 33
device drivers, incompatible with ThinApp 10
DLLs
loading into memory 89
recording by Log Monitor 85
drivers, support for 43
E
entry points
defining 15
for troubleshooting 15
in Setup Capture wizard 15
updating with Application Sync 49
G
global hook DLLs, reduced function with ThinApp 10
I
IE6 on Windows XP
capturing 22
requirements 22
iexplore.exe, defining 15
installing ThinApp 11
inventory name, purpose of 19
isolation modes
defining 16
Merged 16
sample configuration 45
using Application Link 53
WriteCopy 17
L
log format 88
Log Monitor
extra options 86
suspending and resuming logging 86
troubleshooting procedures 86
using 85
M
Merged isolation mode 16
Microsoft Vista, deploying MSI files 39
MSI files
automating the thinreg.exe utility 19
building the database 37
customizing parameters 37
deploying on Microsoft Vista 39
generating 19, 20
modifying the Package.ini 37
overriding the installation directory 38
100
N
nested links, using Application Link 52
network, streaming packages 41
O
operating systems
support for 9
using the lowest version for ThinApp
installation 11
P
Package.ini
Active Directory parameters 39
common parameters 21
editing Application Sync parameters 48
modifying MSI parameters 37
MSI parameters 37
packages
building 21
configuring 20, 21
defining 19
parameters
applying settings at folder level instead of
package level 22
for MSI files 37
for sbmerge.exe 56
for thinreg.exe 35
PermittedGroups, effect on Application Link 53
primary data container
defining 19
maintaining the name with Application Sync 49
size implications 19
project files 20
projects, opening during capture process 20
R
regedit.exe, defining 15
relink
defining 58
examples 58
S
sandbox
considerations for upgraded applications 58
defining 18
location 18, 63
search order 61
structure 64
sbmerge.exe
commands 56
defining 54
merging runtime changes 55
scripts
VMware, Inc.
Index
.bat example 74
.reg example 75
callback functions 73
file copy example 75
reasons for 74
service example 75
system registry example 76
timeout example 74
virtual registry example 75
services
automatic startup 40
starting and stopping in packages 40
Setup Capture wizard
authorizing user groups 16
browsing projects 21
building packages 21
compressing packages 19
entry points 15
installing applications 14
inventory name 19
package settings 20
postscan operation 14
prescan operation 14
project location 19
setting isolation modes 18
shell integration, reduced functions with ThinApp 10
snapshot.exe
creating snapshots from the command line 65
sample commands 67
sample procedure 67
snapshot.ini, defining 65, 68
support
for applications 9
for operating systems 9
technical support
required information for troubleshooting 85
ThinApp
applications that are not supported 10
browsing project files 20
deployment options 33
directory files 11
folder macros 69
in a VMware View environment 33
installing 11
recommendation for clean computers 10
requirements for installing and capturing
applications 9
streaming packages from the network 41
supported operating systems and
applications 9
updating applications 47
VMware, Inc.
U
upgrading applications, methods and
considerations 4759
W
WriteCopy isolation mode 17
101
102
VMware, Inc.