|
@@ -5,7 +5,10 @@
|
|
|
* ==============================================================================*/
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Diagnostics;
|
|
|
+using System.IO;
|
|
|
using System.Linq;
|
|
|
+using System.Reflection;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
@@ -24,13 +27,36 @@ namespace SAGA.MBI
|
|
|
class App
|
|
|
{
|
|
|
[STAThread]
|
|
|
- static void Main()
|
|
|
+ static void Main(string[] args)
|
|
|
{
|
|
|
-
|
|
|
+#if DEBUG
|
|
|
WinLogin win = new WinLogin();
|
|
|
Application myAp = new Application();
|
|
|
myAp.ShutdownMode = ShutdownMode.OnExplicitShutdown;
|
|
|
myAp.Run(win);
|
|
|
+#else
|
|
|
+//有参数时直接启动
|
|
|
+ if (args != null && args.Length > 0)
|
|
|
+ {
|
|
|
+ WinLogin win = new WinLogin();
|
|
|
+ Application myAp = new Application();
|
|
|
+ myAp.ShutdownMode = ShutdownMode.OnExplicitShutdown;
|
|
|
+ myAp.Run(win);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //无参数可看做双击启动,启动前检测版本
|
|
|
+ string fullPath = Path.Combine(Directory.GetCurrentDirectory(), "Update.exe");
|
|
|
+ Process process = new Process();
|
|
|
+ process.StartInfo.FileName = fullPath;
|
|
|
+ process.StartInfo.Arguments = Assembly.GetExecutingAssembly().Location;
|
|
|
+ process.StartInfo.UseShellExecute = false;
|
|
|
+ process.StartInfo.RedirectStandardOutput = true;
|
|
|
+ process.StartInfo.CreateNoWindow = true;
|
|
|
+ process.Start();
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|