Enhance DoliWamp install

This commit is contained in:
Laurent Destailleur 2009-09-07 00:59:58 +00:00
parent 66463fd007
commit da5ccc6e38

View File

@ -349,9 +349,6 @@ begin
if MsgBox('DoliWamp installer will now start or restart Apache and Mysql, this may last from several seconds to one minute after this confirmation...',mbConfirmation,MB_YESNO) = IDYES then
begin
// Check if parameters already defined in conf.php file // Check if parameters already defined in conf.php file
srcFile := pathWithSlashes+'/www/dolibarr/htdocs/conf/conf.php'; srcFile := pathWithSlashes+'/www/dolibarr/htdocs/conf/conf.php';
if not FileExists (srcFile) then if not FileExists (srcFile) then
@ -384,116 +381,127 @@ begin
begin begin
// Test serveur SMTP // Test serveur SMTP
// batFile := pathWithSlashes+'/UsedPort.exe'; // if paramok then
// 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 // begin
// paramok := False; // batFile := pathWithSlashes+'/UsedPort.exe';
// end; // MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO)
// Exec(batFile, '-s '+smtpServer+' -p 25', path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
// Test port Apache //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).';
batFile := pathWithSlashes+'/UsedPort.exe'; // 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 ?';
MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO) // if ((IntToStr(myResult) <> '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then
Exec(batFile, '-s localhost -p '+myporta, path+'\', SW_HIDE, ewWaitUntilTerminated, myResult); // begin
//themessage := 'Le port '+myporta+' semble deja pris. Revenez en arriere pour choisir une autre valeur pour le port Apache.'; // paramok := False;
themessage := 'Port '+myporta+' seems to be already in use. Go back to choose another value for Apache port or click "No" to ignore error.'; // end;
if ((IntToStr(myResult) <> '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then // end;
if paramok then
begin begin
paramok := False; // Test port Apache
end; batFile := pathWithSlashes+'/UsedPort.exe';
//MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO)
// Test port Mysql Exec(batFile, '-s localhost -p '+myporta, path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
batFile := pathWithSlashes+'/UsedPort.exe'; //themessage := 'Le port '+myporta+' semble deja pris. Revenez en arriere pour choisir une autre valeur pour le port Apache.';
MsgBox('batFile = '+batFile,mbConfirmation,MB_YESNO) themessage := 'Port '+myporta+' seems to be already in use. Go back to choose another value for Apache port. Cancel choice and choose another value ?';
Exec(batFile, '-s localhost -p '+myport, path+'\', SW_HIDE, ewWaitUntilTerminated, myResult); if ((IntToStr(myResult) = '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then
//themessage := 'Le port '+myport+' semble deja pris. Revenez en arriere pour choisir une autre valeur pour le port MySQL.'; begin
themessage := 'Port '+myport+' seems to be already in use. Go back to choose another value for MySQL port or click "No" to ignore error.'; paramok := False;
if ((IntToStr(myResult) <> '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then end;
begin end;
paramok := False;
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 := 'Port '+myport+' seems to be already in use. Go back to choose another value for MySQL port. Cancel choice and choose another value ?';
if ((IntToStr(myResult) = '0') and (MsgBox(themessage,mbConfirmation,MB_YESNO) = IDYES)) then
begin
paramok := False;
end;
end;
end; end;
if paramok if paramok
then then
begin begin
//---------------------------------------------- //----------------------------------------------
// Rename file c:/windows/php.ini (we don't want it) // Rename file c:/windows/php.ini (we don't want it)
//---------------------------------------------- //----------------------------------------------
if FileExists ('c:/windows/php.ini') then if FileExists ('c:/windows/php.ini') then
begin 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 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 begin
RenameFile('c:/windows/php.ini','c:/windows/php_old.ini'); RenameFile('c:/windows/php.ini','c:/windows/php_old.ini');
end; end;
end; end;
if FileExists ('c:/winnt/php.ini') then if FileExists ('c:/winnt/php.ini') then
begin 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 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 begin
RenameFile('c:/winnt/php.ini','c:/winnt/php_old.ini'); RenameFile('c:/winnt/php.ini','c:/winnt/php_old.ini');
end; end;
end; end;
//---------------------------------------------- //----------------------------------------------
// rundoliwamp.bat, rundolihelp.bat and rundoliadmin.bat // rundoliwamp.bat, rundolihelp.bat and rundoliadmin.bat
//---------------------------------------------- //----------------------------------------------
destFile := pathWithSlashes+'/rundoliwamp.bat'; destFile := pathWithSlashes+'/rundoliwamp.bat';
srcFile := pathWithSlashes+'/rundoliwamp.bat.install'; srcFile := pathWithSlashes+'/rundoliwamp.bat.install';
destFileH := pathWithSlashes+'/rundolihelp.bat'; destFileH := pathWithSlashes+'/rundolihelp.bat';
srcFileH := pathWithSlashes+'/rundolihelp.bat.install'; srcFileH := pathWithSlashes+'/rundolihelp.bat.install';
destFileA := pathWithSlashes+'/rundoliadmin.bat'; destFileA := pathWithSlashes+'/rundoliadmin.bat';
srcFileA := pathWithSlashes+'/rundoliadmin.bat.install'; srcFileA := pathWithSlashes+'/rundoliadmin.bat.install';
if (not FileExists (destFile) or not FileExists (destFileH) or not FileExists (destFileA)) if (not FileExists (destFile) or not FileExists (destFileH) or not FileExists (destFileA))
and (FileExists(srcFile) and FileExists(srcFileH) and FileExists(srcFileA)) then and (FileExists(srcFile) and FileExists(srcFileH) and FileExists(srcFileA)) then
begin begin
//navigateur //navigateur
browser := 'explorer.exe'; browser := 'explorer.exe';
if FileExists ('C:/Program Files/Mozilla Firefox/firefox.exe') then if FileExists ('C:/Program Files/Mozilla Firefox/firefox.exe') then
begin begin
if MsgBox('Firefox has been detected on your computer. Would you like to use it as the default browser with Dolibarr ?',mbConfirmation,MB_YESNO) = IDYES then if MsgBox('Firefox has been detected on your computer. Would you like to use it as the default browser with Dolibarr ?',mbConfirmation,MB_YESNO) = IDYES then
begin begin
browser := 'C:/Program Files/Mozilla Firefox/firefox.exe'; browser := 'C:/Program Files/Mozilla Firefox/firefox.exe';
end; end;
end; end;
if browser = 'explorer.exe' then
begin
GetOpenFileName('Please choose your default browser. If you are not sure, just click Open :', browser, winPath,'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
end;
LoadStringFromFile (srcFile, srcContents);
StringChange (srcContents, 'WAMPBROWSER', browser);
StringChange (srcContents, 'WAMPAPACHEPORT', myporta);
StringChange (srcContents, 'WAMPAPACHEPSSL', myportas);
SaveStringToFile(destFile,srcContents, False);
LoadStringFromFile (srcFileH, srcContents);
StringChange (srcContents, 'WAMPBROWSER', browser);
StringChange (srcContents, 'WAMPAPACHEPORT', myporta);
StringChange (srcContents, 'WAMPAPACHEPSSL', myportas);
SaveStringToFile(destFileH,srcContents, False);
LoadStringFromFile (srcFileA, srcContents);
StringChange (srcContents, 'WAMPBROWSER', browser);
StringChange (srcContents, 'WAMPAPACHEPORT', myporta);
StringChange (srcContents, 'WAMPAPACHEPSSL', myportas);
SaveStringToFile(destFileA,srcContents, False);
end
if MsgBox('DoliWamp installer will now start or restart Apache and Mysql, this may last from several seconds to one minute after this confirmation. Start to install the web server and database server ?',mbConfirmation,MB_YESNO) = IDYES then
begin
if browser = 'explorer.exe' then
begin
GetOpenFileName('Please choose your default browser. If you are not sure, just click Open :', browser, winPath,'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
end;
LoadStringFromFile (srcFile, srcContents);
StringChange (srcContents, 'WAMPBROWSER', browser);
StringChange (srcContents, 'WAMPAPACHEPORT', myporta);
StringChange (srcContents, 'WAMPAPACHEPSSL', myportas);
SaveStringToFile(destFile,srcContents, False);
LoadStringFromFile (srcFileH, srcContents);
StringChange (srcContents, 'WAMPBROWSER', browser);
StringChange (srcContents, 'WAMPAPACHEPORT', myporta);
StringChange (srcContents, 'WAMPAPACHEPSSL', myportas);
SaveStringToFile(destFileH,srcContents, False);
LoadStringFromFile (srcFileA, srcContents);
StringChange (srcContents, 'WAMPBROWSER', browser);
StringChange (srcContents, 'WAMPAPACHEPORT', myporta);
StringChange (srcContents, 'WAMPAPACHEPSSL', myportas);
SaveStringToFile(destFileA,srcContents, False);
end
//---------------------------------------------- //----------------------------------------------
// Fichier alias phpmyadmin // Fichier alias phpmyadmin
@ -846,23 +854,23 @@ begin
res := True; res := True;
end end
else else
begin begin
MsgBox('Selected values seems to be already used. Please choose other values.',mbInformation,MB_OK); // MsgBox('Apache and Mysql installation has been canceled. Please select parameters to start their installation.',mbInformation,MB_OK)
res := False;
res := False; end
end
end end
else else
begin begin
// MsgBox('Apache and Mysql installation has been canceled. Please select parameters to start their installation.',mbInformation,MB_OK) //MsgBox('Selected values seems to be already used. Please choose other values.',mbInformation,MB_OK);
res := False; res := False;
end end