public bool CreateUpgradePath() { _upgradePath = new UpgradeScripts(); int from = _application.Database.CurrentVersion; int to = _application.Database.RequiredVersion; // Actually create the path. while (from != to) { UpgradeScript script = _upgradeScripts.GetScriptUpgradingFrom(from); if (script == null) { MessageBox.Show("Upgrade path not found. Please contact support", "hMailServer"); return false; } string fileName = GetScriptFileName(script); if (!File.Exists(fileName)) { MessageBox.Show("Required file for upgrade not found:" + Environment.NewLine + fileName, "hMailServer"); return false; } _upgradePath.Add(script); from = script.To; } DisplayUpgradePath(); return true; }
public bool LoadSettings() { _upgradeScripts = new UpgradeScripts(); switch (_application.Database.DatabaseType) { case hMailServer.eDBtype.hDBTypeMSSQL: _databaseType = DatabaseTypeMSSQL; break; case hMailServer.eDBtype.hDBTypeMSSQLCE: _databaseType = "MSSQLCE"; break; case hMailServer.eDBtype.hDBTypeMySQL: _databaseType = "MySQL"; break; case hMailServer.eDBtype.hDBTypePostgreSQL: _databaseType = DatabaseTypePGSQL; break; default: MessageBox.Show("Unknown database type"); return(false); } LoadScripts(); _scriptPath = _application.Settings.Directories.DBScriptDirectory; if (_scriptPath == null || _scriptPath.Length == 0) { MessageBox.Show("Database script directory could not be found." + Environment.NewLine + "Please check the hMailServer error log.", "hMailServer"); return(false); } return(true); }
public bool CreateUpgradePath() { _upgradePath = new UpgradeScripts(); int from = _application.Database.CurrentVersion; int to = _application.Database.RequiredVersion; // Actually create the path. while (from != to) { UpgradeScript script = _upgradeScripts.GetScriptUpgradingFrom(from); if (script == null) { MessageBox.Show("Upgrade path not found. Please contact support", "hMailServer"); return(false); } string fileName = GetScriptFileName(script); if (!File.Exists(fileName)) { MessageBox.Show("Required file for upgrade not found:" + Environment.NewLine + fileName, "hMailServer"); return(false); } _upgradePath.Add(script); from = script.To; } DisplayUpgradePath(); return(true); }
public bool LoadSettings() { _upgradeScripts = new UpgradeScripts(); switch (_application.Database.DatabaseType) { case hMailServer.eDBtype.hDBTypeMSSQL: _databaseType = DatabaseTypeMSSQL; break; case hMailServer.eDBtype.hDBTypeMSSQLCE: _databaseType = "MSSQLCE"; break; case hMailServer.eDBtype.hDBTypeMySQL: _databaseType = "MySQL"; break; case hMailServer.eDBtype.hDBTypePostgreSQL: _databaseType = DatabaseTypePGSQL; break; default: MessageBox.Show("Unknown database type"); return false; } LoadScripts(); _scriptPath = _application.Settings.Directories.DBScriptDirectory; if (_scriptPath == null || _scriptPath.Length == 0) { MessageBox.Show("Database script directory could not be found." + Environment.NewLine + "Please check the hMailServer error log.", "hMailServer"); return false; } return true; }