diff --git a/htdocs/install.php b/htdocs/install.php
index bf611b0609b..f63574407f7 100644
--- a/htdocs/install.php
+++ b/htdocs/install.php
@@ -1,5 +1,85 @@
";
+
+ $fp = fopen("conf/conf.php", "w");
+ if($fp)
+ {
+
+ if (substr($HTTP_POST_VARS["main_dir"], strlen($HTTP_POST_VARS["main_dir"]) -1) == "/")
+ {
+ $HTTP_POST_VARS["main_dir"] = substr($HTTP_POST_VARS["main_dir"], 0, strlen($HTTP_POST_VARS["main_dir"])-1);
+ }
+
+ if (substr($HTTP_POST_VARS["main_url"], strlen($HTTP_POST_VARS["main_url"]) -1) == "/")
+ {
+ $HTTP_POST_VARS["main_url"] = substr($HTTP_POST_VARS["main_url"], 0, strlen($HTTP_POST_VARS["main_url"])-1);
+ }
+
+ fwrite($fp, '');
+ fclose($fp);
+
+ if (file_exists("conf/conf.php"))
+ {
+ include ("conf/conf.php");
+ }
+
+ print "- Configuration enregistré
";
+ print "- test de connexion à la base de données
";
+ require ($dolibarr_main_document_root . "/lib/mysql.lib.php3");
+ require ($dolibarr_main_document_root . "/conf/conf.class.php3");
+ $conf = new Conf();
+ $conf->db->host = $dolibarr_main_db_host;
+ $conf->db->name = $dolibarr_main_db_name;
+ $conf->db->user = $dolibarr_main_db_user;
+ $conf->db->pass = $dolibarr_main_db_pass;
+ $db = new Db();
+
+ $sql = "REPLACE INTO llx_const SET name = 'FAC_OUTPUTDIR', value='".$dolibarr_main_document_root."/document', visible=0, type='chaine'";
+
+ if ($db->query($sql))
+ {
+ print "- connexion réussie à la base de données
";
+
+ print 'Go !';
+
+ }
+ else
+ {
+ print $db->error();
+ }
+ $db->close();
+ }
+ else
+ {
+ print "Erreur le système à besoin d'écrire dans le fichier conf/conf.php veuillez mettre les droits correct pour cela.";
+ }
+ print "
- -