Creating an Installable Package That Copies Files

Overview

This is an overview of how to create a module loadable package that will copy files into your instance of Sugar. This is most helpful when your instance of Sugar is hosted in our On-Demand environment or by a third party.
For more details on the $manifest or $installdef options, you can visit the ‘Introduction to the Manifest File’.

Manifest Example

<?php
    $manifest = array(
        'acceptable_sugar_flavors' => array('CE','PRO','CORP','ENT','ULT'),
        'acceptable_sugar_versions' => array(
            'exact_matches' => array(),
            'regex_matches' => array('6\\.[0-9]\\.[0-9]),
        ),
        'author' => 'SugarCRM',
        'description' => 'Installs updated layouts to the accounts module',
        'icon' => '',
        'is_uninstallable' => true,
        'name' => 'Example File Installer',
        'published_date' => '2012-11-01 2012 20:45:04',
        'type' => 'module',
        'version' => '1391608631',
    );
       $installdefs = array(
        'id' => 'package_1391608631',
        'copy' => array(
            0 => array(
                'from' => '<basepath>/Files/custom/modules/Accounts/metadata/detailviewdefs.php',
                'to' => 'custom/modules/Accounts/metadata/detailviewdefs.php',
            ),
            1 => array(
                'from' => '<basepath>/Files/custom/modules/Accounts/metadata/editviewdefs.php',
                'to' => 'custom/modules/Accounts/metadata/editviewdefs.php',
            ),
            2 => array(
                'from' => '<basepath>/Files/custom/modules/Accounts/metadata/quickcreatedefs.php',
                'to' => 'custom/modules/Accounts/metadata/quickcreatedefs.php',
            ),
        ),
    );
?>