DotNet framework installation and Low disk space - Advanced Installer Community
@patricksoundware
Posts: 2
Joined: Wed Sep 18, 2019 8:29 am

DotNet framework installation and Low disk space

Hello,

Our installation contains a prerequisite of DotNet Framework 4.5.2.
This prerequisite is packed into the installer (no download needed).
The free hard drive space is around 1Gb where the framework requires around 2.8Gb.
Apparently the installation DotNet Framework fails, but AI continues with the installation and gives a message that the installation succeeded.

Is there a way that AI cancels the installation, and even better, (when performing an upgrade or a fresh install) first performs a free disk space check?
Is there a way to do multiple checks, like :
  • when DotNet needs to be installed, 3Gb free space is required
  • when only our software needs to be installed, 250Mb free space is required
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?

Grtz Patrick
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: DotNet framework installation and Low disk space

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:

Code: Select all

AI_FREE_DISK_SPACE < your_value
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
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
@patricksoundware
Posts: 2
Joined: Wed Sep 18, 2019 8:29 am

Re: DotNet framework installation and Low disk space

Hi Catalin,

Thanks for your quick response.
I am going check out your suggestions.

Grtz Patrick
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: DotNet framework installation and Low disk space

You are always welcome, Patrick.

Let me know if it helps.

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

Return to “Common Problems”