Changeset 9363 for branches/OaaS/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionErrorDialog.cs
- Timestamp:
- 04/16/13 13:13:41 (11 years ago)
- Location:
- branches/OaaS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionErrorDialog.cs
r7259 r9363 8 8 * it under the terms of the GNU General Public License as published by 9 9 * the Free Software Foundation, either version 3 of the License, or 10 11 12 13 14 15 16 17 18 19 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 20 #endregion 21 21 22 22 using System; 23 using System.Reflection; 23 24 using System.Windows.Forms; 24 25 … … 26 27 public partial class FrameworkVersionErrorDialog : Form { 27 28 public static bool NET4FullProfileInstalled { 28 get { return Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full") != null; } 29 get { 30 try { 31 return Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full") != null; 32 } 33 catch (System.Security.SecurityException) { 34 return false; 35 } 36 } 37 } 38 39 public static bool MonoInstalled { 40 get { return Type.GetType("Mono.Runtime") != null; } 41 } 42 43 public static bool MonoCorrectVersionInstalled { 44 get { 45 var monoVersion = MonoVersion; 46 var minRequiredVersion = new Version(2, 11, 4); 47 48 //we need at least mono version 2.11.4 49 if (monoVersion != null && monoVersion >= minRequiredVersion) { 50 return true; 51 } else { 52 return false; 53 } 54 } 55 } 56 57 public static Version MonoVersion { 58 get { 59 Type type = Type.GetType("Mono.Runtime"); 60 if (type != null) { 61 MethodInfo dispalayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static); 62 if (dispalayName != null) { 63 string versionString = dispalayName.Invoke(null, null) as string; 64 if (versionString != null) { 65 // the version string looks something like: 2.11.4 (master/99d5e54 Thu Sep 6 15:55:44 CEST 2012) 66 var subVerStrings = versionString.Split(' '); 67 if (subVerStrings.Length > 0) { 68 try { 69 return Version.Parse(subVerStrings[0]); 70 } 71 catch { } 72 } 73 } 74 } 75 } 76 return null; 77 } 29 78 } 30 79 … … 44 93 Application.Exit(); 45 94 } 95 96 private void linkLabelMono_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { 97 try { 98 System.Diagnostics.Process.Start("http://www.mono-project.org"); 99 linkLabelMono.LinkVisited = true; 100 } 101 catch (Exception) { } 102 } 46 103 } 47 104 }
Note: See TracChangeset
for help on using the changeset viewer.