Here are some functions that provide a logging mechanism for
your setups. They were very useful to me because they showed
me which functions I called returned an error. This is not
only useful during testing, it also gives a hint on what may
have failed during the setup on the custumers machine.
You specify the function calls that are logged (use
AddToLog ()) and at the end of your setup all the errors are
written to a file (see WriteLog ()).


Here is how I logged my setup:

program
  if (PrepareLog () < 0) then
    goto end_program;
  endif;

  if (CheckRequirements () < 0) then
    goto end_install;
  endif;

  if (ShowDialogs () < 0) then
    goto end_install;
  endif;

  //everything else you have to do (DataMove etc.)

end_install:
  WriteLog ();
  DestroyLog ();

  //everything else to normally end your setup

end_program:
  if (TRUE) then endif; //dummy action to prevent compiler error

endprogram


Example of a logging call:
  nResult = DeinstallStart (<your parameters>);
  AddToLog ("DeinstallStart ()", nResult);