I am trying to apply the path manipulation function but am only partially successful at getting it right.
Path Manipulation
I can write a single path or several without a problem. Here's the kicker. I noticed upon updating a test installer, the function would *not* check to see if the path already exist. It will simply append the path and it will keep doing it. e.g. If the following paths are defined during first installation...
These will simply get appended with the same path if I install again or update the installer...PATH: C:\alpha;C:\beta
Writing paths work like a charm but there is no check for duplicate paths. Is this how it is supposed to work?PATH: C:\alpha;C:\beta;C:\alpha;C:\beta
Another kicker is this. I believe I have the uninstall call correct. First I'll show my install path manipulation call, then my uninstall...
Installation
DeinstallationSection "alpha"
Push "$INSTDIR\alpha"
Call AddToPath
SectionEnd
Here's the catch with the above code. If a path variable does not exist on my system it is created "sweet". Upon Deinstallation the path value is removed but the path variable stays. In other words I have a variable "path" with no value. Is this ok?Section "Uninstall"
Push "$INSTDIR\alpha"
Call un.RemoveFromPath
SectionEnd
Remember I mentioned how an update will append the same value even though it might already exist? If e.g. C:\alpha;C:\alpha;C:\alpha; already exist but during uninstall I only call one instance of remove alpha then only one instance of the path is removed. Here is a scenario. If a user applies 3 updates, the paths keep getting appended. If the user decides to uninstall, 2 paths are left behind.
The really big quirks with the function as a whole is...
1. It doesn't check to see if a path already exist. It will append the path/s regardless.
2. If the path variable doesn't already exist it will be created along with it's value *but* deinstallation will not remove the blank path variable.
3. Uninstallation will only remove one instance and not all instances of the same path.
I would really like to apply this function but would like to learn a little more about what's going on. Can someone help me apply this function correctly?
I am WinXP.