Can I use a single .xml file to install components, modules, plugins and media files?

by HumanPew   Last Updated May 13, 2016 08:04 AM

I'm trying to create a package of a range of components, modules, plugins, templates and media files which are standard for most website that I create. I was wondering if the .xml file can handle all of this and if so. Which is the best way to go about it. So far this is what I have:

<name>******</name>
<author>******</author>
<creationDate>May 2016</creationDate>
<packagename>MTInstall</packagename>
<version>1.0.0</version>
<url>http://www.******.com</url>
<packager>******</packager>
<packagerurl>http://www.*******.com</packagerurl>
<description>Package contains all components, plugins and modules</description>
<update>http://www.www.*******.com</update>

<files folder="packages">
    <file type="component" id="com_aclmanager" >com_aclmanager.zip</file>
    <file type="component" id="admin_menu_manager" >com_admin-menu-manager.zip</file>
    <file type="component" id="jce" >com_jce.zip</file>
    <file type="plugin" id="plg_mtcustompagedata" group="system">plg_mtcustompagedata.zip</file>
    <file type="plugin" id="plg_mtcustompagefields" group="system">plg_mtcustompagefields.zip</file>
    <file type="plugin" id="plg_mtmodule" group="system">plg_mtmodule.zip</file>
    <file type="plugin" id="plg_mtredirect" group="system">plg_mtredirect.zip</file>
    <file type="plugin" id="plg_mtuserdata" group="system">plg_mtuserdata.zip</file>
</files>

<media folder="packages" destination="mt_media">
    <filename>mttemplateMedia.zip</filename>        
</media>

<install>
    <sql>
        <file charset="utf8" driver="mysql">install.mysql.sql</file>
    </sql>
</install>
<uninstall>
    <sql>
        <file charset="utf8" driver="mysql">uninstall.mysql.sql</file>
    </sql>
</uninstall>

It seems to completely miss the media files. And when I add templates in it also doesn't find those.

Thanks

Tags : installation xml


Answers 1


As far as I know, <media> does not accept zip files in <filename>.

I think you best options will be to create a script.php and use the postinstall() function to:

  1. Move the zip file to the media directory
  2. Extract the zip file
  3. Delete the zip file

Take a look at Adding an install/uninstall/update script file for more information

Lodder
Lodder
May 13, 2016 09:32 AM

Related Questions


Joomla installation database connection

Updated August 03, 2015 14:04 PM


How to secure a new Joomla installation?

Updated May 27, 2015 22:04 PM