4.0.4

Table Of Contents
VMware, Inc. 111
Appendix E ThinApp Scripts
4Entertheinformationinthesystemregistry.
RegEditPid = ExecuteExternalProcess("regedit /s " and chr(34) and RegFileName and chr(34))
WaitForProcess RegEditPid, 0
Waituntiltheprocessiscomplete.
5Cleantheenvironment.
fso.DeleteFile(RegFileName)
End Function
API Functions
YoucanuseAPIfunctionsthatinstructThinApptocompleteoperationssuchasloadDLLsasvirtualDLLS,
convertpathsfrommacroformattosystemformat,andruncommandsinsideofthevirtualenvironment.
AddForcedVirtualLoadPath
TheAddForcedVirtualLoadPath(Path)functioninstructsThinApptoloadallDLLsfromthespecifiedpath
asvirtualDLLseveniftheyarenotlocatedinthepackage.
UsethisfunctioniftheapplicationneedstoloadexternalDLLsthatdependonDLLslocatedinsidethe
package.
Parameters
Path
[in]ThefilenameorpathforDLLstoloadasvirtual.
Examples
YoucanloadanyDLLlocatedinthesamedirectoryastheexecutablefileasavirtualDLL.
Origin = GetEnvironmentVariable("TS_ORIGIN")
TS_ORIGINisthepathfromwhichtheexecutablefileisrunning.
YoucandeletethefilenamefromTS_ORIGINbyfindingthelastbackslashandremovingallofthecharacters
thatfollowit.
LastSlash = InStrRev(Origin, "\")
SourcePath = Left(Origin, LastSlash)
YoucaninstructThinApptoloadallDLLsinthesameorlowerdirectoryfromwherethesourceexecutable
fileresides.
AddForcedVirtualLoadPath(SourcePath)
ThisprocessallowsyoutodropadditionalfilesintheSourcePathtreeandhavethemresolveimport
operationsagainstvirtualDLLs.
ExitProcess
TheExitProcessExitCodefunctionquitsthecurrentprocessandsetsthespecifiederrorcode.
Parameters
ExitCode
[in]Theerrorcodetoset.Thisinformationmightbeavailabletoaparentprocess.Avalueof0indicatesno
error.