Oleksandr
Posts: 15
Joined: Tue Dec 04, 2012 11:09 am

Display dialog based on the result of custom action value

Dear Support,

I am stuck with the following problem:
I need either to display or to hide installation dialog if a particular database exists (MS SQL Server database) or not.
Thus I need to query MS SQL server for database existence prior displaying this dialog.
I thought there is some custom action allowing to do that, but couldn't find.
Then I implemented simple custom action (.NET installer class) and added it as (call native DLL custom action), but it doesn't work.
Could you please let me know if there is any way how to check for database existence in general or how I can implement my own custom action doing that?
Unfortunately, VBScript custom action isn't allowed to use in our project.
Looking forward to the reply.
Thank you.

Kind regards,
Oleksandr
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Display dialog based on the result of custom action valu

Hi Oleksandr,

In order to create a native DLL custom action, you can follow our How do I create fully fledged C# custom actions? article. You can also take a look on the launch attached file: DLL, but needed before install thread which debates a similar problem.

Then, you can go in the Dialogs page, right-click on the dialog you want to set a condition for and select "Show only if..." from the context menu. In the newly appeared dialog, you can set the property returned by your custom action as a condition for your dialog by writing it in the "Expression" text field.

Let us know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Oleksandr
Posts: 15
Joined: Tue Dec 04, 2012 11:09 am

Re: Display dialog based on the result of custom action valu

Hi Eusebiu,

Thank you for the reply.
The approach works perfectly.

Regards,
Oleksandr
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Display dialog based on the result of custom action valu

You're welcome Oleksandr. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”