VLogic
26th January 2004 02:26 UTC
Search path from CD
Hi. I'm sure someone has encountered this problem and can solve it easily.
My installation script requires determining if MySQL is installed. Using the script instruction...
SearchPath <variable> "\mysql\bin",
...I have been able to detect the installation path, if the installer is executed from the hard drive I'm installing on. If the same is from CD, the installer fails to find the path.
Can anyone tell me why it doesn't work the same, and how to accomplish it?
Thank you for your help.
rjstephens
26th January 2004 02:31 UTC
most likely the reason it doesn't work is because the installer is searching for the MySQL path on the CD.
You are much better off checking the registry to see if MySQL is installed and what path it is installed in. If you search for the path, you stand a good chance of recieving both false positives and false negatives.
kichik
26th January 2004 04:14 UTC
SearchPath searches for a file. For example:
SearchPath $0 mysql.exe
But as rjstephens said, you're probably better off reading the registry with ReadRegStr and friends than searching the path.
VLogic
26th January 2004 16:51 UTC
Thank you all for your feedback. Unfortunately, I can't find any registry entry to look for. That's why I tried SearchPath to begin with.
Spatacoli
26th January 2004 20:38 UTC
MySQL should insert a my.ini file in your Windows directory. This usually lists the path to the base dir, from there mysql.exe is usually in the bin dir. This is true for 3.23.x, I'm not sure about newer versions. then do:
ReadINIStr $1 "$WINDIR\my.ini" "mysqld" "basedir"
and start your search from there.
VLogic
27th January 2004 00:52 UTC
Of course! The my.ini file!! Why didn't I think of that. Thanks, Spatacoli. I'm off and running again.