- Enhancement: #4 Verify Windows services have properly terminated upon shutdown. - Moved instanciation of ServiceControl class from Startup.xaml.cs to StatusWindow.xaml.cs.
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using System.Windows;
|
|
|
|
namespace VMwareLauncher
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for Startup.xaml
|
|
/// </summary>
|
|
public partial class Startup : Window
|
|
{
|
|
static internal TrayIcon trayIcon = new TrayIcon();
|
|
internal StatusWindow statusWindow = new StatusWindow();
|
|
internal CheckDependencies checkDependencies = new CheckDependencies();
|
|
|
|
public Startup()
|
|
{
|
|
InitializeComponent();
|
|
|
|
ProcessControl vmWStationControl = new ProcessControl();
|
|
vmWStationControl.ProcessName = ProcessControl.DefaultVmwarePath;
|
|
|
|
ProcessControl vmLauncherControl = new ProcessControl();
|
|
vmLauncherControl.ProcessName = ProcessControl.DefaultVmLauncherPath;
|
|
|
|
checkDependencies.PerformCheck();
|
|
|
|
if (!vmLauncherControl.IsProcessRunning())
|
|
{
|
|
statusWindow.Show();
|
|
trayIcon.Create();
|
|
}
|
|
else
|
|
{
|
|
vmWStationControl.StartProcess();
|
|
ApplicationControl.Shutdown(0);
|
|
}
|
|
}
|
|
}
|
|
}
|