Mantis

Check install script FAIL Corrupted file

Posted by romanh 
Check install script FAIL Corrupted file
May 11, 2008 03:26AM
Hi Vincent.

Thanks for your excellent work.
I'm using mantis as bugtracker and I'd like to transfer couple of my patches on plugins.

I'm trying to create, for the beginning, a simple 'hello world' plugin.
I've followed the manual on [bugtracker.morinie.fr].
The plugin shows on plugins_page.php but when I click on 'install now' I get the 'Check install script FAIL Corrupted file' .

Could you please give me some hints.

I'm using Mantis-1.1.1 .


Best Regards.
Roman
Re: Check install script FAIL Corrupted file
May 11, 2008 10:12AM
Hi,

It seems that you forget to provide an install_inc.php file.

Here is an example: click here.

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 11, 2008 11:25AM
Thanks for quick replay.
Non it is not the case.
I have all files as described in [bugtracker.morinie.fr]
I think about to reduce the code so I can find the where it stucks
Re: Check install script FAIL Corrupted file
May 11, 2008 11:29AM
Can you post the content of the install_manual_inc.php file?

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 11, 2008 11:37AM
I didn't change anything it the same as on wiki
here you go

<?php

/**
* This file is used to install the plugin manually.
*
* Created: 2007-02-12
* Last update: 2007-09-18
*
*/

