fixes for more robust quicktime and launching

This commit is contained in:
benfry
2003-09-01 01:23:32 +00:00
parent f949ce1bc2
commit a52057a906
4 changed files with 95 additions and 22 deletions
+2 -1
View File
@@ -4,7 +4,8 @@ REM --- if you need more ram, change the 64m (which means
REM --- 64 megabytes) to something higher.
set SAVEDCP=%CLASSPATH%
set CLASSPATH=%CLASSPATH%;java\lib\rt.jar;lib;lib\build;lib\pde.jar;lib\kjc.jar;lib\antlr.jar;lib\oro.jar;lib\comm.jar;c:\winnt\system32\qtjava.zip;c:\windows\system32\qtjava.zip
REM set CLASSPATH=%CLASSPATH%;java\lib\rt.jar;lib;lib\build;lib\pde.jar;lib\kjc.jar;lib\antlr.jar;lib\oro.jar;lib\comm.jar;c:\winnt\system32\qtjava.zip;c:\windows\system32\qtjava.zip
set CLASSPATH=%CLASSPATH%;java\lib\rt.jar;lib;lib\build;lib\pde.jar;lib\kjc.jar;lib\antlr.jar;lib\oro.jar;lib\comm.jar;%QTJAVA%
java -ms64m -mx64m PdeBase
+76 -13
View File
@@ -39,20 +39,77 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
*(strrchr(loaddir, '\\')) = '\0';
char *cp = (char *)malloc(8 * strlen(loaddir) + 200);
// put quotes around contents of cp,
// because %s might have spaces in it.
// if this code looks shitty, that's because it is.
// people put the durndest things in their CLASSPATH and
// QTJAVA environment variables. who knows where and
// when the quotes will show up. this is a guess at
// dealing with the things, without spending a whole
// day to make it overly robust. [fry]
// test to see if running with a java runtime nearby or not
char *testpath = (char *)malloc(MAX_PATH * sizeof(char));
*testpath = 0;
strcpy(testpath, loaddir);
strcat(testpath, "\\java\\bin\\java.exe");
FILE *fp = fopen(testpath, "rb");
int localJreInstalled = (fp != NULL);
int local_jre_installed = (fp != NULL);
//char *rt_jar = (fp == NULL) ? "" : "java\\lib\\rt.jar;";
fclose(fp); // argh! this was probably causing trouble
const char *envClasspath = getenv("CLASSPATH");
//const char *envClasspath = getenv("CLASSPATH");
char *env_classpath = (char *)malloc(256 * sizeof(char));
if (getenv("CLASSPATH") != NULL) {
strcpy(env_classpath, getenv("CLASSPATH"));
if (env_classpath[0] == '\"') {
// starting quote in classpath.. yech
env_classpath++; // shitty.. i know..
int len = strlen(env_classpath);
if (env_classpath[len-1] == '\"') {
env_classpath[len-1] = 0;
} else {
// a starting quote but no ending quote.. ugh
// maybe throw an error
}
}
int last = strlen(env_classpath);
env_classpath[last++] = ';';
env_classpath[last] = 0;
} else {
env_classpath[0] = 0;
}
char *env_qtjava = (char *)malloc(256 * sizeof(char));
if (getenv("QTJAVA") != NULL) {
strcpy(env_qtjava, getenv("QTJAVA"));
if (env_qtjava[0] == '\"') {
// starting quote in qtjava.. almost always
env_qtjava++;
int len = strlen(env_qtjava);
if (env_qtjava[len-1] == '\"') {
env_qtjava[len-1] = 0;
} else {
// a starting quote but no ending quote..
}
}
int last = strlen(env_qtjava);
env_qtjava[last++] = ';';
env_qtjava[last] = 0;
} else {
env_qtjava[0] = 0;
}
// put quotes around contents of cp,
// because %s might have spaces in it.
sprintf(cp,
"\"" // begin quote
"%s"
"%s"
"%s"
@@ -61,14 +118,17 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
"%s\\lib\\pde.jar;"
"%s\\lib\\kjc.jar;"
"%s\\lib\\oro.jar;"
"%s\\lib\\antlr.jar;"
"%s\\lib\\antlr.jar;"
"%s\\lib\\comm.jar;"
"C:\\WINNT\\system32\\QTJava.zip;"
"C:\\WINDOWS\\system32\\QTJava.zip;"
"\" ",
localJreInstalled ? "java\\lib\\rt.jar;" : "",
envClasspath ? envClasspath : "",
envClasspath ? ";" : "",
//"C:\\WINNT\\system32\\QTJava.zip;" // worthless
//"C:\\WINDOWS\\system32\\QTJava.zip;"
"\"", // end quote
//localJreInstalled ? "java\\lib\\rt.jar;" : "",
local_jre_installed ? "java\\lib\\rt.jar;" : "", //rt_jar,
env_qtjava,
env_classpath,
//envClasspath ? envClasspath : "",
//envClasspath ? ";" : "",
loaddir, loaddir, loaddir, loaddir, loaddir, loaddir, loaddir);
if (!SetEnvironmentVariable("CLASSPATH", cp)) {
@@ -77,6 +137,8 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
return 0;
}
//MessageBox(NULL, cp, "whaadddup", MB_OK);
// add the name of the class to execute and a space before the next arg
strcat(outgoing_cmdline, JAVA_MAIN_CLASS " ");
@@ -86,7 +148,8 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
char *executable = (char *)malloc(256 * sizeof(char));
// loaddir is the name path to the current application
if (localJreInstalled) {
//if (localJreInstalled) {
if (local_jre_installed) {
strcpy(executable, loaddir);
// copy in the path for javaw, relative to launcher.exe
strcat(executable, "\\java\\bin\\javaw.exe");
Binary file not shown.
+17 -8
View File
@@ -1,23 +1,32 @@
#!/bin/sh
if test -d /cygdrive/c/WINNT
then
#if test -d /cygdrive/c/WINNT
#then
# windows 2000 or nt
QT_JAVA_PATH=C:\\WINNT\\system32\\QTJava.zip
else
# QT_JAVA_PATH=C:\\WINNT\\system32\\QTJava.zip
#else
# other versions of windows, including xp
QT_JAVA_PATH=C:\\WINDOWS\\system32\\QTJava.zip
fi
# QT_JAVA_PATH=C:\\WINDOWS\\system32\\QTJava.zip
#fi
# another alternative
#QT_JAVA_PATH=..\\build\\shared\\lib\\qtjava.zip
# #$(*&@(#*$& quicktime for java
QT_JAVA_PATH=`perl -e '$qt = $ENV{'QTJAVA'}; $qt =~ s/\"//g; print $qt'`;
# rxtx testing
#CLASSPATH=java\\lib\\rt.jar\;lib\;lib\\build\;lib\\pde.jar\;lib\\kjc.jar\;lib\\oro.jar\;lib\\RXTXcomm.jar\;${QT_JAVA_PATH}
CLASSPATH=java\\lib\\rt.jar\;lib\;lib\\build\;lib\\pde.jar\;lib\\kjc.jar\;lib\\antlr.jar\;lib\\oro.jar\;lib\\comm.jar\;lib\\RXTXcomm.jar\;${QT_JAVA_PATH}
CLASSPATH=\"java\\lib\\rt.jar\;lib\;lib\\build\;lib\\pde.jar\;lib\\kjc.jar\;lib\\antlr.jar\;lib\\oro.jar\;lib\\comm.jar\;lib\\RXTXcomm.jar\;${QT_JAVA_PATH}\"
#echo $CLASSPATH
# will this one work? or do the quotes have to be chopped?
#CLASSPATH=java\\lib\\rt.jar\;lib\;lib\\build\;lib\\pde.jar\;lib\\kjc.jar\;lib\\antlr.jar\;lib\\oro.jar\;lib\\comm.jar\;lib\\RXTXcomm.jar\;${QTJAVA}
# version for javac/1.1 testing
#CLASSPATH=java\\lib\\rt.jar\;lib\;lib\\build\;lib\\pde.jar\;lib\\kjc.jar\;lib\\oro.jar\;java\\lib\\ext\\comm.jar\;${QT_JAVA_PATH}\;..\\..\\macos9\\JDKClasses.zip\;..\\..\\macos9\\JDKToolsClasses.zip
#cd work && ./java/bin/java -cp ${CLASSPATH} PdeBase
cd work && ./java/bin/java -cp ${CLASSPATH} PdeBase
#cd work && ./java/bin/java -cp ${CLASSPATH} PdeBase
cd work && ./java/bin/java PdeBase