Is there any simple way of resetting it only if it's higher than the changed value?
There is indeed a way, but not quite "simple".
In order to achieve this, we can proceed as it follows:
- first of all, we need to give the value of the registry entry through a property.
With that being said, please go to "Properties"
page (if you are on the latest version of Advanced Installer - else go to "Install Parameters"
page) and create a property for your value, e.g.:
- in "Registry"
page, we need to give the value to our node through the above property, e.g.:
Let's say the first version is now installed. When building the second version, we would need to:
- create a registry search (in the "Search"
page) that will retrieve the raw value from our node, e.g.:
- we will then need to create a set property custom action that will set the value of our MEMORY property to the value of the search property only if the search property has a value > 4000
Basically, here is what will be happening: during the upgrade, the first thing to execute will be the search for our value. The property assigned to the search (e.g. RESULT_PROPERTY
) will have the value of the node (in our case, let's say this would be 5000 - meaning that the user manually changed it from 4000 to 5000).
After that, the "Set Property"
custom action will come into play.
In order to manipulate the value of the registry node, we will need to manipulate the value of the property that holds its' value (in our case, the MEMORY
prop) - this being the reason why I have mentioned we need to offer the value through a property (above).
Through this "Set property"
custom action, we will set the value of the MEMORY
property to the value of the search property (RESULT_PROPERTY
) only if RESULT_PROPERTY > 4000
Else, the "Set property"
custom action should no longer execute and thus the node should be reset to its normal value (i.e. 4000).
Hope this helps.