1

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

1 Answer 1

0

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

3
  • Ah ok thank you, so with this method. I have all of my plugins and modules in a folder. Can I just use one function to install them all in one go. or will I need code an install for each seperately? Thanks again though. That first answer helped alot.
    – HumanPew
    May 13, 2016 at 9:55
  • @HumanPew - Well each extension can have it's own media files but they're defined in the actual extension XML file, not your package XML file. I was under the impression that your own images were not associated with the extension and were things like banners, etc. Could you confirm the purpose of the custom media files?
    – Lodder
    May 13, 2016 at 10:25
  • Yes they will be banners and logos etc, that part is fine. I was meaning more the components and plugins side of it really. As in, with php can I get my script file to open my "packages" folder and search the zip files for an xml install file. And if it finds it, execute said file.
    – HumanPew
    May 13, 2016 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.