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!

ash77
Posts: 4
Joined: Mon Jun 01, 2020 7:23 pm

at can show faHelp using external DLL thilure reason and abort install

I'm trying to do something in an installer and I know how to do most of the individual pieces, but I'm uncertain how to connect them together.

In our installer I need to:
1. Display a message that we are checking system configuration (because the check can take 15 seconds or more).
2. Run either an exe or dll that performs our checks. Its output is an array of checks performed and success/failure for each.
3. If all checks succeed, just continue the install.
4. If any checks fail, display a message showing which checks failed and then abort the install.

I am writing the exe/dll so I can tailor the API as needed. For example I could return a string with a single failure message instead of an array.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: at can show faHelp using external DLL thilure reason and abort install

Hello and welcome to Advanced Installer forums,

Pretty much all you want to do can be achieved directly through the custom action.

Please allow me to elaborate:

- first of all, the custom action can be added as a custom action "without sequence". This way, we will be able to trigger the execution of our custom action from within a dialog control (e.g. the "Next" button of one of our dialogs)
1. Display a message that we are checking system configuration (because the check can take 15 seconds or more).
- this can be achieved through the custom action. You can develop the custom action to spawn a message box that will let the user know the custom action is running.
2. Run either an exe or dll that performs our checks. Its output is an array of checks performed and success/failure for each.
- as explained above, we can run this custom action when an UI control is pressed
3. If all checks succeed, just continue the install.
- the default behavior will be just this. If everything is fine within the custom action, the next dialog will be shown and the installation will continue
4. If any checks fail, display a message showing which checks failed and then abort the install.
- there are more ways to achieve this as well. One way would be to spawn the message box and fail the installation from within the custom action.

However, there is another way which I believe might be better. When a check failed, we can set a property from within our custom action and then, based on that property, spawn an error message. This can be done as it follows:

1. for more information about setting a property from within a custom action, please have a look over our "How to set an installer property using custom actions" article, which I think you may find useful.

2. for the error message, you can use the "Display error message" custom action. You can condition the spawn of this error message based on the property we have earlier set in the custom action. This custom action should, once again, be added as a custom action "without sequence".

After configuring the above, you can go to "Dialogs" page, select one of your dialogs, select the button that will trigger the custom actions and then add the custom actions under the "Published Events" tab. The events order should be as it follows:

- your custom action

- the error message (which is conditioned)

- the default "Display a specific dialog" event

Hope this helps.

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

Return to “Building Installers”