Bug #7510 MySQL installer incorrectly changes path information in the registry
Submitted: 23 Dec 2004 16:06 Modified: 23 Dec 2004 16:28
Reporter: Ney André de Mello Zunino Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:4.1.8 OS:Windows (Windows XP SP2)
Assigned to: CPU Architecture:Any

[23 Dec 2004 16:06] Ney André de Mello Zunino
Description:
After installing the latest GA (Generally Available) version, 4.1.8, of the MySQL Server [1] on my Windows XP SP2 system, I noticed something strange with the PATH environment variable. Upon opening a command prompt window, I could not directly execute any of the usual applications (ipconfig, net, etc.) which reside in the Windows' subdirectories. Examining the environment variables, I noticed that the special value %SystemRoot% was not being expanded to "C:\Windows" in the path variable, as it used to.

This is due to the fact that the installer changes the type of the value "Path" under the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment in the registry, from REG_EXPAND_SZ to REG_SZ. When this happens, the system does not expand the special values in the string and thus, path entries using them no longer work. This only happens when the user leaves the checkbox for "adding the MySQL's bin directory to the path" set, in the installer.

How to repeat:
1. Open the registry editor.
2. Navigate to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
3. Make sure the "Path" value is of type REG_EXPAND_SZ; if it is not, copy the current contents of the variable, delete it and recreate it with the proper type (expandable string value).
4. Now install the MySQL Server, making sure to check the option for automatically adding the bin directory to the path.
5. Upon the end of the installation, reopen or refresh the registry editor and notice that the type of the "Path" value was reset to REG_SZ, which prevents variable expansion to take place and, therefore, disrupts the normal behavior of the command interpreter.

Suggested fix:
Fix the installer, so that when it updates the path, the *type* of the "Path" value in the above registry key remains as the appropriate REG_EXPAND_SZ.
[23 Dec 2004 16:28] MySQL Verification Team
Duplicate for #7481