cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anom217
Level 8

Enviroment variable not being deleted

I am working on a Basic MSI project and in the Environment Variables view I have an environment variable that needs to be created. I set the On Install value to Create, Placement to Replace, and On Uninstall to Remove. But after the uninstall the environment variable is still there! According to the documentation, the entire environment variable should be deleted during an uninstall. I checked the MSI log and see that the RemoveEnvironmentStrings action is being run successfully, but the env var isn't being deleted. Anyone have any idea why this isn't working? Thanks.
Labels (1)
0 Kudos
(4) Replies
Christopher_Pai
Level 16

Uninstall really refers to the component that it belongs to not the installer is a whole. Check the log to see what the action state of the relevant component is and then trouble shoot why MSI is leaving that component installed.
0 Kudos
anom217
Level 8

I checked the log and for the component after running an uninstall and it says:

Component: Base; Installed: Absent; Request: Local; Action: Local

The folders get uninstalled, so why is the environment variable being left alone?
0 Kudos
Christopher_Pai
Level 16

The component requested removal but it is not being removed because the action state is local. If it was going to be removed it would have an action state of null.

What is the keyfile of the component? Is the component marked perm?
0 Kudos
anom217
Level 8

The condition is not set to Permanent. There is no keyfile, I actually only have empty folders because I'm using a CA to unzip resources which are copied over to the folder structure after it's created. There are certain requirements so I have to do it this way.

I did try setting a text file as the key file for the component, and it gets installed/uninstalled, but the MSI log file has the same entry for the component, and the env var doesn't get deleted. REMOVE = "ALL", so all the components should be getting deleted, right? All the empty folders are correctly uninstalled.
0 Kudos