V1.1
1. Fixed the file path error caused by space in the Windows path.Code
Set src_file = "% Cd %" \ ahswzh.tar.gz
2. fixed the problem that the service was not started automatically after the service was automatically installed.
ECHO is installing Service % SERVICE_NAME %.
% Resin_home %/httpd-conf CONF/resin. conf-install-as % SERVICE_NAME %
Net start % SERVICE_NAME %
Goto endcho
========================================================== ========================
Create a BAT file, copy the following code, modify the configuration, and save it.
Echo offresin one-click Application Deployment function!: Startclscolor 0 cmode con: Cols = 100 echo resin one-click Application Deployment function! Echo powered by: smile. echo Date: 2013-01-13echo. set winrar_home = c: \ Program Files \ winrarset resin_home = D: \ www.\ resin-8081SET web_root = D: \ www \ Resin-8081 \ webapps \ rootset SERVICE_NAME = www_8081_hbswfzset src_file = "% Cd %" \ hbswfz.tar.gz set wait_sec = 30 set temp_root = % Cd % \~~ Temp_web_rootecho ========================================== echo deployment configuration echo ============================================ = echo % SERVICE_NAME % echo winrar_home % echo web_root % echo temp_root % echo src_file % echo wait_sec % secho. rem changes the quotation marks to the service name SC query | find/I "% SERVICE_NAME %"> NUL 2> nulif not errorlevel 1 (goto exist) else goto notexist: notexi Stecho. ECHO does not have a service named % SERVICE_NAME %. Please download and install resin. echo: http://www.caucho.com/download. echo.: choset choice = set/P choice = Are you sure you have installed resin and want to install % SERVICE_NAME % service in windows? [Yes or No]: If not "% choice %" = "" set choice = % choice :~ 0, 3% if/I "% choice %" = "yes" Goto choyesif/I "% choice %" = "no" Goto chono: choyesecho is installing Service % SERVICE_NAME %. % resin_home %/httpd-conf CONF/resin. conf-install-as % SERVICE_NAME % net start % SERVICE_NAME % goto endcho: chonoecho you have canceled the installation of % SERVICE_NAME % service in windows. the Goto endecho option is invalid. Please input it again... goto: Cho: endchogoto: end: existrem echo contains the service named % SERVICE_NAME %. net stop % SERVICE_NAME % if exist "% temp_root %" RD/S/Q % temp_root % mkdir % temp_root % echo is extracting the compressed package... start "% winrar_home % \ winrar.exe" X-inul % src_file % temp_root % \ echo wait % wait_sec % S. Releasing the resource and decompressing the compressed package... echo wscript. sleep wscript. arguments (0) * 1000> delay. vbsdelay. vbs % wait_sec % del delay. vbsdel/f/S/Q % resin_home % \ log \*. * del/f/S/Q % resin_home % \ logs \*. logdel/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 \*. * The echo resource file has been released. echo. ECHO is copying the file. [% temp_root %-> % web_root %] xcopy % temp_root % web_root %/I/y/S/QRD/S/Q % temp_root % net start % SERVICE_NAME %: endecho. & pause