From a7938d7e56b2617de6d5b89b1fac245945b92390 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 7 Apr 2011 16:57:04 +0200 Subject: [PATCH] Work around a WPF issue when %WINDIR% is set to an incorrect path --- src/Main/StartUp/Project/SharpDevelopMain.cs | 5 +++++ 1 file changed, 5 insertions(+) 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; }