2019-01-17 18:54:05 -05:00
|
|
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace AutomationToolLauncher
|
|
|
|
|
{
|
|
|
|
|
class Launcher
|
|
|
|
|
{
|
2019-01-17 18:54:05 -05:00
|
|
|
static int Main(string[] Arguments)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
// Create application domain setup information.
|
|
|
|
|
var Domaininfo = new AppDomainSetup();
|
|
|
|
|
Domaininfo.ApplicationBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
|
|
|
|
Domaininfo.ShadowCopyFiles = "true";
|
|
|
|
|
|
|
|
|
|
// Create the application domain.
|
|
|
|
|
var Domain = AppDomain.CreateDomain("AutomationTool", AppDomain.CurrentDomain.Evidence, Domaininfo);
|
|
|
|
|
// Execute assembly and pass through command line
|
|
|
|
|
var UATExecutable = Path.Combine(Domaininfo.ApplicationBase, "AutomationTool.exe");
|
|
|
|
|
// Default exit code in case UAT does not even start, otherwise we always return UAT's exit code.
|
|
|
|
|
var ExitCode = 193;
|
2014-05-16 09:22:18 -04:00
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
2019-01-17 18:54:05 -05:00
|
|
|
ExitCode = Domain.ExecuteAssembly(UATExecutable, Arguments);
|
2014-05-16 09:22:18 -04:00
|
|
|
// Unload the application domain.
|
|
|
|
|
AppDomain.Unload(Domain);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception Ex)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(Ex.Message);
|
|
|
|
|
Console.WriteLine(Ex.StackTrace);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
return ExitCode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|