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!

Yunukas
Posts: 1
Joined: Wed Jan 08, 2020 1:25 am

Create folder conditionally

Hi,

I am trying to create some folder(s) based on the selections on wizard menus. Getting the selections and properties are OK but just couldn't find a way to create the folders conditionally. When I create property based folders on "files and folders" page, the folders always get created. But this is not what I want.

Right now as a temporary solution, I am using a custom action to create the folders at the end of the installation. However this way, when I uninstall the application, those folders will remain.

There must be an easy way to do this but still couldnt figure out.

Thanks in advance
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Create folder conditionally

Hello and welcome to Advanced Installer forums,

The custom action approach also works, but indeed, as you have mentioned, there is an easier solution for that.

When adding a new folder in the "Files and Folders" page, a new component is created in the "Organization" page. For instance, let's consider we have the following property

Name: MY_PROP
Value: C:\Program Files (x86)\MyFolder


Upon creating a property based folder using that property, the name of the folder in the "Files and Folders" page will be "MY_PROP".

By going to "Organization" page, you can notice that there is a component created with the exact same name. If you select it, you will be able to see that there is a "Condition" field in which you can condition the installation of that component (basically condition if it is either created or not).

Hope this helps.

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

Return to “Building Installers”