Преглед изворни кода

itunes dll for windows now playing now supports StreamTitles (Fixes issue 1719)

FreeBSD 6 and 7 can now download and install a JRE. (Fixes issue 1722)
Launcher and Installer now source the ~/.profile file when looking for java.
Correct some java error messages in the installer

(All backported to 0.6 branch aswell)


git-svn-id: http://svn.dmdirc.com/branches/0.6@4620 00569f92-eb28-0410-84fd-f71c24880f
remotes/0.6
Shane Mc Cormack пре 16 година
родитељ
комит
03c7e931be

+ 11
- 4
installer/linux/getjre.sh Прегледај датотеку

@@ -109,11 +109,16 @@ questiondialog() {
109 109
 # Get the JRE.
110 110
 ARCH=`uname -m`
111 111
 ISAINFO=`which isainfo`
112
+ISFREEBSD=`uname -s | grep -i FreeBSD`
112 113
 if [ "${ISAINFO}" != "" ]; then
113 114
 	# Solaris-ish
114 115
 	ARCH=`uname -p`
115 116
 fi;
116 117
 URL="http://www.dmdirc.com/getjava/`uname -s`/${ARCH}"
118
+if [ "${ISFREEBSD}" != "" ]; then
119
+	RELEASE=`uname -r`
120
+	URL="${URL}/${RELEASE}"
121
+fi;
117 122
 
118 123
 WGET=`which wget`
119 124
 FETCH=`which fetch`
@@ -166,12 +171,12 @@ else
166 171
 	result=$?
167 172
 fi;
168 173
 if [ $result -eq 0 ]; then
169
-	PIPE=`mktemp -p ${PWD} progresspipe.XXXXXXXXXXXXXX`
174
+	PIPE=`mktemp progresspipe.XXXXXXXXXXXXXX`
170 175
 	if [ "${WGET}" != "" ]; then
171 176
 		${WGET} -q -O jre.bin ${URL} &
172 177
 		wgetpid=${!}
173 178
 	elif [ "${FETCH}" != "" ]; then
174
-		${FETCH} -q -o jre.bin &
179
+		${FETCH} -q -o jre.bin ${URL} &
175 180
 		wgetpid=${!}
176 181
 	elif [ "${CURL}" != "" ]; then
177 182
 		${CURL} -s -o jre.bin ${URL} &
@@ -190,8 +195,10 @@ if [ $result -eq 0 ]; then
190 195
 		fi;
191 196
 	done;
192 197
 	wgetpid=""
193
-#	echo "Killing progressbar"
194
-#	kill ${progressbarpid}
198
+	if [ "${ISFREEBSD}" != "" ]; then
199
+		echo "Killing progressbar"
200
+		kill ${progressbarpid}
201
+	fi;
195 202
 	messagedialog "Download Completed" "Download Completed"
196 203
 	if [ -e ${PIPE} ]; then
197 204
 		echo "Deleting Pipe ${PIPE}"

+ 75
- 46
installer/linux/installjre.sh Прегледај датотеку

@@ -51,6 +51,8 @@ if [ "${PIDOF}" = "" ]; then
51 51
 	fi;
52 52
 fi;
53 53
 
54
+ISFREEBSD=`uname -s | grep -i FreeBSD`
55
+
54 56
 ## Helper Functions
55 57
 if [ "${PIDOF}" != "" ]; then
56 58
 	ISKDE=`${PIDOF} -x -s kdeinit`
@@ -124,17 +126,34 @@ questiondialog() {
124 126
 
125 127
 showLicense() {
126 128
 	# Get License Text
127
-	FILE=`mktemp -p ${PWD} license.XXXXXXXXXXXXXX`
128
-	
129
-	# Location of license start
130
-	STARTLINE=`grep ${GREPOPTS} "^more <<\"EOF\"$" jre.bin`
131
-	STARTLINE=$((${STARTLINE%%:*} + 1))
132
-	# Location of license end
133
-	ENDLINE=`grep ${GREPOPTS} "Do you agree to the above license terms?" jre.bin`
134
-	ENDLINE=$((${ENDLINE%%:*} - 2))
135
-	
136
-	head -n ${ENDLINE} jre.bin | tail ${TAILOPTS}${STARTLINE} > ${FILE}
137
-	
129
+	FILE=`mktemp license.XXXXXXXXXXXXXX`
130
+	if [ "${ISFREEBSD}" != "" ]; then
131
+		WGET=`which wget`
132
+		FETCH=`which fetch`
133
+		CURL=`which curl`
134
+		
135
+		ARCH=`uname -m`
136
+		RELEASE=`uname -r`
137
+		URL="http://www.dmdirc.com/getjavalicense/`uname -s`/${ARCH}/${RELEASE}"
138
+		
139
+		if [ "${WGET}" != "" ]; then
140
+			${WGET} -q -O ${FILE} ${URL}
141
+		elif [ "${FETCH}" != "" ]; then
142
+			${FETCH} -q -o ${FILE} ${URL}
143
+		elif [ "${CURL}" != "" ]; then
144
+			${CURL} -s -o ${FILE} ${URL}
145
+		fi;
146
+	else
147
+		# Location of license start
148
+		STARTLINE=`grep ${GREPOPTS} "^more <<\"EOF\"$" jre.bin`
149
+		STARTLINE=$((${STARTLINE%%:*} + 1))
150
+		# Location of license end
151
+		ENDLINE=`grep ${GREPOPTS} "Do you agree to the above license terms?" jre.bin`
152
+		ENDLINE=$((${ENDLINE%%:*} - 2))
153
+		
154
+		head -n ${ENDLINE} jre.bin | tail ${TAILOPTS}${STARTLINE} > ${FILE}
155
+	fi;
156
+
138 157
 	# Send text to console.
139 158
 	echo ""
140 159
 	echo "-----------------------------------------------------------------------"
@@ -169,9 +188,13 @@ messagedialog "Java Install" "Before java can be installed, please review the fo
169 188
 showLicense
170 189
 questiondialog "Java Install" "Do you agree to the Java License?"
171 190
 if [ $? -eq 0 ]; then
172
-	# Look to see where the JRE wants to install to
173
-	JREJAVAHOME=`grep ${GREPOPTS} "^javahome=" jre.bin`
174
- 	JREJAVAHOME=${JREJAVAHOME##*=}
191
+	if [ "${ISFREEBSD}" != "" ]; then
192
+		JREJAVAHOME="diablo-jre1.6.0_07"
193
+	else
194
+		# Look to see where the JRE wants to install to
195
+		JREJAVAHOME=`grep ${GREPOPTS} "^javahome=" jre.bin`
196
+		JREJAVAHOME=${JREJAVAHOME##*=}
197
+	fi;
175 198
 	
176 199
 	echo "JREJAVAHOME: ${JREJAVAHOME}"
177 200
 	
@@ -188,33 +211,40 @@ if [ $? -eq 0 ]; then
188 211
 	echo "installdir: ${installdir}"
189 212
 	
190 213
 	if [ ! -e ${installdir} ]; then
191
-		# Hack jre.bin to allow us to install without asking for a license, or failing
192
-		# the checksum.
214
+		messagedialog "Java Install" "Java install will begin when you press OK.\nThis may take some time, so please wait.\n\nYou will be informed when the installation is completed."
215
+		if [ "${ISFREEBSD}" != "" ]; then
216
+			mv jre.bin jre.tar.bz2
217
+			tar -jxvf jre.tar.bz2
218
+			mv jre.tar.bz2 jre.bin
219
+		else
220
+			# Hack jre.bin to allow us to install without asking for a license, or failing
221
+			# the checksum.
222
+			
223
+			# Location of license start
224
+			STARTLINE=`grep ${GREPOPTS} "^more <<\"EOF\"$" jre.bin`
225
+			STARTLINE=${STARTLINE%%:*}
226
+			# Location of license end
227
+			ENDLINE=`grep ${GREPOPTS} "If you don't agree to the license you can't install this software" jre.bin`
228
+			ENDLINE=$((${ENDLINE%%:*} + 3))
229
+			# Location of checksum start
230
+			CSSTARTLINE=`grep ${GREPOPTS} "^if \[ -x /usr/bin/sum \]; then$" jre.bin`
231
+			CSSTARTLINE=${CSSTARTLINE%%:*}
232
+			# Location of checksum end
233
+			CSENDLINE=`grep ${GREPOPTS} "Can't find /usr/bin/sum to do checksum" jre.bin`
234
+			CSENDLINE=$((${CSENDLINE%%:*} + 2))
235
+			# Location of script end
236
+			SCENDLINE=`grep ${GREPOPTS} "^echo \"Done.\"$" jre.bin`
237
+			SCENDLINE=$((${SCENDLINE%%:*} + 2 - (${ENDLINE} - ${STARTLINE}) - (${CSENDLINE} - ${CSSTARTLINE})))
238
+			# Remove the license and checksum stuff!
239
+			head -n $((${STARTLINE} -1)) jre.bin > jre.bin.tmp
240
+			tail ${TAILOPTS}$((${ENDLINE})) jre.bin | head -n $((${CSSTARTLINE} -1 - ${ENDLINE})) >> jre.bin.tmp
241
+			echo "tail \${tail_args} +${SCENDLINE} \"\$0\" > \$outname" >> jre.bin.tmp
242
+			tail ${TAILOPTS}$((${CSENDLINE})) jre.bin >> jre.bin.tmp
193 243
 		
194
-		# Location of license start
195
-		STARTLINE=`grep ${GREPOPTS} "^more <<\"EOF\"$" jre.bin`
196
-		STARTLINE=${STARTLINE%%:*}
197
-		# Location of license end
198
-		ENDLINE=`grep ${GREPOPTS} "If you don't agree to the license you can't install this software" jre.bin`
199
-		ENDLINE=$((${ENDLINE%%:*} + 3))
200
-		# Location of checksum start
201
-		CSSTARTLINE=`grep ${GREPOPTS} "^if \[ -x /usr/bin/sum \]; then$" jre.bin`
202
-		CSSTARTLINE=${CSSTARTLINE%%:*}
203
-		# Location of checksum end
204
-		CSENDLINE=`grep ${GREPOPTS} "Can't find /usr/bin/sum to do checksum" jre.bin`
205
-		CSENDLINE=$((${CSENDLINE%%:*} + 2))
206
-		# Location of script end
207
-		SCENDLINE=`grep ${GREPOPTS} "^echo \"Done.\"$" jre.bin`
208
-		SCENDLINE=$((${SCENDLINE%%:*} + 2 - (${ENDLINE} - ${STARTLINE}) - (${CSENDLINE} - ${CSSTARTLINE})))
209
-		# Remove the license and checksum stuff!
210
-		head -n $((${STARTLINE} -1)) jre.bin > jre.bin.tmp
211
-		tail ${TAILOPTS}$((${ENDLINE})) jre.bin | head -n $((${CSSTARTLINE} -1 - ${ENDLINE})) >> jre.bin.tmp
212
-		echo "tail \${tail_args} +${SCENDLINE} \"\$0\" > \$outname" >> jre.bin.tmp
213
-		tail ${TAILOPTS}$((${CSENDLINE})) jre.bin >> jre.bin.tmp
244
+			yes | sh jre.bin.tmp
245
+			rm -Rf jre.bin.tmp
246
+		fi;
214 247
 		
215
-		messagedialog "Java Install" "Java install will begin when you press OK.\nThis may take some time, so please wait.\n\nYou will be informed when the installation is completed."
216
-		yes | sh jre.bin.tmp
217
-		rm -Rf jre.bin.tmp
218 248
 		mv ${JREJAVAHOME} ${installdir}
219 249
 		
220 250
 		if [ "0" = "${UID}" ]; then
@@ -230,13 +260,12 @@ if [ $? -eq 0 ]; then
230 260
 			ln -s ${installdir}/bin/java ${PWD}/java-bin
231 261
 		else
232 262
 			# Add to path.
233
-			if [ -e ${HOME}/.profile ]; then
234
-				echo "" >> ${HOME}/.profile
235
-				echo "# set PATH so it includes user's private java if it exists" >> ${HOME}/.profile
236
-				echo "if [ -d ~/${JREJAVAHOME}/bin ] ; then" >> ${HOME}/.profile
237
-				echo "	PATH=~/${JREJAVAHOME}/bin:\${PATH}" >> ${HOME}/.profile
238
-				echo "fi" >> ${HOME}/.profile
239
-			fi
263
+			echo "" >> ${HOME}/.profile
264
+			echo "# set PATH so it includes user's private java if it exists" >> ${HOME}/.profile
265
+			echo "if [ -d ~/${JREJAVAHOME}/bin ] ; then" >> ${HOME}/.profile
266
+			echo "	PATH=~/${JREJAVAHOME}/bin:\${PATH}" >> ${HOME}/.profile
267
+			echo "fi" >> ${HOME}/.profile
268
+			
240 269
 			if [ -e ${HOME}/.cshrc ]; then
241 270
 				echo "" >> ${HOME}/.cshrc
242 271
 				echo "# set PATH so it includes user's private java if it exists" >> ${HOME}/.cshrc

+ 14
- 5
installer/linux/setup.sh Прегледај датотеку

@@ -124,16 +124,25 @@ echo -n "Looking for java.. ";
124 124
 # check it first, because it isn't added to the path automatically
125 125
 JAVA="/usr/local/jdk1.6.0/jre/bin/java"
126 126
 if [ ! -e "${JAVA}" ]; then
127
-	JAVA=`which java`
127
+	# Try alternative BSD Location
128
+	JAVA="/usr/local/diablo-jdk1.6.0/jre/bin/java"
129
+	if [ ! -e "${JAVA}" ]; then
130
+		# Look in path
131
+		if [ -e "${HOME}/.profile" ]; then
132
+				# Source the profile incase java can't be found otherwise
133
+			. ${HOME}/.profile
134
+		fi;
135
+		JAVA=`which java`
136
+	fi
128 137
 fi
129 138
 
130 139
 installjre() {
131 140
 	result=1
132 141
 	if [ ! -e "jre.bin" ]; then
133 142
 		message="Would you like to download and install java?"
134
-		if [ "install" != "${1}" ]; then
143
+		if [ "install" = "${1}" ]; then
135 144
 			message="Java was not detected on your machine. Would you like to download and install it now?" 
136
-		elif [ "upgrade" != "${1}" ]; then
145
+		elif [ "upgrade" = "${1}" ]; then
137 146
 			message="The version of java detected on your machine is not compatible with DMDirc. Would you like to download and install a compatible version now?"
138 147
 		fi;
139 148
 		/bin/sh getjre.sh "${message}"
@@ -143,9 +152,9 @@ installjre() {
143 152
 		fi;
144 153
 	else
145 154
 		message="Would you like to install java?"
146
-		if [ "install" != "${1}" ]; then
155
+		if [ "install" = "${1}" ]; then
147 156
 			message="Java was not detected on your machine. Would you like to install it now?" 
148
-		elif [ "upgrade" != "${1}" ]; then
157
+		elif [ "upgrade" = "${1}" ]; then
149 158
 			message="The version of java detected on your machine is not compatible with DMDirc. Would you like to install a compatible version now?"
150 159
 		fi;
151 160
 		/bin/sh installjre.sh  "${message}"

+ 13
- 3
launcher/linux/DMDirc.sh Прегледај датотеку

@@ -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="5"
26
+LAUNCHERVERSION="6"
27 27
 
28 28
 params=""
29 29
 
@@ -241,10 +241,20 @@ else
241 241
 fi;
242 242
 
243 243
 echo -n "Looking for java - ";
244
-# Check for BSD Ports version of java first as its not always in the path
244
+# Location where ports on FreeBSD/PCBSD installs java6
245
+# check it first, because it isn't added to the path automatically
245 246
 JAVA="/usr/local/jdk1.6.0/jre/bin/java"
246 247
 if [ ! -e "${JAVA}" ]; then
247
-	JAVA=`which java`
248
+	# Try alternative BSD Location
249
+	JAVA="/usr/local/diablo-jdk1.6.0/jre/bin/java"
250
+	if [ ! -e "${JAVA}" ]; then
251
+		# Look in path
252
+		if [ -e "${HOME}/.profile" ]; then
253
+			# Source the profile incase java can't be found otherwise
254
+			. ${HOME}/.profile
255
+		fi;
256
+		JAVA=`which java`
257
+	fi
248 258
 fi
249 259
 
250 260
 if [ "" != "${JAVA}" ]; then

+ 9
- 1
src/com/dmdirc/addons/mediasource_windows/files/itunes.dpr Прегледај датотеку

@@ -108,12 +108,20 @@ function getTitle(data: PChar):integer; stdcall;
108 108
 var
109 109
 	V: Variant;
110 110
 	B: array[0..255] of char;
111
+	kind: Integer;
111 112
 begin
112 113
   result := 1;
113 114
 	try
114 115
 		V := getITunes();
115 116
 		V := callOLEFunction(V, 'CurrentTrack');
116
-		B := String(callOLEFunction(V, 'Name'));
117
+		kind := callOLEFunction(V, 'Kind');
118
+		if kind = 3 then begin
119
+			V := getITunes();
120
+			B := String(callOLEFunction(V, 'CurrentStreamTitle'));
121
+		end
122
+		else begin
123
+			B := String(callOLEFunction(V, 'Name'));
124
+		end;
117 125
 		result := 0;
118 126
 	except
119 127
 		on E : Exception do B:= 'Unable to find iTunes Application ('+E.ClassName+'/'+E.Message+')';

Loading…
Откажи
Сачувај