Download VMware ThinApp User`s Manual

Transcript
Appendix E Using Scripts
To use an example
1
Save contents to a plain text file with the .vbs extension in the same directory as your Package.ini file (produced by Setup Capture).
It doesn’t matter what filename you use, all .vbs files are added to the package at build time and run.
2
Rebuild the application. .bat example
This script executes an external .bat file from a network share inside of the virtual environment. The .bat file can make modifications to the virtual environment by copying files, deleting files, or apply registry changes using regedit /s
regfile.reg. Make sure you only execute this for the first parent process otherwise each copy of cmd.exe executes the script and an infinite recursion will develop. Function OnFirstParentStart
Set Shell = CreateObject("Wscript.Shell")
Shell.Run "\\jcdesk2\test\test.bat"
End Function
timeout example
Prevent an application from being used after a specified date. This check is performed on the parent process startup as well as any child process startup.
ExpirationDate = CDate("03-20-07")
if Date >= ExpirationDate then
msgbox "This application has expired, please contact Administrator"
ExitProcess 0
end if
Registry Modify
This example modifies the virtual registry at runtime so that an external ODBC driver can be loaded from the same directory where the package executable is located. Get path to package executable files. Origin = GetEnvironmentVariable("TS_ORIGIN")
VMware, Inc.
143