From 0ac0f2d86a92b675ad338a2ec6347a630be35ab6 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 5 Aug 2014 16:44:49 +0100 Subject: [PATCH] added code to check for the runtime arguments for the program to tell where its run from --- Saviour Backup System/setup.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Saviour Backup System/setup.cs b/Saviour Backup System/setup.cs index 99ed5bf..959f011 100644 --- a/Saviour Backup System/setup.cs +++ b/Saviour Backup System/setup.cs @@ -17,12 +17,25 @@ namespace Saviour_Backup_System internal static NotifyIcon notifyIcon; internal static ContextMenu contextMenu; static string databaseName = databaseTools.databaseName; + internal static string[] runtimeArguements = null; + + internal static void initProgram(string[] args) { - MessageBox.Show(args.Length.ToString()); + MessageBox.Show(args.Length.ToString()); + runtimeArguements = args; + notificationIcon.init(); + + if (args.Length == 0) //if the program is run out-right or not from startup + { + Application.Run(new mainWindow()); + } + else if (args[0] == "STARTUP") //if the program is run when the computer starts up + { + + } //if (!File.Exists(databaseName)) { setupDatabase(); } // If the program has been run before, then the database will exist, so use that to test it. - notificationIcon.init(); } private static void setupDatabase(){