Validate selected folder - Advanced Installer Community
Tim0n
Posts: 14
Joined: Fri Sep 05, 2014 10:59 am

Validate selected folder

Hello,

I need to validate a folder that has been selected in the browsedlg e.g. the folder should contain a specific file (ini), if not i want to show a child dialog with a warning.. is this somehow feasible?

Regards,
Timon
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Validate selected folder

Hello Timon,

In order to check if the installation folder contains the specific .ini file, you can use a custom action. For example, you can create your custom action as a custom action written in C# or a custom action written in C++. If the file exist you can set a property.

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action without sequence. Add this custom action as a published event on the Next > control from the FolderDlg. Please take a look on the How do I execute a custom action when a button is pushed? article which may be useful to you.

Using the Display a specific child dialog - SpawnDialog event you can inform the user that the related folder is not valid. You can condition the execution of this event through the property that has been set in the .dll custom action.

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
Tim0n
Posts: 14
Joined: Fri Sep 05, 2014 10:59 am

Re: Validate selected folder

Alright, thanks I'll try that.

I have another related question.. I have a search, that checks for a path in the registry. Is it possible to use the result of this search in another search? I can't get this to work.. I guess you can't have a search depending on another search result?

Regards,
Timon
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Validate selected folder

Hi Timon,

I'm afraid that Windows Installer does not guarantee the searches order, so a new search should not use the result of another search.

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

Return to “Building Installers”