Jump to content
Sign in to follow this  
rinon

Contrib Installer

Recommended Posts

How exactly does this work? does it read and add in diff files and alert you for conflicts?

 

I am assuming it only integrates contributions that are formatted a certain way?

Share this post


Link to post
Share on other sites

I am trying to make a simple CIP file to get a better feeling of how this works. The problem is even though I have used the example XML file that you included....nothing seems to happen. Contrib installer says that it has been installed but no files are written and no code is changed.

I even changed the permissions hoping for a permission error but that didn't even happen.

Any help would be wonderful.

 

<contrib>

<description>

<details contrib_ref="" forum_ref="" contrib_type="Other" status="0" last_update="2005-09-30"/>

<comments>osCommerce XML loader. This module allows to update the following fields: products_name (according to the current language), products_quantity, products_price (according to the default currency), products_date_available, products_status

To edit a XML-file it is possible with the help of any XML-editor, for example XML Marker (http://xmlmarker.com).

Visit home page of this module http://MetaShop.ru (russian).

For bug-reports and suggestions mail metashop@metashop.ru</comments>

<credits>Vetal <metashop@metashop.ru>

CIP created by Demon2Lima</credits>

</description>

 

<addcode>

<file name="admin/includes/boxes/tools.php" />

<find>$contents[] = array('text' => </find>

<add><![CDATA[

// Start osCommerce XML updater - installed by contrib_installer

'<a href="' . tep_href_link('oscommerce_xml.php') . '" class="menuBoxContentLink">osCommerce.XML</a><br>' .

// End osCommerce XML updater- installed by contrib_installer

]]></add>

<findlinenumbers start="21" end="21" />

</addcode>

 

 

 

<addfile>

<file name="admin/oscommerce_xml.php" />

</addfile>

 

</contrib>

Share this post


Link to post
Share on other sites
I am trying to make a simple CIP file to get a better feeling of how this works. The problem is even though I have used the example XML file that you included....nothing seems to happen. Contrib installer says that it has been installed but no files are written and no code is changed.

I even changed the permissions hoping for a permission error but that didn't even happen.

Any help would be wonderful.

 

Hi!

What version of Contrib Installer do you use? Latest is 1.0.13.

This version tells you if any problem will appear at the installation time before start this installation.

So if you have syntacs problem or permissions problem or file not found or etc you will get a message about it.

This means that if installation proccess reach the end and you can read message "Status: Installed." - all is OK.

 

May be you check not right files or you are lokking for it in wrong place.

Please post a messages of Contrib Installer instead of xml-file content. Contrib Installer will check XML-file.


===============================

Never give up! Never give up! Never give up!

Share this post


Link to post
Share on other sites
Hi!

What version of Contrib Installer do you use? Latest is 1.0.13.

This version tells you if any problem will appear at the installation time before start this installation.

So if you have syntacs problem or permissions problem or file not found or etc you will get a message about it.

This means that if installation proccess reach the end and you can read message "Status: Installed." - all is OK.

 

May be you check not right files or you are lokking for it in wrong place.

Please post a messages of Contrib Installer instead of xml-file content. Contrib Installer will check XML-file.

 

I am using the current version and here is what CI returns after I try to install the CIP

 

Installing Contribution: osCommerce_XML_0_6From install file: /home/everythi/public_html/shop/catalog/admin/contributions/osCommerce_XML_0_6/install.xml

Author: Comments: osCommerce XML loader. This module allows to update the following fields: products_name (according to the current language), products_quantity, products_price (according to the default currency), products_date_available, products_status

To edit a XML-file it is possible with the help of any XML-editor, for example XML Marker (http://xmlmarker.com).

Visit home page of this module http://MetaShop.ru (russian).

For bug-reports and suggestions mail metashop@metashop.ru

Checking config file: File install.xml is valid.Checking permissions: Permissions is OK.

Checking conflicts:No conflicts.

Backup: nothing.

Status: Installed.

 

No error messages appear and nothing happens to any of the files....

Share this post


Link to post
Share on other sites

Hi, demon2lima

 

Strange. No errors!...

This means that all ok or that my checks is not ok.

Ok. You are adding a file:

<addfile>

<file name="admin/oscommerce_xml.php" />

</addfile>

.../catalog/admin/oscommerce_xml.php

Does it exists after install?

 

Next.

You can see any files that must be modified in .../catalog/admin/backups/<contribs name>/

Before make any changes to files we backup them. So you will have ability to restore them if needed.

 

Check this folder. Is it empty? If empty - no changes was made.

Also check a message "Backup: ...". We print how many files was backuped.

 

Also check a comments in xml -file:

<!-- comments -->

I have found that comments in russian don't work.

Also when I have too many comments - don't work.

You can see in "Log of Contrib Installer Package (CIP) running: "

Just click a plus sign.

If you don't see an install report - nothing was made.

 

God bless you.

:rolleyes:


===============================

Never give up! Never give up! Never give up!

Share this post


Link to post
Share on other sites

I was wondering if you could help me figure this out. I get the following errors trying to install the latest version.

 

Checking permissions: (findreplace #1) Can't read file: /hsphere/local/home/unclemik/summonedskull.com//catalog/admin/index.php

(addcode #1) Can't read file: /hsphere/local/home/unclemik/summonedskull.com//catalog/admin/includes/boxes/tools.php

 

I went to these files and 777'ed them and still got the same error. So right now I set them back to 755 and went back and made sure I installed all the files in the right place. Everything seem to be right but it just will not work.

 

Help me please.

Share this post


Link to post
Share on other sites

Hi,

May be problem in path (double slash):

/hsphere/local/home/unclemik/summonedskull.com//catalog/admin/index.php

Checking permissions: (findreplace #1) Can't read file: /hsphere/local/home/unclemik/summonedskull.com//catalog/admin/index.php
(addcode #1) Can't read file: /hsphere/local/home/unclemik/summonedskull.com//catalog/admin/includes/boxes/tools.php

 

This messages appear when Contrib Installer can't find a file. I'll change a message in next version.


===============================

Never give up! Never give up! Never give up!

Share this post


Link to post
Share on other sites

Hi, everybody!

Try new version.

Contrib Installer 1.0.14 uploaded

 

Changes since 1.0.13:

- added function recursive_permissions_check($path) (contrib_installer_base.php).

del_file (on permissions stage) checks if file and folders is writable recursivly...

 

- changed design of contribs list. Now we have a buttons near each contribs so we can use as many contribs as nessesary.

 

- Added definitions for buttons alt text in lang-file:

define('IMAGE_BUTTON_INSTALL', 'Install');

define('IMAGE_BUTTON_REMOVE', 'Remove');

 

- Changed message when file not exists form "Can't read file" to "File don't exists"

 

- added file How_To_Make_Contrib_Installer_Package.txt

 

May God bless you a lot.


===============================

Never give up! Never give up! Never give up!

Share this post


Link to post
Share on other sites

It still doesn't work for me, I thought this would be easy to install.

 

Now I get this error

Checking permissions: (findreplace #1) File don't exists: /hsphere/local/home/unclemik/summonedskull.com//catalog/admin/index.php

(addcode #1) File don't exists: /hsphere/local/home/unclemik/summonedskull.com//catalog/admin/includes/boxes/tools.php

Share this post


Link to post
Share on other sites

Ok, dumb question of the day (if not longer). How do I install a contribution installer? (Sort of like who's on first - lol). Or perhaps, even better yet, when I download a contribution, how do I install it or where do I save it? I've never tried a contribution before(obviously), but there are several things I'd like to change. Right now I want my "specials" to scroll. Thanks for any help!

 

Jennifer

Share this post


Link to post
Share on other sites

Hi!

Ok, dumb question of the day (if not longer). How do I install a contribution installer? (Sort of like who's on first - lol). Or perhaps, even better yet, when I download a contribution, how do I install it or where do I save it? I've never tried a contribution before(obviously), but there are several things I'd like to change. Right now I want my "specials" to scroll. Thanks for any help!

 

Latest versions of Contrib Installer contain this files:

 

How_To_Install.txt

How_To_Make_Contrib_Installer_Package.txt

How_To_Set_Permissions.txt

How_To_UnInstall.txt

How_To_UpDate_after_Broken_Install.txt

How_To_UpDate.txt

README.txt - What is Contrib Installer and how to get CIP's

 

After you install Contrib Installer at the top of page (/admin/contrib_installer.php)

you can see a link which let you search CIP (Contrib Installer Packages) for Contrib Installer.

 

Try to search:

http://www.oscommerce.com/community?contri...ge&category=all


===============================

Never give up! Never give up! Never give up!

Share this post


Link to post
Share on other sites
Now I get this error

Checking permissions: (findreplace #1) File don't exists: /hsphere/local/home/unclemik/summonedskull.com//catalog/admin/index.php

(addcode #1) File don't exists: /hsphere/local/home/unclemik/summonedskull.com//catalog/admin/includes/boxes/tools.php

 

Does this files exist?

Are you on Windows?


===============================

Never give up! Never give up! Never give up!

Share this post


Link to post
Share on other sites
es the files exist not sure what you mean about on window?

I'm working in Linux. What operation system do you use?


===============================

Never give up! Never give up! Never give up!

Share this post


Link to post
Share on other sites
I'm working in Linux. What operation system do you use?

I guess I was a little slow, I should have known what you meant.

I am also working in linux.

Share this post


Link to post
Share on other sites

Could you (or someone) do a contribution package for this contribution:

http://www.oscommerce.com/community/contributions,1026

 

I tried to use it and somehow screwed up things in my store and spent two days fixing them... Then I found your contribution and thought it would be perfect for me, so I won't screw up things anymore. In other words, I am looking for a safe shortcut. :rolleyes:

 

Any help woud be greatly appreciated!

 

jailaxmi


I repeat myself when under stress, I repeat myself when under stress, I repeat myself...

 

--King Crimson (“Discipline”)

Share this post


Link to post
Share on other sites

Hy Vlad,

 

Some suggestions from me. Refers to 1.0.14

 

1.) unzip of some xxx_CIP.zip in catalog/admin/contributions worked. Unfourtunally on my shared Linux server it was done with -rwxr-xr-x and I have to suggest it was done with the owner root. (I don't have root access on that server) I am not able to remove the extracted directories and files from catalog/admin/contributions/xxxtestcontrib any more. I have only ftp-access and always get a funny 550 error when I want to change permissions :( Can you check if unzip gives full access to all files -rwxrwxrwx.

 

2.) added function recursive_permissions_check($path) (contrib_installer_base.php) gives me unnnessecary errors in permission check when adding a file to the system down to the system root / when I want to have write access only to the directory where the file will be finally added.

I swiched back to version 1.0.13 in function addfile_permissions_check in file function permissions_check.php

 

3.) Can you add a message which says on Status something like installation pendig - please fix the errors and go to update when errors like for permissions arise.

 

Great work

 

Stefan

Edited by Stefan Walter

Share this post


Link to post
Share on other sites

This still dosn't work for me and people seem to have given up trying to help me. :(

 

 

Guess I forget about it and move on to something that works for me.

Edited by uncle mike

Share this post


Link to post
Share on other sites

I still haven't figured out the problem with the CIP file that I am trying to create but I think there is a biger problem with Ver. 1.0.14

 

Every CIP that I try to install seems to need write premissions to my root directory, I can't give CP those permissions even if I wanted to. Why has this changed and where might I find the code to fix this?

Share this post


Link to post
Share on other sites
I still haven't figured out the problem with the CIP file that I am trying to create but I think there is a biger problem with Ver. 1.0.14

 

Every CIP that I try to install seems to need write premissions to my root directory, I can't give CP those permissions even if I wanted to. Why has this changed and where might I find the code to fix this?

 

I have the exact same problem. I've kinda given up on this contribution...

 

jailaxmi


I repeat myself when under stress, I repeat myself when under stress, I repeat myself...

 

--King Crimson (“Discipline”)

Share this post


Link to post
Share on other sites
I have the exact same problem. I've kinda given up on this contribution...

 

jailaxmi

 

Try version 1.0.13 instead. I had the same problem with 1.0.14 but 1.0.13 came through :) having said that I've gotten all products to install but admin access has problems ...

 

Good luck!

 

amhazing

Share this post


Link to post
Share on other sites

Walkthrough of creating a CIP (contrib installer package)

 

I was looking for an idea of how hard it would be to create an install package but couldn't see any comments so I did one to find out and took some notes..

 

NOTE: version 1.0.14 of contrib installer doesn't work for me so I'm using 1.0.13 instead..

 

To give you a quick overview:

 

the Installation package is a directory that is the name of the install. Inside this directory there is a directory called catalog in which we put the new files that will be uploaded. There is then an XML file describing the package in the root of the install package directory..

 

The XML file does the following :-

* files to be added (which are stored in catalog directory)

* code to be added to a particular file

* code to be replaced in a particular file and what to be replaced with.

[ and in more complicated versions does SQL ]

 

The first part of the XML file is descriptive information:

 

It includes:

 

Description

* Details: - conrib_ref, forum_ref, contrib_type, status, last_update

* Comments

* Credits

 

The rest of the XML file details the installation using these:

* findreplace:- file name, find, replace, originallinenumbers start/end

* addcode:- file name, find, add, findlinenumbers start/end

* addfile:- filename

(and SQL too)

 

I noticed

![CDATA[   ]]

 

gets used alot - it's for enabling the script to easily deal with special characters without lots of escape characters from what the previous posts have said..

 

I chose to do the category tabs v 1.3 contrib because I'd done it the old fashioned way and knew it was pretty straight forward. (no SQL!!)

 

You can find the contrib here:

 

http://www.oscommerce.com/community/contri...h,category+tabs

 

This is what happened as I went through the process of creating a "CIP":

 

I started with the xml file.. (seemed like a good idea)

 

The top of the file is pretty straight forward - based on the info in the contrib page I created:

 

<contrib>

<description>

<details contrib_ref="751" forum_ref="00" contrib_type="Features" status="0" last_update="30 Jan 2003" />

<comments>This feature displays the main categories as a set of tabs in the header. A search box was also added to the header. The tabs are generated dynamically and use transparent gifs for the tab corners. As a result, the tab color, highlighted color and text properties can be controlled from the stylesheet. When you are on a main category the tab will be highlighted as long as you are in that category or any of it's subcategories.</comments>

<credits>B?rkur Ingi J?nsson and Paul Marshall with CIP by amhazing.com.au</credits>

</description>

 

I had a guess about 751 and had no idea about a forum ref and I think it's of type Features.. but since this stuff won't stop it working don't really care too much :)

 

Okay so now look at the install.txt that comes with the category tabs v 1.3 contrib to find out how to build it:

 

Install.txt (cat tabs)

 

"STEP 1 - Backup

STEP 2 - Backup"

- yep pay attention to these!

 

- I have a read only copy of the 2.2ms2 05113 CATALOG directory ready just in case and did a backup through the tools menu of the admin panel so I'm right to go!

 

"STEP 3. Copy the categories_tab.php file to the catalog/includes directory."

 

I implement this for contrib installer as follows:

 

<addfile>

<file name="includes/categories_tab.php" />

</addfile>

 

and I create a directory in the CIP folder catalog called "includes" into which I copy the required file..

 

"Step 4. Copy the images, trans_corner_left.gif an dtrans_corner_right.gif to the catalog/images/ directory."

 

same sort of thing again..

 

becomes this in the CIP XML file:

 

<addfile>

<file name="images/trans_corner_left.gif" />

</addfile>

 

<addfile>

<file name="images/trans_corner_right.gif" />

</addfile>

 

and create a directory called images in catalog and copy images into it..

 

"Step 5. Open catalog/stylesheet.css, add the folowing at the bottom of the page...."

 

so this would be an add to file. to add to file I need the following information:

 

* addcode:- file name, find, add, findlinenumbers start/end

 

now we want to put this at the end of the file.. so I go and look at my master copy of OSCommerce and find that this is at the end of the file:

 

/* input requirement */

 

.inputRequirement { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ff0000; }

 

between lines 287 and 291

 

this would translate into:

 

<addcode>

<file name="catalog/stylesheet.css" />

<find><![CDATA[/* input requirement */

 

.inputRequirement { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ff0000; }]]></find>

<add><![CDATA[

 

TD.tab {

background-color: Navy;

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-style: normal;

font-weight: bold;

font-size: smaller;

}

 

A.tab {

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-style: normal;

font-weight: bold;

font-size: 10px;

color: #ffffff;

text-decoration : none;

}

A.tab:hover {

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-style: normal;

font-weight: bold;

font-size: 10px;

color: #ffcc00;

text-decoration : none;

}

TD.ontab {

background-color: #6699ff;

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-style: normal;

font-weight: bold;

font-size: smaller;

color: #ffffff;

}

 

A.headerLink {

background-color: #ffffff;

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-style: normal;

font-weight: bold;

font-size: smaller;

color: #000099;

text-decoration : none;

}

A.headerLink:hover {

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-style: normal;

font-weight: bold;

font-size: smaller;

color: #99ccff;

text-decoration : none;

}

A.ontab {

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-style: normal;

font-weight: bold;

font-size: smaller;

color: #3184B5;

text-decoration : none;

}

]]></add>

<findlinenumbers start="287" end="291"/>

</addcode>

 

 

and now last step is:

 

"Step 6. Open catalog/includes/header.php, On or about line 54, replace:

 

<td align="right" valign="bottom"> ...snip... </a>'; ?>??</td>

 

with:

 

<td align="right" valign="top"> ...snip... </td>

 

which seems to be obviously an example of find and replace facility..

 

format for that is:

 

 

* findreplace:- file name, find, replace, originallinenumbers start/end

 

so this would look like:

 

<findreplace>

<file name="includes/header.php" />

<find><![CDATA[

<td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>??<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>??<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>??</td>

]]></find>

<replace><![CDATA[

<td align=right" valign="top">

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="right">

<tr>

<td height="40" align="right" valign="top"><form name="quick_find" method="get" action="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false);?>">

<input type="text" name="keywords" size="30" maxlength="40" value="<?php echo htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords]));?>">

?<?php echo tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH);?></form>

</td>

<td height="40" align="right" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>??<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>??<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>??

 

</td>

</tr>

<tr>

<td colspan="2" align="center" valign="bottom" nowrap>

<?php include(DIR_WS_INCLUDES . 'categories_tab.php'); ?>

</td>

</tr>

</table>

 

</td>

]]></replace>

<originallinenumbers start="54" end="65" />

</findreplace>

 

 

I used a pretty wide range of 54 to 66 - I checked my master copy of Catalog (MS2.2) and the line appears at about line 57 so I think I'm pretty safe with this line number range.

 

And that's it apart from the closing </contrib> tag..

 

now to test it..

 

I call the folder that holds the catalog and XML file "category tabs ver 1.3"

(turns out that's where the installer gets the name of the contrib from I think)

 

I ftp up the folder into the catalog/admin/contributions folder (which is what I called it at installation)

 

I go to the admin page catalog/admin click on the tools menu on the left

 

click on contrib installer that is at the top.

 

click on category tabs ver 1.3 in the list of contribs available

 

click on install

 

It responds with an error message:

 

(addcode #1) Can't read file: /home/dadsboat/public_html/catalog/catalog/stylesheet.css

 

 

which makes sense because I've stuffed up :)

 

first addcode should have been:

 

<addcode>

<file name="stylesheet.css" />

 

instead of catalog/stylesheet.css

 

I fix it and reupload the XML file..

 

It then comes up with:

 

Couldn't find (findreplace #1) in the file: /home/dadsboat/public_html/catalog/includes/header.php

 

I try removing extra spaces at start and end - no joy

I then go to my master copy (that I prepared earlier!!), find the text (line 58) and copy my version of that text instead of the one that came with the contrib.

 

because when I do a find for their version of the text in crimson editor (what I'm using to edit my php files..) in my master copy of CATALOG (MS2.2 SP051113) I don't find their version of the text.

 

I upload the changed install.xml, go back to the installer page and click update..

 

and it works!!!

 

But does it work??

 

go to my site front page..

 

to find it's put:

 

/* Begin category tabs ver 1.3 - installed by Contrib_Installer */

 

/* End category tabs ver 1.3 - installed by Contrib_Installer */

 

at the top of the page!!

 

hmm.. what now you say??

 

I guess I have to hack the contrib_installer to remove the add comments facility :)

 

or if in doubt read the manual :) (from 1.0.14 - which I'm not using but has a manual that helps)

 

 

-----------------------

When we modify any file by adding some code we wrap this code with comments.

When inserted code is a php-code we add comments like

/* Begin ....*/

... (code)

/* End ....*/

This is default behaviour. The same result you will get if write:

<replace type="php">

<add type="php"> - php-comments

 

If you insert code into HTML code you should write:

<add type="html">

<replace type="html"> - will use html-comments

Comments will be like this:

<!-- Begin .... -->

... (code)

<!-- End ....-->

 

This means that if you are trying to modify mixed (html and php) code you will get in problems.

Solution: splite inserted code in two parts - html-part and php-part and modify them separatly.

 

-------------------

 

AAHHH - so I need to go

<replace type="html"> to get the comments to show properly in HTML..

 

Okay, replaced the tag

 

but what do I do - I've installed the package already..

 

try to do update - it gives an error message. okay so do remove.. it seems to do something. oh well

- click contrib installer on tools menu at left and it looks like it's not installed any more.. so I'll reinstall it ..

 

hmm.. click remove, it says removed..

 

click install again...

 

Couldn't find (findreplace #1) in the file: /home/dadsboat/public_html/catalog/includes/header.php

 

okay..

 

so lets try the old fashioned repair method of overwriting header.php with the master catalog version..

 

yay.. shop starts working again (stops complaining about header.php problem..)

 

okay so go through install process with my updated install files..

 

yay .. looks good!!

 

 

okay - now the real test - removal! go to contrib installer in tools menu, click item and click remove.. test front - all seems okay!! great!!

 

I'll play with the shop a bit to make sure nothing is broken, do a few orders etc and then I'll move on to the next contrib, maybe something with SQL in it?

 

 

perhaps I'll look at repairing admin access?? which seems to be broken

 

- I'll post the results of my fault finding on that one next...

 

regards,

 

amhazing Harry

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×