Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to check return value of INSTALL action


2 replies to this topic

vishnub

vishnub
  • Full Members
  • 63 posts

Posted 23 September 2009 - 15:09

Hi All,
I need to add custom message in the MSI log based on the success or failure of the installation, since the custom message is read by invoking executable to check the installation is success/failed with error/warnings.

I thought of using INSTALL standard action's return value to trace that. How can I get return value of INSTALL action in a custom action and print my custom message accordingly in the MSI log.

Thanks in advance.
Vishnu

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 24 September 2009 - 08:40

A custom action can add messages to the log file with MsiProcessMessaage - it's one of the options.

But a custom action cannot predict what the result of its calling installation will be. Instead you should write a replacement for Setup.exe, something like this:

(update Windows Installer if required) (reboot if necessary)
(install prerequisites) (reboot if necessary)
MsiEnableLog (if you need a log)
MsiInstallProduct
Save the result of MsiInstallProduct somewhere
Reboot if the result of MsiInstallProduct tells you so

BTW, you may like to consider this: if the install fails, everything installed will be removed - no program will be left to read the log file.

vishnub

vishnub
  • Full Members
  • 63 posts

Posted 24 September 2009 - 14:26

Thanks for the reply.
I got it worked with help of a suggestion from one of the forums.

Created a VB custom action to write custom message to MSI log and sequenced CA as -1 (same as SetupCompleteSuccess). This message will be written to the log only if the installation is successful.