Disk size calculation on different platforms

Comments

4 comments

  • Avatar
    BitRock support

    Hi Swarna,

    I've not been able to reproduce this issue. Could you tell me which IB version you are using and which platform versions you are testing it on?

    Best regards,

    Michiel

     

  • Avatar
    Hemavathy Swarna

    Hi ,

    I'm using InstallBuilder version 18.8.0
    Platform versions :
    Windows 10
    Ubuntu 18.04.1

    I created an installer using the following code snippet :

    <project>
    <shortName>Sample</shortName>
    <fullName>Sample_installer</fullName>
    <version>1.0</version>
    <debugLevel>4</debugLevel>
    <enableRollback>1</enableRollback>
    <enableTimestamp>1</enableTimestamp>
    <createOsxBundleDmg>1</createOsxBundleDmg>
    <parameterList>
    <parameterGroup>
    <name>programChoice</name>
    <title>Application selection</title>
    <explanation>Choose which application you want to install:</explanation>
    <value></value>
    <default></default>
    <parameterList>
    <booleanParameter>
    <name>Application_A</name>
    <description>Application A</description>
    <explanation></explanation>
    <value>1</value>
    <default>1</default>
    <ask>yes</ask>
    <displayStyle>checkbox-left</displayStyle>
    </booleanParameter>
    <booleanParameter>
    <name>Application_B</name>
    <description>Application B</description>
    <explanation></explanation>
    <value>1</value>
    <default>1</default>
    <ask>yes</ask>
    <displayStyle>checkbox-left</displayStyle>
    </booleanParameter>
    </parameterList>
    <validationActionList>
    <setInstallerVariable name="TotalApplicationsize" value="3000"/>
    <getFreeDiskSpace path="${installdir}" units ="MB" variable="diskSpace"/>
    <throwError>
    <text>Insufficient disk space.
    Available space : ${diskSpace} MB
    Required space : ${TotalApplicationsize} MB</text>
    <ruleList>
    <compareValues>
    <logic>less</logic>
    <value1>${diskSpace}</value1>
    <value2>${TotalApplicationsize}</value2>
    </compareValues>
    </ruleList>
    </throwError>
    </validationActionList>
    </parameterGroup>
    <directoryParameter>
    <name>installdir</name>
    <description></description>
    <explanation>Please provide installation directory </explanation>
    <value></value>
    <default>${platform_install_prefix}/Sample_installer/v1.0</default>
    <allowEmptyValue>0</allowEmptyValue>
    <mustBeWritable>0</mustBeWritable>
    <mustExist>0</mustExist>
    <width>60</width>
    </directoryParameter>
    </parameterList>
    </project>


    I tested this with a drive of free space 2.09GB in windows , it throwed the error with correct available space in MB.
    But when I tested the same with Linux platform , it throwed the error with same available space as that of windows
    which is not correct because when you right click on the drive and choose properties option in Linux , it will show a different numerical value in available/free space.The same behaviour was also observed in MAC OS.

    Thanks,
    Hema

     

     

  • Avatar
    BitRock support

    Hi Hema,

    On OS X and Linux could you check the output of the following snippet:

     <preInstallationActionList>

    <getFreeDiskSpace units="MB">
    <path>${installdir}</path>
    <variable>space</variable>
    </getFreeDiskSpace>

    <showInfo text="${space}"/>

    </preInstallationActionList>

    And then on the same platform run the following command:

    df -m

    Could you check if the number of both is the same?

    Regards,

    Michiel

     

  • Avatar
    Hemavathy Swarna

    I checked the output of the snippet on Mac and Linux , it seems that the size thrown by the snippet is similar to that of df -m

    Thanks,

    Hema

Please sign in to leave a comment.