\
Source Code
VBSCRIPT
Custom Action Functions
VbsCaCadGetValidate()
This optional function can be used in any generated vbscript custom actions. It can be included or excluded (to save space if not required).
It is included by default, to changes this: - Set the default value to "Y" or "N" on "VBSCA_WANT_VbsCaCadGetValidate".
- Use the "Optcode" parameter on a custom action to override on individual custom actions.
- Redefine the default value for the custom action's "OptCode" parameter (probably in a common header file).
The VbsCaCadGetVbsCaCadGet()
function can be used to retrieve values (see it for more detail) however
the "VbsCaCadGetValidate()" version also performs some validation of the
returned value.
The function takes these parameters:
- The name of a parameter (the first column in the "#data" structure).
The name must be in the exact same case as used on the definition.
- The validation type.
Some types may take parameters if so you may supply this after the
optional ":" character which should follow the type
("Type:parameters").
The available validation types are:
- FILE
Any "\\" sequences are replaced by "\" (user error).
The resulting value must be the name of an existing file.
- DIR
Any "\\" sequences are replaced by "\" (user error).
The resulting value must be the name of an existing directory.
If parameters are passed on a validation type which doesn't require them
then an error is generated.
#data "ConfigData"
"ExistingFile" "c:\tmp\\1.x"
"ExistingDir" "c:\tmp\\"
"InvalidType" "InvalidTypeValue"
#data
<$VbsCa Binary="TestVbsCaCadGetValidate.vbs" data="ConfigData">
<$VbsCaEntry "Test">
dim Val
Val = VbsCaCadGetValidate("ExistingFile", "file")
Val = VbsCaCadGetValidate("ExistingDir", "dir")
Val = VbsCaCadGetValidate("InvalidType", "xxx:yyy")
<$/VbsCaEntry>
<$/VbsCa>
<$VbsCaSetup Binary="TestVbsCaCadGetValidate.vbs" Entry="Test" Seq="InstallInitialize-" SeqTable="InstallExecuteSequence" CONDITION=^<$VBSCA_CONDITION_INSTALL_ONLY>^ data="ConfigData">