2014-04-10 10:36:59 -07:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Diagnostics;
|
2015-04-08 15:20:10 -07:00
|
|
|
|
using System.IO;
|
2014-04-10 10:36:59 -07:00
|
|
|
|
|
|
|
|
|
|
namespace MatterHackers.MatterControl.Launcher
|
|
|
|
|
|
{
|
2015-04-08 15:20:10 -07:00
|
|
|
|
public class LauncherApp
|
|
|
|
|
|
{
|
|
|
|
|
|
public LauncherApp()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2014-04-10 10:36:59 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
[STAThread]
|
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (args.Length == 2 && File.Exists(args[0]))
|
|
|
|
|
|
{
|
|
|
|
|
|
ProcessStartInfo runAppLauncherStartInfo = new ProcessStartInfo();
|
|
|
|
|
|
runAppLauncherStartInfo.FileName = args[0];
|
2014-04-10 10:36:59 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
int timeToWait = 0;
|
|
|
|
|
|
int.TryParse(args[1], out timeToWait);
|
2014-04-10 10:36:59 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
Stopwatch waitTime = new Stopwatch();
|
|
|
|
|
|
waitTime.Start();
|
|
|
|
|
|
while (waitTime.ElapsedMilliseconds < timeToWait)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2014-04-10 10:36:59 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
Process.Start(runAppLauncherStartInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|