\Windows Installer FAQ (the basics)Resource Life CycleNever Overwrite Existing Resources
|Never Overwrite Existing Resources|
The main choices are:
- The resources are members of a component, and a component has
attributes including the "NeverOverwrite" flag.
- The resources are members of a component, these have
conditions associated with them which you may be
able to set, for example you could use a custom action or
FileFind (not so easy)
commands to search for the resource and use the resulting
property in the condition.
- One or more custom actions to perform all the update and removal logic.
|EXAMPLE - Environment Variable|
<$Component "ENVVAR_SOMEVAR" Condition=^%ENVVAR_SOMEVAR = ""^ Directory_="<$AnyDir>" LM="Y">
<$Environment NAME="SOMEVAR" VALUE="[INSTALLDIR]" SYSTEM="Y">