ThinApp User’s Guide ThinApp 5.0 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs.
ThinApp User’s Guide 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 © 2010 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.
Contents About This Book 7 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
ThinApp User’s Guide Deploying ThinApp in the VMware View Environment 33 Deploying ThinApp on Network Shares 34 Deploying ThinApp Using Executable Files 34 Establishing File Type Associations with the thinreg.exe Utility 34 Application Sync Effect on the thinreg.exe Utility 34 Run the thinreg.exe Utility 35 Optional thinreg.exe Parameters 35 Building an MSI Database 37 Customizing MSI Files with Package.ini Parameters 37 Modify the Package.
Contents Listing Virtual Registry Contents with vregtool 62 6 Creating ThinApp Snapshots and Projects from the Command Line 63 Methods of Using the snapshot.exe Utility 63 Creating Snapshots of Machine States 63 Creating the Template Package.ini file from Two Snapshot Files 64 Creating the ThinApp Project from the Template Package.ini File 64 Displaying the Contents of a Snapshot File 65 Sample snapshot.exe Commands 65 Create a Project Without the Setup Capture Wizard 65 Customizing the snapshot.
ThinApp User’s Guide Starting Explorer.exe in the Virtual Environment 91 Troubleshooting Java Runtime Environment Version Conflict Glossary 91 93 Index 97 6 VMware, Inc.
About This Book The ThinApp User’s 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 User’s Guide VMware Professional Services VMware Education Services courses offer extensive hands‐on labs, case study examples, and course materials designed to be used as on‐the‐job reference tools. Courses are available onsite, in the classroom, and live online. For onsite pilot programs and implementation best practices, VMware Consulting Services provides offerings to help you assess, plan, build, and manage your virtual environment.
1 Installing ThinApp 1 You can use ThinApp to isolate applications, simplify application customization, deploy applications to different operating systems, and eliminate application conflict.
ThinApp User’s Guide Applications That ThinApp Cannot Virtualize ThinApp cannot convert some applications into virtual applications and might block certain application functions. You must use traditional installation technologies to deploy some application types. Applications that do not natively support the deployment operating system.
Chapter 1 Installing ThinApp 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.
ThinApp User’s Guide relink.exe – Updates existing packages to the latest ThinApp version installed on the system. sbmerge.exe – Merges runtime changes recorded in the application sandbox with the ThinApp project and updates the captured application. Setup Capture.exe – Captures and configures applications through a wizard. snapshot.exe – Compares the preinstallation environment and postinstallation environment during the application capture process. Snapshot64.
2 2 Capturing Applications You can capture applications to package an application into a virtual environment. The Setup Capture wizard is the main method to capture applications and set initial application parameters. Advanced users who must capture applications from the command line can use the snapshot.exe utility instead of the Setup Capture wizard.
ThinApp User’s Guide Capturing Applications with the Setup Capture Wizard The capture process packages an application and sets initial application parameters. If you use a virtual machine, consider taking a snapshot before you run the wizard. A snapshot of the original clean state enables you to revert to the snapshot when you want to capture another application. This information uses Mozilla Firefox as a key example for application capture.
Chapter 2 Capturing Applications 5 Close the application. 6 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.
ThinApp User’s Guide Active Directory Domain Services define security groups and distribution groups. ThinApp can only support nested security groups. Set user groups in the Setup Capture wizard 1 2 On the Groups page, limit the user access to the application. a Select Only the following Active Directory groups. b Click Add to specify Active Directory object and location information. Option Description Object Types Specifies objects. Locations Specifies a location in the forest.
Chapter 2 Capturing Applications %Common AppData% %Local AppData% %Program Files Common% %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.
ThinApp User’s Guide Option Description Full write access to non system directories (Merged isolation mode) Allows the application to read resources on and write to the local machine. Restricted write access (WriteCopy isolation mode) Allows the application to read resources on the local machine and to restrict most modifications to the sandbox. ThinApp copies file system changes to the sandbox to ensure that ThinApp only modifies copies of files instead of the actual physical files.
Chapter 2 Capturing Applications Customize project settings in the Setup Capture wizard 1 On the Project Settings page, change the inventory name. Using the thinreg.exe utility or deploying the captured application as an MSI file causes the inventory name to appear in the Add or Remove Programs dialog box for Windows. 2 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 Th
ThinApp User’s Guide 2 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.
Chapter 2 Capturing Applications 4 (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. 5 Click Finish. You can rebuild the package at any time after you click Finish to make changes. Advanced Package Configuration Advanced users might modify configuration files, such as the Package.ini or ##Attributes.
ThinApp User’s Guide Modifying Settings in the ##Attributes.ini File The ##Attributes.ini file exists in the folder macros of the project folder and applies configuration settings at the directory level. The Package.ini file applies settings at the overall application level. You can use the DirectoryIsolationMode, CompressionType, and ExcludePattern parameters in an ##Attributes.ini file to override the Package.ini settings at the directory level.
Chapter 2 Capturing Applications Run setup capture on a machine running Windows XP with Service Pack 3, and with the .NET framework installed. Capture Internet Explorer 6 on Windows XP 1 Create a system image using the Prescan process of the Setup Capture wizard. 2 In the Install Application dialog box, click Internet Explorer. 3 Select Include entry point for a fullyvirtualized Internet Explorer 6 in the virtual package and click OK.
ThinApp User’s Guide Capturing Multiple Application Installers with ThinApp Converter On virtual machines running a Windows operating system, you can use ThinApp Converter to convert multiple application installers into ThinApp packages. After you provide a configuration file with specific settings that the converter accesses, ThinApp Converter runs applications in silent mode. Silent mode means that the process occurs without requiring user input, after initial configuration settings are specified.
Chapter 2 Capturing Applications The virtual machines that are used in the conversion process must have the following items installed: Windows XP with Service Pack 3, Windows Vista, or Windows 7 The latest version of VMware Tools 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.
ThinApp User’s Guide VirtualMachineHost=10.13.11.23 The following example shows a local machine specified as localhost. [HostEnvironment] VirtualMachineHost=localhost 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.
Chapter 2 Capturing Applications 3 Use this string as the virtual machine configuration file path. 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.
ThinApp User’s Guide 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.
Chapter 2 Capturing Applications InputUncPath=\\AppInstallerServer\AppInstallers\ThinAppMigration InputMountUserName=readonlyUser InputMountPassword=secret InputMountPasswordPrompt=true OutputUncPath=\\DeploymentServer\ThinAppProj OutputMountUserName=readwriteUser OutputMountPassword=secret OutputMountPasswordPrompt=true ThinApp Converter Logic for Detecting the Application Installation Processes For the application installer’s network share, ThinApp Converter examines all subdirectories under the specifi
ThinApp User’s Guide 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 installer’s network share. Using the example for specifying the network shares for the application installers and ThinApp projects, if you specify ProjectPostProcessingCommand=addscript.
Chapter 2 Capturing Applications 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.
ThinApp User’s Guide 32 VMware, Inc.
3 Deploying Applications 3 Deploying captured applications involves working with deployment tools, the thinreg.exe utility, MSI files, and Active Directory. This information includes the following topics: “ThinApp Deployment Options” on page 33 “Establishing File Type Associations with the thinreg.
ThinApp User’s Guide 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.
Chapter 3 Deploying Applications Run the thinreg.exe Utility This example of running the thinreg.exe utility provides some sample commands. The package name in the thinreg.exe commands can appear in the following ways: C:\ Relative path to .exe file \\\\ 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.
ThinApp User’s Guide Table 3-1. Optional thinreg.exe Parameters Parameter /a, /allusers Purpose Sample Usage Registers a package for all users. thinreg.exe /a "\\\\Microsoft Office 2007 Word.exe" If an unauthorized user attempts to run the application, a message informs the user that he or she cannot run the application. /q, /quiet Prevents the display of an error message for an unrecognized command‐line parameter. /u, /unregister, /uninstall Unregisters a package.
Chapter 3 Deploying Applications Building an MSI Database If you do not create MSI files during the capture process, you can still create these files after building an application. An MSI database is useful for delivering captured applications through traditional desktop management systems to remote locations and automatically creating shortcuts and file type associations. Basic Active Directory group policies provide ways to distribute and start MSI packages.
ThinApp User’s Guide Modify the MSI parameters 1 In the Package.ini file, type the MSI filename. MSIFilename=.msi For example, the filename for Firefox might be Mozilla Firefox 2.0.0.3.msi. 2 (Optional) Update other MSI parameters. 3 Double‐click the build.bat file in the captured application folder to rebuild the application package. Specifying a Database Installation for Individual Users and Machines You can modify the installation of the MSI database for users and machines.
Chapter 3 Deploying Applications In both cases, you can override the installation directory by passing an INSTALLDIR property to the msiexec command. Override the MSI Installation Directory From the command line, type the msiexec /i .msi INSTALLDIR=C:\\ command. Deploying MSI Files on Microsoft Vista When you deploy MSI files on Vista, you must indicate whether an installer needs elevated privileges.
ThinApp User’s Guide In the following Package.ini entry, App1 and App2 inherit PermittedGroups values. [BuildOptions] PermittedGroups=Administrators;OfficeUsers [App1.exe] ... .. [App2.exe] ... ... 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.
Chapter 3 Deploying Applications After you package your service, for example Apache Server, you register it on the physical machine, using the ThinReg.exe application. The service is created as a native service, using information from the virtual registry. The service is available to all users using the virtual application. The service is not user specific.
ThinApp User’s Guide Using ThinApp Packages Streamed from the Network Any network storage device can serve as a streaming server for hundreds or thousands of client computers. See Figure 3‐1. Figure 3-1. Data Block Streaming over a Network Share Jill’s Sandbox shared folder Sam’s Sandbox Joe’s 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.
Chapter 3 Deploying Applications Figure 3-2. Application Streaming packaged executable VMware ThinApp VOS 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) Requirements and Recommendations for Streaming Packages ThinApp does not require specific server software to provide streaming capability.
ThinApp User’s Guide Stream ThinApp Packages from the Network Users can access packaged applications through the network. Stream packages from the network 1 Place the ThinApp package in a location accessible to client computers. 2 Send a link to users to run the application directly. Using Captured Applications with Other System Components Captured applications can interact with other components installed on the desktop.
Chapter 3 Deploying Applications Table 3-2. Default Configuration Options (Continued) Component Description Network mapped drives By default, any user who has access rights can read or write to any location on a network mapped disk. UNC network paths By default, any user who has access rights can read or write to any location on a UNC network path. Accessing the System Registry By default, captured applications can read the full system registry as permitted by access permissions.
ThinApp User’s Guide Sample Isolation Mode Configuration Depending on Deployment Context Isolation modes control the read and write access for specific system directories and system registry subkeys. You can adjust isolation modes to resolve the problems in Table 3‐3. Table 3-3. Sample Problems and Solutions That Use Isolation Modes Problem Solution An application fails to run because previous or future versions exist simultaneously or fail to uninstall properly.
Chapter 3 Deploying Applications 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 VMware, Inc.
ThinApp User’s Guide 48 VMware, Inc.
4 Updating and Linking Applications 4 You can update virtual applications with different utilities depending on the extent of change and dependencies on other applications.
ThinApp User’s Guide Update Firefox 2.0.0.3 to Firefox 3 with Application Sync This example shows the Application Sync update process for Firefox. The update process involves modifying the Package.ini file. The AppSyncURL parameter requires a URL path. ThinApp supports HTTP, HTTPS, and file protocols. For information about all Application Sync parameters, refer ThinApp Package.ini Parameters Reference Guide. Update Firefox 2.0.0.3 to Firefox 3 1 Capture Firefox 2.0.0.
Chapter 4 Updating and Linking Applications Application Sync Effect on Entry Point Executable Files The Application Sync utility updates entry point executable files. For example, assume you deploy a Microsoft Office 2007 package that does not include Microsoft PowerPoint. The Microsoft Office PowerPoint 2007.exe entry point does not exist for the original package.
ThinApp User’s Guide Prevent the startup of the ctfmon.exe process 1 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. 2 Copy the /bin directory in the captured application directory to a clean virtual machine or delete the sandbox for the Microsoft Office package.
Chapter 4 Updating and Linking Applications 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.
ThinApp User’s Guide Link an application to Microsoft .NET 1 Capture the installation of the .NET 2.0 Framework. During the capture process, you must select at least one user‐accessible entry point. 2 Rename the.exe file that ThinApp produces to a .dat file. This renaming prevents users from accidentally running the application. The name of the .dat file you select does not matter because users do not run the file directly. For example, use dotnet.dat. 3 Save the .NET project to C:\Captures\dotnet.
Chapter 4 Updating and Linking Applications 3 Capture Application B. 4 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. 5 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.
ThinApp User’s Guide File and Registry Collisions in Linked Packages If the base application and a dependent package linked to the base application contain file or registry entries at the same location, a collision occurs. When this happens, the order of import operations determines which package has priority. The last package imported has priority in such cases and the file or registry contents from that package are visible to the running applications.
Chapter 4 Updating and Linking Applications Forcing an Application Sync Update on Client Machines You can use the AppSync command to force an Application Sync update on a client machine. You might want to update a package stored in a location where standard users do not have write access. In this situation, you cannot use Application Sync parameters to check for updates when an application starts because users do not have the required rights to update the package. You can schedule a daily AppSync.
ThinApp User’s Guide 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 [] "C:\Program Files\VMware\VMware ThinApp\sbmerge" Apply [
Chapter 4 Updating and Linking Applications Dynamic Updates Without Administrator Rights You can update applications dynamically without requiring administrator rights. For example, .NET‐based applications that download new DLL files from the Internet as part of their update process must run the ngen.exe file to generate native image assemblies for startup performance. In typical circumstances, the ngen.exe file writes to HKLM and C:\WINDOWS, both of which are only accessible with administrator accounts.
ThinApp User’s Guide 3 Create a desktop or Start menu shortcut to the user’s desktop that points to a shared executable file location at \\\\Firefox.exe. Assume two users start Firefox.exe and lock the application. 4 Copy the updated version of Firefox.exe to the central share at \\\\Firefox.1. If you are a new user, ThinApp starts the application with the new package data in Firefox.1.
5 Locating the ThinApp Sandbox 5 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.
ThinApp User’s Guide ThinApp starts the sandbox search by trying to find the following environment variables in this order: %_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.
Chapter 5 Locating the ThinApp Sandbox Controlling the Sandbox Location The setup capture process adds the SandboxName parameter to the Package.ini file. If you capture Firefox and Mozilla Firefox 3.0 is the value of this parameter, the default location of the sandbox for the application is %AppData%\Thinstall\Mozilla Firefox 3.0. The typical %AppData% location is C:\Documents and Settings\\Application Data. %AppData% is often mapped to a shared network drive.
ThinApp User’s Guide 3 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. Sandbox Structure ThinApp stores the sandbox using a file structure almost identical to the build project structure.
6 Creating ThinApp Snapshots and Projects from the Command Line 6 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.
ThinApp User’s Guide 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 Specifies directories or registry subkeys to exclude during snapshot creation. If you do not specify a configuration file, ThinApp uses the snapshot.
Chapter 6 Creating ThinApp Snapshots and Projects from the Command Line Displaying the Contents of a Snapshot File The snapshot.exe utility lists the contents of the snapshot file. Usage snapshot.exe SnapshotFileName.snapshot -Print Examples Snapshot Start.snapshot –Print ThinApp requires all of the parameters. Sample snapshot.exe Commands Table 6‐2 describes sample commands for the snapshot.exe utility. The parameters are not case‐sensitive.
ThinApp User’s Guide 3 Save to disk a snapshot of the new machine configuration. snapshot.exe C:\End.snapshot 4 Generate a template Package.ini file. snapshot.exe C:\Start.snapshot –SuggestProject C:\End.snapshot C:\Template.ini 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.
7 ThinApp File System Formats and Macros 7 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.
ThinApp User’s Guide 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
Chapter 7 ThinApp File System Formats and Macros Table 7-1. Folder Macros (Continued) Macro Name Typical Location %Internet Cache% C:\Documents and Settings\\Local Settings\Temporary Internet Files %Local AppData% C:\Documents and Settings\\Local Settings\Application Data %My Pictures% C:\Documents and Settings\\My Documents\My Pictures %My Videos% C:\Documents and Settings\\My Documents\My Videos %NetHood% C:\Documents and Settings\\NetHood
ThinApp User’s Guide 72 VMware, Inc.
8 Creating ThinApp Scripts 8 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.
ThinApp User’s Guide The following callback example shows the OnFirstSandboxOwner and OnFirstParentExit functions. ------------------------example.
Chapter 8 Creating ThinApp Scripts Modify the Virtual Registry The following script procedure modifies the virtual registry at runtime to load an external ODBC driver from the same directory where the package executable file is located. Modify the registry 1 Obtain the path to the package executable files. Origin = GetEnvironmentVariable("TS_ORIGIN") 2 Find the last slash in the path and obtain the characters that precede the slash. LastSlash = InStrRev(Origin, "\") SourcePath = Left(Origin, LastSlash)
ThinApp User’s Guide 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.
Chapter 8 Creating ThinApp Scripts 4 Add the information in the system registry. RegEditPid = ExecuteExternalProcess("regedit /s " & chr(34) & RegFileName & chr(34)) WaitForProcess RegEditPid, 0 Wait until the process is complete. 5 Clean the environment. fso.
ThinApp User’s Guide 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.
Chapter 8 Creating ThinApp Scripts 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.
ThinApp User’s Guide You can retrieve the following values from most DLLs: 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 (ʺʺ).
Chapter 8 Creating ThinApp Scripts 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 6 Windows Server 2008 6 Windows Server 2003 5 Windows XP 5 Windows 2000 5 Windows NT 4.
ThinApp User’s Guide 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.
Chapter 8 Creating ThinApp Scripts SetfileSystemIsolation The Setfile systemIsolation(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.
ThinApp User’s Guide 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.
9 Monitoring and Troubleshooting ThinApp 9 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.
ThinApp User’s Guide 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. Troubleshoot Activity with Log Monitor You can use Log Monitor to perform basic troubleshooting.
Chapter 9 Monitoring and Troubleshooting ThinApp 3 (Optional) Capture logs for a specific duration to troubleshoot an exact issue. a Select the Suspend check box. b Start the captured application and let it run to the point where the error occurs or the performance problem starts. c In Log Monitor, deselect the Suspend check box to resume the logging process. You can check the application behavior to isolate the issue. d Select the Suspend check box again to stop the logging process.
ThinApp User’s Guide Search for the error message displayed in dialog boxes. Some applications call the MessageBox Win32 API function to display unexpected errors at runtime. You can search a trace file for MessageBox or the contents of the string displayed in the error and determine what the application was running just before the dialog box appeared. Narrow the focus on calls originating from a specific DLL and thread. The log format specifies the DLL and thread that makes a call.
Chapter 9 Monitoring and Troubleshooting ThinApp 74b0f2fc 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. <- indicates the process of the call returning to the original caller.
ThinApp User’s Guide ... 94 total calls 4451728477 total cycles (1593.76 ms): |sprof| ts_lookup_imports 544327945 cycles (194.87 ms) on log entry 21758 385149968 cycles (137.89 ms) on log entry 193970 187246661 cycles (67.04 ms) on log entry 190210 . . ... 34 total calls 1099873523 total cycles (393.76 ms): |sprof| new_thread_start 561664565 cycles (201.08 ms) on log entry 151922 531551734 cycles (190.30 ms) on log entry 152733 1619002 cycles (0.
Chapter 9 Monitoring and Troubleshooting ThinApp [FS missing in view 0][fs entry not found %SystemRoot%\foobar] Perform Advanced Examination for cmd.exe Log Entries A more thorough examination of an entry from the Potential Errors section of a trace file might involve searching the full body of the Log Monitor trace file for that specific entry and reviewing the system calls and conditions leading to the potential error. For example, the following entry for the cmd.
ThinApp User’s Guide Troubleshooting Specific Applications Troubleshooting tips are available for capturing Microsoft Outlook, Explorer.exe, and Java Runtime Environment. Troubleshoot Registry Setup for Microsoft Outlook Microsoft Outlook stores account settings in registry keys and files. When you start Microsoft Outlook for the first time, it checks that the keys exist. If Microsoft Outlook cannot find the keys, it prompts you to create an account.
Chapter 9 Monitoring and Troubleshooting ThinApp [Isolation] DirectoryIsolationMode=Merged Starting Explorer.exe in the Virtual Environment Running one instance of the explorer.exe utility on a Windows operating system makes it difficult to add an entry point to Windows Explorer and start it inside the virtual environment. You can use the following methods to open a Windows Explorer window inside the virtual environment: Add an entry point to iExplorer and start it with the -E parameter.
ThinApp User’s Guide 94 VMware, Inc.
Glossary A 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.
ThinApp User’s Guide L 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. M 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.
Glossary S 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\. 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.
ThinApp User’s Guide 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.
ThinApp User’s Guide MSI files 33 deployment tools, using MSI files 33 device drivers, incompatible with ThinApp 10 DLLs loading into memory 87 recording by Log Monitor 83 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.
Index .bat example 72 .
ThinApp User’s Guide 102 VMware, Inc.