日期:2014-05-17 浏览次数:20996 次
echo off Resin 应用一键部署功能! :start cls color 0c MODE con: COLS=100 echo Resin 应用一键部署功能! echo Powered By 笑的自然. echo Date: 2013-01-13 echo. SET WINRAR_HOME=C:\Program Files\WinRAR SET RESIN_HOME=D:\server\resin-pro-8083_ahswzhfwtyglpt SET WEB_ROOT=E:\nmpt\ahswzhfwtyglpt SET SERVICE_NAME=WWW_8083_AHSWZHFWTYGLPTx SET SRC_FILE=%cd%\ahswzh.tar.gz SET WAIT_SEC=30 SET TEMP_ROOT=%cd%\~~temp_web_root echo ====================================== echo 部署配置 echo ====================================== echo %SERVICE_NAME% %SERVICE_NAME% echo WINRAR_HOME %WINRAR_HOME% echo WEB_ROOT %WEB_ROOT% echo TEMP_ROOT %TEMP_ROOT% echo SRC_FILE %SRC_FILE% echo WAIT_SEC %WAIT_SEC%S echo . REM 将引号内部分改成你要查找的服务名称 sc query |find /i "%SERVICE_NAME%" >nul 2>nul if not errorlevel 1 (goto exist) else goto notexist :notexist echo . echo 不存在服务名为%SERVICE_NAME%的服务,请下载并安装Resin. echo 下载地址:http://www.caucho.com/download/ . echo . :cho set choice= set /p choice=您确定已经安装Resin,并要在Windows中安装 %SERVICE_NAME% 服务吗?[Yes or No]: IF NOT "%Choice%"=="" SET Choice=%Choice:~0,3% if /i "%choice%"=="yes" goto choyes if /i "%choice%"=="no" goto chono :choyes echo 正在安装服务 %SERVICE_NAME% . %RESIN_HOME%/httpd -conf conf/resin.conf -install-as %SERVICE_NAME% goto endcho :chono echo 您取消了在Windows中安装%SERVICE_NAME%服务. goto end echo 选择无效,请重新输入... goto:cho :endcho goto :end :exist rem echo 存在服务名为%SERVICE_NAME%的服务. net stop %SERVICE_NAME% if exist "%TEMP_ROOT%" RD /S /Q %TEMP_ROOT% MKDIR %TEMP_ROOT% echo 正在解压压缩包... start "" "%WINRAR_HOME%\WinRAR.exe" x -inul %SRC_FILE% %TEMP_ROOT%\ echo 等待%WAIT_SEC%秒,正在释放资源和解压压缩包... echo Wscript.Sleep Wscript.Arguments(0) * 1000 > Delay.vbs Delay.vbs %WAIT_SEC% del Delay.vbs del /F /S /Q %RESIN_HOME%\log\*.* del /F /S /Q %RESIN_HOME%\logs\*.log del /F /S /Q %RESIN_HOME%\session\*.* del /F /S /Q %RESIN_HOME%\cache\*.* del /F /S /Q %WEB_ROOT%\WEB-INF\tmp\*.* del /F /S /Q %WEB_ROOT%\WEB-INF\work\*.* echo 资源文件释放完成. echo . echo 正在复制文件. [%TEMP_ROOT% -> %WEB_ROOT%] xcopy %TEMP_ROOT% %WEB_ROOT% /I /Y /S /Q RD /S /Q %TEMP_ROOT% net start %SERVICE_NAME% :end echo. & pause