home *** CD-ROM | disk | FTP | other *** search
/ The Amiga Game Guide / AmigaGameGuide_CD.iso / Amiga / Game-Installer / WHD_Installers / Games_J-M / KGS / Install next >
Text File  |  1977-12-31  |  3KB  |  142 lines

  1. ;Standard Patcher-install-script
  2. ;****************************
  3.  
  4. (set #readme-file "README")    ;name of readme file
  5. (set #cleanup "")        ;files to delete after install
  6. (set #last-file "disk.2")    ;last file the imager should create
  7.  
  8. ;****************************
  9. ;----------------------------
  10. ; Checks if given program is reachable via the path
  11. ; if not abort install
  12. ; IN:  #program - to check
  13. ; OUT: -
  14.  
  15. (procedure P_chkrun
  16.   (if
  17.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  18.     ("")
  19.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  20.   )
  21. )
  22.  
  23. ;****************************
  24.  
  25. (set #program "WHDLoad")
  26. (P_chkrun)
  27.  
  28. (set #program "Patcher")
  29. (P_chkrun)
  30.  
  31. (if
  32.   (= @user-level 2)
  33.   (
  34.     (set #CI_drive
  35.       (askchoice
  36.     (prompt "Select source drive for diskimages")
  37.     (default 0)
  38.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  39.     (help @askchoice-help)
  40.       )
  41.     )
  42.     (if
  43.       (= #CI_drive 0)
  44.       (set #CI_drive "DF0:")
  45.     )
  46.     (if
  47.       (= #CI_drive 1)
  48.       (set #CI_drive "DF1:")
  49.     )
  50.     (if
  51.       (= #CI_drive 2)
  52.       (set #CI_drive "DF2:")
  53.     )
  54.     (if
  55.       (= #CI_drive 3)
  56.       (set #CI_drive "DF3:")
  57.     )
  58.   )
  59.   (
  60.     (set #CI_drive "DF0:")
  61.   )
  62. )
  63.  
  64. (set @default-dest
  65.   (askdir
  66.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  67.     (help @askdir-help)
  68.     (default @default-dest)
  69.     (disk)
  70.   )
  71. )
  72. (set #dest (tackon @default-dest @app-name))
  73. (if
  74.   (exists #dest)
  75.   (
  76.     (set #choice
  77.       (askbool
  78.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  79.         (default 1)
  80.         (choices "Delete" "Skip")
  81.         (help @askbool-help)
  82.       )
  83.     )
  84.     (if
  85.       (= #choice 1)
  86.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  87.     )
  88.   )
  89. )
  90. (makedir #dest
  91.   (help @makedir-help)
  92.   (infos)
  93. )
  94.  
  95. ;----------------------------
  96.  
  97. (copyfiles
  98.   (help @copyfiles-help)
  99.   (source ("%s.inf" @app-name ))
  100.   (newname ("%s.info" @app-name ))
  101.   (dest #dest)
  102. )
  103. (copyfiles
  104.   (help @copyfiles-help)
  105.   (source ("%s.slave" @app-name ))
  106.   (dest #dest)
  107. )
  108. (if
  109.   (exists #readme-file)
  110.   (copyfiles
  111.     (help @copyfiles-help)
  112.     (source #readme-file)
  113.     (dest #dest)
  114.   )
  115. )
  116.  
  117. (run ("Assign \"%s:\" \"%s\"" @app-name #dest))
  118. (run ("Patcher -p%s.imager -s%s" @app-name #CI_drive))
  119. (run ("Assign \"%s:\" Remove" @app-name))
  120.  
  121. (if
  122.   (exists (tackon #dest #last-file))
  123.   ("")
  124.   (abort "Diskimaging not successful !\nThe Patcher could'nt create all needed files !")
  125. )
  126.  
  127. ;----------------------------
  128.  
  129. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  130.  
  131. (if
  132.   (exists #readme-file)
  133.   (if 
  134.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  135.     ("")
  136.     (run ("SYS:Utilities/More %s" #readme-file))
  137.   )
  138. )
  139.  
  140. (exit)
  141.  
  142.