home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / giochi / installer_whdload / g-i / interphase.lha / Interphase / Install-Interphase < prev    next >
Encoding:
Text File  |  1999-05-10  |  3.7 KB  |  181 lines

  1. (set #readme-file "README")    ;name of readme file
  2. (set #cleanup "")        ;files to delete after install
  3. (set #last-file "Disk.1")    ;last file the imager should create
  4. (set #diskname "Coverdisk 18")    ;name of requested dos disk
  5.  
  6. ;---
  7. ; Checks if given program is reachable via the path
  8. ; if not abort install
  9. ; IN:  #program - to check
  10. ; OUT: -
  11.  
  12. (procedure P_chkrun
  13.  (if (= 0 (run ("cd SYS:\nWhich %s" #program)))
  14.      ("")
  15.      (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  16. ))
  17.  
  18. ;---
  19.  
  20. (if (exists #readme-file)
  21.     (if    (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  22.     ("")
  23.     (run ("SYS:Utilities/More %s" #readme-file))
  24.     )
  25. )
  26. (set #program "WHDLoad")
  27. (P_chkrun)
  28.  
  29. ;---
  30.  
  31. (if    (exists "Games:" (noreq))
  32.     (set @default-dest "Games:")
  33.     (if    (exists "SYS:Games" (noreq))
  34.         (set @default-dest "SYS:Games")
  35.         (if    (exists "Work:Games" (noreq))
  36.             (set @default-dest "Work:Games")
  37.             (if    (exists "JEUX:" (noreq) )
  38.                 (set @default-dest "JEUX:")
  39.                 (set @default-dest "SYS:")
  40.             )
  41.         )
  42.     )
  43. )
  44. (set #game_ver
  45.  (askchoice
  46.     (prompt ("\nWhich version of \"%s\"\nwould you like to install ?\n" @app-name))
  47.     (help @askoptions-help)
  48.     (choices "Original Release" "Amiga Format Release")
  49.  )
  50. )
  51. (if (= #game_ver 0)
  52.  ((set #program "Patcher")
  53.   (P_chkrun)
  54.  
  55.   (if (= @user-level 2)
  56.     ((set #CI_drive
  57.       (askchoice
  58.     (prompt "\nSelect source drive for diskimages\n")
  59.     (default 0)
  60.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  61.     (help @askchoice-help)
  62.      ))
  63.      (select #CI_drive
  64.     (set #CI_drive "DF0:")
  65.     (set #CI_drive "DF1:")
  66.     (set #CI_drive "DF2:")
  67.     (set #CI_drive "DF3:")
  68.     ))
  69.     (set #CI_drive "DF0:")
  70. )))
  71.  
  72. (set @default-dest
  73.  (askdir
  74.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  75.     (help @askdir-help)
  76.     (default @default-dest)
  77.     (disk)
  78.   )
  79. )
  80. (set #dest (tackon @default-dest @app-name))
  81.  
  82. (if (exists #dest)
  83.     ((set #choice
  84.       (askbool
  85.     (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  86.     (default 1)
  87.     (choices "Delete" "Skip")
  88.     (help @askbool-help)
  89.      ))
  90.      (if (= #choice 1)
  91.      (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  92.     ))
  93. )
  94. (makedir #dest
  95.     (help @makedir-help)
  96.     (infos)
  97. )
  98.  
  99. ;---
  100.  
  101. (if (exists ("%s.newicon" @app-name))
  102.     (set #icon
  103.     (askchoice
  104.         (prompt "\nWhich icon would you like to install ?\n")
  105.         (default 0)
  106.         (choices "RomIcon" "NewIcon")
  107.         (help @askchoice-help)
  108.     )
  109.     )
  110.     (set #icon 0)
  111. )
  112. (select #icon
  113.     (set #icon ("%s.inf" @app-name))
  114.     (set #icon ("%s.newicon" @app-name))
  115. )
  116. (copyfiles
  117.     (help @copyfiles-help)
  118.     (source #icon)
  119.     (newname ("%s.info" @app-name))
  120.     (dest #dest)
  121. )
  122. (if (exists #readme-file)
  123.     (copyfiles
  124.     (help @copyfiles-help)
  125.     (source #readme-file)
  126.     (dest #dest)
  127.     (infos)
  128.     )
  129. )
  130.  
  131. ;---
  132.  
  133. (if (= #game_ver 0)
  134.    ((copyfiles
  135.     (help @copyfiles-help)
  136.     (source  ("%s.slave" @app-name))
  137.     (dest #dest)
  138.     )
  139.     (run ("Assign \"%s:\" \"%s\"" @app-name #dest))
  140.     (run ("Patcher -p%s.imager -s%s" @app-name #CI_drive))
  141.     (run ("Assign \"%s:\" Remove" @app-name))
  142.  
  143.     (if    (exists (tackon #dest #last-file))
  144.     ("")
  145.     (abort "Diskimaging not successful !\nThe Patcher could'nt create all needed files !")
  146.    ))
  147. )
  148.  
  149. ;---
  150.  
  151. (if (= #game_ver 1)
  152.    ((copyfiles
  153.     (help @copyfiles-help)
  154.     (source ("%sAF.slave" @app-name))
  155.     (dest #dest)
  156.     (newname ("%s.slave" @app-name))
  157.     )
  158.     (copyfiles
  159.     (help @copyfiles-help)
  160.     (source "OSEMUMODULE400.BIN")
  161.     (dest #dest)
  162.     )
  163.     (askdisk
  164.     (prompt    ("\n\n\nPlease insert Amiga Format %s in any drive" #diskname))
  165.     (dest #diskname)
  166.     (help ("Insert %s in any floppy drive or you'll wait for a while !!!" #diskname))
  167.     (assigns)
  168.     )
  169.     (copyfiles
  170.     (source ("%s:" #diskname))
  171.     (dest #dest)
  172.     (pattern "(Int|IntLoad)")
  173.    ))
  174. )
  175.  
  176. ;---
  177.  
  178. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  179.  
  180. (exit)
  181.