@echo off

color 07


echo.
echo.
rem set path=C:\Windows\Microsoft.NET\Framework64\v4.0.30319;%path%

sc config ELinkUpdate start= disabled
net stop ELinkUpdate
sc delete  ELinkUpdate
rem InstallUtil.exe /u ELinkUpdate
%~d0
cd %~dp0
echo %~dp0
rd /s/q "C:\Program Files\ELinkUpdate"
rd /s/q C:\Users\Public\Documents\.elinkup
MD "C:\Program Files\ELinkUpdate"
xcopy *.* "C:\Program Files\ELinkUpdate\" /s /e /c /y /h /r

c:
cd "C:\Program Files\ELinkUpdate"

InstallUtil.exe ELinkUpdate.exe

if not errorlevel 0 goto fail
net start ELinkUpdate
color 07
rem cls
echo.
echo.
echo *************************************
echo.
echo    Install ELinkUpdate Success
echo.
echo.
echo *************************************


goto end
:fail
rem cls
color 4f
echo.
echo.
echo *************************************
echo.
echo    Install ELinkUpdate failed
echo.
echo *************************************
echo.
pause



:end
