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]: CaCreateFolder()[Next]: CaDebugPause()
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->VBSCRIPT->Custom Action Functions->CaDebug()

CaDebug()

This function can be used in any generated jscript or vbscript custom actions.

This function can update line 1 and 2 of the progress bar. It always updates any verbose log you may have set up and optionally creates/updates a separate text log file. It also echos the message to the console if being tested via cscript.

The function takes these parameters:

  1. To Progess Bar?
    More details below but in summary:

  2. The text of the message.

The subroutine "VbsCaLogInc" can be used to incement and decrement the indenting level in the log making the generated logfile much easier to read and understand, for example:

<$VbsCaEntry "Install">
   CaDebug 1, "Installing """ & AppName & """"  ;;To progress dialog and logs
   VbsCaLogInc 1
        CaDebug 1, "Installing the first bit"
        VbsCaLogInc 1
            CaDebug 1, "First part of the  the first bit"
            ...
        VbsCaLogInc -1

        CaDebug 1, "Installing the second bit"
        ...
   VbsCaLogInc -1
<$/VbsCaEntry>

On entry if "err.number" is not 0 then the "err" details are dumped as its quite possible an error has occurred. Scripts are hard to debug so this hopefully makes it easier. Any "err" state is preserved by this routine.

Log File [PARM1 = 0]

The line is written to the verbose log, it has these attributes:

Status Line 1 [PARM1 = 1]

The line is written to the verbose log, it has these attributes:

All MSI progress bars will have the capability of displaying some progress text as well as moving the "bar" (this control is called "status" in the Microsoft's "uisample.msi").

Assuming that you have the capability of displaying 2 text fields then I suggest that line 1 be used to indicate a major step is beginning and normal messages being generated to line 2 (this is also how Windows Installer does it).

This text should not be too long as the field is probably restricted in length and is the main thing the user sees. It would make sence to place a summary in "line 1" and a detailed equivalent in "line 2".

Status Line 2 [PARM1 = 2]

The line is written to the verbose log, it has these attributes:

EXAMPLE

<$VbsCaEntry "Install">
   CaDebug 1, "Installing """ & AppName & """"  ;;To progress dialog and logs
<$/VbsCaEntry>


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]: CaCreateFolder()[Next]: CaDebugPause()


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.