jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Conditionally adding a folder and three files

What is the best way to conditionally add a folder in three files based on a user's dialogue selection? I get kind of lost with the whole multi-feature version and I was hoping there was a simpler way.

Basically, the user selects whether or not they want the installer to create the database automatically or dump the database files to a folder that they specified. The user selects to locations, where they want the application to be installed and, if they select the correct option, they will be asked where they want to database files placed. I just can't find where I can conditionally set where a folder is created or not based on a dialogue property.

Under the SetupOptions dialog, if they select "Extract files and bypass database setup" they skip over the SQLConnection and SystemType dialogs and go directly to the FolderDlg and then SQLDataFiles dialogs where they select where they want the application and database files put. I followed one of your examples on how to browse for different folders (browseforfolder.zip) and got that working, but I can't find if there is a way to conditionally have that folder created if the Condition SETUP_OPTIONS = 3 is met.

Any ideas would be greatly appreciated.
Attachments
Tracker-3.0.1.aip
(90.92 KiB) Downloaded 765 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Conditionally adding a folder and three files

Hello,

You can condition the DB_SCRIPT_DIRECTORY component associated with your property based directory from the Organization page.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Re: Conditionally adding a folder and three files

How do I do that when DB_SCRIPT_DIRECTORY is not under my Install feature. I don't see also how I can add it without creating in as a feature
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Conditionally adding a folder and three files

Hi,

Please note that the Mihai said you should condition the component, not create a new feature. Simply select the desired component in the Organization page.
In the rights side you will view the "Component Properties" page, here you can find the field "Condition" in which you can place the desired condition.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Re: Conditionally adding a folder and three files

I've never really gotten this to work properly. I have the condition for DB_SCRIPT_DIRECTORY component to only be installed when SETUP_OPTIONS = 3, but even when SETUP_OPTIONS is set to 1, the DB_SCRIPT_DIRECTORY is still created. I have even gone so far as to create a VBScript that deletes that folder which it will not delete.
Attachments
Tracker-3.1.3.zip
(27.53 KiB) Downloaded 439 times
jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Re: Conditionally adding a folder and three files

Any movement on this would be greatly appreciated.
jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Re: Conditionally adding a folder and three files

By creating DB_SCRIPT_DIRECTORY's condition, it still creates the directory and adds the file. I notice that DB_SCRIPT_DIRECTORY value is always, at least, the SaveSQLFiles dialog's FolderEdit value. This is assigned whether the user gets to this dialogue or not, therefore the folder and file are created. DB_SCRIPT_DIRECTORY, is a feature that is, by a condition, installed. If the condition is SET_OPTION = 3 is met the feature is installed, however, this feature is always installed.

I created a script, that works as a workaround, that runs when the "Finish" button is pushed that is supposed to delete DB_SCRIPT_DIRECTORY, it deletes everything inside the folder, but not the DB_SCRIPT_DIRECTORY folder.

Jim
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Conditionally adding a folder and three files

Hello Jim,

I'm not sure why this happens. Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

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

Return to “Common Problems”