@ECHO OFF

cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && REG QUERY "HKU\S-1-5-19" 1>nul 2>nul || (  cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && ""%~s0"" %Apply%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )

::清除残留
rd /s/q "%AppData%\2345Pic\temp"2>NUL
rd /s/q "%AppData%\2345Pic\update"2>NUL
rd /s/q "%AppData%\2345Pic\pdf\adv"2>NUL
rd /s/q "%AppData%\2345Pic\pic_news"2>NUL
rd /s/q "%AppData%\2345Pic\SloganPic"2>NUL
del/f/q "%AppData%\2345Pic\RCImage*" >NUL 2>NUL
del/f/q "%AppData%\2345Pic\pdfapp.dat" >NUL 2>NUL
del/f/q "%AppData%\2345Pic\2345Image.hzv" >NUL 2>NUL
del/f/q "%AppData%\2345Pic\cloudconfig.dat" >NUL 2>NUL
del/f/q "%AppData%\2345Pic\RCOptimizeUpdate.hzc" >NUL 2>NUL
schtasks /delete /tn "Pic_2345Upgrade Task.job" /f >NUL 2>NUL
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\ViewPic_2345Svc" /f >NUL 2>NUL

ECHO.&ECHO 正在关联文件类型注册缩列图
if exist 2345ImageThumb64.dll regsvr32 /s ".\2345ImageThumb64.dll"
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -install 7 -invoke-platform-x64
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" --rescue --invoke-point=1
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -skinselected 0 -invoke-platform-x64
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -check-thumbnail -invoke-platform-x64

ECHO.&ECHO 完成 &TIMEOUT /t 3 >NUL&EXIT