How NOT to remove an environment variable in an MSI Installer during the uninstall?

Viewed 47

I created an MSI Installer with Microsoft Visual Studio Installer Projects. During the installation process the user specifies a path for an environment variable to the registry. My problem is that the installer removes it automatically during the uninstall process. How could I achieve that it will not be removed? (Because I need this environmental variable for other programs)

The folder that stores the variable:

The variable itself:

enter image description here

I tried to make a copy of the variable in the BeforeUninstall event and then in the AfterInstall event set the variable again. But it did not work because I still have the environmental variable in the afterInstall event and after the installer quits the variable is gone.

0 Answers
Related