diff --git a/ChangeLog b/ChangeLog
index a5016f1d016e69acde7ad9e76cd234b90d0b334c..eb58f849be4f8307e04aa8d9585c36200f023ae9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,13 @@
 English Dolibarr ChangeLog
 --------------------------------------------------------------
 
+***** ChangeLog for 3.3.5 compared to 3.3.4 *****
+
+- Fix: Change to make debian package ok despite removal of ckeditor.
+- Fix: jcrop file to match debian rules
+- Fix: Add missing country UK.
+- Fix: Minor fix into package.
+- Fix: Add missing label on project field.
 
 ***** ChangeLog for 3.3.4 compared to 3.3.3 *****
 
diff --git a/build/README b/build/README
index 954270d6ef2f3bbaf66079909039b69473f28568..897a59c4eef9d32e261953e4af04b513d6ee781a 100644
--- a/build/README
+++ b/build/README
@@ -7,10 +7,27 @@ All sub-directories of "build" directory contains files required to build
 automatically Dolibarr packages.
 There are several tools:
 
+
+
 - To build full Dolibarr packages, launch the script
-> Edit version in makepack-dolibarr.pl file.
 > Launch command perl makepack-dolibarr.pl
 
+Note: Prerequisites to build tgz, debian, rpm package
+> apt-get install tar dpkg dpatch p7zip-full rpm zip
+
+Note: Prerequisites to build autoexe DoliWamp package:
+> Install InnoSetup
+   For example by running isetup-5.3.9.exe (http://www.jrsoftware.org)
+> Install WampServer into "C:\Program Files\Wamp"
+   For example by running wampserver2.2e-php5.4.3-httpd-2.4.2-mysql5.5.24-x64.exe (http://www.wampserver.com)
+> Install WampServer addon to have versions: Apache2.2.11, Mysql5.0.45, Php5.3.0
+   For example by running WampServer2-APACHE2211.exe (http://www.wampserver.com)
+   For example by running WampServer2-MYSQL5045.exe (http://www.wampserver.com)
+   For example by running WampServer2-PHP530.exe (http://www.wampserver.com)
+> To build from Windows (running from makepack-dolibarr.pl script is however
+  recommanded), open file build/exe/doliwamp.iss and click on button "Compile".
+  The .exe file will be build into directory build.
+
 - To build a translaction package, launch the script
 > perl makepack-dolibarrlang.pl
 
@@ -20,17 +37,6 @@ There are several tools:
 - To build a package for a module, launch the script
 > perl makepack-dolibarrmodule.pl
 
-- To build an autoexe DoliWamp package:
-> Install InnoSetup (http://www.jrsoftware.org)
-> Install WampServer into "C:\Program Files\Wamp" (http://www.wampserver.com)
-> Install WampServer addon to have versions:
-   Apache2.2.6, Mysql5.0.45, Php5.2.5
-> Modify file build/exe/doliwamp.iss to change variable SourceDir
-  with value of Dolibarr repository.
-> Modify AppVerName and OutputBaseFilename.
-> Launch innosetup, open file build/exe/doliwamp.iss and click on
-  button "Compile". The .exe file will be build into directory build.
-
 - To build developper documentation, launch the script
 > perl dolybarr-doxygen-build.pl
 
@@ -43,24 +49,33 @@ generated packages will not contains this "build" directory.
 
 We can find in "build", following sub-directories:
 
-* deb:
+* aps:
+To build APS package.
+
+* debian:
 To build Debian package.
 
-* rpm:
-To build Redhat or Mandrake package.
+* dmg:
+To build Mac OS package (not ready yet).
 
-* tgz:
-To build a tgz package.
+* doap:
+To build Doap descriptor to promote/describe Dolibarr releases.
+
+* doxygen:
+Dir with config file to build doxygen documentation.
 
 * exe:
 To build exe package for Windows that distribute Dolibarr sources or
 to build the complete DoliWamp package.
 
-* tgz:
-To build a zip package.
+* launchpad:
+Doc file to explain how to use launchpad.
 
-* doap:
-To build Doap descriptor to promote/describe Dolibarr releases.
+* live:
+Doc file to explain how to create a demo live CD.
+
+* obs:
+Doc file to explain how to push release onto OBS.
 
 * pad:
 To build a PAD file descriptor to promote/describe Dolibarr releases.
@@ -68,5 +83,14 @@ To build a PAD file descriptor to promote/describe Dolibarr releases.
 * patch:
 Script file to generate a patch file to distribute a Dolibarr mod.
 
-* dmg:
-To build dmg DoliMamp package for Mac OS X
+* perl:
+Tool to install dolibarr when using virtualmin pro
+
+* rpm:
+To build Redhat, Opensuse or Mandriva package.
+
+* tgz:
+To build a tgz package.
+
+* zip:
+To build a zip package.
diff --git a/build/debian/changelog b/build/debian/changelog
index 3a798d0d3cd50dae104e0a41f7fa4f3c776fe499..fe0fc6bbacb0513c7067350b9592d0be7f614d8c 100644
--- a/build/debian/changelog
+++ b/build/debian/changelog
@@ -1,6 +1,6 @@
-dolibarr (3.3.4) unstable; urgency=low
+dolibarr (3.3.5) unstable; urgency=low
 
   [ Laurent Destailleur (eldy) ]
   * New upstream release.
     
- -- Laurent Destailleur (eldy) <eldy@users.sourceforge.net>  Mon, 22 Apr 2013 12:00:00 +0100     
+ -- Laurent Destailleur (eldy) <eldy@users.sourceforge.net>  Mon, 30 Dec 2013 12:00:00 +0100     
diff --git a/build/debian/dolibarr.install b/build/debian/dolibarr.install
index beae194006dbbbb7693f0e2c83cd75d2603a66de..fcbf0cdb43ac793805aa71203c84b18f63215f19 100755
--- a/build/debian/dolibarr.install
+++ b/build/debian/dolibarr.install
@@ -1,6 +1,5 @@
 debian/dolibarr.desktop usr/share/applications
 debian/dolibarr.xpm usr/share/pixmaps
-ChangeLog usr/share/doc/dolibarr
 README usr/share/doc/dolibarr
 doc/install usr/share/doc/dolibarr
 doc/user usr/share/doc/dolibarr
diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss
index 9bd1afd34e9a8c5386fc6b0bc30c50a6bcc60474..56db37dd05c7cf76f310ad59be52c57f3538755b 100644
--- a/build/exe/doliwamp/doliwamp.iss
+++ b/build/exe/doliwamp/doliwamp.iss
@@ -1,1023 +1,1018 @@
-; ----- DoliWamp.iss ---------------------------------------------------------------------
-; Script to build an auto installer for Dolibarr.
-; Works with InnoSetup 5.4.0 (a)
-; Idea from WampServer 2 (http://www.wampserver.com)
-;----------------------------------------------------------------------------------------
-; You must edit some path in this file to build an exe (like SourceDir).
-; WARNING: Be sure that user.* files of Mysql database used to build
-; package contains only one user called root with no password.
-; For this, you can edit the mysql.user table of the source database to keep
-; only the root user with no password, stop server and catch
-; files user.MY* to put them in the Dolibarr build/exe/doliwamp/mysql directory.
-;
-;----------------------------------------------------------------------------------------
-
-
-[Setup]
-; ----- Change this -----
-AppName=DoliWamp
-; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
-AppVerName=DoliWamp-3.3.4
-; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
-OutputBaseFilename=DoliWamp-3.3.4
-; Define full path from wich all relative path are defined
-; You must modify this to put here your dolibarr root directory
-;SourceDir=C:\Documents and Settings\ldestailleur\git\dolibarr_old
-;SourceDir=Z:\home\ldestailleur\git\dolibarr_veryold
-SourceDir=..\..\..
-; ----- End of change
-;OutputManifestFile=build\doliwampbuild.log
-AppId=doliwamp
-AppPublisher=NLTechno
-AppPublisherURL=http://www.nltechno.com
-AppSupportURL=http://www.dolibarr.org
-AppUpdatesURL=http://www.dolibarr.org
-AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
-AppCopyright=Copyright (C) 2008-2013 Laurent Destailleur, NLTechno
-DefaultDirName=c:\dolibarr
-DefaultGroupName=Dolibarr
-;LicenseFile=COPYING
-;Compression=none
-Compression=lzma
-SolidCompression=yes
-WizardImageFile=build\exe\doliwamp\doliwamp.bmp
-WizardSmallImageFile=build\exe\doliwamp\doliwampsmall.bmp
-SetupIconFile=doc\images\dolibarr.ico
-PrivilegesRequired=admin
-DisableProgramGroupPage=yes
-ChangesEnvironment=no
-CreateUninstallRegKey=yes
-;UseSetupLdr=no
-;UninstallDisplayIcon={app}\bidon
-OutputDir=build
-ShowLanguageDialog=auto
-ShowUndisplayableLanguages=no
-;LanguageDetectionMethod=none
-LanguageDetectionMethod=uilanguage
-;SignedUninstaller=yes
-
-[Languages]
-Name: "en"; MessagesFile: "compiler:Default.isl,build\exe\doliwamp\Languages\MyEnglish.isl"
-Name: "br"; MessagesFile: "compiler:Languages\Portuguese.isl,build\exe\doliwamp\Languages\MyBrazilianPortuguese.isl"
-Name: "ca"; MessagesFile: "compiler:Languages\Catalan.isl,build\exe\doliwamp\Languages\MyCatalan.isl"
-Name: "da"; MessagesFile: "compiler:Languages\Danish.isl,build\exe\doliwamp\Languages\MyDanish.isl"
-Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl,build\exe\doliwamp\Languages\MySpanish.isl"
-Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl,build\exe\doliwamp\Languages\MyDutch.isl"
-Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl,build\exe\doliwamp\Languages\MyFinnish.isl"
-Name: "fr"; MessagesFile: "compiler:Languages\French.isl,build\exe\doliwamp\Languages\MyFrench.isl"
-Name: "ge"; MessagesFile: "compiler:Languages\German.isl,build\exe\doliwamp\Languages\MyGerman.isl"
-Name: "it"; MessagesFile: "compiler:Languages\Italian.isl,build\exe\doliwamp\Languages\MyItalian.isl"
-Name: "nb"; MessagesFile: "compiler:Languages\Norwegian.isl,build\exe\doliwamp\Languages\MyNorwegian.isl"
-Name: "po"; MessagesFile: "compiler:Languages\Polish.isl,build\exe\doliwamp\Languages\MyPolish.isl"
-Name: "pt"; MessagesFile: "compiler:Languages\Portuguese.isl,build\exe\doliwamp\Languages\MyPortuguese.isl"
-Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl,build\exe\doliwamp\Languages\MyRussian.isl"
-Name: "sv"; MessagesFile: "compiler:Languages\Slovenian.isl,build\exe\doliwamp\Languages\MySlovenian.isl"
-
-[Tasks]
-;Name: "autostart"; Description: "Automatically launch DoliWamp server on startup. If you check this option, Services will be installed as automatic. Otherwise, services will be installed as manual and will start and stop with the service manager."; GroupDescription: "Auto Start:" ;Flags: unchecked;
-Name: "quicklaunchicon"; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
-Name: "desktopicon"; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
-
-[Dirs]
-Name: "{app}\logs"
-Name: "{app}\tmp"
-Name: "{app}\dolibarr_documents"
-Name: "{app}\bin\apache\apache2.2.11\logs"
-
-[Files]
-; Stop/start
-Source: "build\exe\doliwamp\stopdoliwamp.bat"; DestDir: "{app}\"; Flags: ignoreversion; AfterInstall: close()
-Source: "build\exe\doliwamp\startdoliwamp.bat"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\removefiles.bat"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\rundoliwamp.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\rundolihelp.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\rundoliadmin.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\install_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\uninstall_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\mysqlinitpassword.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\mysqltestinstall.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\startdoliwamp_manual_donotuse.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\builddemosslfiles.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversion;
-; PhpMyAdmin, Apache, Php, Mysql
-; Put here path of Wampserver applications
-; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45 or 5.1.36
-; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45 or 5.1.36
-Source: "C:\Program Files\Wamp\apps\phpmyadmin3.2.0.1\*.*"; DestDir: "{app}\apps\phpmyadmin3.2.0.1"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log,darkblue_orange"
-Source: "C:\Program Files\Wamp\bin\apache\apache2.2.11\*.*"; DestDir: "{app}\bin\apache\apache2.2.11"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
-Source: "C:\Program Files\Wamp\bin\php\php5.3.0\*.*"; DestDir: "{app}\bin\php\php5.3.0"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
-Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe"
-; Mysql data files (does not overwrite if exists)
-Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
-; Dolibarr
-Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
-Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,xdebug\*"
-Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
-Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"
-Source: "*.*"; DestDir: "{app}\www\dolibarr"; Flags: ignoreversion; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,default.properties,install.lock"
-; Config files
-Source: "build\exe\doliwamp\phpmyadmin.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\config.inc.php.install"; DestDir: "{app}\apps\phpmyadmin3.2.0.1"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.2.11\conf"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php5.3.0"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\ca_demo_dolibarr.crt"; DestDir: "{app}"; Flags: ignoreversion;
-Source: "build\exe\doliwamp\ca_demo_dolibarr.key"; DestDir: "{app}"; Flags: ignoreversion;
-; Licence
-Source: "COPYRIGHT"; DestDir: "{app}"; Flags: ignoreversion;
-
-
-
-[Icons]
-Name: "{group}\Dolibarr ERP-CRM"; Filename: "{app}\rundoliwamp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
-Name: "{group}\Tools\Help center"; Filename: "{app}\rundolihelp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\dolihelp.ico
-Name: "{group}\Tools\Start DoliWamp server"; Filename: "{app}\startdoliwamp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\doliwampon.ico
-Name: "{group}\Tools\Stop DoliWamp server"; Filename: "{app}\stopdoliwamp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\doliwampoff.ico
-Name: "{group}\Tools\Admin DoliWamp server"; Filename: "{app}\rundoliadmin.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\doliadmin.ico
-Name: "{group}\Tools\Uninstall DoliWamp"; Filename: "{app}\unins000.exe"; WorkingDir: "{app}"; IconFilename: {app}\uninstall_services.bat
-Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Dolibarr"; WorkingDir: "{app}"; Filename: "{app}\rundoliwamp.bat"; Tasks: quicklaunchicon; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
-Name: "{userdesktop}\Dolibarr ERP-CRM"; Filename: "{app}\rundoliwamp.bat"; WorkingDir: "{app}"; Tasks: desktopicon; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
-Name: "{userdesktop}\Dolibarr Help center"; Filename: "{app}\rundolihelp.bat"; WorkingDir: "{app}"; Tasks: desktopicon; IconFilename: {app}\www\dolibarr\doc\images\dolihelp.ico
-;Start of servers fromstartup menu disabled as services are auto
-;Name: "{userstartup}\DoliWamp server"; Filename: "{app}\startdoliwamp.bat"; WorkingDir: "{app}"; Flags: runminimized; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
-
-
-[Code]
-
-//variables globales
-var phpVersion: String;
-var apacheVersion: String;
-var path: String;
-var pfPath: String;
-var winPath: String;
-var pathWithSlashes: String;
-var Page: TInputQueryWizardPage;
-
-var smtpServer: String;
-var apachePort: String;
-var mysqlPort: String;
-var newPassword: String;
-
-var lockFile: String;
-var srcFile: String;
-var destFile: String;
-var srcFileH: String;
-var destFileH: String;
-var srcFileA: String;
-var destFileA: String;
-var srcContents: String;
-var browser: String;
-var mysqlVersion: String;
-var phpmyadminVersion: String;
-var phpDllCopy: String;
-var batFile: String;
-
-var mysmtp: String;
-var myporta: String;
-var myportas: String;
-var myport: String;
-var mypass: String;
-
-var firstinstall: Boolean;
-var value: String;
-
-
-//-----------------------------------------------
-//procedures lancees au debut de l'installation
-function InitializeSetup(): Boolean;
-begin
-  Result := MsgBox(CustomMessage('YouWillInstallDoliWamp')+#13#13+CustomMessage('ThisAssistantInstallOrUpgrade')+#13#13+CustomMessage('IfYouHaveTechnicalKnowledge')+#13#13+CustomMessage('ButIfYouLook')+#13#13+CustomMessage('DoYouWantToStart'), mbConfirmation, MB_YESNO) = IDYES;
-end;
-
-procedure InitializeWizard();
-begin
-  //version des applis, a modifier pour chaque version de WampServer 2
-  apacheVersion := '2.2.11';
-  phpVersion := '5.3.0' ;
-  mysqlVersion := '5.0.45';
-  phpmyadminVersion := '3.2.0.1';
-
-  smtpServer := 'localhost';
-  apachePort := '80';
-  mysqlPort := '3306';
-  newPassword := 'changeme';
-
-  firstinstall := true;
-
-
-  //LoadStringFromFile (srcFile, srcContents);
-  //posvalue=Pos('$dolibarr_main_db_port=', srcFile);
-
-  if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','smtpServer', value) then
-  begin
-      if value <> '' then smtpServer:=value;
-  end
-  else
-  begin
-    if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\Internet Account Manager\Accounts\00000001','SMTP Server', value) then
-    begin
-      if value <> '' then smtpServer:=value;
-    end
-    else
-    begin
-      if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'PMail\ServiceInfo\Mail_Account_1','SvcSMTPHost', value) then
-      begin
-        if value <> '' then smtpServer:=value;
-      end
-      else
-      begin
-        if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\MSCRM','SMTPServer', value) then
-        begin
-          if value <> '' then smtpServer:=value;
-        end
-      end
-    end
-  end;
-
-  if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','apachePort', value) then
-  begin
-      if value <> '' then apachePort:=value;
-  end;
-
-  if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','mysqlPort', value) then
-  begin
-      if value <> '' then mysqlPort:=value;
-  end;
-
-  if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','newPassword', value) then
-  begin
-      if value <> '' then newPassword:=value;
-  end;
-
-
-  // Prepare an object calle "Page" of type wpInstalling.
-  // Object will be show later in NextButtonClick function.
-  Page := CreateInputQueryPage(wpInstalling,
-  CustomMessage('TechnicalParameters'), '',
-  CustomMessage('IfFirstInstall'));
-
-  // TODO Add control differently if first install or update
-  if firstinstall
-  then
-  begin
-    Page.Add(CustomMessage('SMTPServer'), False);
-    Page.Add(CustomMessage('ApachePort'), False);
-    Page.Add(CustomMessage('MySqlPort'), False);
-    Page.Add(CustomMessage('MySqlPassword'), False);
-  end
-  else
-  begin
-    Page.Add(CustomMessage('SMTPServer'), False);
-    Page.Add(CustomMessage('ApachePort'), False);
-    Page.Add(CustomMessage('MySqlPort'), False);
-    Page.Add(CustomMessage('MySqlPassword'), False);
-  end;
-  
-  // Default values
-  Page.Values[0] := smtpServer;
-  Page.Values[1] := apachePort;
-  Page.Values[2] := mysqlPort;
-  Page.Values[3] := newPassword;
-
-end;
-
-
-//-----------------------------------------------
-// Stop all services (if exist)
-procedure close();
-var myResult: Integer;
-begin
-path := ExpandConstant('{app}');
-pfPath := ExpandConstant('{pf}');
-winPath := ExpandConstant('{win}');
-pathWithSlashes := path;
-StringChange (pathWithSlashes, '\','/');
-
-batFile := path+'\stopdoliwamp.bat';
-Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
-end;
-
-
-
-
-//-----------------------------------------------------------
-// Install pages
-function NextButtonClick(CurPageID: Integer): Boolean;
-var myResult: Integer;
-var res: Boolean;
-var paramok: Boolean;
-var datadirold: String;
-var datadirnew: String;
-var exedirold: String;
-var exedirnew: String;
-var themessage: String;
-begin
-
-   res := True;
-   
-  //MsgBox(''+CurPageID,mbConfirmation,MB_YESNO);
-
-  if CurPageID = Page.ID then
-  begin
-
-    // This must be in if curpage.id = page.id, otherwise it is executed after each Next button
-
-    path := ExpandConstant('{app}');
-    winPath := ExpandConstant('{win}');
-    pathWithSlashes := path;
-    StringChange (pathWithSlashes, '\','/');
-    datadirold := pathWithSlashes+'/bin/mysql/mysql5.0.45/data';
-    datadirnew := pathWithSlashes+'/bin/mysql/data';
-    exedirold := pathWithSlashes+'/bin/mysql/mysql5.0.45';
-    exedirnew := pathWithSlashes+'/bin/mysql/mysql5.0.45';
-
-    // If we have a new database version, we should only copy old my.ini file into new directory
-    // and change only all basedir= strings to use new version. Like this, data dir is still correct.
-    // Install of service and stop/start scripts are already rebuild by installer.
-//      FileCopy(exedirold+'/my.ini',exedirnew+'/my.ini', true);
-
-//    We should not need this, also databases may not be called dolibarr
-//      res := RenameFile(ibdata1dirold+'/dolibarr',ibdata1dirnew+'/dolibarr');
-//      if res then
-//      begin
-//          themessage := CustomMessage('OldVersionFoundAndMoveInNew');
-//          MsgBox(themessage,mbInformation,MB_OK);
-//          TODO Replace also mysql.ini and resintall service
-//      end
-//      else
-//      begin
-//          themessage := CustomMessage('OldVersionFoundButFailedToMoveInNew');
-//          MsgBox(themessage,mbInformation,MB_OK);
-//      end;
-
-
-    //----------------------------------------------
-    // Copie des dll de php vers apache
-    //----------------------------------------------
-	// TODO Update this list when changing PHP/Apache versions
-	
-    phpDllCopy := 'fdftk.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'fribidi.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'gds32.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'libeay32.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'libmhash.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'libmysql.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'libpq.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'msql.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'libmcrypt.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'libmysqli.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'ntwdblib.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-
-    phpDllCopy := 'php5activescript.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'php5nsapi.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'php5ts.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-
-    phpDllCopy := 'ssleay32.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-    phpDllCopy := 'yaz.dll';
-    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
-
-
-    // Remove lock file
-    lockfile := pathWithSlashes+'/dolibarr_documents/install.lock';
-    if FileExists (lockfile) and not DeleteFile(lockfile) then
-    begin
-      themessage := FmtMessage(CustomMessage('FailedToDeleteLock'),[pathWithSlashes]);
- 		  MsgBox(themessage,mbInformation,MB_OK);
-    end
-
-
-		// Check if parameters already defined in conf.php file
-		srcFile := pathWithSlashes+'/www/dolibarr/htdocs/conf/conf.php';
-		if not FileExists (srcFile) then
-		begin
-		    firstinstall := true;
-		
-		    // Values from wizard
-		    mysmtp  := Page.Values[0];
-		    myporta := Page.Values[1];
-		    myportas:= '443';
-		    myport  := Page.Values[2];
-		    mypass  := Page.Values[3];
-		end
-		else
-		begin
-		    firstinstall := false;
-		
-		    // Values from registry
-		    mysmtp  := smtpServer;
-		    myporta := apachePort;
-		    myportas:= '443';
-		    myport  := mysqlPort;
-		    mypass  := newPassword;
-		end;
-		
-		paramok := True;
-		// TODO Test if choice of param is ok if firstinstall
-
-    if (firstinstall) then
-    begin
-    
-		  // Test serveur SMTP
-//      if paramok then
-//      begin
-//    		batFile := pathWithSlashes+'/UsedPort.exe';
-//    		MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO)
-//  	    Exec(batFile, '-s '+smtpServer+' -p 25', path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
-        //themessage := 'Le serveur '+smtpServer+' semble ne pas etre joignable pour l envoi de mail SMTP (port 25). Si vous avez un firewall, verifiez sa configuration. Sinon, revenez en arriere pour choisir une autre valeur pour le serveur SMTP sortant d envoi de mail (Cette information est doit etre fournie par votre fournisseur d acces Internet).';
-//        themessage := 'The server '+smtpServer+' seems to be unreachable to send outgoing SMTP emails (port 25). If you have a firewall, check its setup. Otherwise, go back to choose another value for the SMTP server (This information shoud be given by your Internet Service Provider) or click "No" to ignore error. Cancel choice to choose another value ?';
-//  		  if ((IntToStr(myResult) <> '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then
-//        begin
-//  		    paramok := False;
-//  		  end;
-//	    end;
-	
-      if paramok then
-      begin
-  		  // Test port Apache
-    		batFile := pathWithSlashes+'/UsedPort.exe';
-    		//MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO)
-    		Exec(batFile, '-s localhost -p '+myporta, path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
-        //themessage := 'Le port '+myporta+' semble deja pris. Revenez en arriere pour choisir une autre valeur pour le port Apache.';
-        themessage := FmtMessage(CustomMessage('PortAlreadyInUse'),[myporta,'Apache']);
-    		if ((IntToStr(myResult) = '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then
-        begin
-    		  paramok := False;
-    		end;
-      end;
-      
-      if paramok then
-      begin
-    		// Test port Mysql
-    		batFile := pathWithSlashes+'/UsedPort.exe';
-    		//MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO)
-    		Exec(batFile, '-s localhost -p '+myport, path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
-        //themessage := 'Le port '+myport+' semble deja pris. Revenez en arriere pour choisir une autre valeur pour le port MySQL.';
-        themessage := FmtMessage(CustomMessage('PortAlreadyInUse'),[myport,'MySql']);
-    		if ((IntToStr(myResult) = '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then
-    		begin
-      		paramok := False;
-    		end;
-      end;
-      
-    end;
-		
-		if paramok
-		then
-		begin
-		    
-	    //----------------------------------------------
-	    // Rename file c:/windows/php.ini (we don't want it)
-	    //----------------------------------------------
-		
-	    if FileExists ('c:/windows/php.ini') then
-	    begin
-	      if MsgBox('A previous c:/windows/php.ini file has been detected in your Windows directory. Do you want DoliWamp to rename it to php_old.ini to avoid conflicts ?',mbConfirmation,MB_YESNO) = IDYES then
-	      begin
-	        RenameFile('c:/windows/php.ini','c:/windows/php_old.ini');
-	      end;
-	    end;
-	    if FileExists ('c:/winnt/php.ini') then
-	    begin
-	      if MsgBox('A previous c:/winnt/php.ini file has been detected in your Windows directory. Do you want DoliWamp to rename it to php_old.ini to avoid conflicts ?',mbConfirmation,MB_YESNO) = IDYES then
-	      begin
-	        RenameFile('c:/winnt/php.ini','c:/winnt/php_old.ini');
-	      end;
-	    end;
-		
-		
-		
-	    //----------------------------------------------
-	    // Create rundoliwamp.bat, rundolihelp.bat and rundoliadmin.bat (if not exists)
-	    //----------------------------------------------
-	
-	    destFile := pathWithSlashes+'/rundoliwamp.bat';
-	    srcFile := pathWithSlashes+'/rundoliwamp.bat.install';
-	
-	    destFileH := pathWithSlashes+'/rundolihelp.bat';
-	    srcFileH := pathWithSlashes+'/rundolihelp.bat.install';
-	
-	    destFileA := pathWithSlashes+'/rundoliadmin.bat';
-	    srcFileA := pathWithSlashes+'/rundoliadmin.bat.install';
-	
-	    if (not FileExists (destFile) or not FileExists (destFileH) or not FileExists (destFileA))
-	     and (FileExists(srcFile) and FileExists(srcFileH) and FileExists(srcFileA)) then
-	    begin
-	      //navigateur
-	      browser := 'iexplore.exe';
-	      if FileExists (pfPath+'/Mozilla Firefox/firefox.exe')  then
-	      begin
-	        if MsgBox(CustomMessage('FirefoxDetected'),mbConfirmation,MB_YESNO) = IDYES then
-	        begin
-	          browser := pfPath+'/Mozilla Firefox/firefox.exe';
-	        end;
-	      end;
-	      if browser = 'iexplore.exe' then
-	      begin
-            if FileExists (pfPath+'/Internet Explorer/iexplore.exe')  then
-            begin
-               GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, pfPath+'/Internet Explorer','exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
-	        end
-	        else
-	        begin
-               GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, winPath,'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
-	        end;
-	      end;
-	
-	      LoadStringFromFile (srcFile, srcContents);
-	      StringChangeEx (srcContents, 'WAMPBROWSER', browser, True);
-	      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
-	      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
-	      SaveStringToFile(destFile,srcContents, False);
-	
-	      LoadStringFromFile (srcFileH, srcContents);
-	      StringChangeEx (srcContents, 'WAMPBROWSER', browser, True);
-	      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
-	      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
-	      SaveStringToFile(destFileH,srcContents, False);
-	
-	      LoadStringFromFile (srcFileA, srcContents);
-	      StringChangeEx (srcContents, 'WAMPBROWSER', browser, True);
-	      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
-	      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
-	      SaveStringToFile(destFileA,srcContents, False);
-	    end
-
-
-      if MsgBox(CustomMessage('DoliWampWillStartApacheMysql'),mbConfirmation,MB_YESNO) = IDYES then
-      begin
-
-		
-		    //----------------------------------------------
-		    // Create file alias phpmyadmin (always)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/alias/phpmyadmin.conf';
-		    srcFile := pathWithSlashes+'/alias/phpmyadmin.conf.install';
-		
-		    if FileExists(srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      //installDir et version de phpmyadmin
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		    DeleteFile(srcFile);
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file alias dolibarr (if not exists)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/alias/dolibarr.conf';
-		    srcFile := pathWithSlashes+'/alias/dolibarr.conf.install';
-		
-		    if not FileExists (destFile) and FileExists(srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
-		
-		      SaveStringToFile(destFile, srcContents, False);
-		    end
-		    DeleteFile(srcFile);
-		
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file configuration for phpmyadmin (if not exists)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php';
-		    srcFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php.install';
-		
-		    if not FileExists (destFile) and FileExists (srcFile) then
-		    begin
-	        // sinon on prends le fichier par defaut
-	        LoadStringFromFile (srcFile, srcContents);
-	        StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
-	        StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
-	        SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file httpd.conf (if not exists)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/conf/httpd.conf';
-		    srcFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/conf/httpd.conf.install';
-		
-		    if not FileExists (destFile) and FileExists (srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-
-		      //installDir et version de php
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
-              StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file my.ini (if not exists)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/bin/mysql/mysql'+mysqlVersion+'/my.ini';
-		    srcFile := pathWithSlashes+'/bin/mysql/mysql'+mysqlVersion+'/my.ini.install';
-		
-		    if not FileExists (destFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      //installDir et version de php
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file index.php (always but archive if exists)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/www/index.php';
-		    srcFile := pathWithSlashes+'/www/index.php.install';
-		
-		    if not FileExists (destFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		      StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
-		      SaveStringToFile(destFile, srcContents, False);
-		    end
-		    else
-		    begin
-		      RenameFile(destFile, destFile+'.old');
-		      LoadStringFromFile (srcFile, srcContents);
-		      StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
-		      SaveStringToFile(destFile, srcContents, False);
-		    end
-		
-		
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file dolibarr parametres predefinis install web (if not exists)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/www/dolibarr/htdocs/install/install.forced.php';
-		    srcFile := pathWithSlashes+'/www/dolibarr/htdocs/install/install.forced.php.install';
-		
-		    if not FileExists (destFile) and FileExists (srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file install_services.bat (always)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/install_services.bat';
-		    srcFile := pathWithSlashes+'/install_services.bat.install';
-		
-		    if FileExists(srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      //version de apache et mysql
-		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file install_services_auto.bat (always)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/install_services_auto.bat';
-		    srcFile := pathWithSlashes+'/install_services_auto.bat.install';
-		
-		    if FileExists (srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      //version de apache et mysql
-		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file uninstall_services.bat (always)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/uninstall_services.bat';
-		    srcFile := pathWithSlashes+'/uninstall_services.bat.install';
-		
-		    if FileExists (srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      //version de apache et mysql
-		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		
-		    //----------------------------------------------
-		    // Create file mysqlinitpassword.bat (always)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/mysqlinitpassword.bat';
-		    srcFile := pathWithSlashes+'/mysqlinitpassword.bat.install';
-		
-		    if FileExists (srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      //version de apache et mysql
-		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		    //----------------------------------------------
-		    // Create file mysqltestinstall.bat (always)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/mysqltestinstall.bat';
-		    srcFile := pathWithSlashes+'/mysqltestinstall.bat.install';
-		
-		    if FileExists (srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      //version de apache et mysql
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		    //----------------------------------------------
-		    // Create file startdoliwamp_manual_donotuse.bat (always)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/startdoliwamp_manual_donotuse.bat';
-		    srcFile := pathWithSlashes+'/startdoliwamp_manual_donotuse.bat.install';
-		
-		    if FileExists (srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      //version de apache et mysql
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
-		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		    
-		
-		    //----------------------------------------------
-		    // Create file builddemosslfiles.bat (always)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/builddemosslfiles.bat';
-		    srcFile := pathWithSlashes+'/builddemosslfiles.bat.install';
-		
-		    if FileExists (srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		
-		      //version de apache et mysql
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
-		
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-
-		
-		    //----------------------------------------------
-		    // Create file php.ini in php (if not exists)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini';
-		    srcFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini.install';
-		
-		    if not FileExists (destFile) and FileExists(srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
-              StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		    //----------------------------------------------
-		    // Create file php.ini in apache (if not exists)
-		    //----------------------------------------------
-		
-		    destFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/php.ini';
-		    srcFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini.install';
-		
-		    if not FileExists (destFile) and FileExists(srcFile) then
-		    begin
-		      LoadStringFromFile (srcFile, srcContents);
-		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
-		      StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
-              StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
-		      SaveStringToFile(destFile,srcContents, False);
-		    end
-		
-		
-		
-	   		// Uninstall and Install services
-		  	batFile := path+'\uninstall_services.bat';
-        Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
-  			batFile := path+'\install_services.bat';
-  			Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
-			
-  			// Start services
-        batFile := path+'\startdoliwamp.bat';
-        Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
-        //MsgBox(myResult,mbInformation,MB_OK);
-			
-        // Change mysql password (works only if not yet defined)
-        batFile := path+'\mysqlinitpassword.bat';
-        Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
-			
-        // Remove dangerous files
-        batFile := path+'\removefiles.bat';
-        Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
-
-			
-		    // Save parameters to registry
-		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'smtpServer',  mysmtp);
-		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'apachePort',  myporta);
-		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'apachePSSL',  myportas);
-		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'mysqlPort',   myport);
-		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'newPassword', mypass);
-		
-		
-        res := True;
-		
-		  end
-		  else
-		  begin
-		  
-//	  	MsgBox('Apache and Mysql installation has been canceled. Please select parameters to start their installation.',mbInformation,MB_OK)
-
-      	res := False;
-		  	
-		  end
-      
-    end
-    else
-    begin
-    
-        //MsgBox('Selected values seems to be already used. Please choose other values.',mbInformation,MB_OK);
-		  	
-		  	res := False;
-
-    end
-    
-  end
-
-
-  Result := res;
-end;
-
-
-
-
-
-//-----------------------------------------------
-//procedure launched by the end of the installation, it deletes the installation files
-procedure DeinitializeSetup();
-begin
-//  DeleteFile(path+'\install_services.bat');
-//  DeleteFile(path+'\install_services_auto.bat');
-end;
-
-
-//-----------------------------------------------
-//procedure launched at beginning of the uninstallation
-function InitializeUninstall(): Boolean;
-begin
-    Result := RegDeleteValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','smtpServer');
-    Result := RegDeleteValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','apachePort');
-    Result := RegDeleteValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','mysqlPort');
-    Result := RegDeleteValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','newPassword');
-    Result := RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp');
-
-    Result := True;
-end;
-
-//-----------------------------------------------
-//procedure launched by the end of the uninstallation
-procedure DeinitializeUninstall();
-begin
-  path := ExpandConstant('{app}');
-  winPath := ExpandConstant('{win}');
-  pathWithSlashes := path;
-  StringChange (pathWithSlashes, '\','/');
-
-  MsgBox(FmtMessage(CustomMessage('ProgramHasBeenRemoved'),[path]),mbInformation,MB_OK);
-end;
-
-
-[Run]
-; Launch Dolibarr in browser. This is run after Wizard because of postinstall flag
-Filename: "{app}\rundoliwamp.bat"; Description: {cm:LaunchNow}; Flags: shellexec postinstall skipifsilent runhidden
-
-
-[UninstallDelete]
-Type: files; Name: "{app}\*.*"
-Type: files; Name: "{app}\bin\mysql\mysql5.0.45\*.*"
-Type: filesandordirs; Name: "{app}\alias"
-Type: filesandordirs; Name: "{app}\apps"
-Type: filesandordirs; Name: "{app}\bin\apache"
-Type: filesandordirs; Name: "{app}\bin\php"
-Type: filesandordirs; Name: "{app}\help"
-Type: filesandordirs; Name: "{app}\lang"
-Type: filesandordirs; Name: "{app}\logs"
-Type: filesandordirs; Name: "{app}\scripts"
-Type: filesandordirs; Name: "{app}\tmp"
-Type: filesandordirs; Name: "{app}\www\dolibarr"
-
-
-[UninstallRun]
-Filename: "{app}\uninstall_services.bat"; Flags: runhidden
-
-
-
+; ----- DoliWamp.iss ---------------------------------------------------------------------
+; Script to build an auto installer for Dolibarr.
+; Works with InnoSetup 5.4.0 (a)
+; Idea from WampServer 2 (http://www.wampserver.com)
+;----------------------------------------------------------------------------------------
+; You must edit some path in this file to build an exe (like SourceDir).
+; WARNING: Be sure that user.* files of Mysql database used to build
+; package contains only one user called root with no password.
+; For this, you can edit the mysql.user table of the source database to keep
+; only the root user with no password, stop server and catch
+; files user.MY* to put them in the Dolibarr build/exe/doliwamp/mysql directory.
+;
+;----------------------------------------------------------------------------------------
+
+
+[Setup]
+; ----- Change this -----
+AppName=DoliWamp
+; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
+AppVerName=DoliWamp-3.3.5
+; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
+OutputBaseFilename=DoliWamp-3.3.5
+; ----- End of change
+;OutputManifestFile=build\doliwampbuild.log
+; Define full path from which all relative path are defined
+; You must modify this to put here your dolibarr root directory
+;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx
+SourceDir=..\..\..
+AppId=doliwamp
+AppPublisher=NLTechno
+AppPublisherURL=http://www.nltechno.com
+AppSupportURL=http://www.dolibarr.org
+AppUpdatesURL=http://www.dolibarr.org
+AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
+AppCopyright=Copyright (C) 2008-2013 Laurent Destailleur, NLTechno
+DefaultDirName=c:\dolibarr
+DefaultGroupName=Dolibarr
+;LicenseFile=COPYING
+;Compression=none
+Compression=lzma
+SolidCompression=yes
+WizardImageFile=build\exe\doliwamp\doliwamp.bmp
+WizardSmallImageFile=build\exe\doliwamp\doliwampsmall.bmp
+SetupIconFile=doc\images\dolibarr.ico
+PrivilegesRequired=admin
+DisableProgramGroupPage=yes
+ChangesEnvironment=no
+CreateUninstallRegKey=yes
+;UseSetupLdr=no
+;UninstallDisplayIcon={app}\bidon
+OutputDir=build
+ShowLanguageDialog=auto
+ShowUndisplayableLanguages=no
+LanguageDetectionMethod=uilanguage
+;SignedUninstaller=yes
+
+[Languages]
+Name: "en"; MessagesFile: "compiler:Default.isl,build\exe\doliwamp\Languages\MyEnglish.isl"
+Name: "br"; MessagesFile: "compiler:Languages\Portuguese.isl,build\exe\doliwamp\Languages\MyBrazilianPortuguese.isl"
+Name: "ca"; MessagesFile: "compiler:Languages\Catalan.isl,build\exe\doliwamp\Languages\MyCatalan.isl"
+Name: "da"; MessagesFile: "compiler:Languages\Danish.isl,build\exe\doliwamp\Languages\MyDanish.isl"
+Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl,build\exe\doliwamp\Languages\MySpanish.isl"
+Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl,build\exe\doliwamp\Languages\MyDutch.isl"
+Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl,build\exe\doliwamp\Languages\MyFinnish.isl"
+Name: "fr"; MessagesFile: "compiler:Languages\French.isl,build\exe\doliwamp\Languages\MyFrench.isl"
+Name: "ge"; MessagesFile: "compiler:Languages\German.isl,build\exe\doliwamp\Languages\MyGerman.isl"
+Name: "it"; MessagesFile: "compiler:Languages\Italian.isl,build\exe\doliwamp\Languages\MyItalian.isl"
+Name: "nb"; MessagesFile: "compiler:Languages\Norwegian.isl,build\exe\doliwamp\Languages\MyNorwegian.isl"
+Name: "po"; MessagesFile: "compiler:Languages\Polish.isl,build\exe\doliwamp\Languages\MyPolish.isl"
+Name: "pt"; MessagesFile: "compiler:Languages\Portuguese.isl,build\exe\doliwamp\Languages\MyPortuguese.isl"
+Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl,build\exe\doliwamp\Languages\MyRussian.isl"
+Name: "sv"; MessagesFile: "compiler:Languages\Slovenian.isl,build\exe\doliwamp\Languages\MySlovenian.isl"
+
+[Tasks]
+;Name: "autostart"; Description: "Automatically launch DoliWamp server on startup. If you check this option, Services will be installed as automatic. Otherwise, services will be installed as manual and will start and stop with the service manager."; GroupDescription: "Auto Start:" ;Flags: unchecked;
+Name: "quicklaunchicon"; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
+Name: "desktopicon"; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
+
+[Dirs]
+Name: "{app}\logs"
+Name: "{app}\tmp"
+Name: "{app}\dolibarr_documents"
+Name: "{app}\bin\apache\apache2.2.11\logs"
+
+[Files]
+; Stop/start
+Source: "build\exe\doliwamp\stopdoliwamp.bat"; DestDir: "{app}\"; Flags: ignoreversion; AfterInstall: close()
+Source: "build\exe\doliwamp\startdoliwamp.bat"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\removefiles.bat"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\rundoliwamp.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\rundolihelp.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\rundoliadmin.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\install_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\uninstall_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\mysqlinitpassword.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\mysqltestinstall.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\startdoliwamp_manual_donotuse.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\builddemosslfiles.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversion;
+; PhpMyAdmin, Apache, Php, Mysql
+; Put here path of Wampserver applications
+; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45 or 5.1.36
+; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45 or 5.1.36
+Source: "C:\Program Files\Wamp\apps\phpmyadmin3.2.0.1\*.*"; DestDir: "{app}\apps\phpmyadmin3.2.0.1"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log,darkblue_orange"
+Source: "C:\Program Files\Wamp\bin\apache\apache2.2.11\*.*"; DestDir: "{app}\bin\apache\apache2.2.11"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
+Source: "C:\Program Files\Wamp\bin\php\php5.3.0\*.*"; DestDir: "{app}\bin\php\php5.3.0"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
+Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe"
+; Mysql data files (does not overwrite if exists)
+Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
+; Dolibarr
+Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
+Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,xdebug\*"
+Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
+Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"
+Source: "*.*"; DestDir: "{app}\www\dolibarr"; Flags: ignoreversion; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,default.properties,install.lock"
+; Config files
+Source: "build\exe\doliwamp\phpmyadmin.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\config.inc.php.install"; DestDir: "{app}\apps\phpmyadmin3.2.0.1"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.2.11\conf"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php5.3.0"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\ca_demo_dolibarr.crt"; DestDir: "{app}"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\ca_demo_dolibarr.key"; DestDir: "{app}"; Flags: ignoreversion;
+; Licence
+Source: "COPYRIGHT"; DestDir: "{app}"; Flags: ignoreversion;
+
+
+
+[Icons]
+Name: "{group}\Dolibarr ERP-CRM"; Filename: "{app}\rundoliwamp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
+Name: "{group}\Tools\Help center"; Filename: "{app}\rundolihelp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\dolihelp.ico
+Name: "{group}\Tools\Start DoliWamp server"; Filename: "{app}\startdoliwamp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\doliwampon.ico
+Name: "{group}\Tools\Stop DoliWamp server"; Filename: "{app}\stopdoliwamp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\doliwampoff.ico
+Name: "{group}\Tools\Admin DoliWamp server"; Filename: "{app}\rundoliadmin.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\doliadmin.ico
+Name: "{group}\Tools\Uninstall DoliWamp"; Filename: "{app}\unins000.exe"; WorkingDir: "{app}"; IconFilename: {app}\uninstall_services.bat
+Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Dolibarr"; WorkingDir: "{app}"; Filename: "{app}\rundoliwamp.bat"; Tasks: quicklaunchicon; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
+Name: "{userdesktop}\Dolibarr ERP-CRM"; Filename: "{app}\rundoliwamp.bat"; WorkingDir: "{app}"; Tasks: desktopicon; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
+Name: "{userdesktop}\Dolibarr Help center"; Filename: "{app}\rundolihelp.bat"; WorkingDir: "{app}"; Tasks: desktopicon; IconFilename: {app}\www\dolibarr\doc\images\dolihelp.ico
+;Start of servers fromstartup menu disabled as services are auto
+;Name: "{userstartup}\DoliWamp server"; Filename: "{app}\startdoliwamp.bat"; WorkingDir: "{app}"; Flags: runminimized; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
+
+
+[Code]
+
+//variables globales
+var phpVersion: String;
+var apacheVersion: String;
+var path: String;
+var pfPath: String;
+var winPath: String;
+var pathWithSlashes: String;
+var Page: TInputQueryWizardPage;
+
+var smtpServer: String;
+var apachePort: String;
+var mysqlPort: String;
+var newPassword: String;
+
+var lockFile: String;
+var srcFile: String;
+var destFile: String;
+var srcFileH: String;
+var destFileH: String;
+var srcFileA: String;
+var destFileA: String;
+var srcContents: String;
+var browser: String;
+var mysqlVersion: String;
+var phpmyadminVersion: String;
+var phpDllCopy: String;
+var batFile: String;
+
+var mysmtp: String;
+var myporta: String;
+var myportas: String;
+var myport: String;
+var mypass: String;
+
+var firstinstall: Boolean;
+var value: String;
+
+
+//-----------------------------------------------
+//procedures lancees au debut de l'installation
+function InitializeSetup(): Boolean;
+begin
+  Result := MsgBox(CustomMessage('YouWillInstallDoliWamp')+#13#13+CustomMessage('ThisAssistantInstallOrUpgrade')+#13#13+CustomMessage('IfYouHaveTechnicalKnowledge')+#13#13+CustomMessage('ButIfYouLook')+#13#13+CustomMessage('DoYouWantToStart'), mbConfirmation, MB_YESNO) = IDYES;
+end;
+
+procedure InitializeWizard();
+begin
+  //version des applis, a modifier pour chaque version de WampServer 2
+  apacheVersion := '2.2.11';
+  phpVersion := '5.3.0' ;
+  mysqlVersion := '5.0.45';
+  phpmyadminVersion := '3.2.0.1';
+
+  smtpServer := 'localhost';
+  apachePort := '80';
+  mysqlPort := '3306';
+  newPassword := 'changeme';
+
+  firstinstall := true;
+
+
+  //LoadStringFromFile (srcFile, srcContents);
+  //posvalue=Pos('$dolibarr_main_db_port=', srcFile);
+
+  if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','smtpServer', value) then
+  begin
+      if value <> '' then smtpServer:=value;
+  end
+  else
+  begin
+    if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\Internet Account Manager\Accounts\00000001','SMTP Server', value) then
+    begin
+      if value <> '' then smtpServer:=value;
+    end
+    else
+    begin
+      if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'PMail\ServiceInfo\Mail_Account_1','SvcSMTPHost', value) then
+      begin
+        if value <> '' then smtpServer:=value;
+      end
+      else
+      begin
+        if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\MSCRM','SMTPServer', value) then
+        begin
+          if value <> '' then smtpServer:=value;
+        end
+      end
+    end
+  end;
+
+  if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','apachePort', value) then
+  begin
+      if value <> '' then apachePort:=value;
+  end;
+
+  if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','mysqlPort', value) then
+  begin
+      if value <> '' then mysqlPort:=value;
+  end;
+
+  if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','newPassword', value) then
+  begin
+      if value <> '' then newPassword:=value;
+  end;
+
+
+  // Prepare an object calle "Page" of type wpInstalling.
+  // Object will be show later in NextButtonClick function.
+  Page := CreateInputQueryPage(wpInstalling,
+  CustomMessage('TechnicalParameters'), '',
+  CustomMessage('IfFirstInstall'));
+
+  // TODO Add control differently if first install or update
+  if firstinstall
+  then
+  begin
+    Page.Add(CustomMessage('SMTPServer'), False);
+    Page.Add(CustomMessage('ApachePort'), False);
+    Page.Add(CustomMessage('MySqlPort'), False);
+    Page.Add(CustomMessage('MySqlPassword'), False);
+  end
+  else
+  begin
+    Page.Add(CustomMessage('SMTPServer'), False);
+    Page.Add(CustomMessage('ApachePort'), False);
+    Page.Add(CustomMessage('MySqlPort'), False);
+    Page.Add(CustomMessage('MySqlPassword'), False);
+  end;
+  
+  // Default values
+  Page.Values[0] := smtpServer;
+  Page.Values[1] := apachePort;
+  Page.Values[2] := mysqlPort;
+  Page.Values[3] := newPassword;
+
+end;
+
+
+//-----------------------------------------------
+// Stop all services (if exist)
+procedure close();
+var myResult: Integer;
+begin
+path := ExpandConstant('{app}');
+pfPath := ExpandConstant('{pf}');
+winPath := ExpandConstant('{win}');
+pathWithSlashes := path;
+StringChange (pathWithSlashes, '\','/');
+
+batFile := path+'\stopdoliwamp.bat';
+Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
+end;
+
+
+
+
+//-----------------------------------------------------------
+// Install pages
+function NextButtonClick(CurPageID: Integer): Boolean;
+var myResult: Integer;
+var res: Boolean;
+var paramok: Boolean;
+var datadirold: String;
+var datadirnew: String;
+var exedirold: String;
+var exedirnew: String;
+var themessage: String;
+begin
+
+   res := True;
+   
+  //MsgBox(''+CurPageID,mbConfirmation,MB_YESNO);
+
+  if CurPageID = Page.ID then
+  begin
+
+    // This must be in if curpage.id = page.id, otherwise it is executed after each Next button
+
+    path := ExpandConstant('{app}');
+    winPath := ExpandConstant('{win}');
+    pathWithSlashes := path;
+    StringChange (pathWithSlashes, '\','/');
+    datadirold := pathWithSlashes+'/bin/mysql/mysql5.0.45/data';
+    datadirnew := pathWithSlashes+'/bin/mysql/data';
+    exedirold := pathWithSlashes+'/bin/mysql/mysql5.0.45';
+    exedirnew := pathWithSlashes+'/bin/mysql/mysql5.0.45';
+
+    // If we have a new database version, we should only copy old my.ini file into new directory
+    // and change only all basedir= strings to use new version. Like this, data dir is still correct.
+    // Install of service and stop/start scripts are already rebuild by installer.
+//      FileCopy(exedirold+'/my.ini',exedirnew+'/my.ini', true);
+
+//    We should not need this, also databases may not be called dolibarr
+//      res := RenameFile(ibdata1dirold+'/dolibarr',ibdata1dirnew+'/dolibarr');
+//      if res then
+//      begin
+//          themessage := CustomMessage('OldVersionFoundAndMoveInNew');
+//          MsgBox(themessage,mbInformation,MB_OK);
+//          TODO Replace also mysql.ini and resintall service
+//      end
+//      else
+//      begin
+//          themessage := CustomMessage('OldVersionFoundButFailedToMoveInNew');
+//          MsgBox(themessage,mbInformation,MB_OK);
+//      end;
+
+
+    //----------------------------------------------
+    // Copie des dll de php vers apache
+    //----------------------------------------------
+	// TODO Update this list when changing PHP/Apache versions
+	
+    phpDllCopy := 'fdftk.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'fribidi.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'gds32.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'libeay32.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'libmhash.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'libmysql.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'libpq.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'msql.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'libmcrypt.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'libmysqli.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'ntwdblib.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+
+    phpDllCopy := 'php5activescript.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'php5nsapi.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'php5ts.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+
+    phpDllCopy := 'ssleay32.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+    phpDllCopy := 'yaz.dll';
+    filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
+
+
+    // Remove lock file
+    lockfile := pathWithSlashes+'/dolibarr_documents/install.lock';
+    if FileExists (lockfile) and not DeleteFile(lockfile) then
+    begin
+      themessage := FmtMessage(CustomMessage('FailedToDeleteLock'),[pathWithSlashes]);
+ 		  MsgBox(themessage,mbInformation,MB_OK);
+    end
+
+
+		// Check if parameters already defined in conf.php file
+		srcFile := pathWithSlashes+'/www/dolibarr/htdocs/conf/conf.php';
+		if not FileExists (srcFile) then
+		begin
+		    firstinstall := true;
+		
+		    // Values from wizard
+		    mysmtp  := Page.Values[0];
+		    myporta := Page.Values[1];
+		    myportas:= '443';
+		    myport  := Page.Values[2];
+		    mypass  := Page.Values[3];
+		end
+		else
+		begin
+		    firstinstall := false;
+		
+		    // Values from registry
+		    mysmtp  := smtpServer;
+		    myporta := apachePort;
+		    myportas:= '443';
+		    myport  := mysqlPort;
+		    mypass  := newPassword;
+		end;
+		
+		paramok := True;
+		// TODO Test if choice of param is ok if firstinstall
+
+    if (firstinstall) then
+    begin
+    
+		  // Test serveur SMTP
+//      if paramok then
+//      begin
+//    		batFile := pathWithSlashes+'/UsedPort.exe';
+//    		MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO)
+//  	    Exec(batFile, '-s '+smtpServer+' -p 25', path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
+        //themessage := 'Le serveur '+smtpServer+' semble ne pas etre joignable pour l envoi de mail SMTP (port 25). Si vous avez un firewall, verifiez sa configuration. Sinon, revenez en arriere pour choisir une autre valeur pour le serveur SMTP sortant d envoi de mail (Cette information est doit etre fournie par votre fournisseur d acces Internet).';
+//        themessage := 'The server '+smtpServer+' seems to be unreachable to send outgoing SMTP emails (port 25). If you have a firewall, check its setup. Otherwise, go back to choose another value for the SMTP server (This information shoud be given by your Internet Service Provider) or click "No" to ignore error. Cancel choice to choose another value ?';
+//  		  if ((IntToStr(myResult) <> '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then
+//        begin
+//  		    paramok := False;
+//  		  end;
+//	    end;
+	
+      if paramok then
+      begin
+  		  // Test port Apache
+    		batFile := pathWithSlashes+'/UsedPort.exe';
+    		//MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO)
+    		Exec(batFile, '-s localhost -p '+myporta, path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
+        //themessage := 'Le port '+myporta+' semble deja pris. Revenez en arriere pour choisir une autre valeur pour le port Apache.';
+        themessage := FmtMessage(CustomMessage('PortAlreadyInUse'),[myporta,'Apache']);
+    		if ((IntToStr(myResult) = '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then
+        begin
+    		  paramok := False;
+    		end;
+      end;
+      
+      if paramok then
+      begin
+    		// Test port Mysql
+    		batFile := pathWithSlashes+'/UsedPort.exe';
+    		//MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO)
+    		Exec(batFile, '-s localhost -p '+myport, path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
+        //themessage := 'Le port '+myport+' semble deja pris. Revenez en arriere pour choisir une autre valeur pour le port MySQL.';
+        themessage := FmtMessage(CustomMessage('PortAlreadyInUse'),[myport,'MySql']);
+    		if ((IntToStr(myResult) = '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then
+    		begin
+      		paramok := False;
+    		end;
+      end;
+      
+    end;
+		
+		if paramok
+		then
+		begin
+		    
+	    //----------------------------------------------
+	    // Rename file c:/windows/php.ini (we don't want it)
+	    //----------------------------------------------
+		
+	    if FileExists ('c:/windows/php.ini') then
+	    begin
+	      if MsgBox('A previous c:/windows/php.ini file has been detected in your Windows directory. Do you want DoliWamp to rename it to php_old.ini to avoid conflicts ?',mbConfirmation,MB_YESNO) = IDYES then
+	      begin
+	        RenameFile('c:/windows/php.ini','c:/windows/php_old.ini');
+	      end;
+	    end;
+	    if FileExists ('c:/winnt/php.ini') then
+	    begin
+	      if MsgBox('A previous c:/winnt/php.ini file has been detected in your Windows directory. Do you want DoliWamp to rename it to php_old.ini to avoid conflicts ?',mbConfirmation,MB_YESNO) = IDYES then
+	      begin
+	        RenameFile('c:/winnt/php.ini','c:/winnt/php_old.ini');
+	      end;
+	    end;
+		
+		
+		
+	    //----------------------------------------------
+	    // Create rundoliwamp.bat, rundolihelp.bat and rundoliadmin.bat (if not exists)
+	    //----------------------------------------------
+	
+	    destFile := pathWithSlashes+'/rundoliwamp.bat';
+	    srcFile := pathWithSlashes+'/rundoliwamp.bat.install';
+	
+	    destFileH := pathWithSlashes+'/rundolihelp.bat';
+	    srcFileH := pathWithSlashes+'/rundolihelp.bat.install';
+	
+	    destFileA := pathWithSlashes+'/rundoliadmin.bat';
+	    srcFileA := pathWithSlashes+'/rundoliadmin.bat.install';
+	
+	    if (not FileExists (destFile) or not FileExists (destFileH) or not FileExists (destFileA))
+	     and (FileExists(srcFile) and FileExists(srcFileH) and FileExists(srcFileA)) then
+	    begin
+	      //navigateur
+	      browser := 'iexplore.exe';
+	      if FileExists (pfPath+'/Mozilla Firefox/firefox.exe')  then
+	      begin
+	        if MsgBox(CustomMessage('FirefoxDetected'),mbConfirmation,MB_YESNO) = IDYES then
+	        begin
+	          browser := pfPath+'/Mozilla Firefox/firefox.exe';
+	        end;
+	      end;
+	      if browser = 'iexplore.exe' then
+	      begin
+            if FileExists (pfPath+'/Internet Explorer/iexplore.exe')  then
+            begin
+               GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, pfPath+'/Internet Explorer','exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
+	        end
+	        else
+	        begin
+               GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, winPath,'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
+	        end;
+	      end;
+	
+	      LoadStringFromFile (srcFile, srcContents);
+	      StringChangeEx (srcContents, 'WAMPBROWSER', browser, True);
+	      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
+	      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
+	      SaveStringToFile(destFile,srcContents, False);
+	
+	      LoadStringFromFile (srcFileH, srcContents);
+	      StringChangeEx (srcContents, 'WAMPBROWSER', browser, True);
+	      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
+	      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
+	      SaveStringToFile(destFileH,srcContents, False);
+	
+	      LoadStringFromFile (srcFileA, srcContents);
+	      StringChangeEx (srcContents, 'WAMPBROWSER', browser, True);
+	      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
+	      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
+	      SaveStringToFile(destFileA,srcContents, False);
+	    end
+
+
+      if MsgBox(CustomMessage('DoliWampWillStartApacheMysql'),mbConfirmation,MB_YESNO) = IDYES then
+      begin
+
+		
+		    //----------------------------------------------
+		    // Create file alias phpmyadmin (always)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/alias/phpmyadmin.conf';
+		    srcFile := pathWithSlashes+'/alias/phpmyadmin.conf.install';
+		
+		    if FileExists(srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      //installDir et version de phpmyadmin
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		    DeleteFile(srcFile);
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file alias dolibarr (if not exists)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/alias/dolibarr.conf';
+		    srcFile := pathWithSlashes+'/alias/dolibarr.conf.install';
+		
+		    if not FileExists (destFile) and FileExists(srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
+		
+		      SaveStringToFile(destFile, srcContents, False);
+		    end
+		    DeleteFile(srcFile);
+		
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file configuration for phpmyadmin (if not exists)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php';
+		    srcFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php.install';
+		
+		    if not FileExists (destFile) and FileExists (srcFile) then
+		    begin
+	        // sinon on prends le fichier par defaut
+	        LoadStringFromFile (srcFile, srcContents);
+	        StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
+	        StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
+	        SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file httpd.conf (if not exists)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/conf/httpd.conf';
+		    srcFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/conf/httpd.conf.install';
+		
+		    if not FileExists (destFile) and FileExists (srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+
+		      //installDir et version de php
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
+              StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file my.ini (if not exists)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/bin/mysql/mysql'+mysqlVersion+'/my.ini';
+		    srcFile := pathWithSlashes+'/bin/mysql/mysql'+mysqlVersion+'/my.ini.install';
+		
+		    if not FileExists (destFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      //installDir et version de php
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file index.php (always but archive if exists)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/www/index.php';
+		    srcFile := pathWithSlashes+'/www/index.php.install';
+		
+		    if not FileExists (destFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		      StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
+		      SaveStringToFile(destFile, srcContents, False);
+		    end
+		    else
+		    begin
+		      RenameFile(destFile, destFile+'.old');
+		      LoadStringFromFile (srcFile, srcContents);
+		      StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
+		      SaveStringToFile(destFile, srcContents, False);
+		    end
+		
+		
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file dolibarr parametres predefinis install web (if not exists)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/www/dolibarr/htdocs/install/install.forced.php';
+		    srcFile := pathWithSlashes+'/www/dolibarr/htdocs/install/install.forced.php.install';
+		
+		    if not FileExists (destFile) and FileExists (srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file install_services.bat (always)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/install_services.bat';
+		    srcFile := pathWithSlashes+'/install_services.bat.install';
+		
+		    if FileExists(srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      //version de apache et mysql
+		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file install_services_auto.bat (always)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/install_services_auto.bat';
+		    srcFile := pathWithSlashes+'/install_services_auto.bat.install';
+		
+		    if FileExists (srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      //version de apache et mysql
+		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file uninstall_services.bat (always)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/uninstall_services.bat';
+		    srcFile := pathWithSlashes+'/uninstall_services.bat.install';
+		
+		    if FileExists (srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      //version de apache et mysql
+		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		
+		    //----------------------------------------------
+		    // Create file mysqlinitpassword.bat (always)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/mysqlinitpassword.bat';
+		    srcFile := pathWithSlashes+'/mysqlinitpassword.bat.install';
+		
+		    if FileExists (srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      //version de apache et mysql
+		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		    //----------------------------------------------
+		    // Create file mysqltestinstall.bat (always)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/mysqltestinstall.bat';
+		    srcFile := pathWithSlashes+'/mysqltestinstall.bat.install';
+		
+		    if FileExists (srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      //version de apache et mysql
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		    //----------------------------------------------
+		    // Create file startdoliwamp_manual_donotuse.bat (always)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/startdoliwamp_manual_donotuse.bat';
+		    srcFile := pathWithSlashes+'/startdoliwamp_manual_donotuse.bat.install';
+		
+		    if FileExists (srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      //version de apache et mysql
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
+		      StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		    
+		
+		    //----------------------------------------------
+		    // Create file builddemosslfiles.bat (always)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/builddemosslfiles.bat';
+		    srcFile := pathWithSlashes+'/builddemosslfiles.bat.install';
+		
+		    if FileExists (srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		
+		      //version de apache et mysql
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
+		
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+
+		
+		    //----------------------------------------------
+		    // Create file php.ini in php (if not exists)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini';
+		    srcFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini.install';
+		
+		    if not FileExists (destFile) and FileExists(srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
+              StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		    //----------------------------------------------
+		    // Create file php.ini in apache (if not exists)
+		    //----------------------------------------------
+		
+		    destFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/php.ini';
+		    srcFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini.install';
+		
+		    if not FileExists (destFile) and FileExists(srcFile) then
+		    begin
+		      LoadStringFromFile (srcFile, srcContents);
+		      StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
+		      StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
+              StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
+		      SaveStringToFile(destFile,srcContents, False);
+		    end
+		
+		
+		
+	   		// Uninstall and Install services
+		  	batFile := path+'\uninstall_services.bat';
+        Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
+  			batFile := path+'\install_services.bat';
+  			Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
+			
+  			// Start services
+        batFile := path+'\startdoliwamp.bat';
+        Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
+        //MsgBox(myResult,mbInformation,MB_OK);
+			
+        // Change mysql password (works only if not yet defined)
+        batFile := path+'\mysqlinitpassword.bat';
+        Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
+			
+        // Remove dangerous files
+        batFile := path+'\removefiles.bat';
+        Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
+
+			
+		    // Save parameters to registry
+		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'smtpServer',  mysmtp);
+		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'apachePort',  myporta);
+		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'apachePSSL',  myportas);
+		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'mysqlPort',   myport);
+		    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp', 'newPassword', mypass);
+		
+		
+        res := True;
+		
+		  end
+		  else
+		  begin
+		  
+//	  	MsgBox('Apache and Mysql installation has been canceled. Please select parameters to start their installation.',mbInformation,MB_OK)
+
+      	res := False;
+		  	
+		  end
+      
+    end
+    else
+    begin
+    
+        //MsgBox('Selected values seems to be already used. Please choose other values.',mbInformation,MB_OK);
+		  	
+		  	res := False;
+
+    end
+    
+  end
+
+
+  Result := res;
+end;
+
+
+
+
+
+//-----------------------------------------------
+//procedure launched by the end of the installation, it deletes the installation files
+procedure DeinitializeSetup();
+begin
+//  DeleteFile(path+'\install_services.bat');
+//  DeleteFile(path+'\install_services_auto.bat');
+end;
+
+
+//-----------------------------------------------
+//procedure launched at beginning of the uninstallation
+function InitializeUninstall(): Boolean;
+begin
+    Result := RegDeleteValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','smtpServer');
+    Result := RegDeleteValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','apachePort');
+    Result := RegDeleteValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','mysqlPort');
+    Result := RegDeleteValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','newPassword');
+    Result := RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp');
+
+    Result := True;
+end;
+
+//-----------------------------------------------
+//procedure launched by the end of the uninstallation
+procedure DeinitializeUninstall();
+begin
+  path := ExpandConstant('{app}');
+  winPath := ExpandConstant('{win}');
+  pathWithSlashes := path;
+  StringChange (pathWithSlashes, '\','/');
+
+  MsgBox(FmtMessage(CustomMessage('ProgramHasBeenRemoved'),[path]),mbInformation,MB_OK);
+end;
+
+
+[Run]
+; Launch Dolibarr in browser. This is run after Wizard because of postinstall flag
+Filename: "{app}\rundoliwamp.bat"; Description: {cm:LaunchNow}; Flags: shellexec postinstall skipifsilent runhidden
+
+
+[UninstallDelete]
+Type: files; Name: "{app}\*.*"
+Type: files; Name: "{app}\bin\mysql\mysql5.0.45\*.*"
+Type: filesandordirs; Name: "{app}\alias"
+Type: filesandordirs; Name: "{app}\apps"
+Type: filesandordirs; Name: "{app}\bin\apache"
+Type: filesandordirs; Name: "{app}\bin\php"
+Type: filesandordirs; Name: "{app}\help"
+Type: filesandordirs; Name: "{app}\lang"
+Type: filesandordirs; Name: "{app}\logs"
+Type: filesandordirs; Name: "{app}\scripts"
+Type: filesandordirs; Name: "{app}\tmp"
+Type: filesandordirs; Name: "{app}\www\dolibarr"
+
+
+[UninstallRun]
+Filename: "{app}\uninstall_services.bat"; Flags: runhidden
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 21785733d38b00193efbcf3f4db25983a20c829d..5cff1442a8986b4ecc4e93f529c3963afb2c6a82 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -2,20 +2,27 @@
 #----------------------------------------------------------------------------
 # \file         build/makepack-dolibarr.pl
 # \brief        Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
-# \author       (c)2004-2012 Laurent Destailleur  <eldy@users.sourceforge.net>
+# \author       (c)2004-2013 Laurent Destailleur  <eldy@users.sourceforge.net>
+#
+# This is list of constant you can set to have generated packages moved into a specific dir: 
+#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
+#DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'
+#DESTIMODULES='/media/HDDATA1_LD/Mes Sites/Web/Admin1/wwwroot/files/modules'
+#DESTIDOLIMEDBETARC='/media/HDDATA1_LD/Mes Sites/Web/DoliCloud/dolimed.com/htdocs/files/lastbuild'
+#DESTIDOLIMEDMODULES='/media/HDDATA1_LD/Mes Sites/Web/DoliCloud/dolimed.com/htdocs/files/modules'
+#DESTIDOLIMEDSTABLE='/media/HDDATA1_LD/Mes Sites/Web/DoliCloud/dolimed.com/htdocs/files/stable'
 #----------------------------------------------------------------------------
 
 use Cwd;
 
 $PROJECT="dolibarr";
-$MAJOR="3";
-$MINOR="3";
-$BUILD="4";		# Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
 $RPMSUBVERSION="auto";	# auto use value found into BUILD
 
 @LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT");   # Possible packages
+%REQUIREMENTPUBLISH=(
+"SF"=>"git ssh rsync"
+);
 %REQUIREMENTTARGET=(                            # Tool requirement for each package
-"SNAPSHOT"=>"tar",
 "TGZ"=>"tar",
 "ZIP"=>"7z",
 "XZ"=>"xz",
@@ -25,22 +32,14 @@ $RPMSUBVERSION="auto";	# auto use value found into BUILD
 "RPM_OPENSUSE"=>"rpmbuild",
 "DEB"=>"dpkg",
 "APS"=>"zip",
-"EXEDOLIWAMP"=>"ISCC.exe"
+"EXEDOLIWAMP"=>"ISCC.exe",
+"SNAPSHOT"=>"tar"
 );
 %ALTERNATEPATH=(
 "7z"=>"7-ZIP",
 "makensis.exe"=>"NSIS"
 );
 
-$FILENAME="$PROJECT";
-$FILENAMESNAPSHOT="$PROJECT-snapshot";
-$FILENAMETGZ="$PROJECT-$MAJOR.$MINOR.$BUILD";
-$FILENAMEZIP="$PROJECT-$MAJOR.$MINOR.$BUILD";
-$FILENAMEXZ="$PROJECT-$MAJOR.$MINOR.$BUILD";
-$FILENAMERPM="$PROJECT-$MAJOR.$MINOR.$BUILD-$RPMSUBVERSION";
-$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${BUILD}";
-$FILENAMEAPS="$PROJECT-$MAJOR.$MINOR.$BUILD.app";
-$FILENAMEEXEDOLIWAMP="DoliWamp-$MAJOR.$MINOR.$BUILD";
 if (-d "/usr/src/redhat")   { $RPMDIR="/usr/src/redhat"; } # redhat
 if (-d "/usr/src/packages") { $RPMDIR="/usr/src/packages"; } # opensuse
 if (-d "/usr/src/RPM")      { $RPMDIR="/usr/src/RPM"; } # mandrake
@@ -59,6 +58,7 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/;
 
 $SOURCE="$DIR/..";
 $DESTI="$SOURCE/build";
+$PUBLISH="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
 if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
 {
     print "Error: Missing environment variables.\n";
@@ -112,7 +112,57 @@ if (! $TEMP || ! -d $TEMP) {
 $BUILDROOT="$TEMP/buildroot";
 
 
-my $copyalreadydone=0;      # Use "-" before number of choice to avoid copy
+# Get version $MAJOR, $MINOR and $BUILD
+$result = open( IN, "<" . $SOURCE . "/htdocs/filefunc.inc.php" );
+if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; }
+while (<IN>) {
+	if ( $_ =~ /define\('DOL_VERSION','([\d\.]+)'\)/ ) { $PROJVERSION = $1; break; }
+}
+close IN;
+($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
+if ($MINOR eq '') { die "Error can't detect version into ".$SOURCE . "/htdocs/filefunc.inc.php"; }
+
+# Set vars for packaging
+$FILENAME            = "$PROJECT";
+$FILENAMESNAPSHOT    = "$PROJECT-snapshot";
+$FILENAMETGZ         = "$PROJECT-$MAJOR.$MINOR.$BUILD";
+$FILENAMEZIP         = "$PROJECT-$MAJOR.$MINOR.$BUILD";
+$FILENAMEXZ          = "$PROJECT-$MAJOR.$MINOR.$BUILD";
+$FILENAMEDEB         = "see later";
+$FILENAMEAPS         = "$PROJECT-$MAJOR.$MINOR.$BUILD.app";
+$FILENAMEEXEDOLIWAMP = "DoliWamp-$MAJOR.$MINOR.$BUILD";
+# For RPM
+$ARCH='noarch';
+$newbuild = $BUILD;
+$newbuild =~ s/(dev|alpha)/0.1.a/gi;			# dev (fedora)
+$newbuild =~ s/beta/0.2.beta1/gi;				# beta (fedora)
+$newbuild =~ s/rc./0.3.rc1/gi;					# rc (fedora)
+if ($newbuild !~ /-/) { $newbuild.='-0.3'; }	# finale (fedora)
+#$newbuild =~ s/(dev|alpha)/0/gi;				# dev
+#$newbuild =~ s/beta/1/gi;						# beta
+#$newbuild =~ s/rc./2/gi;						# rc
+#if ($newbuild !~ /-/) { $newbuild.='-3'; }		# finale
+$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
+if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
+$FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
+$FILENAMERPM=$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm";
+# For Deb
+$newbuild = $BUILD;
+$newbuild =~ s/(dev|alpha)/1/gi;                # dev
+$newbuild =~ s/beta/2/gi;                       # beta
+$newbuild =~ s/rc./3/gi;                        # rc
+if ($newbuild !~ /-/) { $newbuild.='-3'; }      # finale is same than rc. 
+# now newbuild is 0-1 or 0-3 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management
+$build = $newbuild;
+$build =~ s/-.*$//g;
+# now build is 0 for example
+# $build .= '+nmu1';
+# now build is 0+nmu1 for example
+$FILENAMEDEBNATIVE="${PROJECT}_${MAJOR}.${MINOR}.${build}";
+$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}";
+
+
+my $copyalreadydone=0;
 my $batch=0;
 for (0..@ARGV-1) {
 	if ($ARGV[$_] =~ /^-*target=(\w+)/i)   { $target=$1; $batch=1; }
@@ -122,41 +172,47 @@ for (0..@ARGV-1) {
     	$FILENAMESNAPSHOT.="-".$PREFIX; 
     }
 }
-if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i)   { $DESTI = $ENV{"DESTIBETARC"}; }	# Force output dir if env DESTI is defined
-if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; }	# Force output dir if env DESTI is defined
-
+if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i)   { $DESTI = $ENV{"DESTIBETARC"}; }	# Force output dir if env DESTIBETARC is defined
+if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; }	# Force output dir if env DESTISTABLE is defined
+if ($ENV{"PUBLISHBETARC"} && $BUILD =~ /[a-z]/i)   { $PUBLISH = $ENV{"PUBLISHBETARC"}; }	# Force target site for publishing if env PUBLISHBETARC is defined
+if ($ENV{"PUBLISHSTABLE"} && $BUILD =~ /^[0-9]+$/) { $PUBLISH = $ENV{"PUBLISHSTABLE"}; }	# Force target site for publishing if env PUBLISHSTABLE is defined
 
 print "Makepack version $VERSION\n";
-print "Building package name: $PROJECT\n";
-print "Building package version: $MAJOR.$MINOR.$BUILD\n";
+print "Building/publishing package name: $PROJECT\n";
+print "Building/publishing package version: $MAJOR.$MINOR.$BUILD\n";
 print "Source directory (SOURCE): $SOURCE\n";
 print "Target directory (DESTI) : $DESTI\n";
+print "Publishing target (PUBLISH): $PUBLISH\n";
 
 
 # Choose package targets
 #-----------------------
 if ($target) {
-    $CHOOSEDTARGET{uc($target)}=1;
+	if ($target eq "ALL") { 
+		foreach my $key (@LISTETARGET) {
+	    	if ($key ne 'SNAPSHOT' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
+		}
+	}
+	if ($target ne "ALL" && $target ne "SF") { $CHOOSEDTARGET{uc($target)}=1; }
+	if ($target eq "SF") { $CHOOSEDPUBLISH{"SF"}=1; }
 }
 else {
     my $found=0;
     my $NUM_SCRIPT;
+   	my $cpt=0;
     while (! $found) {
-    	my $cpt=0;
-    	printf(" %2d - %-12s    (%s)\n",$cpt,"All (Except SNAPSHOT)","Need ".join(",",values %REQUIREMENTTARGET));
+    	printf(" %2d - %-12s    (%s)\n",$cpt,"ALL (1..9)","Need ".join(",",values %REQUIREMENTTARGET));
     	foreach my $target (@LISTETARGET) {
     		$cpt++;
     		printf(" %2d - %-12s    (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target});
     	}
+    	$cpt=99;
+    	printf(" %2d - %-12s    (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH));
     
-    	# On demande de choisir le fichier à passer
+    	# Ask which target to build
     	print "Choose one package number or several separated with space (0 - ".$cpt."): ";
     	$NUM_SCRIPT=<STDIN>; 
     	chomp($NUM_SCRIPT);
-    	if ($NUM_SCRIPT =~ s/-//g) {
-    		# Do not do copy	
-    		$copyalreadydone=1;
-    	}
     	if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
     	{
     		print "This is not a valid package number list.\n";
@@ -168,15 +224,20 @@ else {
     	}
     }
     print "\n";
-    if ($NUM_SCRIPT) {
-    	foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
-    		$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
-    	}
+    if ($NUM_SCRIPT eq "99") {
+   		$CHOOSEDPUBLISH{"SF"}=1;
     }
     else {
-    	foreach my $key (@LISTETARGET) {
-    		if ($key ne 'SNAPSHOT') { $CHOOSEDTARGET{$key}=1; }
-        }
+	    if ($NUM_SCRIPT eq "0") {
+	    	foreach my $key (@LISTETARGET) {
+	    		if ($key ne 'SNAPSHOT' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
+	        }
+	    }
+	    else {
+	   		foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
+	   			$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
+	   		}
+	    }
     }
 }
 
@@ -193,7 +254,8 @@ foreach my $target (keys %CHOOSEDTARGET) {
 		}
 		$atleastonerpm=1;			
 	} 
-    foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
+    foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) 
+    {
         # Test    
         print "Test requirement for target $target: Search '$req'... ";
         $newreq=$req; $newparam='';
@@ -217,7 +279,7 @@ foreach my $target (keys %CHOOSEDTARGET) {
             last;
         } else {
             # Pas erreur ou erreur autre que programme absent
-            print " Found ".$REQUIREMENTTARGET{$target}."\n";
+            print " Found ".$req."\n";
         }
     }
 }
@@ -228,16 +290,20 @@ print "\n";
 #----------------------------------------------
 $nboftargetok=0;
 $nboftargetneedbuildroot=0;
-$nboftargetneedcvs=0;
+$nbofpublishneedtag=0;
 foreach my $target (keys %CHOOSEDTARGET) {
     if ($CHOOSEDTARGET{$target} < 0) { next; }
 	if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP') 
 	{
 		$nboftargetneedbuildroot++;
 	}
-	if ($target eq 'SNAPSHOT')
+	$nboftargetok++;
+}
+foreach my $target (keys %CHOOSEDPUBLISH) {
+    if ($CHOOSEDPUBLISH{$target} < 0) { next; }
+	if ($target eq 'SF')
 	{
-		$nboftargetneedcvs++;
+		$nbofpublishneedtag++;
 	}
 	$nboftargetok++;
 }
@@ -246,13 +312,26 @@ if ($nboftargetok) {
 
     # Update CVS if required
     #-----------------------
-    if ($nboftargetneedcvs)
+    if ($nbofpublishneedtag)
 	{
     	print "Go to directory $SOURCE\n";
    		$olddir=getcwd();
    		chdir("$SOURCE");
-    	print "Run cvs update -P -d\n";
-    	$ret=`cvs update -P -d 2>&1`;
+    	print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
+    	$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
+    	if ($ret =~ /already exists/)
+    	{
+    		print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
+	    	$QUESTIONOVERWRITETAG=<STDIN>; 
+	    	chomp($QUESTIONOVERWRITETAG);
+	    	if ($QUESTIONOVERWRITETAG =~ /(o|y)/)
+	    	{
+		    	print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
+		    	$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
+	    	}
+    	}
+    	print 'Run git push --tags'."\n";
+    	$ret=`git push --tags`;
     	chdir("$olddir");
 	}
 	
@@ -270,15 +349,20 @@ if ($nboftargetok) {
 	    	mkdir "$BUILDROOT/$PROJECT";
 	    	print "Copy $SOURCE into $BUILDROOT/$PROJECT\n";
 	    	$ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`;
+	    	#print "Copy $SOURCE/build/debian/apache/.htaccess into $BUILDROOT/$PROJECT/build/debian/apache/.htaccess\n";
+	    	#$ret=`cp -pr "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT/build/debian/apache/.htaccess"`;
 	    }
 	    print "Clean $BUILDROOT\n";
 	    $ret=`rm -f  $BUILDROOT/$PROJECT/.buildpath`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
+	    $ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/.git`;
 	    $ret=`rm -f  $BUILDROOT/$PROJECT/.gitmodules`;
         $ret=`rm -f  $BUILDROOT/$PROJECT/.gitignore`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
+	    $ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
+	    $ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
 	    $ret=`rm -f  $BUILDROOT/$PROJECT/build.xml`;
 	    $ret=`rm -f  $BUILDROOT/$PROJECT/quickbuild.xml`;
         $ret=`rm -f  $BUILDROOT/$PROJECT/pom.xml`;
@@ -308,6 +392,8 @@ if ($nboftargetok) {
         $ret=`rm -f  $BUILDROOT/$PROJECT/htdocs/install/mysql/README`;
         $ret=`rm -f  $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
 
+        $ret=`rm -fr  $BUILDROOT/$PROJECT/htdocs/install/mssql`;
+
         $ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/dev/codetemplates`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/dev/dbmodel`;
@@ -341,9 +427,12 @@ if ($nboftargetok) {
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
+	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
+	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
+	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/test`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
 	    $ret=`rm -f  $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
@@ -352,8 +441,12 @@ if ($nboftargetok) {
         $ret=`rm -f  $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`;    # Avoid errors into rpmlint
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`;  # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems.
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`;                # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems.
+        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`;		# Keep this removal in case we embed libraries
+        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/adapters`;	# Keep this removal in case we embed libraries
    	    
+	    $ret=`rm -f  $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
+        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
@@ -363,7 +456,7 @@ if ($nboftargetok) {
 	    $ret=`rm -f  $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
 	}
-    
+
     # Build package for each target
     #------------------------------
     foreach my $target (keys %CHOOSEDTARGET) 
@@ -386,7 +479,6 @@ if ($nboftargetok) {
             $ret=`$cmd`;
 
     		print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n";
-   		    #$cmd="tar --exclude \"$BUILDROOT/tgz/tar_exclude.txt\" --exclude .cache --exclude .settings --exclude conf.php --directory \"$BUILDROOT\" -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
    		    $cmd="tar --exclude doli*.tgz --exclude doli*.deb --exclude doli*.exe --exclude doli*.xz --exclude doli*.zip --exclude doli*.rpm --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
 			print $cmd."\n";
 			$ret=`$cmd`;
@@ -496,30 +588,15 @@ if ($nboftargetok) {
     		mkdir($DESTI.'/'.$subdir);
 			if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; } 
 
-    		$ARCH='noarch';
 			if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; }
-           	$newbuild = $BUILD;
-           	# For fedora
-            $newbuild =~ s/(dev|alpha)/0.1.a/gi;			# dev
-            $newbuild =~ s/beta/0.2.beta1/gi;				# beta
-            $newbuild =~ s/rc./0.3.rc1/gi;					# rc
-            if ($newbuild !~ /-/) { $newbuild.='-0.3'; }	# finale
-            #$newbuild =~ s/(dev|alpha)/0/gi;				# dev
-            #$newbuild =~ s/beta/1/gi;						# beta
-            #$newbuild =~ s/rc./2/gi;						# rc
-            #if ($newbuild !~ /-/) { $newbuild.='-3'; }		# finale
-            #print "newbuild=".$newbuild."\n";exit;
-            $REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
-            if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
-            print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
 
-            $FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
+            print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
 
             #print "Create directory $RPMDIR\n";
             #$ret=`mkdir -p "$RPMDIR"`;
 
-    		print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm...\n";
-    		unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm");
+    		print "Remove target ".$FILENAMERPM."...\n";
+    		unlink("$NEWDESTI/".$FILENAMERPM);
     		print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n";
     		unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm");
 
@@ -530,8 +607,8 @@ if ($nboftargetok) {
             $ret=`$cmd`;
 
 			# Set owners
-            print "Set owners on files/dir\n";
-		    $ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
+            #print "Set owners on files/dir\n";
+		    #$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
 
             print "Set permissions on files/dir\n";
 		    $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`;
@@ -574,11 +651,9 @@ if ($nboftargetok) {
 
     		# Move to final dir
    		    print "Move $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm\n";
-   		    #$cmd="mv \"$RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\"";
    		    $cmd="mv $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm \"$NEWDESTI/\"";
     		$ret=`$cmd`;
    		    print "Move $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm\n";
-   		    #$cmd="mv \"$RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\"";
    		    $cmd="mv $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm \"$NEWDESTI/\"";
     		$ret=`$cmd`;
    		    print "Move $RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz into $NEWDESTI/".$FILENAMETGZ2.".tgz\n";
@@ -595,19 +670,6 @@ if ($nboftargetok) {
 
             $olddir=getcwd();
 
-            $newbuild = $BUILD;
-            $newbuild =~ s/(dev|alpha)/1/gi;                # dev
-            $newbuild =~ s/beta/2/gi;                       # beta
-            $newbuild =~ s/rc./3/gi;                        # rc
-            if ($newbuild !~ /-/) { $newbuild.='-4'; }      # finale
-            # now newbuild is 0-1 or 0-4 for example
-            print "Version is $MAJOR.$MINOR.$newbuild\n";
-            $build = $newbuild;
-            $build =~ s/-.*$//g;
-			# now build is 0 for example
-			# $build .= '+nmu1';
-			# now build is 0+nmu1 for example
-			
     		print "Remove target ${FILENAMEDEB}_all.deb...\n";
     		unlink("$NEWDESTI/${FILENAMEDEB}_all.deb");
     		print "Remove target ${FILENAMEDEB}.dsc...\n";
@@ -616,6 +678,8 @@ if ($nboftargetok) {
     		unlink("$NEWDESTI/${FILENAMEDEB}.tar.gz");
     		print "Remove target ${FILENAMEDEB}.changes...\n";
     		unlink("$NEWDESTI/${FILENAMEDEB}.changes");
+    		print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
+    		unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");
 
     		$ret=`rm -fr $BUILDROOT/$PROJECT.tmp`;
     		$ret=`rm -fr $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build`;
@@ -623,6 +687,8 @@ if ($nboftargetok) {
 			print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n";
 			$cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\"";
 			$ret=`$cmd`;
+			#$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/debian/apache/.htaccess\" \"$BUILDROOT/$PROJECT.tmp/build/debian/apache/.htaccess\"";
+			#$ret=`$cmd`;
 
  			print "Remove other files\n";
             $ret=`rm -f  $BUILDROOT/$PROJECT.tmp/README-FR`;
@@ -650,7 +716,7 @@ if ($nboftargetok) {
             $ret=`rm -f  $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates.futur`;
             $ret=`rm -f  $BUILDROOT/$PROJECT.tmp/build/debian/rules`;
             $ret=`rm -f  $BUILDROOT/$PROJECT.tmp/build/debian/README.howto`;
-            $ret=`rm -f  $BUILDROOT/$PROJECT.tmp/build/debian/wash`;
+            $ret=`rm -f  $BUILDROOT/$PROJECT.tmp/build/debian/watch`;
             $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/doap`;
             $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/exe`;
             $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/launchpad`;
@@ -659,13 +725,9 @@ if ($nboftargetok) {
             $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/perl`;
             $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`;
             $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`;
-            # We remove embedded libraries or fonts (this is also inside rules file, target clean)
-	   	    $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor`;
-			$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/fonts`,
-	   	    $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/geoip`;
-	   	    $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/nusoap`;
-            $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/odtphp/zip/pclzip`;
-
+            # Rename upstream changelog to match debian rules
+			$ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`;
+			
             # Prepare source package (init debian dir)
             print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n";
             $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`;
@@ -682,18 +744,24 @@ if ($nboftargetok) {
             $ret=`cp -f  "$SOURCE/build/debian/dolibarr.xpm"  		      	"$BUILDROOT/$PROJECT.tmp/debian"`;
             $ret=`cp -f  "$SOURCE/build/debian/README.source"  "$BUILDROOT/$PROJECT.tmp/debian"`;
             $ret=`cp -f  "$SOURCE/build/debian/rules"          "$BUILDROOT/$PROJECT.tmp/debian"`;
+            $ret=`cp -f  "$SOURCE/build/debian/watch"          "$BUILDROOT/$PROJECT.tmp/debian"`;
             $ret=`cp -fr "$SOURCE/build/debian/patches"        "$BUILDROOT/$PROJECT.tmp/debian"`;
             $ret=`cp -fr "$SOURCE/build/debian/po"             "$BUILDROOT/$PROJECT.tmp/debian"`;
             $ret=`cp -fr "$SOURCE/build/debian/source"         "$BUILDROOT/$PROJECT.tmp/debian"`;
+            #$ret=`cp -fr "$SOURCE/build/debian/apache"         "$BUILDROOT/$PROJECT.tmp/debian/apache"`;
+            #$ret=`cp -f  "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT.tmp/debian/apache"`;
+            #$ret=`cp -fr "$SOURCE/build/debian/lighttpd"       "$BUILDROOT/$PROJECT.tmp/debian/lighttpd"`;
             # Add files also required to build binary package
             $ret=`cp -f  "$SOURCE/build/debian/dolibarr.config"         "$BUILDROOT/$PROJECT.tmp/debian"`;
             $ret=`cp -f  "$SOURCE/build/debian/dolibarr.postinst"       "$BUILDROOT/$PROJECT.tmp/debian"`;
             $ret=`cp -f  "$SOURCE/build/debian/dolibarr.postrm"         "$BUILDROOT/$PROJECT.tmp/debian"`;
             $ret=`cp -f  "$SOURCE/build/debian/dolibarr.templates"      "$BUILDROOT/$PROJECT.tmp/debian"`;
+            $ret=`cp -f  "$SOURCE/build/debian/install.forced.php.install"      "$BUILDROOT/$PROJECT.tmp/debian"`;
             
 			# Set owners and permissions
-            print "Set owners on files/dir\n";
-		    $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
+            #print "Set owners on files/dir\n";
+		    #$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
+
             print "Set permissions on files/dir\n";
 		    $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`;
 		    $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; ";
@@ -722,22 +790,35 @@ if ($nboftargetok) {
             $cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
             $ret=`$cmd`;
 
+
+     		print "Go into directory $BUILDROOT\n";
+            chdir("$BUILDROOT");
+			
+			# We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native)
+    		print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n";
+   		    $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build";
+   		    print $cmd."\n";
+   		    $ret=`$cmd`;
+
 			# Creation of source package          
      		print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
             chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build");
             #$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
             $cmd="dpkg-buildpackage -us -uc";
             print "Launch DEB build ($cmd)\n";
-            $ret=`$cmd`;
+            $ret=`$cmd 2>&1 3>&1`;
             print $ret."\n";
 
             chdir("$olddir");
     		
+    		print "You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n";
+    		print "You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n";
+    		
     		# Move to final dir
-            print "Move *_all.deb to $NEWDESTI\n";
+            print "Move *_all.deb *.dsc *.orig.tar.gz *.changes to $NEWDESTI\n";
             $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
             $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
-            $ret=`mv $BUILDROOT/*.tar.gz "$NEWDESTI/"`;
+            $ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
             $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
         	next;
         }
@@ -852,6 +933,81 @@ if ($nboftargetok) {
     		next;
     	}
     }
+
+    # Build package for each target
+    #------------------------------
+    foreach my $target (keys %CHOOSEDPUBLISH) 
+    {
+        if ($CHOOSEDPUBLISH{$target} < 0) { next; }
+    
+		print "\nList of files to publish\n";
+    	%filestoscan=(
+    		"$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
+    		"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
+    		"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
+    		"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
+    		"$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM'
+    	);
+    	foreach my $file (sort keys %filestoscan)
+    	{
+    		$found=0;
+    		my $filesize = -s $file;
+    		print $file." ".($filesize?"(found)":"(not found)");
+    		print ($filesize?" - ".$filesize:"");
+    		print "\n";
+    	}
+
+    	if ($target eq 'SF') 
+    	{
+    		print "\n";
+    		
+    		$NEWPUBLISH=$PUBLISH;
+    		print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n";
+
+	    	# Ask which target to build
+	    	$NUM_SCRIPT=<STDIN>; 
+	    	chomp($NUM_SCRIPT);
+
+			print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n";
+            $ret=`mkdir -p "/tmp/emptydir/"`;
+            
+	    	foreach my $file (sort keys %filestoscan)
+	    	{
+	    		$found=0;
+	    		my $filesize = -s $file;
+	    		if (! $filesize) { next; }
+
+				print "\n";
+	    		print "Publish file ".$file." to ".$filestoscan{$file}."\n";
+	    		
+	    		$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
+
+				# mkdir	   
+				#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");
+				#$ssh->login("$user","$pass"); 		
+	    		#use String::ShellQuote qw( shell_quote );
+				#$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit');
+
+				#use Net::SFTP::Foreign;
+				#my $sftp = Net::SFTP::Foreign->new($ip, user => $user, password => $pass, autodie => 1);
+				#$sftp->mkdir($destFolder)
+
+				#$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\"";
+				#print "$command\n";	
+				#my $ret=`$command 2>&1`;
+				$command="rsync -s -e 'ssh' --recursive /tmp/emptydir/ \"".$destFolder."\"";
+				print "$command\n";	
+				my $ret=`$command 2>&1`;
+
+				$command="rsync -s $OPTIONUPDATEDIST -e 'ssh' \"$file\" \"".$destFolder."\"";
+				print "$command\n";	
+				my $ret=`$command 2>&1`;
+				print "$ret\n";
+	    		
+	    	}
+
+    	}
+    }    
 }
 
 print "\n----- Summary -----\n";
diff --git a/build/pad/pad_dolibarr.xml b/build/pad/pad_dolibarr.xml
index 4b09346a4db52cea23053b4557d2cef43d79544f..8018e972c79d07bf60a4e11851f8da2e6c1c3581 100644
--- a/build/pad/pad_dolibarr.xml
+++ b/build/pad/pad_dolibarr.xml
@@ -34,10 +34,10 @@
 	</Company_Info>
 	<Program_Info>
 		<Program_Name>Dolibarr</Program_Name>
-		<Program_Version>3.3.2</Program_Version>
-		<Program_Release_Month>05</Program_Release_Month>
-		<Program_Release_Day>17</Program_Release_Day>
-		<Program_Release_Year>2013</Program_Release_Year>
+		<Program_Version>3.3.5</Program_Version>
+		<Program_Release_Month>01</Program_Release_Month>
+		<Program_Release_Day>01</Program_Release_Day>
+		<Program_Release_Year>2014</Program_Release_Year>
 		<Program_Cost_Dollars />
 		<Program_Cost_Other_Code />
 		<Program_Cost_Other />
diff --git a/build/pad/pad_doliwamp.xml b/build/pad/pad_doliwamp.xml
index 2602b3e877f51c807f0cfb99c02deec3ee8266a8..d4e497957dbd67925624383b99595cd4ad3432a0 100644
--- a/build/pad/pad_doliwamp.xml
+++ b/build/pad/pad_doliwamp.xml
@@ -34,10 +34,10 @@
 	</Company_Info>
 	<Program_Info>
 		<Program_Name>DoliWamp</Program_Name>
-		<Program_Version>3.3.2</Program_Version>
-		<Program_Release_Month>05</Program_Release_Month>
-		<Program_Release_Day>17</Program_Release_Day>
-		<Program_Release_Year>2013</Program_Release_Year>
+		<Program_Version>3.3.5</Program_Version>
+		<Program_Release_Month>01</Program_Release_Month>
+		<Program_Release_Day>01</Program_Release_Day>
+		<Program_Release_Year>2014</Program_Release_Year>
 		<Program_Cost_Dollars />
 		<Program_Cost_Other_Code />
 		<Program_Cost_Other />
diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec
index 16f72b5784d3f57965b80932e468252ee5031013..4e1f9b1528429134f3d34e8618e8c1b84285be5a 100755
--- a/build/rpm/dolibarr_fedora.spec
+++ b/build/rpm/dolibarr_fedora.spec
@@ -335,5 +335,5 @@ fi
 
 
 %changelog
-* Mon Apr 22 2013 Laurent Destailleur 3.3.4-0.3
+* Mon Apr 22 2013 Laurent Destailleur 3.3.5-0.3
 - Initial version (#723326)
diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec
index 8cabd545db51e392d3a4307c162d552c90545863..e9a25fc774c8960b32a20f4aa72334dbd0c80dad 100755
--- a/build/rpm/dolibarr_generic.spec
+++ b/build/rpm/dolibarr_generic.spec
@@ -548,5 +548,5 @@ fi
 
 
 %changelog
-* Mon Apr 22 2013 Laurent Destailleur 3.3.4-0.3
+* Mon Apr 22 2013 Laurent Destailleur 3.3.5-0.3
 - Initial version (#723326)
diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec
index 518723e35a2618c84be5298b53e8098a44def094..3bb9609a31c3bf4c067e1b085d5bdcd1848eac74 100755
--- a/build/rpm/dolibarr_mandriva.spec
+++ b/build/rpm/dolibarr_mandriva.spec
@@ -333,5 +333,5 @@ fi
 
 
 %changelog
-* Mon Apr 22 2013 Laurent Destailleur 3.3.4-0.3
+* Mon Apr 22 2013 Laurent Destailleur 3.3.5-0.3
 - Initial version (#723326)
diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec
index c36652973f729572502c40998b4ddbb9d7379747..725d0eed80aceb93a508b548a1a9822032de717a 100755
--- a/build/rpm/dolibarr_opensuse.spec
+++ b/build/rpm/dolibarr_opensuse.spec
@@ -342,5 +342,5 @@ fi
 
 
 %changelog
-* Mon Apr 22 2013 Laurent Destailleur 3.3.4-0.3
+* Mon Apr 22 2013 Laurent Destailleur 3.3.5-0.3
 - Initial version (#723326)
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index 5bf1664f695b2e9764df5c0ac1da89776302eca2..4cc7f5761562e72464a1b3c5189fbe8d0bc1b724 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -48,3 +48,8 @@ with
 //var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
 window.location.href=pRef
 * Replace hard coded string with i18n["String"];
+
+
+JCROP:
+------
+* Remove analytics tag into file index.html
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index 7411c31530492197410e8fa71330de1866cc3172..72147693bd3bc4afe488e34642577e7a1f51f0a0 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -154,7 +154,8 @@ foreach ($modulesdir as $dir)
     					$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
     					if ($objMod->version == 'development'  && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0;
     					if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
-						//if ($mode == 'expdev' && ($objMod->version != 'experimental' && $objMod->version != 'development')) $modulequalified=0;
+						// We discard modules according to property disabled
+    					if (! empty($objMod->hidden)) $modulequalified=false;
 
     					// Define array $categ with categ with at least one qualified module
     					if ($modulequalified)
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index 9256e08318cc62c3e0e24053b51c87ab9e132b48..d79999ccdcbc33d1fbac10449a214a8b9d3cc36a 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -169,7 +169,8 @@ class DolEditor
             	//$skin='office2003';
             	//$skin='v2';
             	$skin='kama';
-            	
+                if (constant('JS_CKEDITOR')) $skin='moono';		// To use external ckeditor 4 js lib
+
             	if ($this->toolbarname=='dolibarr_mailings') {$htmlencode_force='true';}
             	else {$htmlencode_force='false';}
 
diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php
index 10bd7414722a0d6f79a676eceba3398b2bb14e6e..917d15a852c62783f770ca92447bf9415fb6a12e 100644
--- a/htdocs/core/modules/modFckeditor.class.php
+++ b/htdocs/core/modules/modFckeditor.class.php
@@ -62,6 +62,8 @@ class modFckeditor extends DolibarrModules
 		$this->config_page_url = array("fckeditor.php");
 
 		// Dependances
+		global $dolibarr_js_CKEDITOR;
+		$this->hidden = ($dolibarr_js_CKEDITOR == 'disabled'?1:0);	// A condition to disable module (used for native debian packages)
 		$this->depends = array();
 		$this->requiredby = array();
 
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index f27b144fe17024bd731a86adf833357cab3cb375..d87ecbde20238737cf9cce898e2183e4ab42b235 100755
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -29,7 +29,7 @@
  *  \brief      File that include conf.php file and commons lib like functions.lib.php
  */
 
-if (! defined('DOL_VERSION')) define('DOL_VERSION','3.3.4');
+if (! defined('DOL_VERSION')) define('DOL_VERSION','3.3.5');
 if (! defined('EURO')) define('EURO',chr(128));
 
 // Define syslog constants
diff --git a/htdocs/includes/jquery/plugins/jcrop/index.html b/htdocs/includes/jquery/plugins/jcrop/index.html
index 4f65fb095c8b4f054212f7609e0219abdbb117aa..209c929c61d01e4827debc2ae912c99bf8ace2a6 100755
--- a/htdocs/includes/jquery/plugins/jcrop/index.html
+++ b/htdocs/includes/jquery/plugins/jcrop/index.html
@@ -46,20 +46,5 @@
 </div>
 
 
-
-
-<!-- Below here for internal analysis {{{ -->
-
-<script type="text/javascript">
-var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-</script>
-<script type="text/javascript">
-var pageTracker = _gat._getTracker("UA-5176876-1");
-pageTracker._trackPageview();
-</script>
-
-<!-- }}} -->
-
 </body>
 </html>
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index f51cf7b6bd37c09e4f0d0d6734c07660ce94c9f2..6427cf25fd52b8621a0c13fce73c59ef40572176 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1051,14 +1051,19 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
             {
                 print '<!-- Includes JS for CKEditor -->'."\n";
                 $pathckeditor=DOL_URL_ROOT.'/includes/ckeditor/';
-                if (constant('JS_CKEDITOR')) $pathckeditor=JS_CKEDITOR;    // To use external ckeditor js lib
+                $jsckeditor='ckeditor_basic.js';
+                if (constant('JS_CKEDITOR'))	// To use external ckeditor 4 js lib
+                {
+                	$pathckeditor=constant('JS_CKEDITOR');
+                	$jsckeditor='ckeditor.js';
+                }
                 print '<script type="text/javascript">';
                 print 'var CKEDITOR_BASEPATH = \''.$pathckeditor.'\';'."\n";
                 print 'var ckeditorConfig = \''.dol_buildpath('/theme/'.$conf->theme.'/ckeditor/config.js',1).'\';'."\n";
                 print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
                 print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
                 print '</script>'."\n";
-                print '<script type="text/javascript" src="'.$pathckeditor.'ckeditor_basic.js"></script>'."\n";
+                print '<script type="text/javascript" src="'.$pathckeditor.$jsckeditor.'"></script>'."\n";
             }
             // jQuery Timepicker
             if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER'))
diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php
index b1b3d6cac45a92c80163eba541137d8205653ce2..82852c7a6d3254c190ec9118c7e9946597b560e8 100644
--- a/test/phpunit/AdherentTest.php
+++ b/test/phpunit/AdherentTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent.class.php';
 
diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php
index 2850041e0a6dcf00b6d2e29c537c1ae27a0fafb8..562a5d5c7143de18cbc59b01c37946016b342ff3 100644
--- a/test/phpunit/AdminLibTest.php
+++ b/test/phpunit/AdminLibTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/admin.lib.php';
 
diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php
index e037cb03035d3617b8d74f699b22d61259aaf6e7..93668dde5b1727105e652b3e3b8d7846658541b1 100644
--- a/test/phpunit/AllTests.php
+++ b/test/phpunit/AllTests.php
@@ -28,7 +28,7 @@ print "Memory: ". ini_get('memory_limit')."\n";
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 
 if ($langs->defaultlang != 'en_US')
diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php
index 73067787e185b4ed1b57ba6c2199e425d5ee5ed5..4999e7a2014e5ddec096cde58feed09c5afcd325 100644
--- a/test/phpunit/BankAccountTest.php
+++ b/test/phpunit/BankAccountTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/compta/bank/class/account.class.php';
 
diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php
index 67cea036bae84702922c1e2f7cb844d6cc14aa1e..5d68d9a9454c2670a71f996fad4f43ddb2dd752a 100644
--- a/test/phpunit/BuildDocTest.php
+++ b/test/phpunit/BuildDocTest.php
@@ -26,7 +26,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
 require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.facture.class.php';
diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php
index 691abed04571a03b69850bbe31858f4babaf59e5..232d10c4e7822eb8ab13fb243b6c04d4b24224e6 100755
--- a/test/phpunit/CMailFileTest.php
+++ b/test/phpunit/CMailFileTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/class/CMailFile.class.php';
 
diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php
index 128a52796dfc2bdb52f1d3456e072ce3efd762b0..34b293ffdf595dac7f728920a661d76de36ea73c 100755
--- a/test/phpunit/CategorieTest.php
+++ b/test/phpunit/CategorieTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/categories/class/categorie.class.php';
 require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php';
diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php
index 2367c6aadeab8ca95ff65ec90b010894289915b5..23df7ff09fd24f3a8d3bc71c8685c95f3fa91196 100755
--- a/test/phpunit/ChargeSocialesTest.php
+++ b/test/phpunit/ChargeSocialesTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/compta/sociales/class/chargesociales.class.php';
 
diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php
index a3478b74110be937086385dbdd4513e17eece2e6..b17268116ded7561dad368e62dd224e1d01724d8 100644
--- a/test/phpunit/CommandeFournisseurTest.php
+++ b/test/phpunit/CommandeFournisseurTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.commande.class.php';
 require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.product.class.php';
diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php
index 66e56407f45c3763a2ddc1d40bc42eca4737f6c7..c77dd39d0c21a59e8b6df08002a8f23d57abd199 100644
--- a/test/phpunit/CommandeTest.php
+++ b/test/phpunit/CommandeTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/commande/class/commande.class.php';
 
diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php
index 35865bf712df90f6356d6e3e8efd43552395b6a1..a01982508e32547e7c376a68cf5ab21d67738364 100644
--- a/test/phpunit/CommonObjectTest.php
+++ b/test/phpunit/CommonObjectTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/commande/class/commande.class.php';
 require_once dirname(__FILE__).'/../../htdocs/projet/class/project.class.php';
diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php
index 4c954e4e8b7739c5b8594eec8abc1b976a426a49..6564ab501b9e59161ef0459f2246c244ce4df509 100644
--- a/test/phpunit/CompanyBankAccountTest.php
+++ b/test/phpunit/CompanyBankAccountTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/societe/class/companybankaccount.class.php';
 
diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php
index e6cb5159a884a9339c7360381e40b44ceae11f72..bff368e82acf178c6e2bb4d89e016b1541a78882 100755
--- a/test/phpunit/ContactTest.php
+++ b/test/phpunit/ContactTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/contact/class/contact.class.php';
 $langs->load("dict");
diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php
index 82e53fcb30147958862f419d9b79e7754f5ffca8..4a629ac3b16be992f157d40a3562fb96ec142123 100644
--- a/test/phpunit/ContratTest.php
+++ b/test/phpunit/ContratTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/contrat/class/contrat.class.php';
 
diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php
index b7246007862c484befd53421f0d9b121be407dca..d53c25a2dd2d97dce448196d0d3ba4c6cef2867e 100755
--- a/test/phpunit/CoreTest.php
+++ b/test/phpunit/CoreTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 
 if (! defined('NOREQUIREUSER'))  define('NOREQUIREUSER','1');
diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php
index 1b35809e0af0df28c0a20873ce721a478d0d9cc5..17065a476b98be27f63683462cf82c596581a9ef 100644
--- a/test/phpunit/DateLibTest.php
+++ b/test/phpunit/DateLibTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
 
diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php
index 19debed0c309cc022baddfb0ba3a4dfa62a11649..80343da8083e9edfc3e4ec733d4ee53af2545f22 100755
--- a/test/phpunit/DiscountTest.php
+++ b/test/phpunit/DiscountTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/class/discount.class.php';
 
diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php
index a38ffe791241ad8616510a68fee38ebac2e753a6..3f93f7c1dc490c7250de8f8dbe6e1c096913606f 100755
--- a/test/phpunit/ExportTest.php
+++ b/test/phpunit/ExportTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/exports/class/export.class.php';
 
diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php
index 120a77c7e933748cf7fa8d8c986925aefaa9deaa..7fe3dbd32146c52a38f4d94e0ccddf64a84ff7e9 100644
--- a/test/phpunit/FactureFournisseurTest.php
+++ b/test/phpunit/FactureFournisseurTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.facture.class.php';
 
diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php
index 0301333f481743407ba6e918c4b2c76631bdc953..ea59aeab2925151b52f8fe5af77716f80de8bd13 100644
--- a/test/phpunit/FactureTest.php
+++ b/test/phpunit/FactureTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
 
diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php
index 446b6893ae0ac18ed77ca5729549a6924ae5f890..06ac86f10d48cdf4fc07122e8b9f2b742f46c195 100644
--- a/test/phpunit/FactureTestRounding.php
+++ b/test/phpunit/FactureTestRounding.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
 
@@ -323,4 +323,4 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
     }
 
 }
-?>
\ No newline at end of file
+?>
diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php
index 17d36944f8602cec434c15c8c06b5334e2689e59..f23e5241db0deca7b92086506ad9b343cfe8f5ce 100644
--- a/test/phpunit/FilesLibTest.php
+++ b/test/phpunit/FilesLibTest.php
@@ -26,7 +26,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/files.lib.php';
 
diff --git a/test/phpunit/Functions2Test.php b/test/phpunit/Functions2Test.php
index 46f662576f52bd2c64a4db5e0c749b3f32b3ca76..4930ae1fac90edaf600c453e0ab30f4f94efd959 100755
--- a/test/phpunit/Functions2Test.php
+++ b/test/phpunit/Functions2Test.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/functions2.lib.php';
 
diff --git a/test/phpunit/FunctionsTest.php b/test/phpunit/FunctionsTest.php
index 8e26f896c2a8ed5b3b20061fe240d78af13124ab..3f341320b04897669f66b3da438202d6c91f97ad 100755
--- a/test/phpunit/FunctionsTest.php
+++ b/test/phpunit/FunctionsTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
 
diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php
index 3921c711c08d10f60c41a8b547f1125de30349af..1c7dc2d522ae2778109a49c253f0bd52ef0e7e6c 100644
--- a/test/phpunit/HolidayTest.php
+++ b/test/phpunit/HolidayTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/holiday/class/holiday.class.php';
 $langs->load("dict");
diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php
index 2e2bcec81236a5944052795304eb82e33878ac04..e485e4545162404659fce41db5fd981a290c5b1c 100644
--- a/test/phpunit/ImagesLibTest.php
+++ b/test/phpunit/ImagesLibTest.php
@@ -26,7 +26,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/images.lib.php';
 
diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php
index 378031be257bb8f2d8c77049ab4c6f3f408b2e9d..a9bb7eb1e8f5b0e13504d6c90e5d14d1fec4b5a3 100755
--- a/test/phpunit/ImportTest.php
+++ b/test/phpunit/ImportTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 
 if (! defined('NOREQUIREUSER'))  define('NOREQUIREUSER','1');
diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php
index 330c4547eef32870b808485775d18c397d841237..25afee092d6952659a80051f5f9cc72d2668e633 100755
--- a/test/phpunit/JsonLibTest.php
+++ b/test/phpunit/JsonLibTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/json.lib.php';
 
diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php
index 357413e3be9343711a817fc7a5324c6143e791bc..a2a1bd06c811da4cad3cc0b3050a9cc5ff88df34 100755
--- a/test/phpunit/ModulesTest.php
+++ b/test/phpunit/ModulesTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 
 if (empty($user->id))
diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php
index e9e6454a81a04e4e85e2f192233296abc2cdc019..a10a6ef21058d4fad372754d81509ce3b4b88335 100644
--- a/test/phpunit/NumberingModulesTest.php
+++ b/test/phpunit/NumberingModulesTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 
 if (empty($user->id))
diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php
index c119f1a4ec63ae2cb20c544a0f7fd865aab61eaf..8460b305cae93b24c0afa8a5e7fc7b8a885bb9bd 100755
--- a/test/phpunit/PdfDocTest.php
+++ b/test/phpunit/PdfDocTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
 require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php';
diff --git a/test/phpunit/PgsqlTest.php b/test/phpunit/PgsqlTest.php
index 78cc4c7129f512c7722c1f859113126fd6697d81..a354071588987624c3f3c538b8564864b7461b24 100755
--- a/test/phpunit/PgsqlTest.php
+++ b/test/phpunit/PgsqlTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/db/pgsql.class.php';
 $langs->load("dict");
diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php
index c89901fb990342f9042f993f6154d3ce4cf04243..450e164ee65705f992c5d2d45da332c96a2cfa37 100755
--- a/test/phpunit/PricesTest.php
+++ b/test/phpunit/PricesTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/price.lib.php';
 require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php
index 88b77f65aeedafd55b8475a775571a8ea2cdbfd6..371bee4928bd5f6d50d0e2d652619e91a763ae99 100755
--- a/test/phpunit/ProductTest.php
+++ b/test/phpunit/ProductTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php';
 
diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php
index 86b90fda99d298e954b32fbdf911cea94796b09f..70287a933a4f8ed24b04ac4af5b54fb441593774 100644
--- a/test/phpunit/PropalTest.php
+++ b/test/phpunit/PropalTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/comm/propal/class/propal.class.php';
 
diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php
index 9d5b3699d45f40165bac694e37ac9c4cf4acb62a..e3717a7023f235f6f0431e80043fe48c4139a1b7 100755
--- a/test/phpunit/SecurityTest.php
+++ b/test/phpunit/SecurityTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php
index d8cec189add4677eab4aa937255fb21fc3b58da1..84fe3560846c5c1cd2a98f66b8551c1071cf05cd 100755
--- a/test/phpunit/SocieteTest.php
+++ b/test/phpunit/SocieteTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/societe/class/societe.class.php';
 $langs->load("dict");
diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php
index b413acb394253769c8d2bf28e76f547707ac2f6f..5ab1976506fc69c83e0cb8f7c49c6e0ccb2b1e57 100644
--- a/test/phpunit/UserGroupTest.php
+++ b/test/phpunit/UserGroupTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/user/class/usergroup.class.php';
 
diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php
index abb7ab80cc55be477b98a19dfa16a5adaf1153f9..cb4902106831aba2abc37e4692b468b4ee5039ca 100644
--- a/test/phpunit/UserTest.php
+++ b/test/phpunit/UserTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/user/class/user.class.php';
 
diff --git a/test/phpunit/WebservicesTest.php b/test/phpunit/WebservicesTest.php
index bdcc1f2eb8506fb424bbeffb7bc2a55f3ce73370..8371c3a837556fa1f0192837099b20d8da4629dd 100755
--- a/test/phpunit/WebservicesTest.php
+++ b/test/phpunit/WebservicesTest.php
@@ -25,7 +25,7 @@
 
 global $conf,$user,$langs,$db;
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
-require_once 'PHPUnit/Autoload.php';
+//require_once 'PHPUnit/Autoload.php';
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
 require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
 require_once(NUSOAP_PATH.'/nusoap.php');        // Include SOAP