Пример #1
0
        public static void UpdateDatabase()
        {
            Logger.Log(LogEntryType.Info, "Check for updates", "StorageCore");

            //Check, if the Database is up to date
            if (DatabaseDefinition.UpdateDatabaseStatus(true))
            {
                Logger.Log(LogEntryType.Info, "... No Update available", "StorageCore");
            }
            else
            {
                Logger.Log(LogEntryType.Info, "... Update required", "StorageCore");

                //Don't handle old Database-Format
                try
                {
                    if (Convert.ToInt32(Core.GetSetting("version")) < 10)
                    {
                        Logger.Log(LogEntryType.Info, "... Update not available. Database Version is old. Please remove the \"beRemote.db\" from %appdata%\\beRemote. If you like to import your connections, get the Tool \"Database Converter\" from the Plugin Directory", "StorageCore");
                        return;
                    }
                }
                catch (Exception)
                {
                }


                //perform update
                DatabaseDefinition.UpdateDatabaseStatus(false);
            }
        }