@echo off
REM Copyright (c) 2008-2020, Pervasync LLC. All rights reserved.
if exist pervasync_client_mssql_setup.bat goto start
echo Error!! This batch file can only be executed in its own folder.
goto error

:start
java -classpath "../../classes;..\..\lib\*"  pervasync.client.SyncClientSetup mssql setupClient
if ERRORLEVEL 1 goto error
java -classpath "../../classes;..\..\lib\*"  pervasync.client.SyncClientSetup mssql createDb
if ERRORLEVEL 1 goto error
goto success

:error
set BATCH_ERROR=1
echo "Shell script completed with error."
goto done

:success
set BATCH_ERROR=0
echo "Shell script completed successfully."

:done
rem -- We're done!