Exemple #1
0
        private void PreprocessCommandLine()
        {
            Log.Info("Enter PreprocessCommandLine()");
            //check if it need finish updating.
            if (CommandLine.ContainSwitchOption("update"))
            {
                ProgramUpdater.ApplyUpdate();
            }

            if (CommandLine.ContainSwitchOption("update_plugin"))
            {
                PluginUpdaterManager.ApplyPluginUpdate();
            }

            if (CommandLine.ContainSwitchOption("database_backup"))
            {
                if (CommandLine.TryGetOptionValue("to", out string to))
                {
                    LocalDBContext.BackupDatabase(to);
                    Environment.Exit(0);
                }
            }

            if (CommandLine.ContainSwitchOption("database_restore"))
            {
                if (CommandLine.TryGetOptionValue("to", out string to) && CommandLine.TryGetOptionValue("from", out string from))
                {
                    LocalDBContext.RestoreDatabase(from, to);
                    Environment.Exit(0);
                }
            }
        }
Exemple #2
0
        private void PreprocessCommandLine()
        {
            Log.Info("Enter PreprocessCommandLine()");
            //check if it need finish updating.
            if (CommandLine.ContainSwitchOption("update"))
            {
                ProgramUpdater.ApplyUpdate();
            }

            if (CommandLine.ContainSwitchOption("update_plugin"))
            {
                PluginUpdaterManager.ApplyPluginUpdate();
            }
        }