set PLESK_ROOT_D=%~1
set DBUSER=%~2
set DBPASSWD=%~3
set DBNAME=%~4
set horde=%~5
set PHP5_INSTALLDIR=%~6

if not exist "%horde%scripts\upgrades\dump_horde_3.3.6_cln.success" goto upgrade_horde_336_upg
cmd /c ""%horde%scripts\upgrades\upgrade_horde_3.3.6_3.3.8_cln.cmd" "%PLESK_ROOT_D%" "%DBUSER%" "%DBPASSWD%" "%DBNAME%" "%horde%" "%PHP5_INSTALLDIR%""
exit %ERRORLEVEL%

:upgrade_horde_336_upg
if not exist "%horde%scripts\upgrades\dump_horde_3.3.6_upg.success" goto upgrade_horde_310
cmd /c ""%horde%scripts\upgrades\upgrade_horde_3.3.6_3.3.8_upg.cmd" "%PLESK_ROOT_D%" "%DBUSER%" "%DBPASSWD%" "%DBNAME%" "%horde%" "%PHP5_INSTALLDIR%""
exit %ERRORLEVEL%

:upgrade_horde_310
cmd /c ""%horde%scripts\upgrades\upgrade_horde_3.1.0_3.3.8.cmd" "%PLESK_ROOT_D%" "%DBUSER%" "%DBPASSWD%" "%DBNAME%" "%horde%" "%PHP5_INSTALLDIR%""
exit %ERRORLEVEL%
