I have created a very simple installation (Enterprise) that uses [APPDIR] to create a system variable. If the user leaves this path as default during installation, the system variable is removed at uninstall time. However, if the user modifies the default path, the system variable does not get deleted during uninstall.
I've tested the scenario and replicated the behavior. This happens due to an Advanced Installer issue. When no file is added under "Application Folder" APPDIR directory in "Files and Folders" page the APPDIR property will be resolved on uninstall to its default location from the project and not to the one set by the user at install time. Thus when our environment variable support check, at uninstall time, the value of the installed env var it will see it has a different value than the current value APPDIR is expanded to. Thus it will skip the env var removal.
During an uninstall the setup package will remove only what it added. If a value was appended to an existing environment variable, only that value will be removed (not the entire variable).
A fix for this issue will be available in the future and when so, we will update this thread. Until then as a workaround you should just add a small file under "Application Folder" directory in "Files and Folders" page.
From what I can see in our bug tracking tool, this was a design issue that couldn't really be fixed.
However, an easy workaround for this would be right clicking on the "Application Folder" --> "Properties" --> checking the "Create folder on target machine" option.
On the newer versions of Advanced Installer, this option is checked by default.