Browse Source

Issue 2452: Check for wget failing

tags/0.6.3m1rc1
Michael 15 years ago
parent
commit
ee84b2a5bc
1 changed files with 26 additions and 14 deletions
  1. 26
    14
      installer/windows/Setup.dpr

+ 26
- 14
installer/windows/Setup.dpr View File

@@ -1,19 +1,19 @@
1 1
 {*
2 2
  * This application launches the dmdirc java-based installer.
3
- * 
3
+ *
4 4
  * DMDirc - Open Source IRC Client
5 5
  * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
- * 
6
+ *
7 7
  * Permission is hereby granted, free of charge, to any person obtaining a copy
8 8
  * of this software and associated documentation files (the "Software"), to deal
9 9
  * in the Software without restriction, including without limitation the rights
10 10
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 11
  * copies of the Software, and to permit persons to whom the Software is
12 12
  * furnished to do so, subject to the following conditions:
13
- * 
13
+ *
14 14
  * The above copyright notice and this permission notice shall be included in
15 15
  * all copies or substantial portions of the Software.
16
- * 
16
+ *
17 17
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 18
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 19
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -60,7 +60,9 @@ program Setup;
60 60
 // {$DEFINE LAZARUS}
61 61
 // {$UNDEF LAZARUS}
62 62
 
63
-uses 
63
+//{$DEFINE FORCEJREDOWNLOAD}
64
+
65
+uses
64 66
 	{$IFDEF LAZARUS}Interfaces, Forms, ComCtrls, Buttons, Messages, Controls, StdCtrls, {$ENDIF}
65 67
 	Vista, Windows, SysUtils, classes, registry, strutils {$IFNDEF FPC},masks{$ENDIF};
66 68
 
@@ -293,8 +295,13 @@ begin
293 295
 	dir := IncludeTrailingPathDelimiter(ExtractFileDir(paramstr(0)));
294 296
 	url := 'http://www.dmdirc.com/getjava/windows/all';
295 297
 	Result := false;
296
-	ExecAndWait('wget.exe -o '+dir+'wgetoutput --spider '+url, true);
297
-	
298
+	ExecAndWait('wget.exe -o "'+dir+'wgetoutput" --spider '+url, true);
299
+
300
+  if not fileexists(dir+'wgetoutput') then begin
301
+    showerror('Internal error: wget returned no output.');
302
+    result := false;
303
+    exit;
304
+  end;
298 305
 	AssignFile(f, dir+'wgetoutput');
299 306
 	Reset(f);
300 307
 	line := '';
@@ -385,7 +392,7 @@ begin
385 392
 		if not isUpgrade then question := 'Java was not detected on your machine. Would you like to install it now?'
386 393
 		else question := 'The version of java detected on your machine is not compatible with DMDirc. Would you like to install a compatible version now?';
387 394
 	end;
388
-	
395
+
389 396
 	canContinue := true;
390 397
 	if (needDownload) then begin
391 398
 		canContinue := downloadJRE(question);
@@ -421,19 +428,24 @@ begin
421 428
 		writeln('');
422 429
 		writeln('Please wait whilst the GUI part of the installer loads...');
423 430
 		writeln('-----------------------------------------------------------------------');
424
-//	end
425
-//	else begin
426
-//		errorMessage := 'This will install DMDirc on your computer, please click OK to continue, or Cancel to abort.';
427
-//		if (MessageBox(0, PChar(errorMessage), 'DMDirc Installer', MB_OKCANCEL + MB_ICONINFORMATION) <> IDOK) then begin
428
-//			exit;
429
-//		end;
431
+	//end
432
+	//else begin
433
+	//	errorMessage := 'This will install DMDirc on your computer, please click OK to continue, or Cancel to abort.';
434
+	//	if (MessageBox(0, PChar(errorMessage), 'DMDirc Installer', MB_OKCANCEL + MB_ICONINFORMATION) <> IDOK) then begin
435
+	//		exit;
436
+	//	end;
430 437
 	end;
438
+
431 439
 	errorMessage := '';
432 440
 	dowrite('Checking for DMDirc.jar.. ');
433 441
 	if FileExists('DMDirc.jar') then begin
434 442
 		dowriteln('Success!');
435 443
 		dowrite('Checking for JVM.. ');
444
+    {$IFDEF FORCEJREDOWNLOAD}
445
+		if (1 <> 0) then begin
446
+    {$ELSE}
436 447
 		if (ExecAndWait(javaCommand+' -version') <> 0) then begin
448
+    {$ENDIF}
437 449
 			dowriteln('Failed!');
438 450
 			if not installJRE(false) then begin
439 451
 				showError('DMDirc setup can not continue without java. Please install java and try again', false, false);

Loading…
Cancel
Save