From 3e39cd279daef5bdf5e387f5b4248bb1b54b95be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Dec 2013 00:42:53 +0100 Subject: [PATCH 01/22] Fix: avoid to include not desired directory --- build/exe/doliwamp/doliwamp.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 98bfeee9109..61ece7a1a20 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -109,7 +109,7 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m ; 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: "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" From a59a0151fbad9b569fa6cabc5aef8723a80e88eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Dec 2013 12:35:32 +0100 Subject: [PATCH 02/22] Fix: Removed analytics tags --- dev/dolibarr_changes.txt | 5 +++++ htdocs/includes/jquery/plugins/jcrop/index.html | 15 --------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 5bf1664f695..4cc7f576156 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/includes/jquery/plugins/jcrop/index.html b/htdocs/includes/jquery/plugins/jcrop/index.html index 4f65fb095c8..209c929c61d 100755 --- a/htdocs/includes/jquery/plugins/jcrop/index.html +++ b/htdocs/includes/jquery/plugins/jcrop/index.html @@ -46,20 +46,5 @@ - - - - - - - - - From 13eff7d629a3aee38188a6fa5069284da57810ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Dec 2013 14:24:01 +0100 Subject: [PATCH 03/22] More prerequisites to check to run makepack-dolibarr to build debian package (check on dpatch too). --- build/makepack-dolibarr.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 8554a1d7a92..5867cd2c16f 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -23,7 +23,7 @@ $RPMSUBVERSION="auto"; # auto use value found into BUILD "RPM_FEDORA"=>"rpmbuild", "RPM_MANDRIVA"=>"rpmbuild", "RPM_OPENSUSE"=>"rpmbuild", -"DEB"=>"dpkg", +"DEB"=>"dpkg dpatch", "APS"=>"zip", "EXEDOLIWAMP"=>"ISCC.exe" ); @@ -217,7 +217,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"; } } } From 50df4e1ff1aaff3bf42ff909eb46544306ba7bd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Dec 2013 15:23:16 +0100 Subject: [PATCH 04/22] Fix: Update doc and packager for doliwamp Conflicts: build/exe/doliwamp/doliwamp.iss Conflicts: build/exe/doliwamp/doliwamp.iss --- build/README | 70 +- build/exe/doliwamp/doliwamp.iss | 2041 +++++++++++++++---------------- 2 files changed, 1066 insertions(+), 1045 deletions(-) diff --git a/build/README b/build/README index 954270d6ef2..897a59c4eef 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/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 61ece7a1a20..77a9e1b95c9 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -1,1022 +1,1019 @@ -; ----- 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.4.2 -; 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.4.2 -; Define full path from wich all relative path are defined -; You must modify this to put here your dolibarr root directory -;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx -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\install_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion; -Source: "build\exe\doliwamp\uninstall_services.bat.install"; 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\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 - - - +; ----- 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.4.2 +; 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.4.2 +; ----- 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\install_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion; +Source: "build\exe\doliwamp\uninstall_services.bat.install"; 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\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\Host your ERP-CRM in the Cloud"; Filename: "http://wiki.dolibarr.org/index.php/Cloud_Solutions"; 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 From 7fc052ce197ce5f774d27fdf50ae3ebb9e30ad97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Dec 2013 14:24:01 +0100 Subject: [PATCH 05/22] More prerequisites to check to run makepack-dolibarr to build debian package (check on dpatch too). --- build/makepack-dolibarr.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 21785733d38..64f23316f5d 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -23,7 +23,7 @@ $RPMSUBVERSION="auto"; # auto use value found into BUILD "RPM_FEDORA"=>"rpmbuild", "RPM_MANDRIVA"=>"rpmbuild", "RPM_OPENSUSE"=>"rpmbuild", -"DEB"=>"dpkg", +"DEB"=>"dpkg dpatch", "APS"=>"zip", "EXEDOLIWAMP"=>"ISCC.exe" ); @@ -217,7 +217,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"; } } } From 0e54780377fe6a06b69330d167551ec267001de1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Dec 2013 15:41:25 +0100 Subject: [PATCH 06/22] Fix: Update doc and packager for doliwamp Conflicts: build/exe/doliwamp/doliwamp.iss Conflicts: build/exe/doliwamp/doliwamp.iss Conflicts: build/exe/doliwamp/doliwamp.iss --- ChangeLog | 7 + build/README | 70 +- build/debian/changelog | 4 +- build/exe/doliwamp/doliwamp.iss | 2041 +++++++++++++++--------------- build/makepack-dolibarr.pl | 2 +- build/pad/pad_dolibarr.xml | 8 +- build/pad/pad_doliwamp.xml | 8 +- build/rpm/dolibarr_fedora.spec | 2 +- build/rpm/dolibarr_generic.spec | 2 +- build/rpm/dolibarr_mandriva.spec | 2 +- build/rpm/dolibarr_opensuse.spec | 2 +- htdocs/filefunc.inc.php | 2 +- 12 files changed, 1088 insertions(+), 1062 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0b270f3b2e..654a5287bfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.3.5 compared to 3.3.4 ***** + +- 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 ***** - Fix: [ bug #1001 ] Social Contribution : State not correct diff --git a/build/README b/build/README index 954270d6ef2..897a59c4eef 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 3a798d0d3cd..fe0fc6bbacb 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) Mon, 22 Apr 2013 12:00:00 +0100 + -- Laurent Destailleur (eldy) Mon, 30 Dec 2013 12:00:00 +0100 diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 9bd1afd34e9..56db37dd05c 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 64f23316f5d..c66a3b0254d 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -10,7 +10,7 @@ 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 +$BUILD="5"; # 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 diff --git a/build/pad/pad_dolibarr.xml b/build/pad/pad_dolibarr.xml index 4b09346a4db..8018e972c79 100644 --- a/build/pad/pad_dolibarr.xml +++ b/build/pad/pad_dolibarr.xml @@ -34,10 +34,10 @@ Dolibarr - 3.3.2 - 05 - 17 - 2013 + 3.3.5 + 01 + 01 + 2014 diff --git a/build/pad/pad_doliwamp.xml b/build/pad/pad_doliwamp.xml index 2602b3e877f..d4e497957db 100644 --- a/build/pad/pad_doliwamp.xml +++ b/build/pad/pad_doliwamp.xml @@ -34,10 +34,10 @@ DoliWamp - 3.3.2 - 05 - 17 - 2013 + 3.3.5 + 01 + 01 + 2014 diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 16f72b5784d..4e1f9b15284 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 8cabd545db5..e9a25fc774c 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 518723e35a2..3bb9609a31c 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 c36652973f7..725d0eed80a 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/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index f27b144fe17..d87ecbde202 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 From 808abb6b4ee4fcd0306850c53880b8da3cb1c137 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Dec 2013 16:03:58 +0100 Subject: [PATCH 07/22] Restore correct date --- build/debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/debian/changelog b/build/debian/changelog index 170b8945ffe..f3bf1b1d126 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -17,4 +17,4 @@ dolibarr (3.4.0) unstable; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. - -- Laurent Destailleur (eldy) Mon, 30 Dec 2013 12:00:00 +0100 + -- Laurent Destailleur (eldy) Mon, 22 Apr 2013 12:00:00 +0100 From 76f890b72f49432411b7b56bfff6a5f674608534 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 2 Jan 2014 20:49:36 +0100 Subject: [PATCH 08/22] Fix: Call Image on this instead of pdf. Fix: Missing parameter for photo. Conflicts: htdocs/core/modules/member/doc/pdf_standard.class.php htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php --- .../modules/member/doc/pdf_standard.class.php | 8 ++++---- .../doc/pdf_standardlabel.class.php | 17 ++++++++-------- .../modules/printsheet/modules_labels.php | 20 +++++++++---------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 8789c246307..e85e4a7d767 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -195,8 +195,8 @@ class pdf_standard // Center if ($textright=='') // Only a left part { - if ($textleft == '%LOGO%' && $logo) $this->Image($logo,$_PosX+2,$_PosY+3+$this->_Line_Height,20); - else if ($textleft == '%PHOTO%' && $photo) $this->Image($photo,$_PosX+2,$_PosY+3+$this->_Line_Height,20); + if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+2,$_PosY+3+$this->_Line_Height,20); + else if ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+2,$_PosY+3+$this->_Line_Height,20); else { $pdf->SetXY($_PosX+3, $_PosY+3+$this->_Line_Height); @@ -230,8 +230,8 @@ class pdf_standard } else // Only a right part { - if ($textright == '%LOGO%' && $logo) $this->Image($logo,$_PosX+$this->_Width-21,$_PosY+1,20); - else if ($textright == '%PHOTO%' && $photo) $this->Image($photo,$_PosX+$this->_Width-21,$_PosY+1,20); + if ($textright == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-21,$_PosY+1,20); + else if ($textright == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-21,$_PosY+1,20); else { $pdf->SetXY($_PosX+2, $_PosY+3+$this->_Line_Height); diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 5ee5c2bd72b..e4c1cb81adf 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -120,9 +120,10 @@ class pdf_standardlabel * @param string $footer Footer * @param Translate $outputlangs Output langs * @param string $textright Text right + * @param string $photo Photo (full path to image file used as replacement for key %PHOTOS% into left, right, header or footer text) * @return void */ - function Add_PDF_card(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='') + function Add_PDF_card(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$photo='') { global $mysoc,$conf,$langs; @@ -148,8 +149,6 @@ class pdf_standardlabel $logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; } } - // Define photo - $photo=''; // Define background image $backgroundimage=''; @@ -184,8 +183,8 @@ class pdf_standardlabel // Middle if ($textright=='') // Only a left part { - if ($textleft == '%LOGO%' && $logo) $this->Image($logo,$_PosX+2,$_PosY+3+$this->_Line_Height,20); - else if ($textleft == '%PHOTO%' && $photo) $this->Image($photo,$_PosX+2,$_PosY+3+$this->_Line_Height,20); + if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+2,$_PosY+3+$this->_Line_Height,20); + else if ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+2,$_PosY+3+$this->_Line_Height,20); else { $pdf->SetXY($_PosX+3, $_PosY+3+$this->_Line_Height); @@ -218,8 +217,8 @@ class pdf_standardlabel } else // Only a right part { - if ($textright == '%LOGO%' && $logo) $this->Image($logo,$_PosX+$this->_Width-21,$_PosY+1,20); - else if ($textright == '%PHOTO%' && $photo) $this->Image($photo,$_PosX+$this->_Width-21,$_PosY+1,20); + if ($textright == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-21,$_PosY+1,20); + else if ($textright == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-21,$_PosY+1,20); else { $pdf->SetXY($_PosX+2, $_PosY+3+$this->_Line_Height); @@ -394,7 +393,7 @@ class pdf_standardlabel /** * Function to build PDF on disk, then output on HTTP strem. * - * @param array $arrayofmembers Array of members informations + * @param array $arrayofrecords Array of record informations (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) * @param Translate $outputlangs Lang object for output language * @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $outputdir Output directory @@ -471,7 +470,7 @@ class pdf_standardlabel foreach($arrayofmembers as $val) { // imprime le texte specifique sur la carte - $this->Add_PDF_card($pdf,$val['textleft'],$val['textheader'],$val['textfooter'],$langs,$val['textright'],$val['id'],$val['photo']); + $this->Add_PDF_card($pdf,$val['textleft'],$val['textheader'],$val['textfooter'],$langs,$val['textright'],$val['photo']); } //$pdf->SetXY(10, 295); diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php index 63934cad404..4c4ebad6c3a 100644 --- a/htdocs/core/modules/printsheet/modules_labels.php +++ b/htdocs/core/modules/printsheet/modules_labels.php @@ -63,25 +63,25 @@ class ModelePDFLabels * Create a document onto disk accordign to template module * * @param DoliDB $db Database handler - * @param array $arrayofmembers Array of members + * @param array $arrayofrecords Array of records * @param string $modele Force le modele a utiliser ('' to not force) * @param Translate $outputlangs Objet lang a utiliser pour traduction * @param string $outputdir Output directory * @return int <0 if KO, >0 if OK */ -function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $outputdir='') +function members_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outputdir='') { global $conf,$langs; $langs->load("members"); $error=0; - + // Increase limit for PDF build $err=error_reporting(); error_reporting(0); @set_time_limit(120); error_reporting($err); - + $code=''; $srctemplatepath=''; @@ -99,7 +99,7 @@ function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $ } else $code=$modele; $modele='standardlabel'; - + // If selected modele is a filename template (then $modele="modelname:filename") $tmp=explode(':',$modele,2); if (! empty($tmp[1])) @@ -108,7 +108,7 @@ function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $ $srctemplatepath=$tmp[1]; } else $srctemplatepath=$code; - + // Search template files $file=''; $classname=''; $filefound=0; $dirmodels=array('/'); @@ -118,7 +118,7 @@ function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $ foreach(array('doc','pdf') as $prefix) { $file = $prefix."_".$modele.".class.php"; - + // On verifie l'emplacement du modele $file=dol_buildpath($reldir."core/modules/printsheet/doc/".$file,0); if (file_exists($file)) @@ -130,18 +130,18 @@ function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $ } if ($filefound) break; } - + // Charge le modele if ($filefound) { require_once $file; $obj = new $classname($db); - + // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charset_output=$outputlangs->charset_output; - if ($obj->write_file($arrayofmembers, $outputlangs, $srctemplatepath, $outputdir) > 0) + if ($obj->write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir) > 0) { $outputlangs->charset_output=$sav_charset_output; return 1; From 4a4084e0962cac4d4178949785075951433ecfc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jan 2014 00:13:16 +0100 Subject: [PATCH 09/22] Fix: doxygen --- .../core/modules/printsheet/doc/pdf_standardlabel.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index e4c1cb81adf..f4fd38b52ad 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -399,7 +399,7 @@ class pdf_standardlabel * @param string $outputdir Output directory * @return int 1=OK, 0=KO */ - function write_file($arrayofmembers,$outputlangs,$srctemplatepath,$outputdir='') + function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir='') { global $user,$conf,$langs,$mysoc,$_Avery_Labels; @@ -467,7 +467,7 @@ class pdf_standardlabel // Add each record - foreach($arrayofmembers as $val) + foreach($arrayofrecords as $val) { // imprime le texte specifique sur la carte $this->Add_PDF_card($pdf,$val['textleft'],$val['textheader'],$val['textfooter'],$langs,$val['textright'],$val['photo']); From 68893b205c32e170ad77a052e74cd4a7427e81dd Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 3 Jan 2014 09:58:01 +0100 Subject: [PATCH 10/22] New standard VAT rate for France on january, 1st, 2014 --- htdocs/install/mysql/data/llx_c_tva.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index d96bc2d3f36..253f8cedbe8 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -88,13 +88,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (80 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (802,80, '0','0','VAT Rate 0',1); -- FRANCE (id country=1) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1,'19.6','0','VAT standard rate (France hors DOM-TOM)',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1,'20','0','VAT standard rate (France hors DOM-TOM)',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 12, 1, '8.5','0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 13, 1, '8.5','1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 14, 1, '5.5','0','VAT reduced rate (France hors DOM-TOM)',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '0','0','VAT Rate 0 ou non applicable',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 16, 1, '2.1','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 17, 1, '7','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 17, 1, '10','0','VAT reduced rate',1); -- GERMANY (id country=5) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 51, 5, '19.0','0','allgemeine Ust.',1); From d992d5cb228c0976ba3c9f5283fb2f81115172bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jan 2014 18:16:21 +0100 Subject: [PATCH 11/22] Fix: Bad SQL request when using filter on category. --- htdocs/compta/stats/cabyprodserv.php | 55 ++++++++++++++------------ htdocs/compta/stats/casoc.php | 58 +++++++++++++++++++--------- 2 files changed, 70 insertions(+), 43 deletions(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index ebfe0c4834b..f3e5f746e6b 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2013 Antoine Iauch + * Copyright (C) 2013 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -171,23 +172,21 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl // SQL request $catotal=0; -if ($modecompta == 'CREANCES-DETTES') { +if ($modecompta == 'CREANCES-DETTES') +{ $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label,"; - $sql.= " sum(DISTINCT l.total_ht) as amount, sum(DISTINCT l.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - $sql.= " JOIN ".MAIN_DB_PREFIX."facturedet as l"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON l.fk_facture = f.rowid"; - if ($selected_cat === -2) { - $sql.=" LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; - } - if ($selected_cat && $selected_cat !== -2) { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = " . $selected_cat; - if ($subcat) { - $sql.=" OR c.fk_parent = " . $selected_cat; + $sql.= " sum(l.total_ht) as amount, sum(l.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as l, ".MAIN_DB_PREFIX."product as p"; + if ($selected_cat === -2) // Without any category + { + $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; + } + else if ($selected_cat) // Into a specific category + { + $sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp"; } - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_categorie = c.rowid"; - } $sql.= " WHERE l.fk_product = p.rowid"; + $sql.= " AND l.fk_facture = f.rowid"; $sql.= " AND f.fk_statut in (1,2)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql.= " AND f.type IN (0,1,2)"; @@ -197,16 +196,21 @@ if ($modecompta == 'CREANCES-DETTES') { if ($date_start && $date_end) { $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } - if ($selected_cat === -2) { - $sql.=" AND cp.fk_product is null"; - } - if ($selected_cat && $selected_cat !== -2) { - $sql.= " AND cp.fk_product = p.rowid"; - } + if ($selected_cat === -2) // Without any category + { + $sql.=" AND cp.fk_product is null"; + } + else if ($selected_cat) { // Into a specific category + $sql.= " AND (c.rowid = ".$selected_cat; + if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat; + $sql.= ")"; + $sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid"; + } $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY p.rowid "; - $sql.= "ORDER BY p.ref "; + $sql.= " GROUP BY p.rowid"; + $sql.= " ORDER BY p.ref"; + dol_syslog("cabyprodserv sql=".$sql); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -381,7 +385,10 @@ if ($modecompta == 'CREANCES-DETTES') { print ''; } else { // $modecompta != 'CREANCES-DETTES' - // TODO: better message + // TODO: better message, for example: + // "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an + // invoice with 2 product (product A for 10 euros and product B for 20 euros), what is part of paiment for product A and part of paiment for product B ? + // Because there is no way to know this, this report is not relevant. print '
' . $langs->trans("WarningNotRelevant") . '
'; } diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 63ca148e5c3..bbf03e0865c 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Antoine Iauch @@ -177,18 +177,15 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl $catotal=0; if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name,"; - $sql.= " sum(DISTINCT f.total) as amount, sum(DISTINCT f.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= " JOIN ".MAIN_DB_PREFIX."facture as f"; - if ($selected_cat === -2) { + $sql.= " sum(f.total) as amount, sum(f.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; + if ($selected_cat === -2) // Without any category + { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; } - if ($selected_cat && $selected_cat !== -2) { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = ".$selected_cat; - if ($subcat) { - $sql.=" OR c.fk_parent = " . $selected_cat; - } - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON cs.fk_categorie = c.rowid"; + else if ($selected_cat) // Into a specific category + { + $sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; } $sql.= " WHERE f.fk_statut in (1,2)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { @@ -200,34 +197,57 @@ if ($modecompta == 'CREANCES-DETTES') { if ($date_start && $date_end) { $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } - if ($selected_cat === -2) { + if ($selected_cat === -2) // Without any category + { $sql.=" AND cs.fk_societe is null"; } - if ($selected_cat && $selected_cat !== -2) { - $sql.= " AND cs.fk_societe = s.rowid"; + else if ($selected_cat) { // Into a specific category + $sql.= " AND (c.rowid = ".$selected_cat; + if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat; + $sql.= ")"; + $sql.= " AND cs.fk_categorie = c.rowid AND cs.fk_societe = s.rowid"; } - } else { +} else { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) */ $sql = "SELECT s.rowid as socid, s.nom as name, sum(pf.amount) as amount_ttc"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql .= " WHERE p.rowid = pf.fk_paiement"; + $sql.= ", ".MAIN_DB_PREFIX."societe as s"; + if ($selected_cat === -2) // Without any category + { + $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; + } + else if ($selected_cat) // Into a specific category + { + $sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; + } + $sql.= " WHERE p.rowid = pf.fk_paiement"; $sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND f.fk_soc = s.rowid"; if ($date_start && $date_end) { $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } + if ($selected_cat === -2) // Without any category + { + $sql.=" AND cs.fk_societe is null"; + } + else if ($selected_cat) { // Into a specific category + $sql.= " AND (c.rowid = ".$selected_cat; + if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat; + $sql.= ")"; + $sql.= " AND cs.fk_categorie = c.rowid AND cs.fk_societe = s.rowid"; + } } $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY s.rowid, s.nom"; $sql.= " ORDER BY s.rowid"; +dol_syslog("casoc sql=".$sql); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -248,7 +268,7 @@ if ($result) { // On ajoute les paiements anciennes version, non lies par paiement_facture if ($modecompta != 'CREANCES-DETTES') { - $sql = "SELECT '0' as socid, 'Autres' as name, sum(DISTINCT p.amount) as amount_ttc"; + $sql = "SELECT '0' as socid, 'Autres' as name, sum(p.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; From 8d664973841fde293011104f174f33a7025e351c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jan 2014 18:23:07 +0100 Subject: [PATCH 12/22] Update doc for 3.4.2 --- ChangeLog | 92 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index 151c2e47c7d..7c1d434ea37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,55 +4,59 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4.2 compared to 3.4.1 ***** -Fix: field's problem into company's page (RIB) -Fix: Document cerfa doesn't contained firstname & lastname from donator +Fix: field's problem into company's page (RIB). +Fix: Document cerfa doesn't contained firstname & lastname from donator. Fix: Bad rounding on margin calculations and display. Fix: Option drop table into backup was broken. -Fix: [ bug #1105 ] Searching Boxes other search option -Fix: wrong buy price update -Fix: [ bug #1142 ] Set paiement on invoice (PGSql) -Fix: [ bug #1145 ] Agenda button list type do not display -Fix: [ bug #1148 ] Product consomation : supplier order bad status -Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists -Fix: [ bug #1174 ] Product translated description not good into PDF -Fix: [ bug #1163 ] SQL Error when searching for supplier orders -Fix: [ bug #1162 ] Translaction for morning and afternoon -Fix: [ bug #1161 ] Search on product label +Fix: [ bug #1105 ] Searching Boxes other search option. +Fix: wrong buy price update. +Fix: [ bug #1142 ] Set paiement on invoice (PGSql). +Fix: [ bug #1145 ] Agenda button list type do not display. +Fix: [ bug #1148 ] Product consomation : supplier order bad status. +Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists. +Fix: [ bug #1174 ] Product translated description not good into PDF. +Fix: [ bug #1163 ] SQL Error when searching for supplier orders. +Fix: [ bug #1162 ] Translaction for morning and afternoon. +Fix: [ bug #1161 ] Search on product label. Fix: [ bug #1075 ] POS module doesn't decrement stock of products in delayed payment mode. -Fix: [ bug #1171 ] Documents lost in interventions after validating -Fix: fix unsubscribe URL into mailing when sending manually (not by script) -Fix: [ bug #1182 ] ODT company_country tag is htmlencoded -Fix: [ bug #1196 ] Product barcode search does not expect 13th digit on EAN13 type -Fix: [ bug #1202 ] Wrong amount in deposit % invoice from proposal +Fix: [ bug #1171 ] Documents lost in interventions after validating. +Fix: fix unsubscribe URL into mailing when sending manually (not by script). +Fix: [ bug #1182 ] ODT company_country tag is htmlencoded. +Fix: [ bug #1196 ] Product barcode search does not expect 13th digit on EAN13 type. +Fix: [ bug #1202 ] Wrong amount in deposit % invoice from proposal. +Fix: Removed analytics tags into doc page. +Fix: Call Image on this instead of pdf. +Fix: Missing parameter for photo. +Fix: Bad SQL request for turnover report. ***** ChangeLog for 3.4.1 compared to 3.4.0 ***** -Fix: Display buying price on line edit when no supplier price is defined -Fix: Retrieving of margin info when invoice created automatically from order -Fix: Reordering supplier products in list by supplier or supplier ref was crashing -Fix: [ bug #1029 ] Tulip numbering mask -Fix: Supplier invoice and supplier order are not displayed into object link into agenda event card -Fix: [ bug #1033 ] SUPPLIER REF disappeared -Fix: update extrafield do not display immediatly after update -Fix: Fix bug with canvas thirdparty -Fix: [ bug #1037 ] Consumption> Supplier invoices related -Fix: User group name do not display in card (view or edit mode) -Fix: Link "Show all supplier invoice" on suplier card not working -Fix: [ bug #1039 ] Pre-defined invoices conversion -Fix: If only service module is activated, it's impossible to delete service -Fix: [ bug #1043 ] Bad interventions ref numbering -Fix: Mailing module : if an email is already in destinaires list all other email from selector was not inserted -Fix: Localtaxes balance not showing -Fix: Intervention box links to contracts id -Fix: Compatiblity with multicompany module -Fix: Edit propal line was losing product supplier price id -Fix: Delete linked element to supplier invoice when deleted -Fix: [ bug #1061 ] Bad info shipped products -Fix: [ bug #1062 ] Documents lost in propals and contracts validating -Fix: Supplier price displayed on document lines and margin infos didnt take discount -Fix: sorting on qty did not work in supplier product list -Fix: there was no escaping on filter fields in supplier product list -Fix: bugs on margin reports and better margin calculation on credit notes -Qual: Add travis-ci integration +Fix: Display buying price on line edit when no supplier price is defined. +Fix: Retrieving of margin info when invoice created automatically from order. +Fix: Reordering supplier products in list by supplier or supplier ref was crashing. +Fix: [ bug #1029 ] Tulip numbering mask. +Fix: Supplier invoice and supplier order are not displayed into object link into agenda event card. +Fix: [ bug #1033 ] SUPPLIER REF disappeared. +Fix: update extrafield do not display immediatly after update. +Fix: Fix bug with canvas thirdparty. +Fix: [ bug #1037 ] Consumption> Supplier invoices related. +Fix: User group name do not display in card (view or edit mode). +Fix: Link "Show all supplier invoice" on suplier card not working. +Fix: [ bug #1039 ] Pre-defined invoices conversion. +Fix: If only service module is activated, it's impossible to delete service. +Fix: [ bug #1043 ] Bad interventions ref numbering. +Fix: Mailing module : if an email is already in destinaires list all other email from selector was not inserted. +Fix: Localtaxes balance not showing. +Fix: Intervention box links to contracts id. +Fix: Compatiblity with multicompany module. +Fix: Edit propal line was losing product supplier price id. +Fix: Delete linked element to supplier invoice when deleted. +Fix: [ bug #1061 ] Bad info shipped products. +Fix: [ bug #1062 ] Documents lost in propals and contracts validating. +Fix: Supplier price displayed on document lines and margin infos didnt take discount. +Fix: sorting on qty did not work in supplier product list. +Fix: there was no escaping on filter fields in supplier product list. +Fix: bugs on margin reports and better margin calculation on credit notes. +Qual: Add travis-ci integration. ***** ChangeLog for 3.4 compared to 3.3.* ***** For users: From 2ee50769705265aa0a3539bbf5eda07b321d638c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 4 Jan 2014 18:57:57 +0100 Subject: [PATCH 13/22] Problem of key of language into auguria menu --- htdocs/core/menus/init_menu_auguria.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index eeeb699a844..6dbb9e1119d 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -70,9 +70,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/fiche.php?leftmenu=contacts&action=create', 'NewContactAddress', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=p', 'Prospects', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=c', 'Customers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=f', 'Suppliers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=p', 'ThirdPartyProspects', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=c', 'ThirdPartyCustomers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=f', 'ThirdPartySuppliers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 4, __ENTITY__); -- Third parties - Category customer insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 650__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=1', 'SuppliersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__); From 5a7fe6b4a7bc31285a0ef39cf396218a36fa2f9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Jan 2014 01:17:38 +0100 Subject: [PATCH 14/22] Fix: Change to make debian package ok despite removal of ckeditor package. --- htdocs/admin/modules.php | 3 ++- htdocs/core/modules/modFckeditor.class.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 7411c315304..72147693bd3 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/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 10bd7414722..917d15a852c 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(); From 555a49d66ef8176e2053c5c5c0080a79857a5376 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Jan 2014 01:20:27 +0100 Subject: [PATCH 15/22] Update doc --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 654a5287bfe..eb58f849be4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ 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. From d4db5916f02add8b56b93714b6c4c4a6c6cb0401 Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 7 Jan 2014 12:16:16 +0100 Subject: [PATCH 16/22] Fix: Bad get of localtaxes into contracts add lines --- ChangeLog | 3 +++ htdocs/contrat/fiche.php | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5dace50436..d03c4bc8f70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.4.3 compared to 3.4.2 ***** +Fix: Bad get of localtaxes into contracts add lines + ***** ChangeLog for 3.4.2 compared to 3.4.1 ***** Fix: field's problem into company's page (RIB). Fix: Document cerfa doesn't contained firstname & lastname from donator. diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index d49fb69c32e..aba03ea5347 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -3,8 +3,8 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2012 Juanjo Menent - * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -444,8 +444,8 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $desc=GETPOST('dp_desc'); } - $localtax1_tx=get_localtax($tva_tx,1,$object->societe); - $localtax2_tx=get_localtax($tva_tx,2,$object->societe); + $localtax1_tx=get_localtax($tva_tx,1,$object->thirdparty); + $localtax2_tx=get_localtax($tva_tx,2,$object->thirdparty); // ajout prix achat $fk_fournprice = $_POST['fournprice']; From 2b4f0bd4b1c5ca98b96e1e53bde96e70e3748f3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jan 2014 14:28:32 +0100 Subject: [PATCH 17/22] Fix: Add a limit into list to avoid browser to hang when database is too large. --- ChangeLog | 3 ++- htdocs/comm/index.php | 13 ++++++++++--- htdocs/comm/propal/index.php | 13 ++++++++++--- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d03c4bc8f70..a01f827fb2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,8 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4.3 compared to 3.4.2 ***** -Fix: Bad get of localtaxes into contracts add lines +Fix: Bad get of localtaxes into contracts add lines. +Fix: Add a limit into list to avoid browser to hang when database is too large. ***** ChangeLog for 3.4.2 compared to 3.4.1 ***** Fix: field's problem into company's page (RIB). diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index f32fa89b59b..7b83d56fe01 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -473,8 +473,10 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $var=true; print ''; - print ''; - while ($i < $num) + print ''; + + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD)); + while ($i < $nbofloop) { $obj = $db->fetch_object($result); $var=!$var; @@ -511,7 +513,12 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $i++; $total += $obj->total_ttc; } - if ($total>0) { + if ($num > $nbofloop) + { + print '"; + } + else if ($total>0) + { print '"; } print "
'.$langs->trans("ProposalsOpened").'
'.$langs->trans("ProposalsOpened").' ('.$num.')
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)." 

"; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 2a31d4a48b7..6631988c94d 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -301,7 +301,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY p.rowid DESC"; - + $result=$db->query($sql); if ($result) { @@ -314,7 +314,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) print ''; print ''; - while ($i < $num) + + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD)); + while ($i < $nbofloop) { $obj = $db->fetch_object($result); $var=!$var; @@ -356,7 +358,12 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $i++; $total += $obj->total_ttc; } - if ($total>0) { + if ($num > $nbofloop) + { + print '"; + } + else if ($total>0) + { print '"; } print "
'.$langs->trans("ProposalsOpened").' ('.$num.')
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)." 

"; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 2bc80f696bd..3eac4f09a99 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -659,6 +659,7 @@ from=from toward=toward Access=Access SetDemandReason=Set source +XMoreLines=%s line(s) hidden # Week day Monday=Monday diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 9ad1a71b1a8..cc4a2026620 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -657,6 +657,7 @@ from=de toward=vers Access=Accès SetDemandReason=Définir l'origine +XMoreLines=%s ligne(s) non affichée(s) # Week day Monday=Lundi From 364085bd2082fef3a2c4fa373d0ae6bd09c3d759 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 23 Sep 2013 10:55:44 +0200 Subject: [PATCH 18/22] Fix : wrong var used in bank account class --- htdocs/compta/bank/class/account.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 01ec205564a..b809445e28b 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1296,7 +1296,7 @@ class AccountLine extends CommonObject // No error check. Can fail if category already affected } - $bankline->rappro=1; + $this->rappro=1; $this->db->commit(); return 1; From eae92695d63bc0d60d6a6192d566b818623322e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jan 2014 18:47:33 +0100 Subject: [PATCH 19/22] Fix: Warning into bank conciliation feature. --- ChangeLog | 1 + htdocs/compta/bank/class/account.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a01f827fb2b..0e380a9f04c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4.3 compared to 3.4.2 ***** +Fix: Warning into bank conciliation feature. Fix: Bad get of localtaxes into contracts add lines. Fix: Add a limit into list to avoid browser to hang when database is too large. diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index b809445e28b..0c12b5e437a 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1159,7 +1159,7 @@ class AccountLine extends CommonObject $this->db->begin(); // Delete urls - $result=$this->delete_urls(); + $result=$this->delete_urls($user); if ($result < 0) { $nbko++; From 374be1854eed99531577ae578fda85e252b92cc3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jan 2014 23:11:11 +0100 Subject: [PATCH 20/22] Fix: Bad url --- htdocs/comm/index.php | 8 ++++---- htdocs/comm/propal/index.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 7b83d56fe01..dba3b44a14b 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -473,8 +473,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $var=true; print ''; - print ''; - + print ''; + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD)); while ($i < $nbofloop) { @@ -514,10 +514,10 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $total += $obj->total_ttc; } if ($num > $nbofloop) - { + { print '"; } - else if ($total>0) + else if ($total>0) { print '"; } diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 6631988c94d..7389990c105 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -301,7 +301,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " ORDER BY p.rowid DESC"; - + $result=$db->query($sql); if ($result) { @@ -313,7 +313,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $var=true; print '
'.$langs->trans("ProposalsOpened").' ('.$num.')
'.$langs->trans("ProposalsOpened").' ('.$num.')
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)." 
'; - print ''; + print ''; $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD)); while ($i < $nbofloop) @@ -359,10 +359,10 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $total += $obj->total_ttc; } if ($num > $nbofloop) - { + { print '"; } - else if ($total>0) + else if ($total>0) { print '"; } From 78b40eaa8ccda92c2adc7d09c47c001e90650bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Sat, 11 Jan 2014 17:30:29 +0100 Subject: [PATCH 21/22] Handle default session path nicely --- htdocs/core/lib/admin.lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 9aca2c29c26..41f8ce45493 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -557,7 +557,13 @@ function listOfSessions() global $conf; $arrayofSessions = array(); - $sessPath = ini_get("session.save_path").'/'; + // session.save_path can be returned empty so we set a default location and work from there + $sessPath = '/tmp'; + $iniPath = ini_get("session.save_path"); + if ($iniPath) { + $sessPath = $iniPath; + } + $sessPath .= '/'; // We need the trailing slash dol_syslog('admin.lib:listOfSessions sessPath='.$sessPath); $dh = @opendir(dol_osencode($sessPath)); From bd1a10c116902086e71178a578c488ca46e59625 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jan 2014 16:47:54 +0100 Subject: [PATCH 22/22] Fix: doxygen --- htdocs/core/modules/modAgenda.class.php | 6 +++--- htdocs/projet/class/task.class.php | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 7b3b73c22f5..e9ad20345cf 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -23,15 +23,15 @@ /** * \defgroup agenda Module agenda - * \brief Module pour gerer l'agenda et actions + * \brief Module to manage agenda and events * \file htdocs/core/modules/modAgenda.class.php * \ingroup agenda - * \brief Fichier de description et activation du module agenda + * \brief File of class to describe and enable/disable module Agenda */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** - * Classe de description et activation du module Adherent + * Class to describe and enable/disable module Agenda */ class modAgenda extends DolibarrModules { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 80bc1d49cd0..409c426ecdf 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -27,7 +27,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; /** * Class to manage tasks - * Initialy built by build_class_from_table on 2008-09-10 12:41 */ class Task extends CommonObject {
'.$langs->trans("ProposalsOpened").' ('.$num.')
'.$langs->trans("ProposalsOpened").' ('.$num.')
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)."