How do I display the component size?

Comments

1 comment

  • Avatar
    DevHopeful_2012

    You can persist the my_size variable, so that it is available in the uninstaller, using the following persist attribute:

    <setInstallerVariable name="my_size" value="${calculated_size}" persist="1"/>
    

    But, I believe that you missed the requiredSize attribute for each component. In your installation, you might want to compare something like a calculated_size to a requiredSize to see if you get the same result as the value that is set at build time.

    <setInstallerVariable name="each_component">
        <value>component(some_group).component(some_subcomponent)</value>
    </setInstallerVariable>
    <setInstallerVariable name="calculated_size" value="0"/>
    <showInfo>
        <text>The calculated size of ${${each_component}.name} is ${calculated_size}, which is not equal to the required size, ${${each_component}.requiredSize} KB.</text>
        <ruleList>
            <compareValues logic="does_not_equal">
                <value1>${calculated_size}</value1>
                <value2>${${each_component}.requiredSize}</value2>
            </compareValues>
        </ruleList>
    </showInfo>
    <showInfo>
        <text>The calculated size of ${${each_component}.name} is ${calculated_size}, which is equal to the required size, ${${each_component}.requiredSize} KB.</text>
        <ruleList>
            <compareValues logic="equals">
                <value1>${calculated_size}</value1>
                <value2>${${each_component}.requiredSize}</value2>
            </compareValues>
        </ruleList>
    </showInfo>
    

Please sign in to leave a comment.