|
@@ -86,6 +86,33 @@ errordialog() {
|
86
|
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
|
116
|
UNAME=`uname -a`
|
90
|
117
|
|
91
|
118
|
echo ""
|
|
@@ -191,6 +218,19 @@ if [ "${isRelease}" != "" ]; then
|
191
|
218
|
fi
|
192
|
219
|
|
193
|
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
|
234
|
echo "Checking java version.."
|
195
|
235
|
${JAVA} -cp DMDirc.jar com.dmdirc.installer.Main --help >/dev/null
|
196
|
236
|
if [ $? -ne 0 ]; then
|