I know it is not supported by default. I tried to workaround it. I calculated the size in the component's "initialization Actions", then name the component like this: "My component (${my_size} MB)". It worked well during installation, but when I uninstall an individual component, it shows ${my_size} part as undefined variable.

I couldn't find a way to set the value of ${my_size} for uninstalling an individual component. Is there a possible way to do that?


asked 08 Jun '12, 21:23

gt8967884's gravatar image

accept rate: 12%

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">
<setInstallerVariable name="calculated_size" value="0"/>
    <text>The calculated size of ${${each_component}.name} is ${calculated_size}, which is not equal to the required size, ${${each_component}.requiredSize} KB.</text>
        <compareValues logic="does_not_equal">
    <text>The calculated size of ${${each_component}.name} is ${calculated_size}, which is equal to the required size, ${${each_component}.requiredSize} KB.</text>
        <compareValues logic="equals">

answered 09 Jun '12, 01:05

DevHopeful_2012's gravatar image

accept rate: 9%

Oops...just noticed the "for an individual component" part. You can just persist the variables with unique names, such as the individual component names. Then, get their value by constructing the name with the component.name.

(09 Jun '12, 01:09) DevHopeful_2012

Thanks very much. The "persist" trick works very well.

(09 Jun '12, 19:07) gt8967884
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 08 Jun '12, 21:23

Seen: 1,280 times

Last updated: 09 Jun '12, 19:07