diff --git a/VPet.Solution/App.xaml.cs b/VPet.Solution/App.xaml.cs
index 6348e7f..0985e19 100644
--- a/VPet.Solution/App.xaml.cs
+++ b/VPet.Solution/App.xaml.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Configuration;
using System.Data;
+using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
@@ -13,5 +14,24 @@ namespace VPet.Solution
///
public partial class App : Application
{
+ public static bool IsDone { get; set; } = false;
+ protected override void OnStartup(StartupEventArgs e)
+ {
+ if (e.Args != null && e.Args.Count() > 0)
+ {
+ IsDone = true;
+ switch (e.Args[0].ToLower())
+ {
+ case "removestarup":
+ var path = Environment.GetFolderPath(Environment.SpecialFolder.Startup) + @"\VPET_Simulator.lnk";
+ if(File.Exists(path))
+ {
+ File.Delete(path);
+ }
+ return;
+ }
+ }
+ IsDone = false;
+ }
}
}
diff --git a/VPet.Solution/MainWindow.xaml.cs b/VPet.Solution/MainWindow.xaml.cs
index fbd1c19..f6d127e 100644
--- a/VPet.Solution/MainWindow.xaml.cs
+++ b/VPet.Solution/MainWindow.xaml.cs
@@ -22,6 +22,11 @@ namespace VPet.Solution
{
public MainWindow()
{
+ if (App.IsDone)
+ {
+ Close();
+ return;
+ }
InitializeComponent();
}
}
diff --git a/VPet.Solution/VPet.Solution.csproj b/VPet.Solution/VPet.Solution.csproj
index 700984a..daa478f 100644
--- a/VPet.Solution/VPet.Solution.csproj
+++ b/VPet.Solution/VPet.Solution.csproj
@@ -116,10 +116,6 @@
{dcad838a-1a02-4bdf-962c-fd47c6006d28}
VPet-Simulator.Windows.Interface
-
- {b5c2dd17-735f-4f9f-82e4-b8692aec03f1}
- VPet-Simulator.Windows
-
\ No newline at end of file