madams
23rd July 2007 17:14 UTC
Problem Editing System Path
Hi,
I am using the Path Manipulation plugin on the main NSIS website, but whenever I try to use:
Push $antHomeDir\bin
Call AddToPath
To add the ANT bin directory to the path, nothing happens. When I use:
Push $antHomeDir
Call AddToPath
or
Push $javaHome
Call AddToPath
however, the command works perfectly. I have no idea what is going on, and would really appreciate some help.
Thanks!
p.s. I have tried quotes around $antHomeDir\bin but nothing has happened.
Red Wine
23rd July 2007 18:13 UTC
Maybe there's already one backslash at the end of $antHomeDir value, so by adding the second with \BIN causes that issue.
Try to debug your script with message boxes and remove one backslash if necessary to see if it works.
madams
23rd July 2007 18:50 UTC
I put the following message box:
Message Box MB_OK "$anthomedir\bin"
right before the Path command and got "C:\apache-ant-1.6.0\bin" as the output, which is correct. I then tried this:
Push "C:\apache-ant-1.6.0\bin"
Call AddToPath
But even that didn't work. Any other ideas?
Thanks.
kichik
23rd July 2007 19:06 UTC
Make sure the directory exists prior to adding it. AddToPath doesn't add non-existing paths.
madams
23rd July 2007 19:20 UTC
The directory does already exist before the command is called. I've even tried:
Push "PATH"
Push $antHomeDir\bin
Call AddToEnvVar
but that doesn't work either.
kichik
23rd July 2007 19:28 UTC
Then it must think the directory is already in the PATH for some reason. Are you sure it's not in the user's local PATH?
madams
23rd July 2007 19:58 UTC
Nope, its not already there. Maybe this particular plugin just doesn't like the syntax of the ANT directory...Are there any other path manipulation plugins out there that I could try?
kichik
23rd July 2007 20:06 UTC
It's not a plug-in, it's a script. You can take a look at the code and even modify it to find out where it stops.
The syntax of the directory is fine. It's perfectly normal.
The script only stops for two reasons which I've already mentioned. Maybe you're running the installer from an environment where the PATH is already set, so it doesn't add it again. You can add some debugging code to AddToPath to make sure.