static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //with args(user open file with the program)
            if (args != null && args.Length > 0)
            {
                string fileName = args[0];
                //Check file exists
                if (File.Exists(fileName))
                {
                    ComparisonForm MainFrom = new ComparisonForm();
                    MainFrom.LoadFile(fileName);
                    Application.Run(MainFrom);
                }
                //The file does not exist
                else
                {
                    Application.Run(new ComparisonForm());
                }
            }
            //without args
            else
            {
                Application.Run(new ComparisonForm());
            }
        }
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);

            //If new install, see if need to migrate settings file from previous version
            try
            {
                if (Settings.Default.UpgradeRequired)
                {
                    Settings.Default.Upgrade();
                    Settings.Default.UpgradeRequired = false;
                    Settings.Default.Save();
                }
            }
            catch { }

            // Default web requests like AAD Auth to use windows credentials for proxy auth
            System.Net.WebRequest.DefaultWebProxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            if (args != null && args.Length > 0)
            {
                if (args.Length > 1)
                //User opened from Desktop with server/db name
                {
                    string serverName   = args[0];
                    string databaseName = args[1];

                    ComparisonForm MainFrom = new ComparisonForm();
                    MainFrom.LoadFromDesktop(serverName, databaseName);
                    Application.Run(MainFrom);
                    return;
                }
                else
                //User opened file with the program
                {
                    string fileName = args[0];
                    //Check file exists, if not will run without args below
                    if (File.Exists(fileName))
                    {
                        ComparisonForm MainFrom = new ComparisonForm();
                        MainFrom.LoadFile(fileName);
                        Application.Run(MainFrom);
                        return;
                    }
                }
            }

            //Without valid args
            Application.Run(new ComparisonForm());
        }