The "VbsCaEntry" Command |
This command along with the "/VbsCaEntry" command are used to define a function which can be specified with the VbsCaSetup command.
This function must be defined between the VbsCa and /VbsCa commands.
If the "VbsCa" passed "Y" for the "PAUSE" command then a "CaDebugPause()" will be executed on function entry and exit.
This command takes these parameters:
Some available VBSCRIPT functions are:
You should have a look at the "custom action functions" section.
Error Handling |
The function begins with the return code already set to 0 and with "on error goto 0" to ensure that any problems are detected and reported.
If you wish to set the return code you must use the "VbsCaEntryName" macro, note that your "Entry" point has been renamed and a stub placed in front of it.
It is highly recommended that you don't use "on error resume next" in the mainline of your function, if required then I suggest you call a function which does this.
EXAMPLE |
;--- Create a VBSCRIPT and add to the binary table -------------------------- #( '<?NewLine>' #define InstallationOnTrap ;--- This code must be called to "clean up" after failed install --------- 'clean up code statement 1 'clean up code statement 2 'clean up code statement 3 #) <$VbsCa Binary="TEST.vbs"> <$VbsCaEntry "Install" OnTrap="<$InstallationOnTrap>"> ;--- Do something ---------------------------------------------------- UserFunction("Called during Install...") ;--- Set the return code --------------------------------------------- '<$VbsCaEntryName> = 1603 ;;Error Return code <$/VbsCaEntry> <$VbsCaEntry "UnInstall"> ;--- Do something ---------------------------------------------------- UserFunction("Called during UNInstall...") <$/VbsCaEntry> '======================= sub UserFunction(Text) '======================= CaMsgBox "I", Text end sub <$/VbsCa> ;--- Call the above script during install and uninstall --------------------- <$VbsCaSetup Binary="TEST.vbs" Entry="Install" Seq="InstallFiles-" CONDITION=^<$CONDITION_INSTALL_ONLY>^> <$VbsCaSetup Binary="TEST.vbs" Entry="UnInstall" Seq="InstallFiles-" CONDITION=^<$CONDITION_UNINSTALL_ONLY>^>