Browse Source

Make Launcher compatible with FreeBSD


git-svn-id: http://svn.dmdirc.com/trunk@4236 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 years ago
parent
commit
0f8557977d
1 changed files with 16 additions and 14 deletions
  1. 16
    14
      launcher/linux/DMDirc.sh

+ 16
- 14
launcher/linux/DMDirc.sh View File

23
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
 # SOFTWARE.
24
 # SOFTWARE.
25
 
25
 
26
-LAUNCHERVERSION="3"
26
+LAUNCHERVERSION="4"
27
 
27
 
28
 params=""
28
 params=""
29
 
29
 
61
 fi;
61
 fi;
62
 
62
 
63
 ## Helper Functions
63
 ## Helper Functions
64
-if [ "${PIDOF}" = "" ]; then
64
+if [ "${PIDOF}" != "" ]; then
65
 	ISKDE=`${PIDOF} -x -s kdeinit`
65
 	ISKDE=`${PIDOF} -x -s kdeinit`
66
 	ISGNOME=`${PIDOF} -x -s gnome-panel`
66
 	ISGNOME=`${PIDOF} -x -s gnome-panel`
67
 else
67
 else
68
-	ISKDE=`ps ux | grep kdeinit | grep -v grep`
69
-	ISGNOME=`ps ux | grep gnome-panel | grep -v grep`
68
+	ISKDE=`ps -Af | grep kdeinit | grep -v grep`
69
+	ISGNOME=`ps -Af | grep gnome-panel | grep -v grep`
70
 fi;
70
 fi;
71
 KDIALOG=`which kdialog`
71
 KDIALOG=`which kdialog`
72
 ZENITY=`which zenity`
72
 ZENITY=`which zenity`
241
 fi;
241
 fi;
242
 
242
 
243
 echo -n "Looking for java - ";
243
 echo -n "Looking for java - ";
244
-JAVA=`which java`
244
+# Check for BSD Ports version of java first as its not always in the path
245
+JAVA="/usr/local/jdk1.6.0/jre/bin/java"
246
+if [ ! -e "${JAVA}" ]; then
247
+	JAVA=`which java`
248
+fi
245
 
249
 
246
 if [ "" != "${JAVA}" ]; then
250
 if [ "" != "${JAVA}" ]; then
247
-	echo "Success!"
251
+	echo "Success! (${JAVA})"
248
 else
252
 else
249
 	echo "Failed!"
253
 	echo "Failed!"
250
-	# This should in future offer to download and install the JVM automatically.
251
-	ERROR="Sorry, java is not installed on this machine.";
254
+	ERROR="Sorry, java does ont appear to be installed on this machine.";
252
 	ERROR=${ERROR}"\n"
255
 	ERROR=${ERROR}"\n"
253
-	ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM, you can get one from:";
254
-	ERROR=${ERROR}"\nhttp://jdl.sun.com/webapps/getjava/BrowserRedirect";
256
+	ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM, you can get one from: http://www.java.com";
257
+	ERROR=${ERROR}"\nor reinstall DMDirc and let the installer install one for you.";
255
 	errordialog "Unable to launch dmdirc!" "${ERROR}";
258
 	errordialog "Unable to launch dmdirc!" "${ERROR}";
256
 	exit 1;
259
 	exit 1;
257
 fi
260
 fi
264
 	${JAVA} -jar ${jar} --help >/dev/null 2>&1
267
 	${JAVA} -jar ${jar} --help >/dev/null 2>&1
265
 	if [ $? -ne 0 ]; then
268
 	if [ $? -ne 0 ]; then
266
 		echo "Failed."
269
 		echo "Failed."
267
-		ERROR="Sorry, the currently installed version of java is not compatible with";
268
-		ERROR=${ERROR}"\nDMDirc.";
270
+		ERROR="Sorry, the currently installed version of java is not compatible with DMDirc.";
269
 		ERROR=${ERROR}"\n";
271
 		ERROR=${ERROR}"\n";
270
-		ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM, you can get one from:";
271
-		ERROR=${ERROR}"\nhttp://jdl.sun.com/webapps/getjava/BrowserRedirect";
272
+		ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM, you can get one from: http://www.java.com";
273
+		ERROR=${ERROR}"\nor reinstall DMDirc and let the installer install one for you.";
272
 		errordialog "Unable to launch dmdirc!" "${ERROR}";
274
 		errordialog "Unable to launch dmdirc!" "${ERROR}";
273
 		exit 1;
275
 		exit 1;
274
 	fi
276
 	fi

Loading…
Cancel
Save