home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / giochi / installer_whdload / e-f / flashback.lha / Flashback / Install-Flashback < prev    next >
Encoding:
Text File  |  1999-11-08  |  3.0 KB  |  142 lines

  1. (if    (exists "Games:" (noreq) )
  2.     (set @default-dest "Games:")
  3.     (if    (exists "SYS:Games" (noreq) )
  4.         (set @default-dest "SYS:Games")
  5.         (if    (exists "Work:Games" (noreq) )
  6.             (set @default-dest "Work:Games")
  7.             (if     (exists "JEUX:" (noreq) )
  8.                 (set @default-dest "JEUX:")
  9.                 (set @default-dest "SYS:")
  10.             )
  11.         )
  12.     )
  13. )
  14. (set #readme-file "README") ;name of readme file
  15. (set #last-disk 4)          ;amount of disks
  16.  
  17. ;---
  18. ; Checks if given program is reachable via the path
  19. ; if not abort install
  20. ; IN:  #program - to check
  21. ; OUT: -
  22.  
  23. (procedure P_chkrun
  24.  (if (= 0 (run ("cd SYS:\nWhich %s" #program)))
  25.      ("")
  26.      (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  27. ))
  28.  
  29. (procedure P_disk
  30.  ((askdisk
  31.     (prompt    ("\n\n\nPlease insert %s in any drive" #CI_diskname))
  32.     (dest #CI_diskname)
  33.     (help ("Insert %s in any floppy drive\nor you'll wait for a while!" #CI_diskname))
  34.     (assigns)
  35.   )
  36.   (copyfiles
  37.     (source ("%s:" #CI_diskname ))
  38.     (dest #dest)
  39.     (pattern "(F#?|Cine|Data|Music|Sound)")
  40. )))
  41.  
  42. ;---
  43. (if (exists #readme-file)
  44.     (if    (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  45.     ("")
  46.     (run ("SYS:Utilities/More %s" #readme-file))
  47.     )
  48. )
  49. (set #program "WHDLoad")
  50. (P_chkrun)
  51.  
  52. (set #program "DIC")
  53. (P_chkrun)
  54.  
  55. (set #dest
  56.  (askdir
  57.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  58.     (help @askdir-help)
  59.     (default @default-dest)
  60.     (disk)
  61. ))
  62. (set @default-dest (tackon #dest @app-name))
  63.  
  64. (set #dest @default-dest)
  65. (if (exists #dest)
  66.     ((set #choice
  67.       (askbool
  68.     (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  69.     (default 1)
  70.     (choices "Delete" "Skip")
  71.     (help @askbool-help)
  72.      ))
  73.      (if (= #choice 1)
  74.      (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  75.     )
  76.   )
  77. )
  78. (makedir #dest
  79.     (help @makedir-help)
  80.     (infos)
  81. )
  82. ;---
  83.  
  84. (copyfiles
  85.     (help @copyfiles-help)
  86.     (source ("%s.slave" @app-name))
  87.     (dest #dest)
  88. )
  89. (if (exists ("%s.newicon" @app-name))
  90.     (set #icon
  91.     (askchoice
  92.         (prompt "\nWhich icon would you like to install ?\n")
  93.         (default 0)
  94.         (choices "RomIcon" "NewIcon")
  95.         (help @askchoice-help)
  96.     )
  97.     )
  98.     (set #icon 0)
  99. )
  100. (select #icon
  101.     (set #icon ("%s.inf" @app-name))
  102.     (set #icon ("%s.newicon" @app-name))
  103. )
  104. (copyfiles
  105.     (help @copyfiles-help)
  106.     (source #icon)
  107.     (newname ("%s.info" @app-name))
  108.     (dest #dest)
  109. )
  110. (copyfiles
  111.     (help @copyfiles-help)
  112.     (source "OSEmu.400")
  113.     (dest #dest)
  114. )
  115. (if (exists #readme-file)
  116.     (copyfiles
  117.     (help @copyfiles-help)
  118.     (source #readme-file)
  119.     (dest #dest)
  120.     (infos)
  121.     )
  122. )
  123. (set #CI_diskno 1)
  124. (while
  125.   (<= #CI_diskno #last-disk)
  126.   ( (set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
  127.     (P_disk)
  128.     (set #CI_diskno (+ #CI_diskno 1))
  129.   )
  130. )
  131. (if    (= 0 (run ("patchexe %s" (tackon #dest "Flashback"))))
  132.     ("")
  133.     (if    (= 0 (run ("xfddecrunch >NIL: %s" (tackon #dest "Flashback"))))
  134.         (if    (= 0 (run ("patchexe %s" (tackon #dest "Flashback"))))
  135.             ("")
  136.             (abort "Could not patch executable!")
  137.         )
  138.         (abort "Could not patch executable!")
  139.     )
  140. )
  141. (exit)
  142.