浏览代码

Add check for openjdk.

Fixes issue 1665


git-svn-id: http://svn.dmdirc.com/trunk@4579 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 年前
父节点
当前提交
20a018054e
共有 1 个文件被更改,包括 40 次插入0 次删除
  1. 40
    0
      installer/linux/setup.sh

+ 40
- 0
installer/linux/setup.sh 查看文件

86
 	fi
86
 	fi
87
 }
87
 }
88
 
88
 
89
+questiondialog() {
90
+	# Send question to console.
91
+	echo ""
92
+	echo "-----------------------------------------------------------------------"
93
+	echo "Question: ${1}"
94
+	echo "-----------------------------------------------------------------------"
95
+	echo "${2}"
96
+	echo "-----------------------------------------------------------------------"
97
+
98
+	# Now try to use the GUI Dialogs.
99
+	if [ "" != "${ISKDE}" -a "" != "${KDIALOG}" -a "" != "${DISPLAY}" ]; then
100
+		echo "Dialog on Display: ${DISPLAY}"
101
+		${KDIALOG} --title "${1}" --yesno "${2}"
102
+	elif [ "" != "${ISGNOME}" -a "" != "${ZENITY}" -a "" != "${DISPLAY}" ]; then
103
+		echo "Dialog on Display: ${DISPLAY}"
104
+		${ZENITY} --question --title "${1}" --text "${2}"
105
+	else
106
+		if [ "${3}" != "" ]; then
107
+			echo "Unable to ask question, assuming '${3}'."
108
+			return ${3};
109
+		else
110
+			echo "Unable to ask question, assuming no."
111
+			return 1;
112
+		fi;
113
+	fi
114
+}
115
+
89
 UNAME=`uname -a`
116
 UNAME=`uname -a`
90
 
117
 
91
 echo ""
118
 echo ""
191
 fi
218
 fi
192
 
219
 
193
 if [ -e "DMDirc.jar" ]; then
220
 if [ -e "DMDirc.jar" ]; then
221
+	echo "Checking for openJDK.."
222
+	ISOPENJDK=`${JAVA} -version 2>&1 | grep -i openjdk`
223
+	if [ "" != "${ISOPENJDK}" ]; then
224
+		The DMDirc installer has detected that you are using OpenJDK.
225
+		message="The DMDirc installer has detected that you are using OpenJDK. There are currently known issues with some versions of OpenJDK and DMDirc. To ensure DMDirc runs optimally we recommend you use the Sun JRE."
226
+		message="${message}\n\nWould you like to continue anyway?"
227
+		questiondialog "OpenJDK" "${message}" 0
228
+		if [ $? -ne 0 ]; then
229
+			echo "Aborting."
230
+			exit 1;
231
+		fi;
232
+	fi;
233
+	
194
 	echo "Checking java version.."
234
 	echo "Checking java version.."
195
 	${JAVA} -cp DMDirc.jar com.dmdirc.installer.Main --help >/dev/null
235
 	${JAVA} -cp DMDirc.jar com.dmdirc.installer.Main --help >/dev/null
196
 	if [ $? -ne 0 ]; then
236
 	if [ $? -ne 0 ]; then

正在加载...
取消
保存