diff --git a/src/Main/StartUp/Project/SharpDevelopMain.cs b/src/Main/StartUp/Project/SharpDevelopMain.cs index 5670230ec9..81c9fc288f 100644 --- a/src/Main/StartUp/Project/SharpDevelopMain.cs +++ b/src/Main/StartUp/Project/SharpDevelopMain.cs @@ -120,6 +120,11 @@ namespace ICSharpCode.SharpDevelop MessageBox.Show("This version of SharpDevelop requires .NET 4.0. You are using: " + Environment.Version, "SharpDevelop"); return false; } + // Work around a WPF issue when %WINDIR% is set to an incorrect path + string windir = Environment.GetFolderPath(Environment.SpecialFolder.Windows, Environment.SpecialFolderOption.DoNotVerify); + if (Environment.GetEnvironmentVariable("WINDIR") != windir) { + Environment.SetEnvironmentVariable("WINDIR", windir); + } return true; }