Description:
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):
-----------------------------------------------------
Installer.cs:
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):
--------------------------------------------------
Installer.cs:
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.