
Workstation User’s Manual
424 VMware, Inc.
Writing Plug-In Policy Scripts
YoucanwritescriptstocontrolcertainpoliciesinVMwarePlayer.Youmayuseany
languagethatissupportedontheuser’scomputer.
Forsecurityreasons,scriptsmustbedeployedaspartofapackageandinstalledbythe
packageinstaller.Userscannotmodifythesescripts.
Whenscriptsrun,theymustwritethea
ppropriateval
uestotheStdOut file.Outputto
theStdOutfilemightbeupto4096byteslong.
PlaceanyscriptsyouwanttouseforapackageintheACE Resourcesdirectoryinthe
virtualmachinedirectory.DonotplacetheminasubdirectoryoftheACE Resources
directory.Ifthesc
riptsneedanyadditionalresourcefiles,placethosefilesinthemain
ACE Resourcesdirectory.Makesurethescriptusesrelativepathstoreferencethose
resources.
ScriptscanalsowritemessagestotheStdErrfile.OutputtotheStdErrfilemaybeup
to4096byteslong.AnymessagesgeneratedontheStdErrfilearecapturedinth
elog
fileontheenduser’smachineatthefollowinglocation:
<UserAppData>\VMware\VMware ACE\<package_name>\Virtual
Machines\<VM_name>\vmware.log
Theexitcodeofascriptindicateswhetherthescriptsucceededorfailed.
Table 19‐1describestheenvironmentvariablessetinthescriptexecutionenvironment.
AllscriptsruneachtimetheenduserstartsVMwarePlayerorresetsthevirtual
machine.Somemightrunmoreoften.Forexample,anexpirationscriptisrunevery24
hours.
Thesam
plescriptspresentedin“ExamplesofPolicyScripts”onpage 425areinstalled
withVMwarePlayerinthefollowinglocation:
C:\Program Files\VMware\VMware Player\Samples
Thetopicsthatfollowshowtheformatfortheoutputthatyourscriptsmustwritetothe
StdOutfiletocontrolvariouspolicies.
Table 19-1. Environment Variables
Variable Description
VMWARE_MASTER_ID TheIDoftheACE‐enabledvirtualmachine(ACEmaster).
VMWARE_PACKAGE_ID TheIDofthepackagethevirtualmachinewasinstantiated
from.
VMWARE_INSTANCE_ID ABooleanvaluethatissettoTRUEthefirsttimethevirtual
machineispoweredon.Otherwise,itissettoFALSE.
Comentarios a estos manuales