Added docs from cidero web site.
[learning-java-upnp.git] / cidero / RadioServer.bat
blob465272459ed64ff3ab0f9fdc470573e9559be0e7
1 ::\r
2 :: Batch file to start up Radio Server (Windows)\r
3 ::\r
4 :: This code adapted from sample at www.ericphelps.com\r
5 :: It automatically determines the install directory\r
6 :: under Windows XP,NT, & 9X, in order to set the \r
7 :: Java CLASSPATH for the application. \r
8 :: It assumes the user runs the batch file by clicking\r
9 :: on its icon in a windows file explorer window\r
10 ::\r
11 @echo off\r
12 ::First test to see if we are on NT or similar OS by seeing \r
13 ::if the ampersand is interpreted as a command separator\r
14 > script echo 1234&rem\r
15 type script | find "rem"\r
16 if not errorlevel 1 goto WIN9X\r
18 :NT\r
19 echo Running under NT\r
20 del script\r
21 ::Get the current batch file's short path\r
22 for %%x in (%0) do set INSTALL_DIR=%%~dpsx\r
23 for %%x in (%INSTALL_DIR%) do set INSTALL_DIR=%%~dpsx\r
24 echo INSTALL_DIR = %INSTALL_DIR%\r
25 goto TEST\r
27 :WIN9X\r
28 echo Running under Win9X\r
29 ::An assumption is made that the batch file is run by double-clicking.\r
30 ::This means %0 is a short file name and path with no quotes\r
31 ::Test for quotes by quoting %0\r
32 if not exist "%0" goto ERROR\r
33 :: Make a line fragment per http://www.ericphelps.com/batch/lines/frag-dbg.htm\r
34 echo e 100 "set INSTALL_DIR="> script\r
35 echo rcx>> script\r
36 echo e>> script\r
37 echo n ~temp.bat>> script\r
38 echo w>> script\r
39 echo q>>script\r
40 debug < script > nul\r
41 del script\r
42 ::Change to the batch file's drive\r
43 %0\\r
44 ::Change to the batch file's directory\r
45 cd %0\..\r
46 ::Use the TRUENAME command to get the short path\r
47 truename | find ":" >> ~temp.bat\r
48 call ~temp.bat\r
49 del ~temp.bat\r
50 set INSTALL_DIR=%INSTALL_DIR%\\r
51 echo INSTALL_DIR = %INSTALL_DIR%\r
52 goto TEST\r
54 :TEST\r
55 ::For example, to test the INSTALL_DIR to see if "My.jar" is there.\r
56 :: - if not exist %INSTALL_DIR%My.jar goto ERROR\r
57 ::\r
59 ::Use the path of the batch file to build the Java CLASSPATH\r
60 set JAVA=java\r
61 set LIBDIR=%INSTALL_DIR%\lib\r
62 set CLASSPATH=%LIBDIR%\cidero-common.jar;%LIBDIR%\xercesImpl.jar;%LIBDIR%\xml-apis.jar;%INSTALL_DIR%\r
64 :: On most systems, once Java is installed, it will be in the user's path.\r
65 :: If not set the following variable to the full path of the Java \r
66 :: executable (preferably version 1.5 / J2SE 5.0)\r
67 set JAVA=java\r
69 :: Run the server\r
70 %JAVA% -classpath %CLASSPATH% com.cidero.server.RadioServer\r
72 goto DONE\r
74 :ERROR\r
75 ::Insert error-handling code here\r
76 goto DONE\r
78 :DONE\r