@ECHO OFF&PUSHD %~DP0 &TITLE 绿化
Rd "%WinDir%\system32\test_permissions" >NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行！&&Pause >nul&&Exit)

taskkill /f /im QQLive* >NUL 2>NUL

rd/s/q "%AppData%\Tencent\QQLive\LiveUp"2>NUL
rd/s/q "%AppData%\Tencent\QQLive\MiniTips"2>NUL
rd/s/q "%AppData%\Tencent\QQLive\CacheFile\AD"2>NUL
del/f "%AppData%\Tencent\QQLive\CacheFile\AutoUpdate.conf" >NUL 2>NUL
del/f "%AppData%\Tencent\QQLive\CacheFile\TencentVideo*" >NUL 2>NUL

regsvr32 /s LiveOcx.dll
regsvr32 /s LiveAPI.dll
regsvr32 /s npQQLive.dll
regsvr32 /s LiveLogin.dll

start /wait /B "" "%~dp0QQLive.exe" -register
start /wait /B "" "%~dp0QQLive.exe" -reg_video_file
start /wait /B "" "%~dp0QQLive.exe" -cacl
start /wait /B "" "%~dp0OcxHelper.exe" -install
start /wait /B "" "%~dp0OcxHelper.exe" -fix_reg -install
if exist "%Public%" start /wait /B "" "%~dp0OcxHelper.exe" -drm_path "%ProgramData%\Tencent\QQLive\"
if not exist "%Public%" start /wait /B "" "%~dp0OcxHelper.exe" -drm_path "%AllUsersProfile%\Application Data\Tencent\QQLive\"

reg add HKCR\qqtv /f /v install /d "%CD%" >NUL
reg add HKCR\qqtv /f /v installPath /d "%CD%" >NUL

if not exist "%WinDir%\SysWOW64" reg add HKLM\Software\tencent\qqlive /f /v install /d "%CD%" >NUL
if not exist "%WinDir%\SysWOW64" reg add HKLM\Software\tencent\qqliveocx /f /v install /d "%CD%" >NUL
if not exist "%WinDir%\SysWOW64" reg add HKLM\Software\tencent\qqlive /f /v short_instal /d "%CD%" >NUL

if exist "%WinDir%\SysWOW64" reg add HKLM\Software\Wow6432Node\tencent\qqlive /f /v install /d "%CD%" >NUL
if exist "%WinDir%\SysWOW64" reg add HKLM\Software\Wow6432Node\tencent\qqliveocx /f /v install /d "%CD%" >NUL
if exist "%WinDir%\SysWOW64" reg add HKLM\Software\Wow6432Node\tencent\qqlive /f /v short_instal /d "%CD%" >NUL

ECHO.&ECHO.完成! 是否创建桌面快捷方式？
ECHO.&ECHO.是请按任意键，否就直接关闭！&PAUSE >NUL 2>NUL
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\腾讯视频.lnk""):b.TargetPath=""%~dp0QQLive.exe"":b.WorkingDirectory=""%~dp0"":b.Save:close")
CLS&ECHO.&ECHO.创建完成! &PAUSE >NUL 2>NUL&EXIT