AnsweredAssumed Answered

pre_execute.php ignored

Question asked by Nagy Zoltan on Mar 10, 2020
Latest reply on Apr 2, 2020 by Nagy Zoltan

Hello. I am trying to remove a custom module of ours from a 9.0.2 installation, called AG_AG_Version. I updated the code in the files using the module, that part is working. BUT, I also have to remove the module folder itself and a file generated by the module. I am using this as base:… 


This is the content of pre_execute.php:

echo "In pre_execute";
if (isset($this->installdefs['remove_files'])) {
foreach($this->installdefs['remove_files'] as $relpath){
if (SugarAutoloader::fileExists($relpath)) {
function deleteDir($dirPath) {
if (! is_dir($dirPath)) {
throw new InvalidArgumentException("$dirPath must be a directory");
if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
$dirPath .= '/';
$files = glob($dirPath . '*', GLOB_MARK);
foreach ($files as $file) {
if (is_dir($file)) {
} else {
echo "Deleting custom/modules/AG_AG_Versions";
echo "Deleting modules/AG_AG_Versions";


The manifest.php's relevant part looks like this (inside installdefs array):

'pre_execute' => [


Any idea why those echo messages from pre_execute.php appears nowhere in the logs and .. nothing is deleted. Like the file is completly ignored.