Bug #7825 Windows installer screws up the PATH environment variable.
Submitted: 12 Jan 2005 4:17 Modified: 13 Jan 2005 21:42
Reporter: David Lendrum Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:4.1.8 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[12 Jan 2005 4:17] David Lendrum
Description:
On Windows XP, the PATH variable get screwed up (doesn't expand %systemroot%) after installing MySQL 4.1.8 via the Windows Installer.

How to repeat:
I installed MySQL 4.1.8 using the Windows Installer version and used all of the default settings.  After installing, I realised I did not include the development libraries and include files, so open Control Panel, Add Remove Programs, clicked Change next to MySQL Server 4.1.  I then enabled the Developer Components for the C Include Files / Libs.  All of this went well (nice installer by the way).

After installing everything works fine on the machine, but after rebooting, and logging in again, although MySQL works ok (and most of Windows does), simply open a command prompt, type 'ping 172.0.0.1' which usually returns 4 ping requests, but now I received an 'unrecognised command'.  Typing 'set' I noticed that the path variable had the following:

PATH=%SystemRoot%\Windows32;%SystemRoot%;(more path stuff here)

This alerted me to the fact that the environment variables for the PATH had not been expanded.  Checking the registry at:
HKLM\SYSTEM\CurrentControlSet\Control\SessionManager\Environment, I noticed the PATH variable was of type REG_SZ whereas it was of type RG_EXPAND_SZ before installing MySQL 4.1.

I installed this on numersous machines (all Windows XP + SP2 + latest fixes) and all were effected.

Suggested fix:
To fix this, I renamed PATH to PATHOLD, created a new value of type REG_EXPAND_SZ called PATH, copied the data from PATHOLD to PATH and then deleted PATHOLD.  Changes are not effective until a reboot.  After the reboot all is well.

Change the Windows Installer version, so that when changing the PATH variable via the installer, make sure the type you are using is REG_EXPAND_SZ and not REG_SZ.
[12 Jan 2005 4:18] David Lendrum
Typo in the ping quote above - should be 'ping 127.0.0.1'. (Not relevant really as the ping program does not get found).
[13 Jan 2005 21:42] MySQL Verification Team
Duplicate for #7710