@echo off
@if exist "%windir%\Microsoft.NET\Framework\v4.0.30319" goto END
echo 开始安装系统组件 . . .
:INSTALL
echo 开始安装:wic_x86_chs
@.\wic_x86_chs.exe
echo 开始安装:dotNetFx40_Full_x86_x64
@.\dotNetFx40_Full_x86_x64.exe
echo 系统组件安转完成!
:END
net stop CloudUpdateSong
net stop CloudUpdateApp
if exist c:\thunder\ktv\ktvsvr\CloudUpdateSong.exe del c:\thunder\ktv\ktvsvr\CloudUpdateSong.exe
if exist c:\thunder\ktv\ktvsvr\CloudUpdateApp.exe del c:\thunder\ktv\ktvsvr\CloudUpdateApp.exe
echo 停止nginx服务
tasklist |findstr /i "nginx.exe"
if %errorlevel%==0 (goto killnginx) else (goto startnginx)
:killnginx
 taskkill /f /im nginx.exe
:startnginx
if  not exist c:\thunder\cloudlibrary md c:\thunder\cloudlibrary
copy client\*.* c:\thunder\cloudlibrary
echo 当前CMD默认目录：%cd%
sc delete CloudUpdateSong
sc delete CloudUpdateApp
@ping 127.0.0.1 -n 15 -w 1000>nul
echo 开始安装服务！
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil C:\thunder\cloudlibrary\CloudUpdateSong.exe
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil C:\thunder\cloudlibrary\CloudUpdateApp.exe
net start CloudUpdateSong
net start CloudUpdateApp
del c:\thunder\cloudlibrary\cloudupdateapp.installlog
del c:\thunder\cloudlibrary\cloudupdateapp.installstate
del c:\thunder\cloudlibrary\cloudupdatesong.installlog
del c:\thunder\cloudlibrary\cloudupdatesong.installstate
del c:\thunder\cloudlibrary\installutil.installlog
echo 视频服务器安装完成！


pause