Single .zip Installs Part 2, P.O.C Video.

I almost regretted posting “part 1” of this series, after I hit the submit button. I could have been lining myself up for a fall and making myself look a little silly, by not achieving my goal.

This regret further deepened when I went to bed that night and still had not found a viable solution for a single .zip install file for both Joomla! 1.0 And 1.5 extensions.

However, I woke up the next morning with multiple ideas on how to do it and a great determination to achieve my goal, most of the ideas didn’t work, but one of them did...

Follow up:

The first thing that clicked into my head was that we could use 2 different xml files. We would call one “myextension.xml” and the other “myextension.15.xml”.

Because the “15” file is earlier in the list Joomla! 1.5 would find it first and install it as usual and also because it does not contain “mosinstall” joomla! 1.0 would skip it and move on to find “myextension.xml”. This process initially worked great, the module would install on both systems, and worked perfectly on Joomla! 1.0, however when it came to 1.5, the module backend showed nothing! No params, no description, nothing!

That was when I realised it was the name of the xml file that was throwing Joomla!, it was looking for “myextension.xml” but obviously couldn’t find it as we had named it “myextension.15.xml”. This is default Joomla! behaviour.

So, I had a little think about this, and had another thought...

If I placed all the files (apart from the xml’s) in a folder, I could then have a 3rd xml file, which I would name “myextension.xml” and place inside the files folder. That way I could tell Joomla! 1.5 to upload the additional xml file, so after install I would be able to use parameters and descriptions as I normally would, because it would now be able to find “myextension.xml”

This is where I found something very interesting, upon the installation of the above, joomla! 1.5 installed as it should and worked correctly, however I didn’t have the 2 xml files I was expecting, I only had 1 “myextension.xml” this is when I realised that Joomla! will process the xml file that is inside the files folder first before it processes the xml’s outside of the folder.

What does this mean?

Well it means that we can have a single .zip file, with 2 xml files, that will install and work on both Joomla! 1.0 And 1.5.

Check out the video below to see it in action, or alternatively download the P.O.C .zip file.

Drop me a line if you use this method for your own extensions, and let me know how you get on with it.

Woochaa!

Download .zip File
Video on Next Page

Pages: 1 · 2