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,7 +23,7 @@
23 23
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 24
 # SOFTWARE.
25 25
 
26
-LAUNCHERVERSION="3"
26
+LAUNCHERVERSION="4"
27 27
 
28 28
 params=""
29 29
 
@@ -61,12 +61,12 @@ if [ "${PIDOF}" = "" ]; then
61 61
 fi;
62 62
 
63 63
 ## Helper Functions
64
-if [ "${PIDOF}" = "" ]; then
64
+if [ "${PIDOF}" != "" ]; then
65 65
 	ISKDE=`${PIDOF} -x -s kdeinit`
66 66
 	ISGNOME=`${PIDOF} -x -s gnome-panel`
67 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 70
 fi;
71 71
 KDIALOG=`which kdialog`
72 72
 ZENITY=`which zenity`
@@ -241,17 +241,20 @@ else
241 241
 fi;
242 242
 
243 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 250
 if [ "" != "${JAVA}" ]; then
247
-	echo "Success!"
251
+	echo "Success! (${JAVA})"
248 252
 else
249 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 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 258
 	errordialog "Unable to launch dmdirc!" "${ERROR}";
256 259
 	exit 1;
257 260
 fi
@@ -264,11 +267,10 @@ if [ -e "${jar}" ]; then
264 267
 	${JAVA} -jar ${jar} --help >/dev/null 2>&1
265 268
 	if [ $? -ne 0 ]; then
266 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 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 274
 		errordialog "Unable to launch dmdirc!" "${ERROR}";
273 275
 		exit 1;
274 276
 	fi

Loading…
Cancel
Save