summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/ant/templates/generic-windows.tmpl15
-rw-r--r--src/compiler/scala/tools/ant/templates/tool-windows.tmpl15
2 files changed, 20 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/ant/templates/generic-windows.tmpl b/src/compiler/scala/tools/ant/templates/generic-windows.tmpl
index a23422a7e4..5635d9a3ee 100644
--- a/src/compiler/scala/tools/ant/templates/generic-windows.tmpl
+++ b/src/compiler/scala/tools/ant/templates/generic-windows.tmpl
@@ -14,11 +14,7 @@ rem - Local batch variables start with an underscore ('_')
if "%OS%"=="Windows_NT" (
@@setlocal
- set _BIN_DIR=
- for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi
- set _SCALA_HOME=%_BIN_DIR%..
- rem The following works on WinXP SP2 or newer (http://support.microsoft.com/?kbid=833431)
- rem set _SCALA_HOME=%~dsp0..
+ call :set_home
) else (
set _SCALA_HOME=%SCALA_HOME%
if "%_SCALA_HOME%"=="" goto error1
@@ -94,6 +90,15 @@ rem # subroutines
)
goto :eof
+rem Variable "%~dps0" works on WinXP SP2 or newer
+rem (see http://support.microsoft.com/?kbid=833431)
+rem set _SCALA_HOME=%~dps0..
+:set_home
+ set _BIN_DIR=
+ for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi
+ set _SCALA_HOME=%_BIN_DIR%..
+goto :eof
+
rem ##########################################################################
rem # errors
diff --git a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl
index 8fcafb50a2..4a15430d50 100644
--- a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl
+++ b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl
@@ -14,11 +14,7 @@ rem - Local batch variables start with an underscore ('_')
if "%OS%"=="Windows_NT" (
@@setlocal
- set _BIN_DIR=
- for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi
- set _SCALA_HOME=%_BIN_DIR%..
- rem The following works on WinXP SP2 or newer (http://support.microsoft.com/?kbid=833431)
- rem set _SCALA_HOME=%~dsp0..
+ call :set_home
) else (
set _SCALA_HOME=%SCALA_HOME%
if "%_SCALA_HOME%"=="" goto error1
@@ -73,6 +69,15 @@ rem # subroutines
)
goto :eof
+rem Variable "%~dps0" works on WinXP SP2 or newer
+rem (see http://support.microsoft.com/?kbid=833431)
+rem set _SCALA_HOME=%~dps0..
+:set_home
+ set _BIN_DIR=
+ for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi
+ set _SCALA_HOME=%_BIN_DIR%..
+goto :eof
+
rem ##########################################################################
rem # errors