9eller
Posts: 1
Joined: Mon Sep 24, 2012 8:53 am

Validate Folder path?

I need my installer to specify a folder path and validate that not root drive is specifyed..
e.g.
C:\Folder\ - Allowed
C:\Folder\Subfolder\ - Allowed
C:\ - Not Allowed

I have made a custom action with the following VB script and attached it to dialog next button:

Path=Session.Property("REPOSITORY_FOLDER") : If Len(Path)<4 Then MsgBox("Please specify folder")

But how do I prevent that the wizard continues if Path not longer than 4 chars.?
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Validate Folder path?

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can set an installer property (i.e. MY_PROP), inside your custom action, with "true" if the related path contains more than four characters and with "false" otherwise. Then you can add a "Display a child dialog while a condition is true" published event which will notify the users with a message, on [Next>] button, like this:
  • Name: Display a specific child dialog
    Argument: <NewDialog>
    Condition: MY_PROP = "false"
Please keep in mind that "Display a specific child dialog" control event must be scheduled as latest control event in the "Published Events" tab.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”