home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 25 / amigaformatcd25.iso / websites / f1_gp / ftp / f1gp-ed_upd333.lha / F1GP-Ed_333to336 / Patch_F1GP-Ed < prev    next >
Text File  |  1997-10-12  |  6KB  |  237 lines

  1. ; $VER: Patch_F1GP-Ed 2.3 (6.9.97)
  2. ;   by Oliver Roberts (oliver@poboxes.com)
  3. ;
  4. ; French translation by Daniel Grenson
  5.  
  6. ;************
  7. ; PARAMETERS
  8. ;************
  9.  
  10. (set #newver "3.36")
  11. (set #oldver "3.33")
  12. (set #oldvernum 3)
  13. (set #oldrevnum 33)
  14.  
  15. ;*************
  16. ; LOCALE INIT
  17. ;*************
  18.  
  19. (if (= (exists "Env:Language") 1)
  20.     (set @language (getenv "Language"))
  21. )
  22.  
  23. ;*****************
  24. ; ENGLISH STRINGS
  25. ;*****************
  26.  
  27. (set #str-createnew "Creating new %s file in T:")
  28. (set #str-copynew "Copying updated %s file to destination")
  29. (set #str-deletetmp "Deleting temporary file")
  30. (set #str-welcome (cat
  31.     "This Installer script will attempt to patch an existing "
  32.     "installation of F1GP-Ed %s.  The F1GP-Ed, F1GP-Ed.guide, "
  33.     "History.txt & 1997.f1gp files will be transformed into their "
  34.     "v%s counterparts.\n\n"
  35.     "Make sure you have booted from your hard drive and "
  36.     "have already successfully installed F1GP-Ed %s, before "
  37.     "continuing with this installation!\n\n"
  38.     "Do you want to continue?")
  39. )
  40. (set #str-where "Where have you installed F1GP-Ed?")
  41. (set #str-failed (cat
  42.     "Could not find the \"F1GP-Ed\" executable in this drawer - "
  43.     "make sure you have selected the correct drawer.\n\n\n"
  44.     "Patching Failed!")
  45. )
  46. (set #str-attemptpatch "Attempting to patch F1GP-Ed %ld.%ld")
  47. (set #str-wrongver "Found F1GP-Ed %ld.%ld - unable to patch this version.")
  48. (set #str-installnew "Installing new files")
  49. (set #str-updatecats "Updating catalogs")
  50. (set #str-theend (cat
  51.     "\nEnjoy using F1GP-Ed ;-)\n\n"
  52.     "The latest version of F1GP-Ed is always available from the "
  53.         "F1GP-Ed Web Site\n\n"
  54.         "   %s\n\n"
  55.     "%s\n")
  56. )
  57. (set #str-updatelib "Updating f1gp.library")
  58.  
  59. ;****************
  60. ; FRENCH STRINGS
  61. ;****************
  62.  
  63. (if (= @language "français") (
  64.  
  65.  (set #str-createnew "Creating new %s file in T:")
  66.  (set #str-copynew "Copie des mises à jour du fichier %s vers le fichier de destination")
  67.  (set #str-deletetmp "Effacement du fichier temporaire")
  68.  (set #str-welcome (cat
  69.     "Ce script d'installation essayera de 'patcher' une "
  70.         "installation existante de F1GP-Ed %s.  Les fichiers F1GP-Ed, "
  71.     "F1GP-Ed.guide, History.txt & 1997.f1gp seront transformés en leurs "
  72.     "v%s équivalents.\n\n"
  73.     "Assurez-vous d'avoir lancé votre ordinateur au départ de votre "
  74.     "disque dur et que vous avez déja installé avec succès F1GP-Ed %s, "
  75.     "avant de poursuivre cette installation!\n\n"
  76.     "Voulez-vous continuer?")
  77.  )
  78.  (set #str-where "Où avez-vous installé F1GP-Ed?")
  79.  (set #str-failed (cat
  80.     "Impossible de trouver le programme exécutable \"F1GP-Ed\" dans ce "
  81.     "tiroir - assurez-vous d'avoir sélectionné le tiroir correct.\n\n\n"
  82.     "Echec de l'opération de patch!")
  83.  )
  84.  (set #str-attemptpatch "Essai de 'patch' de F1GP-Ed %ld.%ld")
  85.  (set #str-wrongver "Trouvé F1GP-Ed %ld.%ld - impossible de patcher cette version.")
  86.  (set #str-installnew "Installation des nouveaux fichiers")
  87.  (set #str-updatecats "Mise à jour des catalogues")
  88.  (set #str-theend (cat
  89.     "\nAmusez-vous en utilisant F1GP-Ed !\n\n"
  90.     "La dernière version de F1GP-Ed est toujours disponible sur "
  91.         "le site Web F1GP-Ed\n\n"
  92.         "   %s\n\n"
  93.     "%s\n")
  94.  )
  95. ))
  96.  
  97. ;************
  98. ; PROCEDURES
  99. ;************
  100.  
  101. (procedure P_Patch
  102.     (if (exists (tackon (tackon @default-dest #pdir) #pfile))
  103.         (
  104.             (working (#str-createnew #pfile))
  105.             (run ("C/spatch -p%s.pch -oT:%s.new \"%s\"" #pfile #pfile (tackon (tackon @default-dest #pdir) #pfile)))
  106.             (if (exists ("T:%s.new" #pfile))
  107.                 (
  108.                     (copyfiles
  109.                         (prompt (#str-copynew #pfile))
  110.                         (source ("T:%s.new" #pfile))
  111.                         (dest (tackon @default-dest #pdir))
  112.                         (newname #pfile)
  113.                     )
  114.                     (delete ("T:%s.new" #pfile) (prompt #str-deletetmp))
  115.                 )
  116.             )
  117.         )
  118.     )
  119. )
  120.  
  121. ;*******
  122. ; START
  123. ;*******
  124.  
  125. (if (NOT (askbool
  126.         (prompt (#str-welcome #oldver #newver #oldver))
  127.         (default 0)
  128.         (help "")
  129.     ))
  130.     (exit (quiet))
  131. )
  132.       
  133. (welcome "")
  134.  
  135. (complete 0)
  136.  
  137. (set #destdir
  138.     (askdir
  139.         (prompt #str-where)
  140.         (help @askdir-help)
  141.         (default @default-dest)
  142.     )
  143. )
  144.  
  145. (set @default-dest #destdir)
  146.  
  147. (if (<> 1 (exists (tackon @default-dest "F1GP-Ed"))) (
  148.     (message #str-failed)
  149.     (exit (quiet)))
  150. )
  151.  
  152. ;*****************
  153. ; PATCH OLD FILES
  154. ;*****************
  155.  
  156. (set #vernum (getversion (tackon @default-dest "F1GP-Ed")))
  157. (set #ver (/ #vernum 65536))
  158. (set #rev (- #vernum (* #ver 65536)))
  159.  
  160. (if (AND (= #ver #oldvernum) (= #rev #oldrevnum))
  161.     (
  162.         (message (#str-attemptpatch #ver #rev))
  163.         (set #pdir "")
  164.                 (set #pfile "F1GP-Ed")
  165.         (P_Patch)
  166.         (complete 33)
  167.         (set #pdir "Docs/")
  168.                 (set #pfile "F1GP-Ed_english.guide")
  169.         (P_Patch)
  170.                 (set #pfile "F1GP-Ed_deutsch.guide")
  171.         (P_Patch)
  172.         (complete 66)
  173.         (set #pdir "")
  174.                 (set #pfile "History.txt")
  175.         (P_Patch)
  176.     )
  177.     (
  178.         (message (#str-wrongver #ver #rev))
  179.                 (exit (quiet))
  180.     )
  181. )
  182.  
  183. (complete 85)
  184.  
  185. ;****************
  186. ; COPY NEW FILES
  187. ;****************
  188.  
  189. (copyfiles
  190.     (prompt #str-installnew)
  191.     (source "")
  192.     (choices "1997.f1gp" "1997.f1gp.events" "Reg_Form")
  193.     (dest @default-dest)
  194.     (help @copyfiles-help)
  195.     (confirm)
  196.     (infos)
  197. )
  198.  
  199. ;****************
  200. ; UPDATE LIBRARY
  201. ;****************
  202.  
  203. (copylib
  204.     (prompt #str-updatelib)
  205.     (source "f1gp.library")
  206.     (dest "LIBS:")
  207.     (help @copylib-help)
  208.     (confirm)
  209. )
  210.  
  211. ;*****************
  212. ; UPDATE CATALOGS
  213. ;*****************
  214.  
  215. ;(set #newcatalog "Catalogs/italiano/F1GP-Ed.catalog")
  216.  
  217. ;(if (AND (exists #newcatalog) (exists (tackon @default-dest #newcatalog)))
  218. ;    (copyfiles
  219. ;        (prompt #str-updatecats)
  220. ;        (source #newcatalog)
  221. ;        (dest (tackon @default-dest "Catalogs/italiano"))
  222. ;        (help @copyfiles-help)
  223. ;        (confirm)
  224. ;    )
  225. ;)
  226.  
  227. ;*********
  228. ; THE END
  229. ;*********
  230.  
  231. (complete 100)
  232.  
  233. (exit (#str-theend
  234.         "http://www.nanunanu.org/~oliver/F1GP-Ed/"
  235.     "Oliver Roberts (Oliver@POBoxes.com)")
  236. )
  237.