diff --git a/build/exe/doliwamp/UsedPort.cpp b/build/exe/doliwamp/UsedPort.cpp index 830f645607036989aa4dac25b0c172e5c04d5e72..45fb5423b5f6809cc79dedae50cf2c3778537f6f 100644 --- a/build/exe/doliwamp/UsedPort.cpp +++ b/build/exe/doliwamp/UsedPort.cpp @@ -293,7 +293,7 @@ if (help|invalide) { printf(" -v Print version and help information\n"); printf(" -help Print version and help information\n"); printf("\n"); - exit(0); + exit(-1); } diff --git a/build/exe/doliwamp/UsedPort.exe b/build/exe/doliwamp/UsedPort.exe index c851f9c635d052d920bc315f217ea167b414158e..c2813bbecd3cbff0c405b3384a9d49f17b6de77f 100644 Binary files a/build/exe/doliwamp/UsedPort.exe and b/build/exe/doliwamp/UsedPort.exe differ diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index bf22ef5af7846e4be1e6d17ce4a70cf3dfc6dcae..8ce6ddedd0a4109aa14ce55bf911701b33817aac 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -73,6 +73,7 @@ Source: "build\exe\doliwamp\mysqlinitpassword.bat.install"; DestDir: "{app}\"; F 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"; DestDir: "{app}\"; Flags: ignoreversion; +Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversion; ; PhpMyAdmin, Apache, Php, Mysql ; Put here path of Wampserver applications Source: "C:\Program Files\Wamp\apps\phpmyadmin2.10.1\*.*"; DestDir: "{app}\apps\phpmyadmin2.10.1"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log" @@ -267,7 +268,7 @@ end; //----------------------------------------------- -//procedure qui ferme les services (si ils existent) +// Stop all services (if exist) procedure close(); var myResult: Integer; @@ -292,6 +293,7 @@ function NextButtonClick(CurPageID: Integer): Boolean; var myResult: Integer; var res: Boolean; var paramok: Boolean; +var themessage: String; begin res := True; @@ -378,23 +380,43 @@ begin paramok := True; // TODO Test if choice of param is ok if firstinstall - // Test port Apache - //batFile := pathWithSlashes+'/usedport.exe'; - //MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO) - //Exec(batFile, myporta, path+'\', SW_HIDE, ewWaitUntilTerminated, myResult); - //if myResult > 0 && MsgBox('Revenez en arriere pour choisir un autre port Apache.',mbConfirmation,MB_YES) = IDYES then - //begin - //end; + if (firstinstall) then + begin + + // Test serveur SMTP +// 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.'; +// if ((IntToStr(myResult) <> '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then +// begin +// paramok := False; +// end; - // Test port Mysql - //batFile := pathWithSlashes+'/usedport.exe'; - //MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO) - //Exec(batFile, myport, path+'\', SW_HIDE, ewWaitUntilTerminated, myResult); - //MsgBox(IntToStr(myResult),mbConfirmation,MB_YESNO); - //if myResult > 0 && MsgBox('Revenez en arriere pour choisir un autre port Mysql.',mbConfirmation,MB_YES) = IDYES then - //begin - //end; - + // 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 := 'Port '+myporta+' seems to be already in use. Go back to choose another value for Apache port or click "No" to ignore error.'; + if ((IntToStr(myResult) <> '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then + begin + paramok := False; + end; + + // 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 := 'Port '+myport+' seems to be already in use. Go back to choose another value for MySQL port or click "No" to ignore error.'; + if ((IntToStr(myResult) <> '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then + begin + paramok := False; + end; + + end; if paramok then