cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How To Display Required and Available Space During Install

How To Display Required and Available Space During Install

Summary

How to display the require space for the installation and space available on a dialog box during runtime of an installer

Synopsis


This article will provide a step-by-step guide to add the required space for an installer to a dialog box during runtime.
In addition we will also show the available space on the hard drive on the same dialog box.

This process will use the Microsoft Properties:
[PrimaryVolumeSpaceRequired]
[PrimaryVolumeSpace and Available]

In addition we will also learn about the FormatSize Control attribute.

Discussion



The first step is to choose the dialog box where you would like this information displayed - for this example I have selected the "ReadyToInstall" dialog box.
On this dialog box I created 2 text boxes which are names "Text1" and "Text2". I then used the properties [PrimaryVolumeSpaceRequired] and [PrimaryVolumeSpace and Available] to populate the text value of each one:

User-added image

Next - A new Custom Action was created of type "New Set Property" type. The Property Name of this custom action was set to PRIMARYFOLDER and for this example I used INSTALDIR as the value.
The custom action was then placed in the User Interface Sequence just before PatchWelcome.

User-added image

After building and running the installer the following dialog is displayed during runtime:

User-added image

The values showing in the above dialog represent the memory sizes in units of 512 bytes. To convert these into something more useful for the user we can use the FormatSize Control Attribute.
More details regarding this can be found here.
To use the FormatSize Attribute navigate to the Direct Editor within your project and locate the Control Table, then locate "Text1" and "Text2" controls on the ReadyToInstall Dialog (these are the names given to the text boxes).

The attribute value should then be changed to 589827 to account for the FormatSize attribute.

User-added image

Now running the Install displays the following:

User-added image


This can be edited to include additional text boxes to add descriptions for these values - for example "Total Space required" etc....




Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jul 16, 2018 08:44 PM
Updated by: