@ECHO OFF&(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(
powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)

::设置默认中文
reg add "HKCU\Software\GRETECH\GOMPLAYERPLUS\OPTION" /f /v "sSettingLanguage" /d "chs" >NUL 2>NUL
reg add "HKCU\Software\GRETECH\GOMPLAYERPLUS\OPTION" /f /v "sLanguageFileInfo" /d "chs.ini" >NUL 2>NUL
::启用硬件加速
reg add "HKCU\Software\GRETECH\GOMPLAYERPLUS\OPTION" /f /v "bUseHwDecoding" /t REG_DWORD /d "0" >NUL 2>NUL
::关闭检测升级
reg add "HKCU\Software\GRETECH\GOMPLAYERPLUS\OPTION" /f /v "bCheckUpdate" /t REG_DWORD /d "0" >NUL 2>NUL
reg add "HKCU\Software\GRETECH\GOMPLAYERPLUS\OPTION" /f /v "bNotifyUpdate" /t REG_DWORD /d "0" >NUL 2>NUL
reg add "HKCU\Software\GRETECH\GOMPLAYERPLUS\OPTION" /f /v "bNotifyMinorUpdate" /t REG_DWORD /d "0" >NUL 2>NUL
reg add "HKCU\Software\GRETECH\GOMPLAYERPLUS\OPTION" /f /v "bUpdateForcedChecked2" /t REG_DWORD /d "0" >NUL 2>NUL
::程序路径键值
reg add "HKLM\SOFTWARE\GRETECH\GOMPLAYERPLUS" /f /v "ProgramFolder" /d "%~dp0\" >NUL 2>NUL
reg add "HKLM\SOFTWARE\GRETECH\GOMPLAYERPLUS" /f /v "ProgramPath" /d "%~dp0GOM64.EXE" >NUL 2>NUL

::结束相关进程
start "" /wait "%~dp0KillGom.exe" GOM64.EXE 
start "" /wait "%~dp0KillGom.exe" popup.EXE
taskkill /f /im GOMProtect.exe >NUL 2>NUL
taskkill /f /im GrLauncher.exe >NUL 2>NUL
taskkill /f /im GOM64 >NUL 2>NUL

::注册解码器
regsvr32 /s VSUtil64.dll
start "" /wait "%~dp0GOM64.EXE" /RegServer
start "" /wait "%~dp0GOM64.EXE" /showicon


::创建桌面快捷方式
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\GOMPlayerPlus.lnk""):b.TargetPath=""%~sdp0GOM64.EXE"":b.WorkingDirectory=""%~sdp0Bin"":b.Save:close")


ECHO.&ECHO 是否GOMPlayer关联视频格式？
ECHO.&ECHO 敲任意键关联，取消关闭窗口

Pause >NUL 2>NUL

::关联文件类型
start "" /wait "%~dp0GOM64.EXE" /regassoc

ECHO.&ECHO 完成 &TIMEOUT /t 2 >NUL