- Timestamp:
- 09/11/12 14:39:23 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionErrorDialog.Designer.cs
r7967 r8632 49 49 this.linkLabel = new System.Windows.Forms.LinkLabel(); 50 50 this.label = new System.Windows.Forms.Label(); 51 this.linkLabelMono = new System.Windows.Forms.LinkLabel(); 51 52 this.SuspendLayout(); 52 53 // 53 54 // iconLabel 54 55 // 55 this.iconLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 56 56 this.iconLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 57 | System.Windows.Forms.AnchorStyles.Left))); 57 58 this.iconLabel.Image = global::HeuristicLab.PluginInfrastructure.Resources.Error; 58 59 this.iconLabel.ImageAlign = System.Drawing.ContentAlignment.TopLeft; 59 60 this.iconLabel.Location = new System.Drawing.Point(12, 9); 60 61 this.iconLabel.Name = "iconLabel"; 61 this.iconLabel.Size = new System.Drawing.Size(50, 98);62 this.iconLabel.Size = new System.Drawing.Size(50, 121); 62 63 this.iconLabel.TabIndex = 0; 63 64 // … … 66 67 this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 67 68 this.closeButton.DialogResult = System.Windows.Forms.DialogResult.OK; 68 this.closeButton.Location = new System.Drawing.Point(294, 81);69 this.closeButton.Location = new System.Drawing.Point(294, 104); 69 70 this.closeButton.Name = "closeButton"; 70 71 this.closeButton.Size = new System.Drawing.Size(75, 23); … … 76 77 // linkLabel 77 78 // 78 this.linkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 79 | System.Windows.Forms.AnchorStyles.Left)80 79 this.linkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 80 | System.Windows.Forms.AnchorStyles.Left) 81 | System.Windows.Forms.AnchorStyles.Right))); 81 82 this.linkLabel.Location = new System.Drawing.Point(68, 52); 82 83 this.linkLabel.Name = "linkLabel"; 83 this.linkLabel.Size = new System.Drawing.Size(301, 26);84 this.linkLabel.Size = new System.Drawing.Size(301, 49); 84 85 this.linkLabel.TabIndex = 2; 85 86 this.linkLabel.TabStop = true; … … 89 90 // label 90 91 // 91 this.label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 92 92 this.label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 93 | System.Windows.Forms.AnchorStyles.Right))); 93 94 this.label.Location = new System.Drawing.Point(68, 9); 94 95 this.label.Name = "label"; 95 96 this.label.Size = new System.Drawing.Size(301, 43); 96 97 this.label.TabIndex = 1; 97 this.label.Text = "The Microsoft .NET Framework 4 (Full Profile) is not properly installed on your s" + 98 "ystem. Please download and install it."; 98 this.label.Text = "To run HeuristicLab you need at least the Microsoft .NET Framework 4 (Full Profil" + 99 "e) or Mono version 2.11.4 or higher. Please download and install it."; 100 // 101 // linkLabelMono 102 // 103 this.linkLabelMono.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 104 | System.Windows.Forms.AnchorStyles.Left) 105 | System.Windows.Forms.AnchorStyles.Right))); 106 this.linkLabelMono.Location = new System.Drawing.Point(68, 72); 107 this.linkLabelMono.Name = "linkLabelMono"; 108 this.linkLabelMono.Size = new System.Drawing.Size(301, 16); 109 this.linkLabelMono.TabIndex = 4; 110 this.linkLabelMono.TabStop = true; 111 this.linkLabelMono.Text = "Download Mono"; 112 this.linkLabelMono.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelMono_LinkClicked); 99 113 // 100 114 // FrameworkVersionErrorDialog 101 115 // 102 116 this.AcceptButton = this.closeButton; 103 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);104 117 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 105 118 this.CancelButton = this.closeButton; 106 this.ClientSize = new System.Drawing.Size(381, 116); 119 this.ClientSize = new System.Drawing.Size(381, 139); 120 this.Controls.Add(this.linkLabelMono); 107 121 this.Controls.Add(this.label); 108 122 this.Controls.Add(this.linkLabel); … … 127 141 private System.Windows.Forms.LinkLabel linkLabel; 128 142 private System.Windows.Forms.Label label; 143 private System.Windows.Forms.LinkLabel linkLabelMono; 129 144 } 130 145 } -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionErrorDialog.cs
r7259 r8632 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 version = MonoVersion; 46 47 //we need at least mono version 2.11.4 48 if (version != null && version.Major >= 2 && version.Minor >= 11 && version.Build >= 4) { 49 return true; 50 } else { 51 return false; 52 } 53 } 54 } 55 56 public static Version MonoVersion { 57 get { 58 Type type = Type.GetType("Mono.Runtime"); 59 if (type != null) { 60 MethodInfo dispalayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static); 61 if (dispalayName != null) { 62 string versionString = dispalayName.Invoke(null, null) as string; 63 if (versionString != null) { 64 // the version string looks something like: 2.11.4 (master/99d5e54 Thu Sep 6 15:55:44 CEST 2012) 65 var subVerStrings = versionString.Split(' '); 66 if (subVerStrings.Length > 0) { 67 try { 68 return Version.Parse(subVerStrings[0]); 69 } 70 catch { } 71 } 72 } 73 } 74 } 75 return null; 76 } 29 77 } 30 78 … … 44 92 Application.Exit(); 45 93 } 94 95 private void linkLabelMono_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { 96 try { 97 System.Diagnostics.Process.Start("http://www.mono-project.org"); 98 linkLabelMono.LinkVisited = true; 99 } 100 catch (Exception) { } 101 } 46 102 } 47 103 }
Note: See TracChangeset
for help on using the changeset viewer.