Lolico
Posts: 2
Joined: Tue Jul 27, 2021 4:08 am

How to add conditions when selecting a directory

Tue Jul 27, 2021 4:12 am

How to add conditions when selecting a directory?
How do I add a conditional judgment when the user selects the installation directory? For example, the default is D:\, but when he does not exist, select the system disk

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

Re: How to add conditions when selecting a directory

Tue Jul 27, 2021 10:46 am

Hello and welcome to our forums,

If I understand your concern right, the desired condition can be achieved by following next steps:

1. Navigate to "Properties" page and add a New Property like this:
  • Name: CUSTOM_DIR
    Value: D:\
2. Go to "Install Parameters" page, "Installation Folder" section and set the "Application folder" filed like this:

Code: Select all

[CUSTOM_DIR][Manufacturer]\[ProductName]
3. Navigate to "Search" page and add a New Search with Name: DRIVE_SEARCH
4. Press the [Add Search Location] button from the ribbon and choose "Folder" then set the Path: D:\
5. Open "Custom Actions" page and add a "Set Installer property" action with sequence after "Searches" action group from "Wizard Dialogs Stage" like this:
  • Property: APPDIR
    Value: [WindowsVolume][Manufacturer]\[ProductName]
    Condition: NOT DRIVE_SEARCH
This way the installer will search for drive D:\ in user's machine, if it will be found the installation path will be D:\Your Company\Your Application , otherwise it will be C:\Your Company\Your Application

Please tell me if this solution solves your request, otherwise please send us your .AIP (setup project) file by email at support at advancedinstaller dot com and few more details about the behavior you want to implement (maybe exemplify with more details) and we will try to help!

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

Return to “Building Installers”