@ECHO OFF&PUSHD %~DP0 &TITLE 绿化和选项
mode con cols=36 lines=20
color 2F
:Menu
Cls
@ echo.
@ echo.　　　　　 菜 单 选 项
@ echo.
@ echo.     绿化[必须] → 请输入1
@ echo.
@ echo.     创建桌面图标 → 请输入2
@ echo.
@ echo.     删除桌面图标 → 请输入3
@ echo.
@ echo.     卸载 → 请输入4
@ echo.
set /p xj= 输入数字按回车：
if /i "%xj%"=="1" Goto Install
if /i "%xj%"=="2" Goto Establish
if /i "%xj%"=="3" Goto Delete
if /i "%xj%"=="4" Goto Uninstall
@ echo.
echo      选择无效，请重新输入
ping -n 2 127.1>nul 
goto menu
:Install
@ echo.
ECHO 　　　正在安装中..请稍等..
taskkill /f /im QQG*  >NUL 2>NUL
rd/s/q "%AppData%\Tencent\Logs"  2>NUL
rd/s/q "%AppData%\Tencent\QQGame"2>NUL
rd/s/q "%AppData%\Tencent\QQGameAndroidMgr"2>NUL
md "%AppData%\Tencent\QQGame\MiniGameFile\Hlddz"2>NUL
echo.NoAndroid>"%AppData%\Tencent\QQGameAndroidMgr" 2>NUL
echo.NoAndroid>"%AppData%\Tencent\QQGame\AndroidMgr" 2>NUL
echo.>"%AppData%\Tencent\QQGame\MiniGameFile\Hlddz\AD" 2>NUL
rd/s/q "%AllUsersProfile%\Application Data\Tencent\QQGame"2>NUL
if exist "%Public%" rd/s/q "%ProgramData%\Tencent\QQGame"2>NUL
video\QQGameNet.exe /RegServer
regsvr32 /s CUQG.ocx QQGameDetect.ocx
regsvr32 /s Logic\CAAddins\GInterop.dll
start /wait /B "" "%~dp0Update\update.exe" -AssociateQGI
start /wait /B "" "%~dp0Update\update.exe" -CreateResourceOnly
reg add HKCU\Software\Tencent\QQGame\SYS /v GameDirectory /d "%~dp0\" /F>NUL
reg add HKCU\Software\Tencent\QQGame\SYS /v HallDirectory /d "%~dp0\" /F>NUL
reg delete HKCU\Software\Classes\VirtualStore\MACHINE\SOFTWARE\Tencent\QQGame /F>NUL 2>NUL
reg add HKCR\Software\Classes\QQGameProtocol /v "URL Protocol" /d "%~dp0QQGwp.exe" /F >NUL
reg add HKCR\Software\Classes\QQGameProtocol\shell\open\command /ve /d "\"%~dp0QQGwp.exe\" \"%%1\"" /F>NUL
if not exist "%WinDir%\SysWOW64" reg add HKLM\Software\Tencent\QQGame\SYS /v GameDirectory /d "%~dp0\" /F>NUL
if not exist "%WinDir%\SysWOW64" reg add HKLM\Software\Tencent\QQGame\SYS /v HallDirectory /d "%~dp0\" /F>NUL
if exist "%WinDir%\SysWOW64" reg add HKLM\Software\Wow6432Node\Tencent\QQGame\SYS /v GameDirectory /d "%~dp0\" /F>NUL
if exist "%WinDir%\SysWOW64" reg add HKLM\Software\Wow6432Node\Tencent\QQGame\SYS /v HallDirectory /d "%~dp0\" /F>NUL

goto Install2
:Establish
ping -n 2 127.1>nul
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\QQ游戏.lnk""):b.TargetPath=""%~dp0QQGame.exe"":b.WorkingDirectory=""%~dp0office6"":b.Save:close")
goto fanhui
:Delete
ping -n 2 127.1>nul
del /f /q "%userprofile%"\Desktop\QQ游戏.lnk
goto fanhui
:Uninstall
@ echo.
echo 　　　正在卸载中..请稍等..
taskkill /f /im QQG*  >NUL 2>NUL
video\QQGameNet.exe /UnregServer
rd/s/q "%AppData%\Tencent\QQGame"2>NUL
regsvr32 /s /u CUQG.ocx QQGameDetect.ocx
regsvr32 /s /u Logic\CAAddins\GInterop.dll
rd/s/q "%AppData%\Tencent\QQGameAndroidMgr"2>NUL
reg delete HKLM\Software\Tencent\QQGame /F>NUL 2>NUL
reg delete HKCU\Software\Tencent\QQGame\SYS /F>NUL 2>NUL
reg delete HKCR\Software\Classes\QQGameProtocol /F>NUL 2>NUL
rd/s/q "%AllUsersProfile%\Application Data\Tencent\QQGame"2>NUL
if exist "%Public%" rd/s/q "%ProgramData%\Tencent\QQGame"2>NUL
reg delete HKLM\Software\Wow6432Node\Tencent\QQGame /F>NUL 2>NUL
goto Uninstall2
:fanhui
@ ECHO.
ECHO 　　　设置完成..
ping -n 2 127.8>nul
goto menu
:Install2
@ ECHO.
ECHO 　　　安装完成..
ping -n 2 127.8>nul
goto menu
:Uninstall2
@ ECHO.
ECHO 　　　卸载完成..
ping -n 2 127.8>nul
goto menu
