Collecting return code from Custom Action Executable? - Advanced Installer Community
mcseforsale
Posts: 57
Joined: Wed Mar 27, 2013 10:53 pm

Collecting return code from Custom Action Executable?

I'd like to be able to collect the return code from an executable launched from a custom action into a property. Is this possible?

Thanks,
Andy
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Collecting return code from Custom Action Executable?

Hi Andy,

Please note that you cannot set a property from an .EXE custom action. Also, custom actions that are executable files must return a value of 0 for success. The installer interprets any other return value as failure.

You can try to create your .EXE custom action as a .DLL custom action. For details, please take a look on the How to integrate and debug custom actions? article.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mcseforsale
Posts: 57
Joined: Wed Mar 27, 2013 10:53 pm

Re: Collecting return code from Custom Action Executable?

Thanks! Our particular executable will identify if any version of Firefox is installed on the client, and set the return to 0 for any version and another number for none installed. Can I action off this return of 0? I guess I don't necessarily need to get it as a property, I just need to be able to action off it's return success.

Thanks!
AJ
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Collecting return code from Custom Action Executable?

Hi Aj,

Yes, this should work. However, the error that the user will get is not very friendly or meaningful (see below):
Return code.png
Return code.png (7.57 KiB) Viewed 3819 times
I strongly recommend you the .DLL approach as explain in the How to integrate and debug custom actions? article. For example, you can create your custom action as a custom action written in C# or a custom action written in C++

If you need any help, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”