diff --git a/inc/inc.ClassExtensionMgr.php b/inc/inc.ClassExtensionMgr.php index 5cd4f1f4c..22eda0f75 100644 --- a/inc/inc.ClassExtensionMgr.php +++ b/inc/inc.ClassExtensionMgr.php @@ -565,12 +565,16 @@ class SeedDMS_Extension_Mgr { * location and leave the extracted archive in place. The next time an * extension is imported the last extracted archive will be removed. */ -// if(!rename($newdir, $this->extdir ."/". $extname)) { - if(false === exec('mv '.escapeshellarg($newdir).' '.escapeshellarg($this->extdir."/".$extname))) { + if(strpos(PHP_OS, 'WIN') === 0) + $ret = rename($newdir, $this->extdir ."/". $extname); + else + $ret = exec('mv '.escapeshellarg($newdir).' '.escapeshellarg($this->extdir."/".$extname)); + if(false === $ret) { /* If copy didn't succeed, then there is probably nothing to delete, * but do it anyway, just to be sure not just parts of the extension * has been copied. */ + $this->errmsgs[] = "Cannot move temp. extension directory to final destination"; $this->rrmdir($this->extdir ."/". $extname); return false; }