]> git.lyx.org Git - features.git/commitdiff
two mirror servers for all downloads
authorJoost Verburg <joostverburg@users.sourceforge.net>
Thu, 21 Jun 2007 18:41:24 +0000 (18:41 +0000)
committerJoost Verburg <joostverburg@users.sourceforge.net>
Thu, 21 Jun 2007 18:41:24 +0000 (18:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18847 a592a061-630c-0410-9148-cb99ea01b6c8

development/Win32/packaging/installer/components/dicts.nsh
development/Win32/packaging/installer/components/external.nsh
development/Win32/packaging/installer/include/declarations.nsh
development/Win32/packaging/installer/include/download.nsh [new file with mode: 0644]
development/Win32/packaging/installer/settings.nsh

index fa77c832bfc1ad927b04969929d59ac9e4c68a5b..63c1b2d2d3ba2be2b14ce849b80ac00b0d7b2f62 100644 (file)
@@ -106,18 +106,10 @@ Function DownloadDictionary
 
   dict_download:
 
-    #Download
-    InetLoad::load "${DOWNLOAD_ASPELLDICTS}/aspell6-$R0.exe" "$PLUGINSDIR\aspell6-$R0.exe" /END
-    Pop $R3
+    !insertmacro DownloadFile $R3 ASPELLDICTS aspell6-$R0.exe
 
     ${if} $R3 != "OK"
-      #Download failed, try an alternative link
-      InetLoad::load "${ALT_DOWNLOAD_ASPELLDICTS}/aspell6-$R0.exe" "$PLUGINSDIR\aspell6-$R0.exe" /END
-      Pop $R3
-    ${endif}
-
-    ${if} $R3 != "OK"
-      #Download failed again
+      #Download failed
       MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_DOWNLOAD_FAILED_DICT) ($R3)" IDYES dict_download
       Goto dict_noinstall
     ${endif}
index c58868cf85023d1038a1a80e514ad4f0622b120f..2c33850faafcc0abf1bc4b043ff7a3c127a66702 100644 (file)
@@ -73,9 +73,7 @@ External Components: MiKTeX, ImageMagick, Ghostscript
 
     download_${COMPONENT}:
 
-      #Download using HTTP
-      InetLoad::load "${DOWNLOAD_${COMPONENT}}" "$PLUGINSDIR\${COMPONENT}Setup.exe" /END
-      Pop $R0
+      !insertmacro DownloadFile $R0 "${COMPONENT}" "${COMPONENT}Setup.exe"
  
       ${if} $R0 != "OK"
         #Download failed
index 42b686b3054c4fe90d96c9711b4f911d3803d8de..b7f5ac8a38b1159ceb3408ebed2ddf44e2ea0152 100644 (file)
@@ -108,6 +108,7 @@ Var AspellHive
 #--------------------------------
 #LyX installer header files  
 
+!include "include\download.nsh"
 !include "include\init.nsh"
 !include "include\windows.nsh"
 !include "include\lang.nsh"
diff --git a/development/Win32/packaging/installer/include/download.nsh b/development/Win32/packaging/installer/include/download.nsh
new file mode 100644 (file)
index 0000000..ddd78ae
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+\r
+Support code for file downloads\r
+\r
+*/\r
+\r
+!macro DownloadFile RET ID FILENAME\r
+\r
+  #Downloads a file using the InetLoad plug-in (HTTP or FTP)\r
+  \r
+  #RET = Return value (OK if succesful)\r
+  #ID = Name of the download in settings.nsh\r
+  #FILENAME = Location to store file\r
+\r
+  #Try first mirror server\r
+  InetLoad::load "${DOWNLOAD_${ID}}" "$PLUGINSDIR\${FILENAME}" /END\r
+  Pop ${RET} #Return value (OK if succesful)\r
+\r
+  ${if} ${RET} != "OK"\r
+    #Download failed, try second mirror server\r
+    InetLoad::load "${DOWNLOADALT_${ID}}" "$PLUGINSDIR\${FILENAME}" /END\r
+    Pop ${RET}\r
+  ${endif}\r
+\r
+!macroend\r
index ec0d66efaedfe7fe9d304290d8b404d6364f9367..f72d34b3353c727ff34dab83df5ae1a3e9e4787e 100644 (file)
@@ -29,36 +29,47 @@ Settings for LyX installer
 \r
 #--------------------------------\r
 #Locations of components to download\r
