From 36c33a58892f49067f4d3edf51b401b4a3c94259 Mon Sep 17 00:00:00 2001 From: James Jong Date: Fri, 15 Feb 2013 18:54:02 -0500 Subject: [PATCH] CB-1944: Better error messages for Create script - fixed to detect missing packages individually - added a specific message for each missing package - messages include how to correct and package download link --- bin/create.bat | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/bin/create.bat b/bin/create.bat index 35fdc3b6..cdbd6118 100644 --- a/bin/create.bat +++ b/bin/create.bat @@ -16,17 +16,37 @@ :: under the License. @ECHO OFF -IF NOT DEFINED JAVA_HOME GOTO MISSING +IF NOT DEFINED JAVA_HOME GOTO MISSING_JAVA_HOME + FOR %%X in (java.exe javac.exe ant.bat android.bat) do ( - SET FOUND=%%~$PATH:X - IF NOT DEFINED FOUND GOTO MISSING + IF [%%~$PATH:X]==[] ( + ECHO Cannot locate %%X using the PATH environment variable. + ECHO Retry after adding directory containing %%X to the PATH variable. + ECHO Remember to open a new command window after updating the PATH variable. + IF "%%X"=="java.exe" GOTO GET_JAVA + IF "%%X"=="javac.exe" GOTO GET_JAVA + IF "%%X"=="ant.bat" GOTO GET_ANT + IF "%%X"=="android.bat" GOTO GET_ANDROID + GOTO ERROR + ) ) cscript "%~dp0\create.js" %* GOTO END -:MISSING -ECHO Missing one of the following: -ECHO JDK: http://java.oracle.com -ECHO Android SDK: http://developer.android.com -ECHO Apache ant: http://ant.apache.org +:MISSING_JAVA_HOME + ECHO The JAVA_HOME environment variable is not set. + ECHO Set JAVA_HOME to an existing JRE directory. + ECHO Remember to also add JAVA_HOME to the PATH variable. + ECHO After updating system variables, open a new command window and retry. + GOTO ERROR +:GET_JAVA + ECHO Visit http://java.oracle.com if you need to install Java (JDK). + GOTO ERROR +:GET_ANT + ECHO Visit http://ant.apache.org if you need to install Apache Ant. + GOTO ERROR +:GET_ANDROID + ECHO Visit http://developer.android.com if you need to install the Android SDK. + GOTO ERROR +:ERROR EXIT /B 1 :END