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

Custom action exitcode


3 replies to this topic

cornel_gav

cornel_gav
  • Full Members
  • 10 posts

Posted 13 March 2008 - 09:48

I have custom actions that runs some exes where I check the exit code.
If the exit code is wrong (1 I think) the installer displays a message box informing the user that the current action finished with exit code 1.

How can I change the text displayed in the message box?
I'm using InstallShield

Thanks

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 13 March 2008 - 10:04

Ah, the joys of return values...One day, MS will standardise on return values. Quite why it decided that most functions should return 0 as success but others a non-zero value has always alluded me. Then to compound the confusion by using '1' as the success value for CAs in Windows Installer....it defies belief, it really does. Anyway....

QUOTE
How can I change the text displayed in the message box?

You can't, it's built in to the Windows Installer engine. Better to handle the error 'internally' to your CA and present your own dialog/MsgBox there (you can use the IE object to present dialogs as an alternative to MsgBox). If the return value of the CA determines some future action/inaction, set a Windows Installer property (or registry entry) accordingly.

Edited by VBScab, 13 March 2008 - 10:04.

- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 13 March 2008 - 10:39

Most, if not all, messages generated by the Windows Installer are listed in the Error table and UIText table.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 13 March 2008 - 12:38

QUOTE
Most, if not all, messages generated by the Windows Installer are listed in the Error table and UIText table.
Really? Create a guaranteed-to-fail CA (e.g. run a non-existent EXE or an EXE with an invalid argument) and see if a single sentence from either of those tables appears in the resulting dialog. Certainly some of the *common* errors appear in the Errors table (1603 and so on) and one can add the missing ones if desired.

@cornel_gav, What I think you're saying is that the *EXE* returns a non-zero value. As I mentioned, a return value of 1 from a *CA* indicates success, not failure. MS guidelines state that EXEs return zero as a success failure and anything else indicates a failure. Did you author the CA? I suspect this is a vendor MSI calling perhaps a DLL function, in which case, you're stumped and you'd be better off trying to determine why the call is failing.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.