diff --git a/bin/buildForWindows.sh b/bin/buildForWindows.sh index 99f9bb08a..1d47bff1b 100755 --- a/bin/buildForWindows.sh +++ b/bin/buildForWindows.sh @@ -1,6 +1,6 @@ #!/bin/sh -NODE_VERSION="0.6.5" +NODE_VERSION="0.8.4" #Move to the folder where ep-lite is installed cd `dirname $0` @@ -50,7 +50,7 @@ mv node_modules_resolved node_modules echo "download windows node..." cd bin -wget "http://nodejs.org/dist/v$NODE_VERSION/node.exe" -O node.exe +wget "http://nodejs.org/dist/v$NODE_VERSION/node.exe" -O ../node.exe echo "create the zip..." cd /tmp diff --git a/bin/installOnWindows.bat b/bin/installOnWindows.bat index 159c517f9..c46ac0340 100644 --- a/bin/installOnWindows.bat +++ b/bin/installOnWindows.bat @@ -1,22 +1,19 @@ @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\.." + +:: Is node installed? +cmd /C node -e "" || ( echo "Please install node.js ( http://nodejs.org )" && exit /B 1 ) 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 +24,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 diff --git a/start.bat b/start.bat index 624102228..0f6fc5535 100644 --- a/start.bat +++ b/start.bat @@ -1 +1 @@ -bin\node.exe node_modules\ep_etherpad-lite\node\server.js \ No newline at end of file +node node_modules\ep_etherpad-lite\node\server.js \ No newline at end of file