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!

kartik.vyas.1988
Posts: 1
Joined: Mon Jun 01, 2020 4:12 pm

Issue with returning Custom Action result

Hi Team,

I am newbies to the advanced installer and I've created a custom action using .net framework.

everything is working fine and user redirects to the next dialog if validation is successful written in custom action.

now, if the validation fails I want to keep user on the same dialog box. I tried all 5 possible ActionResult but not working?

Any help will be appreciated.
Attachments
ActionResult.png
ActionResult.png (28.21 KiB) Viewed 1846 times
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Issue with returning Custom Action result

Hello and welcome to Advanced Installer forums,

I am assuming that you are triggering the custom action from an UI control. In order to not advance to the next dialog, we can proceed as it follows:
  • in case of failure, we will set an installer property to a value
  • we will show the dialog based on that property
In order to get and set a property from within a custom action, please have a look over the "How to set an installer property using custom actions" article.

Let's consider the following example. In case of failure, we will set the following:

Code: Select all

MY_PROP = 1
As you can see, we have set the MY_PROP property to the value "1".

Based on this property, we will now not advanced to the next dialog. In our case, we will want to continue with the next dialog only when MY_PROP is different than "1" (because we have set it to "1" in case of a failure).

failure.png
failure.png (237.77 KiB) Viewed 1839 times
As you can see, the custom action is scheduled to execute before the "Display a specific dialog" event. The custom action will first execute and, if we are in the failure scenario, it will set the MY_PROP property to "1".

In our scenario, we want to display the next dialog only when MY_PROP propert is NOT equal to "1".

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”