MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: /VbsCa[Next]: VbsCaEntryName
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->VbsCaEntry

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:

  1. VbsCaCadGet
  2. VbsCaCadGetValidate
  3. VbsCaCadReplace
  4. CaDebug
  5. CaDebugPause
  6. CaGetEnv
  7. CaMsgBox
  8. VbsCaPropertyGet
  9. VbsCaRaiseError

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>^>


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: /VbsCa[Next]: VbsCaEntryName


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.