VbsCaCadGet() |
This function can be called to retrieve a parameter specified with the "DATA" parameter of the "VbsCaSetup" command. It must only be used in deferred custom actions (the information is passed as "CustomActionData"). If your custom action is not deferred you would normally use "VbsCaPropertyGet" instead.
If the parameter does not exist then the function traps.
The VbsCaCadGetVbsCaCadGetValidate() function is similar but also validates the value.
The function takes a single parameter (with 3 meanings):
TEST MODE |
When testing this parameter from a command line the data will not be available and so you will be prompted for the information (for all data variables).
If you have supplied the "DATA" parameter on the "VbsCa" command then it is used to to supply the default data for the prompt. This data will not be perfect as items such as "[INSTALLDIR]" will not have been expanded.
I suggest if you are doing lots of testing that you update the initialization for VBSCRIPT variable "TestCustomActionData" before testing.
EXAMPLE |
;--- Set up the 2 parameters (CustomActionData) ----------------------------- #data "Fred" "Name1" 'Name 1 Value' ;;Parameter 1 (name + value) "Name2" "[INSTALLDIR]" ;;Parameter 2 #data ;--- Deferred Custom Action which accesses 2 passed parameters -------------- <$VbsCa Binary="TestCustomActionDataPassing.vbs" DATA="Fred"> <$VbsCaEntry "Install"> ;--- Do something ---------------------------------------------------- Show("Install: NAME1=" & VbsCaCadGet("Name1")) Show("Install: NAME2=" & VbsCaCadGet("Name2")) <$/VbsCaEntry> '======================= sub Show(Text) '======================= CaMsgBox "I", Text end sub <$/VbsCa> ;--- Set up the Deferred custom action passing the CustomActionData --------- <$VbsCaSetup Data="Fred" Binary="TestCustomActionDataPassing.vbs" Entry="Install" Seq="InstallFiles-" CONDITION=^<$CONDITION_INSTALL_ONLY>^>