Where does the return value of the function go? - Advanced Installer Community
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Where does the return value of the function go?

Hello,

I am using the custom action "Call Function From Attached Native DLL". I have called the function. I take it Action Data is where you need to give the passing parameter of the function. This function returns a value. Where does this value is stored please?

:?:
K
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Where does the return value of the function go?

Hello,

You can't access the exit value of the custom action because Windows Installer doesn't save it, it just interprets it. If the value returned is different from '0' the installation will fail. A list of exit codes can be found in "Logging of Action Return Values" article.

As a workaround you can use an installer property in which you can store the exit code. You can check the "Set an installer property using custom actions" and "Integrate and debug custom actions" which show you how to set an installer property.

Please note that properties can be accessed and set only by the immediate custom action. So, it's necessarily that you set "Execution Time" of your custom action as "Immediately" .

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Where does the return value of the function go?

Thank you. Is there a way for the installer to get the return value from the DLL please?
K
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Where does the return value of the function go?

No, if you want to access the DLL return value from your installer, then the solution will be to set from your DLL code an installer property with the exit code (when DLL exits) and you can further on access the property value from your installation setup.

If you have any further questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Where does the return value of the function go?

You're always welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”