ThinApp User’s Guide ThinApp 4.7.3 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 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. ThinApp starts this utility during the setup capture process. snapshot.
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 Set User Groups ThinApp can use Active Directory groups to authorize access to the virtual application. You can restrict access to an application to ensure that users do not pass it to unauthorized users. 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.
Chapter 2 Capturing Applications When you select Merged isolation, ThinApp completes the following operations: Sets the DirectoryIsolationMode parameter in the Package.ini file to Merged. Sets up exceptions that apply WriteCopy isolation to the following directories and their subdirectories: %AppData% %Common AppData% %Local AppData% %Program Files Common% %ProgramFilesDir% %SystemRoot% %SystemSystem% ThinApp retains Merged isolation mode for the %SystemSystem%\spool subdi
ThinApp User’s Guide Set File System Isolation Modes The capture process sets the level of read and write access to the physical file system to determine which directories are visible and writable by the virtual application. For information about Full isolation and registry isolation that are available only outside of the Setup Capture wizard, see “DirectoryIsolationMode” and “RegistryIsolationMode” in ThinApp Package.ini Parameters Reference Guide.
Chapter 2 Capturing Applications Customize ThinApp Project Settings A project is the data that the capture process creates. You cannot run or deploy the captured application until you build a package from the project files. Setting up the project involves determining the inventory name and the project location. The inventory name facilitates internal tracking of the application and determines the default project directory name.
ThinApp User’s Guide Customize Package Settings The capture process includes initial settings for the primary data container, MSI packages, and executable package compression. Customize package settings in the Setup Capture wizard 1 2 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.
Chapter 2 Capturing Applications Build Virtual Applications You can adjust project files and build the application for deployment. Build virtual applications in the Setup Capture wizard 1 2 (Optional) On the Ready to Build page, scan or change the project files. Option Description Edit Package.ini Modify application parameters for the entire package. Open project folder Browse ThinApp project files in Windows Explorer.
ThinApp User’s Guide Modify the Package.ini File Use a text editor to modify the Package.ini file. Modify the Package.ini file 1 Open the Package.ini file located in the captured application folder. For example, a Firefox 2.0.0.3 path might be C:\Program Files\VMware\VMware ThinApp\Captures\Mozilla Firefox 2.0.0.3\Package.ini. 2 Activate the parameter to edit by removing the semicolon at the beginning of the line. For example, activate the RemoveSandboxOnExit parameter for Firefox.
Chapter 2 Capturing Applications Requirements for Capturing Internet Explorer 6 on Windows XP Before you start the Setup Capture wizard the following requirements must be met: You must have a clean virtual machine with Windows XP installed. Ensure that Windows XP includes all the service packs and Microsoft updates, so that Internet Explorer 6 is captured with the latest security fixes from Microsoft. ThinApp must be installed on the same machine.
ThinApp User’s Guide Extracting and Registering ThinDirect After you have built the Internet Explorer 6 package, you need to extract and register the ThinDirect plug‐in on the test machine. The ThinDirect plug‐in must be installed as part of the virtual package. The plug‐in is installed in your native browser during the registration process. Extract and register ThinDirect In the console, run the thinreg /a VirtIE6.
Chapter 2 Capturing Applications Builds the ThinApp project on the network share into a package 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.
ThinApp User’s Guide 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. You can use a locally installed VMware Workstation. 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.
Chapter 2 Capturing Applications 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.
ThinApp User’s Guide UserName=administrator Password=secret PasswordPrompt=false Following is an example for a VMware Workstation‐based virtual machine. On virtual machine 1, PasswordPrompt has been set to true. The user will be prompted for a password even though a password has been specified in the configuration. [VirtualMachine1] VmxPath=C:\MyVMs\Windows XP\Windows XP.vmx UserName=administrator Password=secret PasswordPrompt=true [VirtualMachine2] VmxPath=C:\MyVMs\Windows 7\Windows 7.
Chapter 2 Capturing Applications Specify the password for connecting to the network share. You have the following options when you specify passwords: You can enter clear text. 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.
ThinApp User’s Guide 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 installer’s 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.
Chapter 2 Capturing Applications 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.
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 Deploying MSI Files on Microsoft Vista When you deploy MSI files on Vista, you must indicate whether an installer needs elevated privileges. Typical individual user installations do not require elevated privileges but individual machine installations require such privileges. ThinApp provides the MSIRequireElevatedPrivileges parameter in the Package.ini file that specifies the need for elevated privileges when the value is set to 1.
ThinApp User’s Guide 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 can’t run this application .. [App2.exe] ... ...
Chapter 3 Deploying Applications 3 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. 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.
ThinApp User’s Guide 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. Any Windows file share, NAS device, or SMB share can provide this capability.
Chapter 3 Deploying Applications 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.
ThinApp User’s Guide 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.
Chapter 3 Deploying Applications 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.
ThinApp User’s Guide 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.
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 70 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. See “WaitForProcess” on page 81.
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.
ThinApp User’s Guide 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.
Chapter 8 Creating ThinApp Scripts 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.
ThinApp User’s Guide 82 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 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 <- 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. kernel32.dll indicates the DLL where the API call lands. 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.
ThinApp User’s Guide . ... 438 total calls 7847975891 total cycles (2809.64 ms): |sprof| ts_load_internal_module 764794646 cycles (273.80 ms) on log entry 21753 426837866 cycles (152.81 ms) on log entry 191955 408570540 cycles (146.27 ms) on log entry 193969 . . ... 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 . . ...
Chapter 9 Monitoring and Troubleshooting ThinApp The example shows the %drive_C%\test\cmd_test\bin, %SystemSystem%\foobar, and %SystemRoot%\foobar paths as the locations in the virtual file system that ThinApp probes. ----Potential Errors Detected --*** Unable to determine if any services need to be auto-started, error 2 001550 *** FindFirstFileW ’C:\test\cmd_test\bin\foobar.*’ -> INVALID_HANDLE_VALUE *** failed [system probe C:\test\cmd_test\bin\foobar.
ThinApp User’s Guide 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.
Chapter 9 Monitoring and Troubleshooting ThinApp 2 Replace the last four xxxx characters with random alphanumeric entries to increase security. 3 Create a directory that is named in the OutlookSecureTempFolder registry key in your ThinApp project. For example, create the %Profile%\Local Settings\OutlookTempxxxx directory. 4 In the %Profile%\Local Settings\OutlookTempxxxx directory, create a ##Attributes.ini file with the following entries: [Isolation] DirectoryIsolationMode=Merged Starting Explorer.
ThinApp User’s Guide 92 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 96 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 100 VMware, Inc.