@echo off
setlocal
set CURRENT_FILENAME=%~dp0DeskHack-%PROCESSOR_ARCHITECTURE%.dll
if not exist "%CURRENT_FILENAME%" goto done
set INSTALL_FILENAME=%SystemRoot%\System32\DeskHack.dll
if not exist "%INSTALL_FILENAME%" goto inst
start /wait RegSvr32 /u /s "%INSTALL_FILENAME%"
del "%INSTALL_FILENAME%"
:inst
copy /D /Y "%CURRENT_FILENAME%" "%INSTALL_FILENAME%"
if not exist "%INSTALL_FILENAME%" goto done
start /wait RegSvr32 "%INSTALL_FILENAME%"
:done
endlocal
pause
