Author: bob
Date: 2005-12-05 23:27:14 +0000 (Mon, 05 Dec 2005)
New Revision: 7677

Modified:
   trunk/contrib/wininstall/freenet-java.nsi
   trunk/contrib/wininstall/freenet-modern.nsi
   trunk/contrib/wininstall/update/Update.nsi
   trunk/contrib/wininstall/webinstall.inc
Log:
New NSI build scripts for winstallers and UpdateSnapshot, see last win32-bin 
commit comments.

Modified: trunk/contrib/wininstall/freenet-java.nsi
===================================================================
--- trunk/contrib/wininstall/freenet-java.nsi   2005-12-05 22:32:38 UTC (rev 
7676)
+++ trunk/contrib/wininstall/freenet-java.nsi   2005-12-05 23:27:14 UTC (rev 
7677)
@@ -14,6 +14,5 @@
 # freenet.nsi. Thus inherits zipped seednode support I added.

 !define embedJava
-!define JAVAINSTALLER jre-1_5_0_05-windows-i586-p.exe
+!define JAVAINSTALLER jre-1_5_0_06-windows-i586-p.exe
 !include freenet-modern.nsi
-

Modified: trunk/contrib/wininstall/freenet-modern.nsi
===================================================================
--- trunk/contrib/wininstall/freenet-modern.nsi 2005-12-05 22:32:38 UTC (rev 
7676)
+++ trunk/contrib/wininstall/freenet-modern.nsi 2005-12-05 23:27:14 UTC (rev 
7677)
@@ -20,7 +20,7 @@

 !define NUMBER_OF_DOWNLOADABLE_FILES 4

-
+!include "webinstall.inc"      # Because RetryableDownload has been moved there
 !include "MUI.nsh"

 !define PRODUCT_NAME "Freenet"
@@ -862,54 +862,9 @@
 FunctionEnd


-Function RetryableDownload
- POP $R2 # local filename
- POP $R3 # local dir
- POP $R4 # remote dir+filename

- StrCpy $R5 "$R3\$R2"

- DetailPrint "Downloading $R2 from $R4 ..."

- DoDownload:
- NSISdl::download /TIMEOUT=150000 "$R4" "$R5"
- Pop $R9
- StrCmp $R9 "success" Success
- DetailPrint "Download of $R2 failed: $R9"
- SetDetailsPrint none
- Delete "$R5"
- SetDetailsPrint both
- MessageBox MB_YESNO "Download of $R2 failed: '$R9'. Retry?" IDYES Retry
- IfFileExists "$INSTDIR\$R2" PreExistingDownload
- goto Aborted
-
- PreExistingDownload:
-  MessageBox MB_YESNO "Download of $R2 failed - Continue with 
installation?$\r$\n(This will use your pre-existing $R2 file)" IDYES NoFailed
-  goto Aborted
-
- Retry:
-  DetailPrint "Retrying download of $R2 ..."
-  goto DoDownload
-
- NoFailed:
-  DetailPrint "Using preexisting $R2"
-  StrCpy $0 "preexisting"
-  goto end
-
- Success:
-  DetailPrint "Downloaded $R2 successfully"
-  StrCpy $0 "success"
-  goto end
-
- Aborted:
-  DetailPrint "Download of $R2 aborted"
-  StrCpy $0 "aborted"
-  goto end
-
-  end:
-FunctionEnd
-
-
 Function GetFile
   POP $R2 # local filename
   POP $R3 # local dir

Modified: trunk/contrib/wininstall/update/Update.nsi
===================================================================
--- trunk/contrib/wininstall/update/Update.nsi  2005-12-05 22:32:38 UTC (rev 
7676)
+++ trunk/contrib/wininstall/update/Update.nsi  2005-12-05 23:27:14 UTC (rev 
7677)
@@ -7,6 +7,9 @@

 # Bob H, Nov 2005 : Made it grab and decompress zipped seednodes instead of 
raw ones.
 # Bob H, later : New emu / coralcache file locations, UPX path fix
