Author: bob
Date: 2005-11-06 01:09:44 +0000 (Sun, 06 Nov 2005)
New Revision: 7490

Modified:
   trunk/contrib/wininstall/freenet-java.nsi
   trunk/contrib/wininstall/freenet-modern.nsi
   trunk/contrib/wininstall/update/Update.nsi
Log:
Bob H : Updated NSIS scripts freenet-java.nsi, freenet.modern.nsi, 
update/Update.nsi.
freenet-java.nsi : Uses freenet-modern.nsi now, embeds modern java installer.
freenet-modern.nsi : Added zipped seednode support, workaround to stop 
NodeConfig hang due to it downloading seednodes itself without prompting! (this 
still needs fixing though)
Update.nsi : Should handle zipped seednodes now


Modified: trunk/contrib/wininstall/freenet-java.nsi
===================================================================
--- trunk/contrib/wininstall/freenet-java.nsi   2005-11-05 22:32:47 UTC (rev 
7489)
+++ trunk/contrib/wininstall/freenet-java.nsi   2005-11-06 01:09:44 UTC (rev 
7490)
@@ -10,7 +10,10 @@
 # You still need to add the javaexecutable yourself
 # Created April 2001 by David McNab and improved by various others :-)

+# Bob H, Nov 2005 : Resurrected, now uses freenet-modern.nsi instead of
+# freenet.nsi. Thus inherits zipped seednode support I added.
+
 !define embedJava
-!define JAVAINSTALLER j2re-1_3_1_01-win.exe
-!include freenet.nsi
+!define JAVAINSTALLER jre-1_5_0_05-windows-i586-p.exe
+!include freenet-modern.nsi


Modified: trunk/contrib/wininstall/freenet-modern.nsi
===================================================================
--- trunk/contrib/wininstall/freenet-modern.nsi 2005-11-05 22:32:47 UTC (rev 
7489)
+++ trunk/contrib/wininstall/freenet-modern.nsi 2005-11-06 01:09:44 UTC (rev 
7490)
@@ -26,7 +26,7 @@
 !define PRODUCT_NAME "Freenet"
 !define WEBINSTALL  #  the default install type
 !define BUILDDATE 20041124
-!define JAVAINSTALLER "jre-win32-latest.exe"
+# !define JAVAINSTALLER "jre-win32-latest.exe"

 !ifdef WEBINSTALL
  !define PRODUCT_VERSION "Webinstall"
@@ -165,6 +165,8 @@
  GetFullPathName /SHORT $2 $EXEDIR # same for EXEDIR into $2
  GetFullPathName /SHORT $R0 $TEMP # same for TEMP into $R0

+# MessageBox MB_OK "Temp is $R0, Exedir is $2"
+
  # make sure the files we're downloading don't already exist in the temp dir:
  SetDetailsPrint none
  Delete "$R0\freenet-install\*.*"
@@ -344,10 +346,10 @@
  IfFileExists "$R0\freenet-install\seednodes.ref" NoDownloadSeednodes
  # if "Don't Prompt Me" is selected the following message box will not appear 
and seed download will be automatic
  # ###TODO
- MessageBox MB_YESNO "To connect to the Freenet network, your Freenet node 
needs to know about at least one other Freenet node.$\r$\nThis is called a 
'Node Reference' or 'seednodes.ref' file.$\r$\nDo you want to download 
'seednodes.ref' from the Free Net Project's servers?$\r$\nYou may want to say 
NO if you have been given a .ref file by a friend,$\r$\nor if you have 
installed Freenet before and still have the file named seednodes.ref" IDNO 
NoDownloadSeedNodes
- Push "http://freenetproject.org/snapshots/seednodes.ref";
+ MessageBox MB_YESNO "To connect to the Freenet network, your Freenet node 
needs to know about at least one other Freenet node.$\r$\nThis is called a 
'Node Reference' or 'seednodes.ref' file.$\r$\nDo you want to download a 
compressed 'seednodes.ref' from the Free Net Project's servers?$\r$\nYou may 
want to say NO if you have been given a .ref file by a friend,$\r$\nor if you 
have installed Freenet before and still have the file named seednodes.ref" IDNO 
NoDownloadSeedNodes
+ Push "http://freenetproject.org/snapshots/seednodes.zip";
  Push "$R0\freenet-install"
- Push "seednodes.ref"
+ Push "seednodes.zip"
  Call RetryableDownload
  StrCmp $0 "success" seedsuccess
  MessageBox MB_YESNO "Couldn't download seednodes.ref - Without this file 
