Right now, I can add an environmental variable on install with the Environment tag in WiX. Here's an example:
<Environment Id="LibPath"
Action="set"
Name="PATH"
Part="last"
Separator=";"
System="yes"
Value="[INSTALLDIR]" />
However, sometimes, the environmental variable has already been installed on the client. In this case, that environmental variable must remain upon uninstall. However, if they did not have it already, we do want to remove it. After looking over the wix documentation for Environment, I'm not sure this is possible. It looks like I have two options:
- Leave the environmental variable polluting the name space, every time, on uninstall.
- Uninstall the variable, no matter what, even if I didn't install it.
Is this the case, or am I missing something? I've been looking, but it seems you either get the option to pollute, or remove always. Neither seems like the right solution.