diff options
Diffstat (limited to 'lib/private/installer.php')
-rw-r--r-- | lib/private/installer.php | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/private/installer.php b/lib/private/installer.php index e082c7eeee9..835b6b4c01a 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -147,7 +147,14 @@ class OC_Installer{ } // check if the ocs version is the same as the version in info.xml/version - if(!isset($info['version']) or ($info['version']<>$data['appdata']['version'])) { + $versionFile= $extractDir.'/appinfo/version'; + if(is_file($versionFile)) { + $version = trim(file_get_contents($versionFile)); + }else{ + $version = trim($info['version']); + } + + if($version<>trim($data['appdata']['version'])) { OC_Helper::rmdirr($extractDir); throw new \Exception($l->t("App can't be installed because the version in info.xml/version is not the same as the version reported from the app store")); } @@ -181,7 +188,11 @@ class OC_Installer{ //install the database if(is_file($basedir.'/appinfo/database.xml')) { - OC_DB::createDbFromStructure($basedir.'/appinfo/database.xml'); + if (OC_Appconfig::getValue($info['id'], 'installed_version') === null) { + OC_DB::createDbFromStructure($basedir.'/appinfo/database.xml'); + } else { + OC_DB::updateDbFromStructure($basedir.'/appinfo/database.xml'); + } } //run appinfo/install.php @@ -259,7 +270,7 @@ class OC_Installer{ /** * @brief Check if an update for the app is available * @param $name name of the application - * @returns empty string is no update available or the version number of the update + * @return boolean false or the version number of the update * * The function will check if an update for a version is available */ @@ -275,11 +286,11 @@ class OC_Installer{ return($ocsversion); }else{ - return(''); + return false; } }else{ - return(''); + return false; } } @@ -396,6 +407,9 @@ class OC_Installer{ include OC_App::getAppPath($app)."/appinfo/install.php"; } $info=OC_App::getAppInfo($app); + if (is_null($info)) { + return false; + } OC_Appconfig::setValue($app, 'installed_version', OC_App::getAppVersion($app)); //set remote/public handelers @@ -449,8 +463,7 @@ class OC_Installer{ ); // is the code checker enabled? - if(OC_Config::getValue('appcodechecker', false)) { - + if(OC_Config::getValue('appcodechecker', true)) { // check if grep is installed $grep = exec('which grep'); if($grep=='') { |