From 9ff3e36a7c8c4c2ce2d65183ce80e5e81a95bc9c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jul 2011 14:56:11 +0000 Subject: [PATCH] Work on 3.1 packaging --- build/deb/changelog | 3 +- build/deb/install.forced.php.install | 8 +-- build/deb/postinst | 73 +++++++++++----------------- build/deb/postrm | 64 ++++++++++++------------ build/makepack-dolibarr.pl | 51 +++++++++++-------- build/rpm/install.forced.php.install | 5 +- htdocs/install/check.php | 6 ++- htdocs/install/etape0.php | 6 ++- htdocs/install/etape1.php | 7 ++- htdocs/install/etape2.php | 6 ++- htdocs/install/etape4.php | 6 ++- htdocs/install/etape5.php | 14 +++--- htdocs/install/fileconf.php | 43 +++++++++------- htdocs/install/licence.php | 6 ++- 14 files changed, 152 insertions(+), 146 deletions(-) diff --git a/build/deb/changelog b/build/deb/changelog index 47667b3cfb5..420975c16ec 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,6 +1,5 @@ -dolibarr (3.1.0-1.1) unstable; urgency=low +dolibarr (3.1.0) unstable; urgency=low - * Non-maintainer upload * New upstream release. closes: bug#634783 diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index c266426209b..7de8616ac15 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,19 +4,19 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.8 2011/07/27 16:45:47 eldy Exp $ +// $Id: install.forced.php.install,v 1.9 2011/07/30 14:56:12 eldy Exp $ // -$force_install_noedit=1; +$force_install_noedit=2; $force_install_message='KeepDefaultValuesDeb'; #$force_install_main_data_root='/usr/share/dolibarr/documents'; $force_install_main_data_root='/var/lib/dolibarr/documents'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; -$force_install_database='dolibarr'; +$force_install_database='dolibarrdebian'; $force_install_createdatabase='1'; -$force_install_databaselogin='dolibarrmysql'; +$force_install_databaselogin='dolibarrdebian'; $force_install_databasepass=''; $force_install_createuser='1'; $force_install_databaserootlogin='__SUPERUSERLOGIN__'; diff --git a/build/deb/postinst b/build/deb/postinst index dd03156a6d2..ca5fd1645dd 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -24,23 +24,31 @@ db_version 2.0 echo Run the dolibarr postinst script +# Define vars docdir='/var/lib/dolibarr/documents' #docdir='/usr/share/dolibarr/documents' - +apachefileorig="/usr/share/dolibarr/build/deb/apache.conf" +apacheconfig="/etc/dolibarr/apache.conf" +installfileorig="/usr/share/dolibarr/build/deb/install.forced.php.install" +installconfig="/etc/dolibarr/install.forced.php" +#config="/usr/share/dolibarr/htdocs/conf/conf.php" +config="/etc/dolibarr/conf.php" case "$1" in configure) - # Copy apache.conf file into target directory. - #fileorig="/usr/share/dolibarr/build/deb/apache.conf" - #config="/etc/dolibarr/apache.conf" - #mkdir -p /etc/dolibarr - #cp -p $fileorig $config + # Create document directory for uploaded data files + mkdir -p $docdir + chown -R www-data:www-data $docdir + chmod -R 775 $docdir + chmod -R g+s $docdir - # Edit install.forced.php to match Debian values - fileorig="/usr/share/dolibarr/build/deb/install.forced.php.install" - config="/usr/share/dolibarr/htdocs/install/install.forced.php" + # Copy apache.conf file into target directory + #mkdir -p /etc/dolibarr + #cp -p $apachefileorig $apacheconfig + + # Copy install config file (with matching Debian) values into target directory superuserlogin='' superuserpassword='' if [ -f /etc/mysql/debian.cnf ] ; then @@ -50,29 +58,24 @@ case "$1" in fi echo Mysql superuser found to use is $superuserlogin if [ -z "$superuserlogin" ] ; then - cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/root/g' | sed -e 's/__SUPERUSERPASSWORD__//g' > $config + cat $installfileorig | sed -e 's/__SUPERUSERLOGIN__/root/g' | sed -e 's/__SUPERUSERPASSWORD__//g' > $installconfig else - cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config + cat $installfileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $installconfig fi - - # Create document directory for uploaded data files - mkdir -p $docdir - chown -R www-data:www-data $docdir - chmod -R 775 $docdir - chmod -R g+s $docdir + chown -R root:www-data $installconfig + chmod -R 660 $installconfig # Create an empty conf.php with permission to web server - if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] + if [ ! -f $config ] then - echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php - touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R root:www-data /usr/share/dolibarr/htdocs/conf/conf.php - chmod -R 660 /usr/share/dolibarr/htdocs/conf/conf.php + echo Create empty file $config + touch $config + chown -R root:www-data $config + chmod -R 660 $config fi - #db_reset "dolibarr/webserver" - # Get the web server type (use db_get for interactive mode). + #db_reset "dolibarr/webserver" #db_get "dolibarr/webserver" # Read value for webserver. #webserver="$RET" @@ -102,7 +105,7 @@ case "$1" in # Set permissions to web server chown -R $webuser:$webgroup /usr/share/dolibarr - chown -R root:$webgroup /usr/share/dolibarr/htdocs/conf/conf.php + chown -R root:$webgroup $config # Add link to config file echo Setup web server $server to add dolibarr config file @@ -110,26 +113,6 @@ case "$1" in done - #echo "Install menu entry" - # This one is for Gnome ubuntu - #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" - #target="/usr/share/applications/" - #cp -f $fileorig $target - # Not sure this is usefull - #if test -x /usr/bin/update-menus; then - # echo "update-menus" - # update-menus; - #fi - - # TODO Create the file to force parameters in Web installer - #if grep DBHOST /usr/share/dolibarr/htdocs/conf/conf.php > /dev/null - #then - # perl -pi -e "s/DBHOST/$dbserver/" /usr/share/dolibarr/htdocs/conf/conf.php - # perl -pi -e "s/DBNAME/$dbname/" /usr/share/dolibarr/htdocs/conf/conf.php - # perl -pi -e "s/DBUSER/$dbuser/" /usr/share/dolibarr/htdocs/conf/conf.php - # perl -pi -e "s/DBPASS/$dbpass/" /usr/share/dolibarr/htdocs/conf/conf.php - #fi - # Restart servers servers="apache2-ssl apache2 mysql" # Another way to restart diff --git a/build/deb/postrm b/build/deb/postrm index 8be194f0a41..95f27de27dd 100644 --- a/build/deb/postrm +++ b/build/deb/postrm @@ -26,6 +26,10 @@ echo Run the dolibarr postrm script docdir='/var/lib/dolibarr/documents' #docdir='/usr/share/dolibarr/documents' +apachefileorig="/usr/share/dolibarr/build/deb/apache.conf" +apacheconfig="/etc/dolibarr/apache.conf" +#config="/usr/share/dolibarr/htdocs/conf/conf.php" +config="/etc/dolibarr/conf.php" export webserver="" @@ -36,13 +40,12 @@ case $webserver in Both) webservers="apache2 apache2-ssl" ;; *) webservers="apache2 apache2-ssl" ;; esac -export includefile=/etc/dolibarr/apache.conf case "$1" in # Call when we uninstall and purge purge) - echo "postrm purge webservers=$webservers includefile=$includefile" + echo "postrm purge webservers=$webservers apacheconfig=$apacheconfig" # Ask if we must delete database echo "postrm db_input dolibarr/postrm" @@ -59,7 +62,8 @@ case "$1" in echo postrm Mysql database deletion # Get database configuration dbserver="localhost" - dbname="dolibarrmysql" + dbuser="dolibarrdebian" + dbname="dolibarrdebian" #db_get "dolibarr/db/name" #dbname="$RET" superuserlogin='' @@ -120,23 +124,31 @@ case "$1" in fi mysqlcmd="mysql $hostopt $passopt -u $dbadmin" - # Now run the drop commands - if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then - log="${log}Droping database $dbname." - if eval $mysqlcmd -f -e "\"DROP DATABASE $dbname;\"" ; then - if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then - error="Database $dbname NOT successfully droped. You have to do it manually." - echo $error - else - status=drop - fi + # Now run the drop user + if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'localhost';\"" ; then + echo Database login $dbuser removed else - error="Unable to run the drop database script." + error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'localhost';\"" echo $error fi + + # Now run the drop commands + if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then + log="${log}Droping database $dbname." + if eval $mysqlcmd -f -e "\"DROP DATABASE $dbname;\"" ; then + if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then + error="Database $dbname NOT successfully droped. You have to do it manually." + echo $error + else + status=drop + fi + else + error="Unable to run the drop database script." + echo $error + fi else - status=nothing - log="${log}Database $dbname already not exists." + status=nothing + log="${log}Database $dbname already not exists." fi echo "Remove directory $docdir" @@ -178,18 +190,6 @@ case "$1" in set -e done - # Remove file and conf file - for dir in /usr/share/dolibarr; do - if [ -d $dir ] ; then - # We disable blocking errors - set +e - echo "Remove directory $dir" - rm -rf $dir ; - # We restore blocking errors - set -e - fi - done - # We clean variable (we ignore errors because db_reset can fails if var was never set) set +e db_reset "dolibarr/postrm" @@ -200,19 +200,15 @@ case "$1" in # Call when we uninstall remove) - echo "postrm Force remove of /usr/share/dolibarr/htdocs/install" - rm -fr /usr/share/dolibarr/htdocs/install + rm -f /usr/share/dolibarr/install.lock - echo "postrm Force remove of /usr/share/dolibarr/htdocs/conf" - rm -fr /usr/share/dolibarr/htdocs/conf - # Remove include files export restart="" for server in $webservers ; do export conffile="/etc/$server/conf.d/dolibarr.conf" if [ -f $conffile ] ; then - echo Delete file $conffile + echo Delete link $conffile rm -f $conffile status=purge fi diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 5dcf81d3a85..a791fd3f828 100644 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -2,7 +2,7 @@ #---------------------------------------------------------------------------- # \file build/makepack-dolibarr.pl # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps) -# \version $Id: makepack-dolibarr.pl,v 1.122 2011/07/30 10:23:26 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.123 2011/07/30 14:56:12 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.122 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.123 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -522,20 +522,33 @@ if ($nboftargetok) { print "Version set to $MAJOR.$MINOR.$newbuild\n"; print "Remove other files\n"; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/COPYRIGHT`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/INSTALL`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README-FR`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/README`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/README-FR`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/aps`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dmg`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/pad/README`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/tgz/README`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/README`; + #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/po`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/changelog`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/compat`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/config`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/control.*`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/copyright`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/dolibarr.desktop`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/dolibarr.menu`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/format`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/install`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/menu`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/postrm`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/postinst`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/rules`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/README.debian`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/templates`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/templates.futur`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/wash`; @@ -649,29 +662,25 @@ if ($nboftargetok) { $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian/source"`; $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/pom.xml"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/COPYRIGHT"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/INSTALL"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README-FR"`; $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc"`; print "Copy $SOURCE/build/deb/xxx to $BUILDROOT/$PROJECT.tmp/debian\n"; # Add files for dpkg-source - $ret=`cp -f "$SOURCE/ChangeLog" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/UserChangeLog"`; - $ret=`cp -f "$SOURCE/build/deb/README.debian" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/README"`; - $ret=`cp -f "$SOURCE/build/deb/changelog" "$BUILDROOT/$PROJECT.tmp/debian/changelog"`; - $ret=`cp -f "$SOURCE/build/deb/control.debian" "$BUILDROOT/$PROJECT.tmp/debian/control"`; - $ret=`cp -f "$SOURCE/build/deb/install" "$BUILDROOT/$PROJECT.tmp/debian/install"`; - $ret=`cp -f "$SOURCE/build/deb/rules" "$BUILDROOT/$PROJECT.tmp/debian/rules"`; - $ret=`cp -f "$SOURCE/build/deb/copyright" "$BUILDROOT/$PROJECT.tmp/debian/copyright"`; - $ret=`cp -f "$SOURCE/build/deb/compat" "$BUILDROOT/$PROJECT.tmp/debian/compat"`; - $ret=`cp -f "$SOURCE/build/deb/format" "$BUILDROOT/$PROJECT.tmp/debian/source/format"`; - $ret=`cp -fr "$SOURCE/build/deb/po" "$BUILDROOT/$PROJECT.tmp/debian/po"`; + $ret=`cp -f "$SOURCE/ChangeLog" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/UserChangeLog"`; + $ret=`cp -f "$SOURCE/build/deb/README.debian" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/README"`; + $ret=`cp -f "$SOURCE/build/deb/changelog" "$BUILDROOT/$PROJECT.tmp/debian/changelog"`; + $ret=`cp -f "$SOURCE/build/deb/control.debian" "$BUILDROOT/$PROJECT.tmp/debian/control"`; + $ret=`cp -f "$SOURCE/build/deb/install" "$BUILDROOT/$PROJECT.tmp/debian/install"`; + $ret=`cp -f "$SOURCE/build/deb/rules" "$BUILDROOT/$PROJECT.tmp/debian/rules"`; + $ret=`cp -f "$SOURCE/build/deb/copyright" "$BUILDROOT/$PROJECT.tmp/debian/copyright"`; + $ret=`cp -f "$SOURCE/build/deb/compat" "$BUILDROOT/$PROJECT.tmp/debian/compat"`; + $ret=`cp -f "$SOURCE/build/deb/format" "$BUILDROOT/$PROJECT.tmp/debian/source/format"`; + $ret=`cp -fr "$SOURCE/build/deb/po" "$BUILDROOT/$PROJECT.tmp/debian/po"`; + $ret=`rm -fr "$SOURCE/build/deb/po/CVS"`; # Add files also required to build binary package with dpkg-buildpackages - $ret=`cp -f "$SOURCE/build/deb/config" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/deb/postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/deb/postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/deb/templates" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/deb/config" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/deb/postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/deb/postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/deb/templates" "$BUILDROOT/$PROJECT.tmp/debian"`; $cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; $ret=`$cmd`; diff --git a/build/rpm/install.forced.php.install b/build/rpm/install.forced.php.install index f01e5303ce0..5f390270b51 100755 --- a/build/rpm/install.forced.php.install +++ b/build/rpm/install.forced.php.install @@ -3,11 +3,10 @@ $force_install_noedit=2; $force_install_message='KeepDefaultValuesDeb'; $force_install_main_data_root='/usr/share/dolibarr/documents'; $force_install_type='mysqli'; -$force_install_dbserver='localhost'; $force_install_port='3306'; -$force_install_database='dolibarrrpm'; +$force_install_database='dolibarr'; $force_install_createdatabase='1'; -$force_install_databaselogin='dolibarrrpm'; +$force_install_databaselogin='dolibarrmysql'; $force_install_databasepass=''; $force_install_createuser='1'; $force_install_databaserootlogin='__SUPERUSERLOGIN__'; diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 374ebd4ebbf..3724ef23d95 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -23,7 +23,7 @@ * \file htdocs/install/check.php * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it - * \version $Id: check.php,v 1.85 2011/07/30 10:23:25 eldy Exp $ + * \version $Id: check.php,v 1.86 2011/07/30 14:56:43 eldy Exp $ */ include_once("./inc.php"); @@ -39,7 +39,9 @@ $langs->load("install"); // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin=''; -if (file_exists("./install.forced.php")) include_once("./install.forced.php"); +$useforcedwizard=false; +if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } +else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } dolibarr_install_syslog("Dolibarr install/upgrade process started"); diff --git a/htdocs/install/etape0.php b/htdocs/install/etape0.php index f11fdb322b7..20ef1080e85 100644 --- a/htdocs/install/etape0.php +++ b/htdocs/install/etape0.php @@ -22,7 +22,7 @@ * \file htdocs/install/etape0.php * \ingroup install * \brief Show and ask charset for database - * \version $Id: etape0.php,v 1.40 2011/07/30 10:23:25 eldy Exp $ + * \version $Id: etape0.php,v 1.41 2011/07/30 14:56:43 eldy Exp $ */ define('DONOTLOADCONF',1); // To avoid loading conf by file inc.php @@ -49,7 +49,9 @@ $passroot=isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:""; $main_dir=isset($_POST["main_dir"])?trim($_POST["main_dir"]):''; // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. -if (file_exists("./install.forced.php")) include_once("./install.forced.php"); +$useforcedwizard=false; +if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } +else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } dolibarr_install_syslog("--- etape0: Entering etape0.php page"); diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index d430b8731df..5d7fca530f2 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -24,7 +24,7 @@ * \file htdocs/install/etape1.php * \ingroup install * \brief Build conf file on disk - * \version $Id: etape1.php,v 1.134 2011/07/30 10:23:25 eldy Exp $ + * \version $Id: etape1.php,v 1.135 2011/07/30 14:56:42 eldy Exp $ */ define('DONOTLOADCONF',1); // To avoid loading conf by file inc.php @@ -39,7 +39,9 @@ $langs->load("admin"); $langs->load("install"); // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. -if (file_exists("./install.forced.php")) include_once("./install.forced.php"); +$useforcedwizard=false; +if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } +else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } dolibarr_install_syslog("--- etape1: Entering etape1.php page"); @@ -526,6 +528,7 @@ function write_conf_file($conffile) global $dolibarr_main_url_root,$dolibarr_main_document_root,$dolibarr_main_data_root,$dolibarr_main_db_host; global $dolibarr_main_db_port,$dolibarr_main_db_name,$dolibarr_main_db_user,$dolibarr_main_db_pass; global $dolibarr_main_db_type,$dolibarr_main_db_character_set,$dolibarr_main_db_collation,$dolibarr_main_authentication; + global $conffile,$conffiletoshow,$conffiletoshowshort; $error=0; diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index e29a0b49221..d7df4ac6929 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -21,7 +21,7 @@ * \file htdocs/install/etape2.php * \ingroup install * \brief Create tables, primary keys, foreign keys, indexes and functions into database and then load reference data - * \version $Id: etape2.php,v 1.104 2011/07/30 10:23:25 eldy Exp $ + * \version $Id: etape2.php,v 1.105 2011/07/30 14:56:43 eldy Exp $ */ include("./inc.php"); @@ -54,7 +54,9 @@ if ($dolibarr_main_db_type == "pgsql") $choix=2; if ($dolibarr_main_db_type == "mssql") $choix=3; // Init "forced values" to nothing. "forced values" are used after a Doliwamp install wizard. -if (file_exists("./install.forced.php")) include_once("./install.forced.php"); +$useforcedwizard=false; +if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } +else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } dolibarr_install_syslog("--- etape2: Entering etape2.php page"); diff --git a/htdocs/install/etape4.php b/htdocs/install/etape4.php index 80a2cf5f51d..9a0dd0fcc43 100644 --- a/htdocs/install/etape4.php +++ b/htdocs/install/etape4.php @@ -23,7 +23,7 @@ * \file htdocs/install/etape4.php * \ingroup install * \brief Ask login and password of Dolibarr admin user - * \version $Id: etape4.php,v 1.36 2011/07/30 10:23:25 eldy Exp $ + * \version $Id: etape4.php,v 1.37 2011/07/30 14:56:43 eldy Exp $ */ @@ -41,7 +41,9 @@ $langs->load("install"); // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin=''; -if (file_exists("./install.forced.php")) include_once("./install.forced.php"); +$useforcedwizard=false; +if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } +else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } dolibarr_install_syslog("--- etape4: Entering etape4.php page"); diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index af4df81ae1a..5e826a0f9f7 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -24,7 +24,7 @@ * \file htdocs/install/etape5.php * \ingroup install * \brief Last page of upgrade or install process - * \version $Id: etape5.php,v 1.103 2011/07/30 10:23:25 eldy Exp $ + * \version $Id: etape5.php,v 1.104 2011/07/30 14:56:43 eldy Exp $ */ include_once("./inc.php"); @@ -63,12 +63,9 @@ if (! isset($force_install_databasepass)) $force_install_databasepass=''; if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin=''; if (! isset($force_install_databaserootpass)) $force_install_databaserootpass=''; if (! isset($force_install_lockinstall)) $force_install_lockinstall=''; -$usedoliwamp=false; -if (file_exists("./install.forced.php")) -{ - $usedoliwamp=true; - include_once("./install.forced.php"); -} +$useforcedwizard=false; +if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } +else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } dolibarr_install_syslog("--- etape5: Entering etape5.php page", LOG_INFO); @@ -105,6 +102,7 @@ if ($action == "set") */ pHeader($langs->trans("SetupEnd"),"etape5"); +print '
'; // Test if we can run a first install process if (! GETPOST("versionfrom") && ! GETPOST("versionto") && ! is_writable($conffile)) @@ -208,7 +206,7 @@ if ($action == "set" || preg_match('/upgrade/i',$action)) if (! $resql) dol_print_error($db,'Error in setup program'); $conf->global->MAIN_VERSION_LAST_INSTALL=$targetversion; - if ($usedoliwamp) + if ($useforcedwizard) { dolibarr_install_syslog('install/etape5.php set MAIN_REMOVE_INSTALL_WARNING const to 1', LOG_DEBUG); $resql=$db->query("DELETE FROM llx_const WHERE ".$db->decrypt('name')."='MAIN_REMOVE_INSTALL_WARNING'"); diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 6448a678189..6d19b01e197 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -25,7 +25,7 @@ * \file htdocs/install/fileconf.php * \ingroup install * \brief Ask all informations required to build Dolibarr htdocs/conf/conf.php file (will be wrote on disk on next page) - * \version $Id: fileconf.php,v 1.92 2011/07/30 10:23:25 eldy Exp $ + * \version $Id: fileconf.php,v 1.93 2011/07/30 14:56:43 eldy Exp $ */ include_once("./inc.php"); @@ -39,8 +39,8 @@ $langs->load("install"); $langs->load("errors"); // You can force preselected values of the config step of Dolibarr by adding a file -// install.forced.php into directory htdocs/install (This is the case with some installer -// lile DoliWamp, DoliMamp or DoliBuntu. +// install.forced.php into directory htdocs/install (This is the case with some wizard +// installer like DoliWamp, DoliMamp or DoliBuntu). // We first init "forced values" to nothing. if (! isset($force_install_noedit)) $force_install_noedit=''; if (! isset($force_install_type)) $force_install_type=''; @@ -53,7 +53,9 @@ if (! isset($force_install_databasepass)) $force_install_databasepass=''; if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin=''; if (! isset($force_install_databaserootpass)) $force_install_databaserootpass=''; // Now we load forced value from install.forced.php file. -if (file_exists("./install.forced.php")) include_once("./install.forced.php"); +$useforcedwizard=false; +if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } +else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } dolibarr_install_syslog("Fileconf: Entering fileconf.php page"); @@ -159,7 +161,10 @@ if (! empty($force_install_message)) } ?> - name="main_data_dir"> + '; + print ''; + ?> trans("WithNoSlashAtTheEnd")."
"; @@ -167,7 +172,7 @@ if (! empty($force_install_message)) print $langs->trans("Examples").":
"; ?> @@ -205,7 +210,10 @@ if (empty($dolibarr_main_url_root)) trans("URLRoot"); ?> - value=""> + '; + print ''; + ?> trans("Examples").":
"; ?>