Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: abdulbasitnawab on June 22, 2009, 07:30:49 AM

Title: Error in Package Installation
Post by: abdulbasitnawab on June 22, 2009, 07:30:49 AM
Hi  I have been creating a mod for smf forum I wrote the xml and zip n intstalled it when installing it said Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

The code is listed below

***************package-info*************************
<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
   <name>imate</name>
   <id>Abdul:Imate</id>
   <type>modification</type>
   <version>1.0</version>
   <install>
      <readme type="inline">welcomet this is the imate jama package</readme>
      <modification type="file">jama.xml</modification>
   </install>
   <uninstall>
      <readme type="inline">welcomet this is the imate jama package</readme>
      <modification type="file" reverse="true">jama.xml</modification>
   </uninstall>
</package-info>

************ end of package info ******************

************start of jama.xml***************
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
   <id>Abdul:Imate</id>
   <version>1.0</version>
   <info>welcomet this is the imate jama package</info>
   <homepage>www.abdulbasitnawab.com</homepage>
   <file name="$sourcedir/index.php">
      <operation>
         <search position="before"><![CDATA[
header('Location: ' . $boardurl);
]]></search>
         <add><![CDATA[
echo "this is custom text" welcome ther
]]></add>
      </operation>
   </file>
</modification>
************end of jama.xml*****************

This one for testing can any one tell me what is wrong with my code thatnx
Title: Re: Error in Package Installation
Post by: Arantor on June 22, 2009, 07:37:49 AM
Question: why are you modifying Sources/index.php? The user never goes there, ever. And if they do, they are meant to get redirected, so they'll never see the text anyway.

I think the issue is that <info> and <homepage> shouldn't be in jama.xml.

Plus, the echo line should be:

echo "this is custom text welcome ther";

Otherwise it's a PHP error.
Title: Re: Error in Package Installation
Post by: TheDisturbedOne on June 22, 2009, 07:46:01 AM
Also make sure the name of the file is package-info.xml. I made the mistake of not naming it correctly when I was making my MOD.
Title: Re: Error in Package Installation
Post by: abdulbasitnawab on June 22, 2009, 01:42:07 PM
Hi
    thanx for ur reply i was first trying to modify the boardindex/index.php but then for testing purpose i tried to modify this file any how em using smf mod creator for creating mod
tell me if i create the mod manually then how to zip the files i used the winzip for this also tried by linux zip command but when uploading/installing it gives error message then i used smf mod creator using it the mod was installed but when i execute the mod then gives the above mentioned error
tell me how to zip the files coz using winzip or linux command didnot worked with me

thanx in advance
Title: Re: Error in Package Installation
Post by: Arantor on June 22, 2009, 02:11:04 PM
You need to have package-info.xml and jama.xml in the zip file, then you use the Download Packages page, to send the .zip file to the server.

The first file must be called package-info.xml, the second is whatever you called it in the <modification> block in package-info.xml.

The best thing to do is download some existing packages and have a look at them. The mod I have linked in my signature is a very small mod, no database required, and it shows how mods can be applied to 2.0rc1-1.
Title: Re: Error in Package Installation
Post by: abdulbasitnawab on June 23, 2009, 02:18:18 AM
yes i did all the steps required and also tried it by downloading a smf package from the smf site but the isssue with me is when i click the apply in the installed packages page it gives the error test failed

any idea
Title: Re: Error in Package Installation
Post by: Arantor on June 23, 2009, 06:42:12 AM
There are two tests, first to make sense of the package itself, then second to apply the changes. Which test is it failing on?
Title: Re: Error in Package Installation
Post by: abdulbasitnawab on June 23, 2009, 07:58:02 AM
hi
    thans for the reply i got it done it was acually not matching the regularexpressions coz of spacing issue thanx once again http://www.abdulbasitnawab.com (http://www.abdulbasitnawab.com)