@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\pic_news"2>NUL
rd /s/q "%AppData%\2345Pic\SloganPic"2>NUL
del/f/q "%AppData%\2345Pic\RCImage.stat" >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" -fixdir
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -install 79 -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
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -check-pdfconverter -invoke-platform-x64

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