From de12910fc85156632870c1b8ec808c5bd9ac9f3a Mon Sep 17 00:00:00 2001
From: davidely <davidely@localhost>
Date: Tue, 08 May 2007 08:09:58 +0000
Subject: [PATCH] Fixed a problem where OpenDS couldn't be installed on Windows in a directory with a space in it's path.  There was also a similar, but more benign problem with log messages generated from start-ds.bat and stop-ds.bat.

---
 opends/lib/opends_service.exe            |    0 
 opends/lib/winlauncher.exe               |    0 
 opends/resource/bin/stop-ds.bat          |    2 +-
 opends/src/build-tools/windows/common.c  |    2 +-
 opends/src/build-tools/windows/service.c |    4 ++--
 opends/resource/bin/start-ds.bat         |    2 +-
 6 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/opends/lib/opends_service.exe b/opends/lib/opends_service.exe
index 2a7b3a3..63cccd9 100755
--- a/opends/lib/opends_service.exe
+++ b/opends/lib/opends_service.exe
Binary files differ
diff --git a/opends/lib/winlauncher.exe b/opends/lib/winlauncher.exe
index 52c87a1..7e0fd52 100755
--- a/opends/lib/winlauncher.exe
+++ b/opends/lib/winlauncher.exe
Binary files differ
diff --git a/opends/resource/bin/start-ds.bat b/opends/resource/bin/start-ds.bat
index 4b16016..31a2f71 100644
--- a/opends/resource/bin/start-ds.bat
+++ b/opends/resource/bin/start-ds.bat
@@ -30,7 +30,7 @@
 set DIR_HOME=%~dP0..
 set INSTANCE_ROOT=%DIR_HOME%
 
-set LOG=%INSTANCE_ROOT%\logs\native-windows.out
+set LOG="%INSTANCE_ROOT%\logs\native-windows.out"
 set SCRIPT=start-ds.bat
 
 echo %SCRIPT%: invoked >> %LOG%
diff --git a/opends/resource/bin/stop-ds.bat b/opends/resource/bin/stop-ds.bat
index dbd6e98..15ecf1d 100644
--- a/opends/resource/bin/stop-ds.bat
+++ b/opends/resource/bin/stop-ds.bat
@@ -35,7 +35,7 @@
 
 set INSTANCE_ROOT=%DIR_HOME%
 
-set LOG=%INSTANCE_ROOT%\logs\native-windows.out
+set LOG="%INSTANCE_ROOT%\logs\native-windows.out"
 set SCRIPT=stop-ds.bat
 
 rem This is the template to use for logging.  Make sure to use >>
diff --git a/opends/src/build-tools/windows/common.c b/opends/src/build-tools/windows/common.c
index b8e598b..daabef4 100644
--- a/opends/src/build-tools/windows/common.c
+++ b/opends/src/build-tools/windows/common.c
@@ -53,7 +53,7 @@
   STARTUPINFO startInfo; // info to pass to the new process
   DWORD processFlag; // background process flag
 
-  debug("Attempting to child process '%s' background=%d.", command, background);
+  debug("Attempting to create child process '%s' background=%d.", command, background);
 
   // reset process info first
   ZeroMemory(procInfo, sizeof(PROCESS_INFORMATION));
diff --git a/opends/src/build-tools/windows/service.c b/opends/src/build-tools/windows/service.c
index 09c450a..5152900 100644
--- a/opends/src/build-tools/windows/service.c
+++ b/opends/src/build-tools/windows/service.c
@@ -662,10 +662,10 @@
     }
     else
     {
-      if ((strlen(fileName) + strlen(" start ") + strlen(_instanceDir) + strlen("\"\""))
+      if ((strlen(fileName) + strlen(" start ") + strlen(_instanceDir) + 2 * strlen("\"\""))
         < COMMAND_SIZE)
       {
-        sprintf(serviceBinPath, "%s start \"%s\"", fileName,
+        sprintf(serviceBinPath, "\"%s\" start \"%s\"", fileName,
         _instanceDir);
       }
       else

--
Gitblit v1.10.0