Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit b3d1d285 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

VECTOStart now prints an error if the start failed.

parent f1fb4be2
No related branches found
No related tags found
No related merge requests found
......@@ -4,28 +4,32 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
namespace TUGraz.VECTO
{
class Program
{
static void Main(string[] args)
{
static void Main(string[] args) {
var path = "No path found.";
string version = "No version found.";
try {
string version;
if (args.Length > 0) {
version = args[0];
ValidateVersion(version);
} else {
version = GetHighestNETVersion();
}
Process.Start(new ProcessStartInfo($"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe") {
path = $"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe";
Process.Start(new ProcessStartInfo(path) {
WorkingDirectory = Directory.GetCurrentDirectory()
});
} catch (Exception e) {
Console.WriteLine(e);
File.AppendAllText("LOG.txt", e.ToString());
throw;
var message = $"Error during starting VECTO.\nDetected .NET version: {version}\nTried to open path: {path}\n{e.Message}";
File.AppendAllText("LOG.txt", $"{DateTime.Now} {message}\n");
MessageBox.Show(message);
}
}
......
......@@ -10,4 +10,8 @@
<DefineConstants />
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment