Bug #55493 Installer Issues: Expecting Machine.Config to Exist
Submitted: 23 Jul 2010 1:48 Modified: 23 Jul 2010 9:58
Reporter: chris myers Email Updates:
Status: Duplicate Impact on me:
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.3.2 Beta OS:Microsoft Windows
Assigned to: CPU Architecture:Any

[23 Jul 2010 1:48] chris myers
Installer fails at the portion where the machine configs are updated if a directory resides in "C:\Windows\Microsoft.NET\Framework\" which does not contain "CONFIG\machine.config".

For example, my computer has a folder named "Old_v4.0.21006" that resides in C:\Windows\Microsoft.NET\Framework\".  This folder does not contain "CONFIG\machine.config".

How to repeat:
1. Create the following directory tree: "C:\Windows\Microsoft.NET\Framework\Old_v4.0.21006\CONFIG".  
2. Leave the newly created CONFIG directory empty.  
3. Run the 6.3.2 installer.  Installer will fail at portion where machine configs are updated.

Suggested fix:
Update Source\Installer.cs in MySql.Data project with one of the following fixes...

Method 1 (Verify that folder is not a backup folder):

        private static void UpdateMachineConfigs(string rootPath, bool add)
            // ... code snipped
                if (pathElements[pathElements.Length - 1].StartsWith("v1")) continue;
                if (pathElements[pathElements.Length - 1].StartsWith("v3")) continue;
                //************** NEW CODE *************************//
                // Verify that folder is not a backup folder
                if (!(pathElements[pathElements.Length - 1].StartsWith("v")) continue;

                //************** END NEW CODE *********************//
            // ... code snipped

Method 2 (Do not create steam unless file exists):

        private static void AddProviderToMachineConfigInDir(string path)
            string configFile = String.Format(@"{0}\machine.config", path);

            //************** NEW CODE *************************//
            // Do not create steam unless file exists
            if (!File.Exists(configFile)) return;

            //************** END NEW CODE *********************//

            // now read the config file into memory
            StreamReader sr = new StreamReader(configFile);

           // ... remaining code snipped.
[23 Jul 2010 9:58] Tonci Grgin
Hi Chris and thanks for your report.

This is actually a duplicate of Bug#53975 and already fixed. Please review http://lists.mysql.com/commits/113989 for full patch made.