@echo off

set SCRIPTS=..\scripts
set SOFTWARE=..\software
set T=%SystemDrive%\TEMP
set TOOLS=%SystemDrive%\tools
set EXE=officedeploymenttool-setup.exe

if NOT EXIST %SOFTWARE%\%EXE% (
  echo ERROR: %SOFTWARE%\%EXE% not found!
  exit /b
)

echo ####### %0 #######

echo unpacking office deployment tool (Microsoft) ...
cd %SOFTWARE%
@echo on
%EXE% /extract:%T% /quiet /passive
@echo off
cd %SCRIPTS%

echo moving binary to tools folder ...
move /Y %T%\setup.exe %TOOLS%\officedeploymenttool.exe
del /F /Q %T%\setup.exe 1>nul 2>nul
del /F /Q %T%\configuration*.xml 1>nul 2>nul

echo ####### %0 #######