+# Bob H, 1/12/2005 : Now uses the RetryableDownload function that the main 
+#                    wininstaller does, since in my experience Coral-Cache 
latency
+#                    could make the old DownloadFile method time out

 !include ..\webinstall.inc
 !include "MUI.nsh"
@@ -78,16 +81,24 @@
   Goto CloseFreenet

 ClosedFreenet:
- StrCpy $1 "http://downloads.freenetproject.org/freenet-stable-latest.jar";
- StrCpy $2 "$INSTDIR\freenet.jar.new"
- Call DownloadFile
+#> StrCpy $1 "http://downloads.freenetproject.org/freenet-stable-latest.jar";
+#> StrCpy $2 "$INSTDIR\freenet.jar.new"
+#> Call DownloadFile
+  Push "http://downloads.freenetproject.org/freenet-stable-latest.jar";
+  Push "$INSTDIR"
+  Push "freenet.jar.new"
+  Call RetryableDownload

  Delete "$INSTDIR\freenet.jar"
  Rename "$INSTDIR\freenet.jar.new" "$INSTDIR\freenet.jar"

- StrCpy $1 "http://downloads.freenetproject.org/seednodes/seednodes.ref.zip";
- StrCpy $2 "$INSTDIR\seednodes.zip"
- Call DownloadFile
+#> StrCpy $1 "http://downloads.freenetproject.org/seednodes/seednodes.ref.zip";
+#> StrCpy $2 "$INSTDIR\seednodes.zip"
+#> Call DownloadFile
+  Push "http://downloads.freenetproject.org/seednodes/seednodes.ref.zip";
+  Push  "$INSTDIR"
+  Push "seednodes.zip"
+  Call RetryableDownload

  Delete "$INSTDIR\seednodes.ref"
 # Rename "$INSTDIR\seednodes.ref.new" "$INSTDIR\seednodes.ref"  

Modified: trunk/contrib/wininstall/webinstall.inc
===================================================================
--- trunk/contrib/wininstall/webinstall.inc     2005-12-05 22:32:38 UTC (rev 
7676)
+++ trunk/contrib/wininstall/webinstall.inc     2005-12-05 23:27:14 UTC (rev 
7677)
@@ -31,3 +31,52 @@

 FunctionEnd
 
;-----------------------------------------------------------------------------------
+
+# Bob H - Retryable download, moved from freenet-modern.nsi so it can be shared
+
+Function RetryableDownload
+ POP $R2 # local filename
+ POP $R3 # local dir
+ POP $R4 # remote dir+filename
+
+ StrCpy $R5 "$R3\$R2"
+
+ DetailPrint "Downloading $R2 from $R4 ..."
+
+ DoDownload:
+ NSISdl::download /TIMEOUT=150000 "$R4" "$R5"
+ Pop $R9
+ StrCmp $R9 "success" Success
+ DetailPrint "Download of $R2 failed: $R9"
+ SetDetailsPrint none
+ Delete "$R5"
+ SetDetailsPrint both
+ MessageBox MB_YESNO "Download of $R2 failed: '$R9'. Retry?" IDYES Retry
+ IfFileExists "$INSTDIR\$R2" PreExistingDownload
+ goto Aborted
+
+ PreExistingDownload:
+  MessageBox MB_YESNO "Download of $R2 failed - Continue with 
installation?$\r$\n(This will use your pre-existing $R2 file)" IDYES NoFailed
+  goto Aborted
+
+ Retry:
+  DetailPrint "Retrying download of $R2 ..."
+  goto DoDownload
+
+ NoFailed:
+  DetailPrint "Using preexisting $R2"
+  StrCpy $0 "preexisting"
+  goto end
+
+ Success:
+  DetailPrint "Downloaded $R2 successfully"
+  StrCpy $0 "success"
+  goto end
+
+ Aborted:
+  DetailPrint "Download of $R2 aborted"
+  StrCpy $0 "aborted"
+  goto end
+
+  end:
+FunctionEnd


Reply via email to