From df38915b63f92bd32dbbf5101269e70ed41621b3 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 1 Aug 2012 15:51:14 +0200 Subject: [PATCH] Simplify windows install Don't download node.exe and jquery on install Check node version Exit on error --- bin/installOnWindows.bat | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/bin/installOnWindows.bat b/bin/installOnWindows.bat index 159c517f9..d16333e04 100644 --- a/bin/installOnWindows.bat +++ b/bin/installOnWindows.bat @@ -1,22 +1,15 @@ @echo off -set NODE_VERSION=0.8.1 -set JQUERY_VERSION=1.7 :: change directory to etherpad-lite root -cd bin -cd .. +cd /D "%~dp0\.." -echo _ -echo Updating node... -curl -lo bin\node.exe http://nodejs.org/dist/v%NODE_VERSION%/node.exe +echo Checking node version... +set check_version="if(['6','8'].indexOf(process.version.split('.')[1].toString()) === -1) { console.log('You are running a wrong version of Node. Etherpad Lite requires v0.6.x or v0.8.x'); process.exit(1) }" +cmd /C node -e %check_version% || exit /B 1 echo _ echo Installing etherpad-lite and dependencies... -cmd /C npm install src/ - -echo _ -echo Updating jquery... -curl -lo "node_modules\ep_etherpad-lite\static\js\jquery.min.js" "http://code.jquery.com/jquery-%JQUERY_VERSION%.min.js" +cmd /C npm install src/ || exit /B 1 echo _ echo Copying custom templates... @@ -27,12 +20,16 @@ FOR %%f IN (index pad timeslider) DO ( ) echo _ -echo Clearing cache. +echo Clearing cache... del /S var\minified* echo _ echo Setting up settings.json... -IF NOT EXIST settings.json copy settings.json.template settings.json +IF NOT EXIST settings.json ( + echo Can't find settings.json. + echo Copying settings.json.template... + cmd /C copy settings.json.template settings.json || exit /B 1 +) echo _ echo Installed Etherpad-lite! \ No newline at end of file