divyaniP
Posts: 16
Joined: Mon Dec 21, 2020 1:15 pm

Staying on same dialog after error in input from user

Tue Dec 22, 2020 2:35 pm

Hello

I use a batch file for custom action on the next button of the dialog with the help of Execute Custom Action in published events.
I check the validation of the port number in a batch file.
If there is an error with the port number, I have called the VBScript message box in the same batch file to give a warning to the user.

Now at the same time when the user gets a warning, the installer should remain on the same dialog with a cursor on the edit box of the port number. But currently, the installer goes to the next dialog.

Here are some snippets of my batch file, custom action, and VBscript message box file.

What can I do to stay on the current dialog for wrong input?
Attachments
VBscript.JPG
VBscript.JPG (16.3KiB)Viewed 16902 times
problem.png
problem.png (74.45KiB)Viewed 16902 times
Capture.JPG
Capture.JPG (79.76KiB)Viewed 16902 times

Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Staying on same dialog after error in input from user

Wed Dec 23, 2020 2:53 pm

Hello,

What you need to do is to set a property in the custom action, depending the result of the custom action. You will further use the property to conditionally displaying the next dialog.

Conditionally display the next event.PNG
Conditionally display the next event.PNG (37.3KiB)Viewed 16888 times


As long as the value of the property is not equal True, then you can display a message box to the user using our predefined Display message box custom action informing the user that the input is not correct.

Unfortunately, you cannot set a property from a batch file. In this case, you will have your custom action to a PowerShell script or full VBScript. Please check How to set an installer property using custom actions article to see the full list of custom actions that allows you to set properties.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and
I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

divyaniP
Posts: 16
Joined: Mon Dec 21, 2020 1:15 pm

Re: Staying on same dialog after error in input from user

Thu Dec 24, 2020 6:20 am

Hello Danut,

I have implemented as you have suggested in that reply and it is working as expected now.
Thanks a lot.

Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Staying on same dialog after error in input from user

Thu Dec 24, 2020 7:22 am

You're always welcome,

If you have any other questions we'll be glad to answer them.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”