Index: /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/ErrorHandling.cs
===================================================================
--- /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/ErrorHandling.cs (revision 5983)
+++ /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/ErrorHandling.cs (revision 5984)
@@ -25,18 +25,16 @@
namespace HeuristicLab.PluginInfrastructure {
public static class ErrorHandling {
- public static readonly string NewLine = Environment.NewLine;
-
public static string BuildErrorMessage(Exception exception) {
if (exception == null) {
return string.Empty;
} else {
- string message = exception.GetType().Name + ": " + exception.Message + NewLine +
+ string message = exception.GetType().Name + ": " + exception.Message + Environment.NewLine +
exception.StackTrace;
while (exception.InnerException != null) {
exception = exception.InnerException;
- message += NewLine +
- "-----" + NewLine +
- exception.GetType().Name + ": " + exception.Message + NewLine +
+ message += Environment.NewLine +
+ "-----" + Environment.NewLine +
+ exception.GetType().Name + ": " + exception.Message + Environment.NewLine +
exception.StackTrace;
}
@@ -53,4 +51,5 @@
public static void ShowErrorDialog(string message, Exception exception) {
using (ErrorDialog dialog = new ErrorDialog(message, exception)) {
+ dialog.StartPosition = FormStartPosition.CenterScreen;
dialog.ShowDialog();
}
Index: /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionWarning.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionWarning.Designer.cs (revision 5984)
+++ /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionWarning.Designer.cs (revision 5984)
@@ -0,0 +1,123 @@
+#region License Information
+/* HeuristicLab
+* Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+*
+* This file is part of HeuristicLab.
+*
+* HeuristicLab is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+namespace HeuristicLab.PluginInfrastructure {
+ partial class FrameworkVersionWarning {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.iconLabel = new System.Windows.Forms.Label();
+ this.okButton = new System.Windows.Forms.Button();
+ this.linkLabel = new System.Windows.Forms.LinkLabel();
+ this.label1 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // iconLabel
+ //
+ this.iconLabel.Image = global::HeuristicLab.PluginInfrastructure.Resources.Error;
+ this.iconLabel.Location = new System.Drawing.Point(12, 9);
+ this.iconLabel.Name = "iconLabel";
+ this.iconLabel.Size = new System.Drawing.Size(21, 22);
+ this.iconLabel.TabIndex = 1;
+ //
+ // okButton
+ //
+ this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.okButton.Location = new System.Drawing.Point(206, 102);
+ this.okButton.Name = "okButton";
+ this.okButton.Size = new System.Drawing.Size(75, 23);
+ this.okButton.TabIndex = 6;
+ this.okButton.Text = "&Close";
+ this.okButton.UseVisualStyleBackColor = true;
+ this.okButton.Click += new System.EventHandler(this.cancelButton_Click);
+ //
+ // linkLabel
+ //
+ this.linkLabel.AutoSize = true;
+ this.linkLabel.Location = new System.Drawing.Point(39, 66);
+ this.linkLabel.Name = "linkLabel";
+ this.linkLabel.Size = new System.Drawing.Size(210, 13);
+ this.linkLabel.TabIndex = 9;
+ this.linkLabel.TabStop = true;
+ this.linkLabel.Text = ".NET framework v4.0 (full profile) download";
+ this.linkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel_LinkClicked);
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(39, 9);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(255, 33);
+ this.label1.TabIndex = 10;
+ this.label1.Text = ".NET framework version 4.0 (full profile) is not properly installed. Please downl" +
+ "oad and install it.";
+ //
+ // FrameworkVersionWarning
+ //
+ this.AcceptButton = this.okButton;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.okButton;
+ this.ClientSize = new System.Drawing.Size(293, 137);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.linkLabel);
+ this.Controls.Add(this.okButton);
+ this.Controls.Add(this.iconLabel);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.Icon = global::HeuristicLab.PluginInfrastructure.Resources.HeuristicLab;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "FrameworkVersionWarning";
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Warning";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label iconLabel;
+ private System.Windows.Forms.Button okButton;
+ private System.Windows.Forms.LinkLabel linkLabel;
+ private System.Windows.Forms.Label label1;
+ }
+}
Index: /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionWarning.cs
===================================================================
--- /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionWarning.cs (revision 5984)
+++ /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/FrameworkVersionWarning.cs (revision 5984)
@@ -0,0 +1,42 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+using System;
+using System.Windows.Forms;
+
+namespace HeuristicLab.PluginInfrastructure {
+ public partial class FrameworkVersionWarning : Form {
+ public FrameworkVersionWarning() {
+ InitializeComponent();
+ }
+
+ private void linkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
+ try {
+ System.Diagnostics.Process.Start("http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7");
+ linkLabel.LinkVisited = true;
+ }
+ catch (Exception) { }
+ }
+
+ private void cancelButton_Click(object sender, EventArgs e) {
+ Application.Exit();
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj (revision 5983)
+++ /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj (revision 5984)
@@ -221,4 +221,10 @@
+
+ Form
+
+
+ FrameworkVersionWarning.cs
+
Form
Index: /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Main.cs
===================================================================
--- /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Main.cs (revision 5983)
+++ /trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Main.cs (revision 5984)
@@ -34,11 +34,18 @@
/// Command line arguments
public static void Run(string[] args) {
- try {
+ bool fullProfileInstalled = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full") != null;
+ if (!fullProfileInstalled) {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new StarterForm());
- }
- catch (Exception ex) {
- ErrorHandling.ShowErrorDialog(ex);
+ Application.Run(new FrameworkVersionWarning());
+ } else {
+ try {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new StarterForm());
+ }
+ catch (Exception ex) {
+ ErrorHandling.ShowErrorDialog(ex);
+ }
}
}