Freenet will not work.$\r$\nDo you want to continue installation anyway?  (You 
will still need to download seednodes.ref yourself)" IDYES NoDownloadSeedNodes
@@ -356,6 +358,8 @@
  seedsuccess:
  ClearErrors

+# Should have seednodes.zip if we're here
+
  NoDownloadSeedNodes:

  StrCmp "$3" "${NUMBER_OF_DOWNLOADABLE_FILES}" DoneGettingFiles
@@ -409,6 +413,28 @@
  File update\UpdateSnapshot.exe
  IfErrors DiskWriteError

+
+IfFileExists "$INSTDIR\seednodes.zip" unzipSeednodes
+
+# If we haven't got it for some reason, jump to error handler
+goto unzipSeednodesDownloadError
+
+# Bob H : We've got seednodes, unzip them
+# We must run before NodeConfig, or it will "helpfully" go and download the 
uncompressed seednodes.ref itself without asking!
+unzipSeednodes:
+DetailPrint "Decompressing seednodes, please wait ..."
+       # We extract it to temp install dir first, to stop NodeConfig 
downloading seednodes.ref
+ZipDLL::extractall "$R0\freenet-install\seednodes.zip" "$R0\freenet-install"
+       # Then copy to final install dir
+CopyFiles "$R0\freenet-install\seednodes.ref" "$INSTDIR"
+ goto seednodesUnzipped
+
+unzipSeednodesDownloadError:
+MessageBox MB_OK "Sorry, the compressed seednodes 'seednodes.zip' could not be 
found.$\r$\nA seednodes file is needed for freenet to work.$\r$\nYou could try 
downloading seednodes manually from :$\r$\n 
http://freenetproject.org/snapshots/";
+
+seednodesUnzipped:
+
+
  # Step 3- Merge ini files
  # Step 3a - create a default .ini file
  IfFileExists "$INSTDIR\default.ini" 0 NoFreenetIniDefaults
@@ -582,6 +608,8 @@
   Delete "$INSTDIR\flaunch.ini"
   Delete "$INSTDIR\freenet.ini"
   Delete "$INSTDIR\seednodes.ref"
+# Bob H : Cleanup zipped seednodes too
+  Delete "$INSTDIR\seednodes.zip"
   Delete "$INSTDIR\prng.seed"
   RMDir /r "$INSTDIR\store"
   Delete "$INSTDIR\lsnodes*"
@@ -694,6 +722,7 @@
   SetOutPath "$R0\freenet-install"
   SetDetailsPrint both

+
   !ifdef embedJava
    # Install Java runtime only if not found
    DetailPrint "Lauching Sun's Java Runtime Environment installation..."

Modified: trunk/contrib/wininstall/update/Update.nsi
===================================================================
--- trunk/contrib/wininstall/update/Update.nsi  2005-11-05 22:32:47 UTC (rev 
7489)
+++ trunk/contrib/wininstall/update/Update.nsi  2005-11-06 01:09:44 UTC (rev 
7490)
@@ -5,6 +5,8 @@
 ; start the node again
 ;

+# Bob H, Nov 2005 : Made it grab and decompress zipped seednodes instead of 
raw ones.
+
 !include ..\webinstall.inc
 !include "MUI.nsh"
 !include "WinMessages.nsh"
@@ -82,12 +84,16 @@
  Delete "$INSTDIR\freenet.jar"
  Rename "$INSTDIR\freenet.jar.new" "$INSTDIR\freenet.jar"

- StrCpy $1 "http://freenetproject.org/snapshots/seednodes.ref";
- StrCpy $2 "$INSTDIR\seednodes.ref.new"
+ StrCpy $1 "http://freenetproject.org/snapshots/seednodes.zip";
+ StrCpy $2 "$INSTDIR\seednodes.zip"
  Call DownloadFile

  Delete "$INSTDIR\seednodes.ref"
- Rename "$INSTDIR\seednodes.ref.new" "$INSTDIR\seednodes.ref"  
+# Rename "$INSTDIR\seednodes.ref.new" "$INSTDIR\seednodes.ref"  
+
+# Bob H : Unzip seednodes (to seednodes.ref)
+ZipDLL::extractall "$INSTDIR\seednodes.zip" "$INSTDIR"
+

  # update finished, starting the node if it ran before
  IntCmp $9 1 0 StartedFreenet


Reply via email to