Hello Patrick and welcome to Advanced Installer forums,
Is there a way that AI cancels the installation
If the prerequisite is not installed, you can cancel the main installation by going to
"Prerequisites" page --> your prerequisite -->
"Properties" tab --> under
"Options" section --> uncheck the
"Continue with main installation even if the prerequisite is not installed".
and even better, (when performing an upgrade or a fresh install) first performs a free disk space check?
This is done automatically by the
"CostInitialize" and "FIleCost" standard actions.
CostInitialize - determines the disk space required by the install process
FileCost - determines the disk space required by each file in the
"Files and Folders" page
Is there a way, when the above mentioned free hard disk space is not available ON A UPGRADE, the previous installation will not be removed/installation cancelled before uninstall?
Yes, this is possible. In order to achieve this, we can use the
"Get free disk space" custom action. This custom action retrieves the available disk space for a specific drive. The available disk size in
MegaBytes is saved in the
AI_FREE_DISK_SPACE installer property. You can use this property during installation, for example to compare it with a minimum disk size in a custom launch condition.
For instance, here is a step-by-step on how you can proceed:
1. go to
"Custom Actions" page and add the
"GetFreeDiskSpace" custom action
1.1. in the
"Disk path" field, insert the disk that you want to be checked (e.g. "C:\")
1.2. the custom action should be scheduled in the
"Wizard Dialogs Stage", before the
"Searches" action group.
1.3. under the
"Dialogs Stage Condition" section and leave only the
"Install" option checked.
2. now, as explained above, the free disk size is stored in the
"AI_FREE_DISK_SPACE" property.
3. now please go to
"Launch Conditions" page -->
"Custom" tab --> create a new launch condition which should look as it follows:
Note: the your_value value
should not be encapsulated between quotes ("")
Here is how the launch condition is working:
a) if the condition is evaluated as false, the launch condition description is triggered and the installation fails
b) if the condition is evaluated as true, the installation continues
In our case, if the free disk space < the space required, then the installation should fail.
Hope this helps.
Best regards,
Catalin
FOLLOW US
Get the latest news in Application Packaging