diff --git a/core/shipped.json b/core/shipped.json index 717e433e017c..eb514f733b3a 100644 --- a/core/shipped.json +++ b/core/shipped.json @@ -3,7 +3,6 @@ "encryption", "configreport", "dav", - "enterprise_key", "federation", "federatedfilesharing", "files", diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 2ebeda117b42..a41ac1e1dc80 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -429,16 +429,21 @@ public static function isDownloaded( $name ) { public static function removeApp($appId) { if(Installer::isDownloaded( $appId )) { - $appDir=OC_App::getInstallPath() . '/' . $appId; + $appDir = OC_App::getAppPath($appId); + if ($appDir === false) { + return false; + } + if(is_dir("$appDir/.git")) { + throw new AppAlreadyInstalledException("App <$appId> is a git clone - it will not be deleted."); + } + OC_Helper::rmdirr($appDir); return true; - }else{ - \OCP\Util::writeLog('core', 'can\'t remove app '.$appId.'. It is not installed.', \OCP\Util::ERROR); - - return false; } + \OCP\Util::writeLog('core', 'can\'t remove app '.$appId.'. It is not installed.', \OCP\Util::ERROR); + return false; } /** diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 4507e8bc292a..9f48dcb9c682 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -359,6 +359,9 @@ public static function enable($app, $groups = null) { $config = \OC::$server->getConfig(); $l = \OC::$server->getL10N('core'); $info = self::getAppInfo($app); + if ($info === null) { + throw new \Exception("$app can't be enabled since it is not installed."); + } self::checkAppDependencies($config, $l, $info); diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index f2f24cff63b1..b6d64aa4d920 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -116,10 +116,11 @@ public function getAlwaysEnabledApps(); /** * @param string $package + * @param bool $skipMigrations whether to skip migrations, which would only install the code * @return mixed * @since 10.0 */ - public function installApp($package); + public function installApp($package, $skipMigrations = false); /** * @param string $package