stdDllWrapper.dll custom actions and return codes - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

todd.throne
Posts: 11
Joined: Tue Jan 18, 2011 6:48 pm

stdDllWrapper.dll custom actions and return codes

I have several custom actions that run during install via a stdDllWrapper.dll custom action. If I get an error during the custom action I don't seem to be able to effect the installation success/failure by returning an error code from my custom action. Is there something else I'm suppose to do like set a particular property or somehow trigger the stdDllWrapper.dll to return my error. All I really want is for the install to fail if my custom action fails.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: stdDllWrapper.dll custom actions and return codes

Hello and welcome to the Advanced Installer Forums,

If you want to stop the installation from within your DLL function called through our "Call a function from a standard dll" predefined custom action, you can set a public property from the return value of your function. Once the property is set you can use it to condition an Error Message custom action.

This way and error message will pop up and the installation will rollback. You should place the Error Message custom action right after the Call a function from a standard dll predefined custom action in the install sequence from the Custom Actions page.

The "Call a function from a standard dll" predefined custom action has a success return code if the function from the DLL was successfully called and an error return code in any other situation. If the called function throws an exception, Windows Installer catches it and does a rollback to the installation( error return code behavior ).

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
todd.throne
Posts: 11
Joined: Tue Jan 18, 2011 6:48 pm

Re: stdDllWrapper.dll custom actions and return codes

Hi Mihai,

I followed your first suggestion;

>If you want to stop the installation from within your DLL function called through our "Call a function from a standard dll" predefined custom action, >you can set a public property from the return value of your function. Once the property is set you can use it to condition an Error Message custom >action.

>This way and error message will pop up and the installation will rollback. You should place the Error Message custom action right after the Call a >function from a standard dll predefined custom action in the install sequence from the Custom Actions page.

I see the Error Message dialog and the install says it didn't install successfully but my Rollback custom action doesn't get called afterwards so everything is not uninstalled properly. My Rollback custom action is another stdDllWrapper.dll custom action and has no Execution Condition, is there a way to get this Rollback custom action to run?

Thanks
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: stdDllWrapper.dll custom actions and return codes

Hi Todd,

Please note that a rollback custom action must have its execution option set to "Rollback" or "Rollback with no impersonation" and must be sequenced before the custom action you want reverted.
Also, a rollback can be triggered only by a custom action scheduled between "InstallInitialize" and "InstallFinalize" standard actions.

If you already have these settings, please send us the .AIP (project) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”