Index: branches/unlabeled/unlabeled-1.6.2/core/install.php =================================================================== diff -u -r7525 -r7526 --- branches/unlabeled/unlabeled-1.6.2/core/install.php (.../install.php) (revision 7525) +++ branches/unlabeled/unlabeled-1.6.2/core/install.php (.../install.php) (revision 7526) @@ -526,7 +526,20 @@ function GetModuleVersion($module_name) { - return '0.1.1'; + $upgrades_file = sprintf(UPGRADES_FILE, 'core/'); + if (!file_exists($upgrades_file)) { + // no upgrade file + return '4.0.0'; + } + + $sqls = file_get_contents($upgrades_file); + $versions_found = preg_match_all('/# ===== v ([\d]+\.[\d]+\.[\d]+) =====/s', $sqls, $regs); + if (!$versions_found) { + // upgrades file doesn't contain version definitions + return '4.0.0'; + } + + return end($regs[1]); } function ConnectToDatabase()