From 2a53d6014d25f18216c7a82180679a263028fe31 Mon Sep 17 00:00:00 2001
From: Harald Martini <harald.martini@student.tugraz.at>
Date: Tue, 21 Jun 2022 15:47:14 +0200
Subject: [PATCH] updated VectoConsoleStart project

---
 Tools/VECTOConsoleStart/Program.cs            | 19 ++++++++++++++++---
 .../VECTOConsoleStart.csproj                  |  6 ++++--
 VECTO.sln                                     |  4 ++--
 3 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/Tools/VECTOConsoleStart/Program.cs b/Tools/VECTOConsoleStart/Program.cs
index 4ee38c806d..1fd271eeac 100644
--- a/Tools/VECTOConsoleStart/Program.cs
+++ b/Tools/VECTOConsoleStart/Program.cs
@@ -3,17 +3,30 @@ using Microsoft.Win32;
 using System.Diagnostics;
 using System.Reflection;
 using System.IO;
+using System.Linq;
+using System.Text;
 
 namespace TUGraz.VECTO
 {
 	class Program
 	{
-		static void Main()
+		private static int Main(string[] args)
 		{
 			var version = GetHighestNETVersion();
-			Process.Start(new ProcessStartInfo($"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe") {
-				WorkingDirectory = Directory.GetCurrentDirectory()
+
+			var argsString = "";
+			foreach (var arg in args) {
+				argsString += $"\"{arg}\" ";
+			}
+
+			var process = Process.Start(new ProcessStartInfo($"{version}\\{Assembly.GetExecutingAssembly().GetName().Name}.exe")
+            {
+                WorkingDirectory = Directory.GetCurrentDirectory(),
+				UseShellExecute = false,
+				Arguments = argsString,
 			});
+			process?.WaitForExit();
+			return process?.ExitCode ?? -1;
 		}
 
 		private static string GetHighestNETVersion()
diff --git a/Tools/VECTOConsoleStart/VECTOConsoleStart.csproj b/Tools/VECTOConsoleStart/VECTOConsoleStart.csproj
index eb31dee287..0fb874df04 100644
--- a/Tools/VECTOConsoleStart/VECTOConsoleStart.csproj
+++ b/Tools/VECTOConsoleStart/VECTOConsoleStart.csproj
@@ -1,12 +1,14 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <OutputType>WinExe</OutputType>
+    <OutputType>exe</OutputType>
+    
     <AssemblyName>vectocmd</AssemblyName>
     <ApplicationIcon>Icon2.ico</ApplicationIcon>
     <RootNamespace>TUGraz.VECTO</RootNamespace>
     <TargetFrameworks>net45</TargetFrameworks>
-    <DefineConstants />
+	<DefineConstants />
+    <StartupObject></StartupObject>
   </PropertyGroup>
 
 </Project>
diff --git a/VECTO.sln b/VECTO.sln
index ccc6b575f7..eb7e1c1731 100644
--- a/VECTO.sln
+++ b/VECTO.sln
@@ -168,8 +168,8 @@ Global
 		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.Deploy|Any CPU.Build.0 = Release|Any CPU
 		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.MockupDebug|Any CPU.ActiveCfg = MockupDebug|Any CPU
 		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.MockupDebug|Any CPU.Build.0 = MockupDebug|Any CPU
-		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.MockupDeploy|Any CPU.ActiveCfg = Debug|Any CPU
-		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.MockupDeploy|Any CPU.Build.0 = Debug|Any CPU
+		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.MockupDeploy|Any CPU.ActiveCfg = MockupRelease|Any CPU
+		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.MockupDeploy|Any CPU.Build.0 = MockupRelease|Any CPU
 		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.MockupRelease|Any CPU.ActiveCfg = Debug|Any CPU
 		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.MockupRelease|Any CPU.Build.0 = Debug|Any CPU
 		{60AD4DF0-6648-4374-83CB-C7A162EFB391}.Release|Any CPU.ActiveCfg = Release|Any CPU
-- 
GitLab