-!define DOWNLOAD_LATEX "http://superb-west.dl.sourceforge.net/sourceforge/miktex/basic-miktex-2.5.2580.exe"\r
-!define DOWNLOAD_IMAGEMAGICK "http://superb-west.dl.sourceforge.net/sourceforge/imagemagick/ImageMagick-6.3.3-7-Q16-windows-dll.exe"\r
-!define DOWNLOAD_GHOSTSCRIPT "http://superb-west.dl.sourceforge.net/sourceforge/ghostscript/gs854w32-gpl.exe"\r
+\r
+!define MIRROR_SF1 "http://superb-west.dl.sourceforge.net/sourceforge"\r
+!define MIRROR_SF2 "http://mesh.dl.sourceforge.net/sourceforge"\r
+\r
+!macro SourceForgeMirror ID FILENAME\r
+  !define DOWNLOAD_${ID} "${MIRROR_SF1}/${FILENAME}"\r
+  !define DOWNLOADALT_${ID} "${MIRROR_SF2}/${FILENAME}"\r
+!macroend\r
+\r
+!insertmacro SourceForgeMirror LATEX "miktex/basic-miktex-2.6.2704.exe"\r
+!insertmacro SourceForgeMirror IMAGEMAGICK "imagemagick/ImageMagick-6.3.4-10-Q16-windows-dll.exe"\r
+!insertmacro SourceForgeMirror GHOSTSCRIPT "ghostscript/gs857w32.exe"\r
+\r
 !define DOWNLOAD_VIEWER "http://tug.ctan.org/tex-archive/nonfree/support/ghostscript/ghostgum/gsv48w32.exe"\r
+!define DOWNLOADALT_VIEWER "http://ctan.basemirror.de/nonfree/support/ghostscript/ghostgum/gsv48w32.exe"\r
 \r
 !define DOWNLOAD_ASPELLDICTS "ftp://ftp.lyx.org/pub/lyx/contrib/aspell6-windows"\r
-!define ALT_DOWNLOAD_ASPELLDICTS "http://www.lyx.org/~bpeng/aspell6-windows"\r
+!define DOWNLOADALT_ASPELLDICTS "http://www.lyx.org/~bpeng/aspell6-windows"\r
 \r
 #--------------------------------\r
 #Download size (in KB)\r
 \r
-!define SIZE_DOWNLOAD_LATEX 47271\r
-!define SIZE_DOWNLOAD_IMAGEMAGICK 6947\r
-!define SIZE_DOWNLOAD_GHOSTSCRIPT 12669\r
+!define SIZE_DOWNLOAD_LATEX 53759\r
+!define SIZE_DOWNLOAD_IMAGEMAGICK 7111\r
+!define SIZE_DOWNLOAD_GHOSTSCRIPT 11916\r
 !define SIZE_DOWNLOAD_VIEWER 1459\r
 \r
 #--------------------------------\r
 #Approximations of space required for components (in KB)\r
 \r
 !define SIZE_LATEX 120000\r
-!define SIZE_IMAGEMAGICK 17000\r
-!define SIZE_GHOSTSCRIPT 26000\r
+!define SIZE_IMAGEMAGICK 18000\r
+!define SIZE_GHOSTSCRIPT 30000\r
 !define SIZE_VIEWER 4000\r
 \r
 #--------------------------------\r
 #Locations of setup files for components (for bundled setup)\r
 \r
-!define INSTALL_LATEX "basic-miktex-2.5.2580.exe"\r
-!define INSTALL_IMAGEMAGICK "ImageMagick-6.3.3-7-Q16-windows-dll.exe"\r
-!define INSTALL_GHOSTSCRIPT "gs854w32-gpl.exe"\r
+!define INSTALL_LATEX "basic-miktex-2.6.2704.exe"\r
+!define INSTALL_IMAGEMAGICK "ImageMagick-6.3.4-8-Q16-windows-dll.exe"\r
+!define INSTALL_GHOSTSCRIPT "gs857w32.exe"\r
 !define INSTALL_VIEWER "gsv48w32.exe"\r
 \r
 #--------------------------------\r
@@ -71,7 +82,7 @@ Settings for LyX installer
 !define APP_SERIES_KEY "15"\r
 !define APP_DIR_USERDATA "LyX1.5.x"\r
 !define APP_INFO "${APP_NAME} - The Document Processor"\r
-!define APP_COPYRIGHT "LyX is Copyright © 1995 by Matthias Ettrich, 1995-2006 LyX Team"\r
+!define APP_COPYRIGHT "LyX is Copyright © 1995 by Matthias Ettrich, 1995-2007 LyX Team"\r
 \r
 !define APP_RUN "bin\lyx.exe"\r
 \r