echo off
title 绿化安装/卸载

echo %PROCESSOR_ARCHITECTURE% | findstr 64 > nul
@if ERRORLEVEL 1 (
    @set "PROGRAM_FILES86=%ProgramFiles%"
    @set "HKLM_SOFTWARE86=HKEY_LOCAL_MACHINE\SOFTWARE"
)else @if ERRORLEVEL 0 (
    @set "PROGRAM_FILES86=%ProgramFiles(x86)%"
    @set "HKLM_SOFTWARE86=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node"
)

:主菜单
color 1B
cls
echo.*-----------------------------------------------------------------------------*
echo * ***************************** 绿化安装/卸载 *********************************
echo.*-----------------------------------------------------------------------------*
echo.*    　　　　　　　　　                                                       *
echo.*         (1) 安装                                                            *
echo.*    　　　　　　　　　                                                       *
echo.*         (2) 卸载                                                            *
echo.*    　　　　　　　　　                                                       *
echo.*-----------------------------------------------------------------------------*
echo.* (A)安装  (U)卸载                                                   (X)退出  *
echo.*-----------------------------------------------------------------------------*
echo.*     请在管理员下运行...........                            (www.7down.net)  *
echo *******************************************************************************
SET /P runcd=   请输入（）中的数字键并按回车 :
if /I "%runcd%"=="1" goto Installation
if /I "%runcd%"=="2" goto Uninstallation
if /I "%runcd%"=="3" goto StartApplication
if /I "%runcd%"=="A" goto Installation
if /I "%runcd%"=="U" goto Uninstallation
if /I "%runcd%"=="X" goto EX
goto 主菜单

:EX
exit

:StartApplication
start start Photoshop.exe
exit

:Installation
cls
color 1B
REG ADD "%HKLM_SOFTWARE86%\Adobe\Photoshop\11.0" /v "ApplicationPath" /t REG_SZ /d "%cd%" /f
REG ADD "%HKLM_SOFTWARE86%\Adobe\Photoshop\11.0" /v "FreeBeforeSlopAdjust" /t REG_DWORD /d 0x000b49a4 /f
REG ADD "%HKLM_SOFTWARE86%\Adobe\Photoshop\11.0" /v "FreeSpace" /t REG_DWORD /d 0x0005ed4d /f
REG ADD "%HKLM_SOFTWARE86%\Adobe\Photoshop\11.0" /v "PluginPath" /t REG_SZ /d "%cd%\Plug-ins\\" /f
REG ADD "%HKLM_SOFTWARE86%\Adobe\Photoshop\11.0\ApplicationPath" /v "" /t REG_SZ /d "%cd%" /f
REG ADD "%HKLM_SOFTWARE86%\Adobe\Photoshop\11.0\PluginPath" /v "" /t REG_SZ /d "%cd%\Plug-ins\\" /f

echo ***************************************************************************
echo.
echo     安装完成......
echo.
echo ***************************************************************************
start Photoshop.exe
exit

:Uninstallation
cls
color 1B
REG DELETE "%HKLM_SOFTWARE86%\Adobe\Photoshop\11.0" /f

@if exist "%USERPROFILE%\AppData\Roaming\Adobe\Adobe Photoshop CS4" (
    rd /q/s "%USERPROFILE%\AppData\Roaming\Adobe\Adobe Photoshop CS4"
)
@if exist "%USERPROFILE%\Application Data\Adobe\Adobe Photoshop CS4" (
    rd /q/s "%USERPROFILE%\Application Data\Adobe\Adobe Photoshop CS4"
)
echo ***************************************************************************
echo.
echo     卸载完成......
echo.
echo ***************************************************************************
pause
exit