diff --git a/Tools/VECTOConsoleStart/Program.cs b/Tools/VECTOConsoleStart/Program.cs index 4ee38c806d52ec7f2ee2e774945c926e400537ee..1fd271eeacb671396da496e84940b00385d92c18 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 eb31dee287a0b3b2fdcfb7d6069dfdfbde1f7296..0fb874df0422f1f62e7efe4260761f8bcb872408 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 ccc6b575f74ebde12f9d7fd02f6bfeff3d228952..eb7e1c1731659830eae22b068c577fa022769153 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