From f1ae6b8af754bdae1de0dad0acc54df4c2810b34 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 15 May 2013 14:08:15 +0000
Subject: [PATCH] OPENDJ-842 On Windows, the setup command hangs when the length of the install path is too long

---
 opends/resource/bin/_script-util.bat |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/opends/resource/bin/_script-util.bat b/opends/resource/bin/_script-util.bat
index b46ce54..7c03b5e 100644
--- a/opends/resource/bin/_script-util.bat
+++ b/opends/resource/bin/_script-util.bat
@@ -55,14 +55,17 @@
 cd /d %CUR_DIR%
 goto scriptBegin
 
-
 :setClassPath
 if "%SET_CLASSPATH_DONE%" == "true" goto end
+rem get the absolute paths before building the classpath
+rem it also helps comparing the two paths
+FOR /F %%i IN ("%INSTALL_ROOT%")  DO set INSTALL_ROOT=%%~dpnxi
+FOR /F %%i IN ("%INSTANCE_ROOT%") DO set INSTANCE_ROOT=%%~dpnxi
 FOR %%x in ("%INSTALL_ROOT%\lib\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x
-if "%INSTALL_ROOT%" == "%INSTANCE_ROOT%"goto setClassPathDone
-FOR %%x in ("%INSTANCE_ROOT%\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x
 FOR %%x in ("%INSTALL_ROOT%\resources\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x
 set CLASSPATH=%INSTANCE_ROOT%\classes;%CLASSPATH%
+if "%INSTALL_ROOT%" == "%INSTANCE_ROOT%" goto setClassPathDone
+FOR %%x in ("%INSTANCE_ROOT%\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x
 :setClassPathDone
 set SET_CLASSPATH_DONE=true
 goto scriptBegin

--
Gitblit v1.10.0