$t_result = array();
// Don&#039;t change $t_result[&#039;info_pm&#039;]
$t_result[&#039;info_pm&#039;] = array( &#039;name&#039; => &#039;Plugin Manager&#039;,
&#039;version&#039; => &#039;0.2.1&#039;,
&#039;url&#039; => &#039;[deboutv.free.fr]#039;,
&#039;check&#039; => &#039;[deboutv.free.fr]#039;,
&#039;upgrade&#039; => &#039;[deboutv.free.fr]#039; );
$t_result[&#039;info&#039;] = array( &#039;name&#039; => &#039;My Plugin&#039;, &#039;version&#039; => &#039;0.0.1&#039; );

$t_result[&#039;check&#039;][&#039;mantis&#039;][&#039;min&#039;] = &#039;1.0.5&#039;; // Optional
$t_result[&#039;check&#039;][&#039;php&#039;][&#039;min&#039;] = &#039;4.0.7&#039;; // Optional

$t_result[&#039;plugin&#039;] = &#039;myplugin&#039;;

?>



Edited 1 time(s). Last edit at 05/11/2008 11:38AM by romanh.
Re: Check install script FAIL Corrupted file
May 11, 2008 11:39AM
So your plugin is located into plugins/myplugin/ directory?

If yes, make sure that there is no error in the name of the file install_inc.php.

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 11, 2008 11:52AM
The file install_inc.php is in mantis_installation/plugins/my_plugin directory.
The code is copy / paste of => [bugtracker.morinie.fr]
Re: Check install script FAIL Corrupted file
May 11, 2008 11:54AM
So change $t_result[&#039;plugin&#039;] = &#039;myplugin&#039;; to $t_result[&#039;plugin&#039;] = &#039;my_plugin&#039;;

I&#039;ve updated the Wiki to explain the $t_result[&#039;plugin&#039;] meaning.

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 11, 2008 12:24PM
Now the message is &#039;Install/Upgrade instructions missing&#039;.
Thanks for the comments on wiki. It makes the procedure much more clear.



Edited 1 time(s). Last edit at 05/11/2008 12:31PM by romanh.
Re: Check install script FAIL Corrupted file
May 11, 2008 12:28PM
In your install_inc.php file you must have function like this:

function plugins_my_plugin_install_description_plugin( $p_step ) {

and not like this:

function plugins_pluginmanager_install_description_plugin( $p_step ) {

(my_plugin instead of pluginmanager).

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 11, 2008 12:50PM
I&#039;ve changed all the install/upgrade functions :
plugins_my_plugin_install_description_plugin
plugins_my_plugin_upgrade_description_plugin
plugins_my_plugin_install_plugin
plugins_my_plugin_upgrade_plugin
The $t_result[&#039;plugin&#039;] display right the name of my plugin
It doesn&#039;t help. I&#039;m still getting &#039;Install/Upgrade instructions missing&#039;
Re: Check install script FAIL Corrupted file
May 11, 2008 12:54PM
The following functions are missing:

plugins_my_plugin_install_undo_plugin
plugins_my_plugin_upgrade_undo_plugin

These functions are called if the installation fails (to remove what has already been installed).

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 11, 2008 01:01PM
Shouldn&#039;t all of the patterns &#039;pluginmanager&#039; be changed to my_plugin?
Re: Check install script FAIL Corrupted file
May 11, 2008 01:04PM
Yes. Here is another example with the plugin Search:

Language: PHP
  /** * Search Engine Plugin * * * Created: 2007-06-08 * Last update: 2008-03-24 * * @link http://deboutv.free.fr/mantis/ * @author Vincent DEBOUT <deboutv@free.fr> */ ( ( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_install_page.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, $_SERVER[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;PHP_SELF&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] ) && !ereg( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_uninstall_page.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, $_SERVER[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;PHP_SELF&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] ) ) { ( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Location: ../../plugins_page.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ); (); }   $t_plugins_plugin_manager_step_count =(); $t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;install&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 1; $t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;upgrade&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 1; $t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;uninstall&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 1; $t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;mantis_upgrade&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 0; $t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;mantis_repair&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 1; plugins_search_install_description_plugin( $p_step ) { &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Add menu link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;; } plugins_search_upgrade_description_plugin( $p_step ) { &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Add menu link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;; } plugins_search_uninstall_description_plugin( $p_step ) { &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Remove menu link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;; } plugins_search_mantis_upgrade_description_plugin( $p_step ) { &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;; } plugins_search_mantis_repair_description_plugin( $p_step ) { &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Check menu link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;; } plugins_search_install_plugin( &$p_msg, $p_step ) { $p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;   $t_main_menu_custom_options = config_get( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;main_menu_custom_options&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, array() ); $t_found =; (( $t_main_menu_custom_options ) &&( $t_main_menu_custom_options ) ) { ( $t_main_menu_custom_options $t_menu_link ) { ( $t_menu_link[0] == &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_search_link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ) { $t_found =; } } } { $t_main_menu_custom_options =(); } ( !$t_found ) { $t_main_menu_custom_options[] =( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_search_link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, VIEWER, &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins/search/search_page.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ); } config_set( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;main_menu_custom_options&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, $t_main_menu_custom_options ); PLUGINS_PLUGINMANAGER_OK; } plugins_search_upgrade_plugin( &$p_msg, $p_step ) { plugins_search_install_plugin( &$p_msg, $p_step ); } plugins_search_install_undo_plugin( &$p_msg, $p_step ) { $p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;   PLUGINS_PLUGINMANAGER_OK; } plugins_search_upgrade_undo_plugin( &$p_msg, $p_step ) { $p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;   PLUGINS_PLUGINMANAGER_OK; } plugins_search_uninstall_undo_plugin( &$p_msg, $p_step ) { $p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;   PLUGINS_PLUGINMANAGER_OK; } plugins_search_uninstall_plugin( &$p_msg, $p_step ) { $p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;   $t_main_menu_custom_options = config_get( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;main_menu_custom_options&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, array() ); ( $i=0; $i<count( $t_main_menu_custom_options ); $i++ ) { ( $t_main_menu_custom_options[$i][0] == &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_search_link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ) { ( $t_main_menu_custom_options[$i] ); } } config_set( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;main_menu_custom_options&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, $t_main_menu_custom_options );   PLUGINS_PLUGINMANAGER_OK; } plugins_search_mantis_upgrade_plugin( &$p_msg, $p_step ) { $p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;   PLUGINS_PLUGINMANAGER_OK; } plugins_search_mantis_repair_plugin( &$p_msg, $p_step ) { plugins_search_install_plugin( $p_msg, $p_step ); }  

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 11, 2008 01:05PM
Done for :
plugins_my_plugin_upgrade_undo_plugin and plugins_my_plugin_install_undo_plugin
It didn&#039;t help.
Re: Check install script FAIL Corrupted file
May 11, 2008 01:16PM
It seem&#039;s that there is a bug in the plugin manager.

Can you add this in your install_inc.php file:

Language: PHP
$t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;mantis_repair&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = $t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;install&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;]; plugins_my_plugin_mantis_repair_description_plugin( $p_step ) { plugins_my_plugin_install_description_plugin( $p_step ); } plugins_my_plugin_mantis_repair_plugin( &$p_msg, $p_step ) { plugins_my_plugin_install_plugin( $p_msg, $p_step ); }

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 11, 2008 01:26PM
Few step before you must have an information of the type of operation: Repair/Install/Upgrade. What do you have? (this is the "Install or Upgrade?" answer)

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 11, 2008 01:28PM
I&#039;ve replaced all the pluginmanager by the name of &#039;my plugin&#039; in all functions. The plugin&#039;s installed without the option &#039;uninstall&#039; and it&#039;s added one more link &#039;Plugins&#039; among the links.
Re: Check install script FAIL Corrupted file
May 11, 2008 01:31PM
That&#039;s because you didn&#039;t change the content of the install_inc.php file. The install_inc.php file represents what the plugin manager has to do to install the plugin (patch files, patch the database...).

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Check install script FAIL Corrupted file
May 14, 2008 12:16AM
Getting there step by step.
I&#039;ve used your example with the plugin Search to build my install_inc.php.
The installation works well and plugin is installed.
The problem is that the “uninstall” link is missing.
When I run manualy the [myserver] . The plugin is removed (directory included) but the link stays. I&#039;ve got already 5 undelete links .....
I&#039;ve checked the plugin db tables :
mantis_plugins_pm_dependencies_table, mantis_plugins_pm_function_overwrite_table and mantis_plugins_pm_list_table
All references of myplugin has disappeared I have no idea where the links are coming from.
Re: Check install script FAIL Corrupted file
May 14, 2008 08:33AM
The link appears because of the content of plugins_search_install_plugin function and is removed with the function plugins_search_uninstall_plugin.

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Sorry, only registered users may post in this forum.

Click here to login



Online Users

Guests: 11
Record Number of Users: 1 on April 02, 2023
Record Number of Guests: 115 on November 09, 2023
Top Users
Hébergeur : Morinie.Fr