Condition to skip feature when low diskspace
I try to create a msi-setup with Wise Installation Express 7. It has two features, no select feature dialog.
One feature, which is very small, should always be installed. The other must not be installed when the available diskspace on drive c: is below 500MB.
I thought to achieve this easily by adding a condition in Installation Expert | Features. I added conditions like "PrimaryVolumeSpaceAvailable > 500000000" to the relevant feature.
I tried a lot and played with different conditions, unfortunately nothing works. The feature will always be installed.
As an alternative I tried in vain to use the select feature dialog and have my feature grayed out automatically when the diskapace is low.
How can a feature's installation automatically depend on the free diskspace?
Any help would be appreciated.
Comments
The installation of features
The installation of features can be controlled by the INSTALLLEVEL property.
So you could set the level of the small feature to 3 and the large feature to 5, with INSTALLLEVEL set to 5 in the property table.
Then you have a "Set Property" custom action which sets the INSTALLLEVEL to 4, with a condition on it that is based on PrimaryVolumeSpaceAvailable < 1024000 (the units of PrimaryVolumeSpaceAvailable are 512 byte chunks, and not single bytes as you put in your posting).
When this condition is true, ie the space on the volume is less than 1024000 x 512 bytes, then the custom action runs, sets the INSTALLLEVEL to 4, and therefore your large feature is not installed.
You should place the custom action in the InstallExecute sequence before InstallInitialize.
You also need to set ROOTDRIVE = C:\ in your property table, assuming you always want to perform the install to C:\ otherwise windows installer will (by default) install to the largest local partition available.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Thank you very much EdT for
Thank you very much EdT for explaining to me in detail how to use the INSTALLLEVEL property to solve my problem. I just tested a little bit and your solution seems to work fine!
Special thanks for pointing out that the unit of PrimaryVolumeSpaceAvailable is not single bytes but 512-byte-chunks, I never would have found that out ...
Set up a Quicklaunch link...
...to the help file MSI.CHM (This is the windows installer SDK help file from Microsoft, also installed by Wise)
This file has the information you need - just look up PrimaryVolumeSpaceAvailable and you will see all the relevant information you need.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Would you like to reply?
Login or Register to post your comment.