[TeamTalk 349]: [885] trunk/TeamTalk/TeamTalkBuild.bat: 1) Now NetBeans 6. 0 path is retrieved from the registry.
bfrisch@edam.speech.cs.cmu.edu
bfrisch at edam.speech.cs.cmu.edu
Mon Dec 24 18:50:57 EST 2007
An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071224/bc928930/attachment.html
-------------- next part --------------
Modified: trunk/TeamTalk/TeamTalkBuild.bat
===================================================================
--- trunk/TeamTalk/TeamTalkBuild.bat 2007-12-24 20:58:54 UTC (rev 884)
+++ trunk/TeamTalk/TeamTalkBuild.bat 2007-12-24 23:50:57 UTC (rev 885)
@@ -5,8 +5,6 @@
IF "%BUILD_TYPE%"=="" SET BUILD_TYPE=Build
IF "%BUILD_CONF%"=="" SET BUILD_CONF=Release
-:: If Netbeans is updated change the NetBeans version to the current version of NetBeans as the default folder name will likely change.
-SET NetBeansVer=6.0
IF "%CYGWIN_DIR%"=="" SET CYGWIN_DIR=C:\cygwin
:: Check to make sure the file is not running with a wrong working directory
@@ -40,7 +38,7 @@
if "%VSTemp%"=="" goto VSWEND
if not "%VSHome%"=="" set VSHome=%VSHome%\
for /f "delims=\" %%x in ("%VSTemp%") do set VSHome=%VSHome%%%x
- for /f "tokens=1,* delims=\" %%x in ("%VSTemp%") do set VSTemp=%%y
+ for /f "tokens=1,* delims=\" %%y in ("%VSTemp%") do set VSTemp=%%y
goto VSWHILE
:VSWEND
set VSTemp=
@@ -85,7 +83,7 @@
if "%JavaTemp%"=="" goto WEND
if not "%JAVA_HOME%"=="" set JAVA_HOME=%JAVA_HOME%\
for /f "delims=\" %%x in ("%JavaTemp%") do set JAVA_HOME=%JAVA_HOME%%%x
- for /f "tokens=1,* delims=\" %%x in ("%JavaTemp%") do set JavaTemp=%%y
+ for /f "tokens=1,* delims=\" %%y in ("%JavaTemp%") do set JavaTemp=%%y
goto WHILE
:WEND
set JavaTemp=
@@ -94,92 +92,38 @@
:: Test the java path to see if there really is a javac.exe
IF NOT EXIST "%JAVA_HOME%\bin\javac.exe" goto JAVAERROR
-:ANTCHK
+:ANTCHK - To Find NetBeans' 6.0 Ant Version
echo Looking for NetBeans...
-FOR %%d in (C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A, B) DO IF EXIST "%%d:\Program Files\NetBeans %NetBeansVer%\java1\ant\bin\ant.bat" goto NB%%d
-goto NETBEANSERROR
+:: Find the current (most recent) Java version
+start /w regedit /e reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\nbi-nb-base-6.0.0.0.200711261600"
+type reg1.txt | %windir%\system32\find.exe "InstallLocation" > reg2.txt
+if errorlevel 1 goto NETBEANSERROR
+for /f "tokens=2 delims==" %%x in (reg2.txt) do set NBPathTemp=%%~x
+if errorlevel 1 goto NETBEANSERROR
-:NBA
-SET NetBeansDrive=A
-goto Ant
-:NBB
-SET NetBeansDrive=B
-goto Ant
-:NBC
-SET NetBeansDrive=C
-goto Ant
-:NBD
-SET NetBeansDrive=D
-goto Ant
-:NBE
-SET NetBeansDrive=E
-goto Ant
-:NBF
-SET NetBeansDrive=F
-goto Ant
-:NBG
-SET NetBeansDrive=G
-goto Ant
-:NBH
-SET NetBeansDrive=H
-goto Ant
-:NBI
-SET NetBeansDrive=I
-goto Ant
-:NBJ
-SET NetBeansDrive=J
-goto Ant
-:NBK
-SET NetBeansDrive=K
-goto Ant
-:NBL
-SET NetBeansDrive=L
-goto Ant
-:NBM
-SET NetBeansDrive=M
-goto Ant
-:NBN
-SET NetBeansDrive=N
-goto Ant
-:NBO
-SET NetBeansDrive=O
-goto Ant
-:NBP
-SET NetBeansDrive=P
-goto Ant
-:NBQ
-SET NetBeansDrive=Q
-goto Ant
-:NBR
-SET NetBeansDrive=R
-goto Ant
-:NBS
-SET NetBeansDrive=S
-goto Ant
-:NBT
-SET NetBeansDrive=T
-goto Ant
-:NBU
-SET NetBeansDrive=U
-goto Ant
-:NBV
-SET NetBeansDrive=V
-goto Ant
-:NBW
-SET NetBeansDrive=W
-goto Ant
-:NBX
-SET NetBeansDrive=X
-goto Ant
-:NBY
-SET NetBeansDrive=Y
-goto Ant
-:NBZ
-SET NetBeansDrive=Z
+del reg1.txt
+del reg2.txt
-:Ant Compilation
-:JBUILD
-CALL "%NetBeansDrive%:\Program Files\NetBeans %NetBeansVer%\java1\ant\bin\ant.bat" -buildfile Agents\PenDecoder\build.xml
+
+
+:: Convert double backslashes to single backslashes
+set JAVA_HOME=
+:WHILE
+ if "%NBPathTemp%"=="" goto WEND
+ if not "%NetBeansPath%"=="" set JAVA_HOME=%NetBeansPath%\
+ for /f "delims=\" %%x in ("%NBPathTemp%") do set JAVA_HOME=%NetBeansPath%%%x
+ for /f "tokens=1,* delims=\" %%y in ("%NBPathTemp%") do set NBPathTemp=%%y
+ goto WHILE
+:WEND
+set NBPathTemp=
+echo NetBeans Path (per registy) = %NetBeansPath%
+
+:: Test the java path to see if there really is a javac.exe
+IF NOT EXIST "%JAVA_HOME%\bin\javac.exe" goto JAVAERROR
+
+
+:Ant Compilation of PenDecoder using NetBeans 6.0
+CALL "%NetBeansPath%\java1\ant\bin\ant.bat" -buildfile Agents\PenDecoder\build.xml
pause
:Compile
@@ -211,10 +155,12 @@
:NETBEANSERROR
echo The Pen Decoder can not be built because the location of NetBeans %NetBeansVer% can not be determined.
+echo Is it installed?
goto Pause
:ErrorNoOlympus
echo Please set the OLYMPUS_ROOT environment variable to your Olympus installation root.
+echo You can do this by running the OlympusBuild.bat script in your Olympus directory.
goto Pause
:Error message that says that the script was run outside of the TeamTalk directory.
@@ -230,4 +176,5 @@
SET BUILD_TYPE=
SET BUILD_CONF=
SET NetBeansVer=
+SET NetBeansDrive=
pause
More information about the TeamTalk-developers
mailing list