5.0

Table Of Contents
VMware, Inc. 77
Chapter 8 Creating ThinApp Scripts
4Addtheinformationinthesystemregistry.
RegEditPid = ExecuteExternalProcess("regedit /s " & chr(34) & RegFileName & chr(34))
WaitForProcess RegEditPid, 0
Waituntiltheprocessiscomplete.
5Cleantheenvironment.
fso.DeleteFile(RegFileName)
End Function
API Functions
YoucanuseAPIfunctionsthatinstructThinApptocompleteoperationssuchasloadDLLsasvirtualDLLs,
convertpathsfrommacroformattosystemformat,andruncommandsinsideofthevirtualenvironment.
AddForcedVirtualLoadPath
TheAddForcedVirtualLoadPath(Path)functioninstructsThinApptoloadallDLLsfromthespecifiedpath
asvirtualDLLseveniftheyarenotlocatedinthepackage.
UsethisfunctioniftheapplicationneedstoloadexternalDLLsthatdependonDLLslocatedinsidethe
package.
YoucanusetheForcedVirtualLoadPathsparameterinthe
Package.inifiletoachievethesameresultas
thisAPIfunction.Formoreinformationabout“ForcedVirtualLoadPaths”seeThinAppPackage.iniParamer
ReferenceGudie.
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)
ThisprocessenablesyoutodropadditionalfilesintheSourcePathtreeandhavethemresolveimport
operationsagainstvirtualDLLs.
ExitProcess
TheExitProcessExitCodefunctionquitsthecurrentprocessandsetsthespecifiederrorcode.
Parameters
ExitCode
[in]Theerrorcodetoset.Thisinformationmightbeavailabletoaparentprocess.Avalueof0indicatesno
error.