MC06
Posts: 1
Joined: Fri Apr 27, 2018 4:21 pm

Drive Variables

I'm sure this has been covered before, and I apologize, but I haven't been able to find a post that covers it.

I'm working on an installer package that was developed long ago (in SMS Installer). On the machines this package is deployed to, there is a specific folder that is targeted for the file copy, but that folder can reside on either the C: or the D: drive. As such we created a variable that would look for the target folder on either the C: or D: drive - the target folder variable would then be used throughout the rest of the install package to copy the files to their relevant locations in the sub-directories.

My question is how can I do this in AI? Essentially all I need is a variable path that checks for C:\TargetFolder or D:\TargetFolder, then sets that as the install path variable.
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: Drive Variables

Hello and welcome to Advanced Installer forums,

In order to do that, you can use our support for "Search" and then use the property of the search, which is the search name, to create a "Property based" folder and add your files under it. After that, you can condition the install of the file components using the above search property.

These are the steps you have to follow :

1) Go to "Search" page in the left pane and click on the "New Search" button from the toolbar. Select "Search for a folder button" and give a property name (e.g. PROPERTYNAME_PROP) that you want. Enter the name of the folder you want to search for and then press "On all fixed drives" button. Press "Finish" button.

Please keep in mind that, if you know that the "TargetFolder" exists on either "C:\" or "D:\" drive, you can create two separate
searches to look in either "C:\" or "D:\" drive. In order to do this, repeat the steps from 1) and instead of selecting
"On all fixed drives", select "In a specific folder" and replace "[SystemFolder]" property with your path (e.g. C:\TargetFolder)

2) Now we have to create a "Property based" folder and add our files to it. Go to "Files and Folders" page in the left pane,
right click on "Application Folder" -> "New Folder" -> "Property Based". Select the property we defined at 1) and click "Ok".
Now add your files to the property based folder by using "Add files" button from the toolbar.

3) Go to "Organization" page from the left pane, select the component you wish to install and in the right pane type the following
in the "Condition" box :

Code: Select all

NOT PROPERTYNAME_PROP = NULL
if you have any further questions or doubts, please let us know.

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

Return to “Building Installers”