Index: branches/RC/core/install.php =================================================================== diff -u -N -r10886 -r10924 --- branches/RC/core/install.php (.../install.php) (revision 10886) +++ branches/RC/core/install.php (.../install.php) (revision 10924) @@ -57,6 +57,7 @@ */ var $steps = Array ( 'fresh_install' => Array ('check_paths', 'db_config', 'select_license', 'download_license', 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'finish'), + 'clean_reinstall' => Array ('check_paths', 'clean_db', 'db_config', 'select_license', 'download_license', 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'finish'), 'already_installed' => Array ('check_paths', 'install_setup'), 'upgrade' => Array ('check_paths', 'install_setup', 'upgrade_modules', 'finish'), @@ -77,7 +78,7 @@ * * @var Array */ - var $skipApplicationSteps = Array ('check_paths', 'db_config', 'db_reconfig' /*, 'install_setup'*/); // remove install_setup when application will work separately from install + var $skipApplicationSteps = Array ('check_paths', 'clean_db', 'db_config', 'db_reconfig' /*, 'install_setup'*/); // remove install_setup when application will work separately from install /** * Folders that should be writeable to continue installation. $1 - main writeable folder from config.php ("/system" by default) @@ -242,6 +243,22 @@ } break; + case 'clean_db': + // don't use Application, because all tables will be erased and it will crash + $sql = 'SELECT Path + FROM ' . TABLE_PREFIX . 'Modules'; + $modules = $this->Conn->GetCol($sql); + + foreach ($modules as $module_folder) { + $remove_file = '/' . $module_folder . 'install/remove_schema.sql'; + if (file_exists(FULL_PATH . $remove_file)) { + $this->toolkit->RunSQL($remove_file); + } + } + + $this->currentStep = $this->GetNextStep(); + break; + case 'db_config': case 'db_reconfig': $fields = Array (