@echo off

chcp 65001

echo Deploy path = %XTR_CURRENT_PATH%
echo Installer path = %XTR_DISTR_PATH%

if "%XTR_CURRENT_PATH%" == "" (
  echo Exteor local path not set
) else (
  echo Replacing current version...
  rmdir /s /q "%XTR_CURRENT_PATH%"
  mkdir "%XTR_CURRENT_PATH%"
  xcopy /y /s /q /i "distr\app" "%XTR_CURRENT_PATH%\"
  copy /y bin\x64\Exteor.exe "%XTR_CURRENT_PATH%\Exteor.exe
)

if "%XTR_DISTR_PATH%" == "" (
  echo Exteor distribution path not set
) else (
  echo Replacing installer distributive...

  copy /y bin\x64\ExteorSetup.exe "%XTR_DISTR_PATH%\ExteorSetup.exe"
  copy /y bin\x86\ExteorSetup.exe "%XTR_DISTR_PATH%\ExteorSetup_32bit.exe"
  copy /y bin\x64\Exteor.7z "%XTR_DISTR_PATH%\!Архив\%DATE%.7z"
  copy /y distr\!!Листовка.docx "%XTR_DISTR_PATH%\..\!!Листовка.docx"
  copy /y distr\app\!Памятка.docx "%XTR_DISTR_PATH%\..\!Памятка.docx"
)