home *** CD-ROM | disk | FTP | other *** search
/ Amiga Computing 105 / ac105b.adf / -Installing- next >
Text File  |  1996-07-07  |  8KB  |  147 lines

  1. ; Generic lzx extractor, by Neil Mohr
  2. ; $VER: Amiga Computing lzx Extractor v1.2 (14:11 7 July 1996)
  3.  
  4. (complete 0)
  5. (set requiredKick 33)
  6. (set arcSize 25000)
  7. (set @default-dest "RAM:")
  8. (set level @user-level)
  9. (set finished 0)
  10. (set totalMem (+(dataBase "total-mem"))) ;get total free memory, AND, convert into a integer
  11. (set @app-name (substr (fileonly @icon) 0 (- (strlen (fileonly @icon)) 4)) ) ;get icon(archive) name minus the ".lzx"
  12.  
  13. (if (= @app-name "AppTool") ((set requiredKick 37) (set arcSize 380000) (set xInstall 1) ))
  14. (if (= @app-name "PhotoAlbum") ((set requiredKick 37) (set arcSize 180000) (set xInstall 1) ))
  15. (if (= @app-name "TinyMeter") ((set requiredKick 37) (set arcSize 380000) (set xInstall 1) ))
  16. (if (= @app-name "XDVE2") ((set requiredKick 37) (set arcSize 830000) (set xInstall 1) ))
  17.  
  18.  
  19. (if (OR (= (getDevice @icon) "DF0") (= (getDevice @icon) "DF1") (= (getDevice @icon) "DF2"))
  20.     (set originalDisc (getAssign (getDevice @icon) "d")) )
  21.  
  22. (if (= requiredKick 37) (set Kickversion "2.04"))
  23. (if (= requiredKick 39) (set Kickversion "3.0"))
  24. (if (= requiredKick 40) (set Kickversion "3.1"))
  25.  
  26. (set hello            (cat "\n\n\nThis will extract the " @app-name" archive\nto your chosen location.\n\n\nSelect NOVICE to simply extract\n to RAM: or a floppy drive."))
  27. (set noDiscSpace      (cat "\n\n" @default-dest " has not enought space on it."))
  28. (set extractionError  (cat "lzx reported an error when extracting\n" @app-name " to the destination path " @default-dest ".\n\nThis could either be a problem with how your computer is setup or with the disk itself.\nMake sure you are running from the cover disk and you have read the installation instructions.\n\nIf problems persist ring 01625 878888 and ask for Amiga Computing Technical Help." ))
  29. (set lowMem           (cat "\nSorry you only have " totalMem " bytes of RAM,\nand you need " arcSize " bytes, to be able\nto extract " @app-name " into RAM:.\n\n\nTry removing some other applications,\nor use a blank floppy disc."))
  30. (set discRequest      (cat "\n\n\n\n\nPlease insert a (blank) disc into "))
  31. (set lowDiskSpace     (cat ": does not have enought room for " @app-name " to fit. You can either replace the current disk with another or I will format the current one."))
  32. (set removeCoverDisc  (cat "\n\n\n\n\nPlease remove the cover disc,\n\nand insert a (blank) disc in "))
  33. (set formatCheck      (cat  ", does not have enough room. You will have to format it.\n\nTo do this click on its icon, and then select 'Format Disk' from the Workbench menu.\nFormating a disc DESTROYS ALL the data on a disc.\nPress YES when done or NO to quit."))
  34. (set deviceTooSmall   (cat " bytes,\nand so " @app-name " cannot fit onto it.\n\nTry using RAM:, or buy a hard drive.\n\n\n\n(You won't regret it;-)"))
  35. (set noRoom           (cat " bytes free, and\n\n" @app-name " needs " arcSize " bytes."))
  36. (set @askchoice-help  (cat "\n\nEach button represent a destination. You can select either to extract the program into RAM:, or onto a floppy disc using one of the drives.\n\nSimply press the appropriate button, then proceed."))
  37. (set wrongKick        (cat "\n\nWarning, you need at least Kickstart v" requiredKick " (" Kickversion ")\n\nto use " @app-name ".\n\n\nPress 'proceed' to continue anyway;\n\n\n\nBut you won't be able to run the program!"))
  38. (set destPrompt       "Where do you want the archives extracting?")
  39.  
  40. (if (getassign "DF1" "d") ;check for external disc drive, and set correct procedure
  41.   (procedure @noviceGetDest
  42.  
  43.     (set destination (cat (askchoice
  44.                         (prompt "\n\nWhere do you want me to put " @app-name "?\n\n")
  45.                         (choices "RAM: {Recommended}" "DF0: {Internal Drive}" "DF1: {External Drive}\n\n\n\n")
  46.                         (help @askchoice-help)
  47.                        ) )
  48.     )
  49.   )
  50.   (procedure @noviceGetDest
  51.     (set destination (cat (askchoice
  52.                         (prompt "\n\nWhere do you want me to put " @app-name "?\n\n")
  53.                         (choices "RAM: {Recommended}" "DF0: {Internal Drive}")
  54.                         (help @askchoice-help)
  55.                        ) )
  56.     )
  57.   )
  58. )
  59.  
  60. (procedure @getdefault-dest
  61.   (set destination (askdir
  62.                       (help @askdir-help)
  63.                       (prompt "Where Do you want " @app-name " extracting?")
  64.                       (newpath)
  65.                       (default @default-dest)
  66.                      )
  67.   )
  68.   (set @default-dest destination)
  69. )
  70.  
  71.  
  72. (procedure @noviceUnArc ;handles quick extraction to ram or floppy
  73.   (if (= @default-dest 0)                                     ;if RAM
  74.     ( (set @default-dest "RAM:")
  75.       (if (> arcSize totalMem) (abort lowMem"\n\n"))
  76.     )
  77.     ( (set @default-dest (cat "DF" (- @default-dest 1) ":") ) ;else
  78.       (until (= finished 1)
  79.         (while (OR (=   (getAssign (getDevice @default-dest) "d") originalDisc) ;wait for new disc
  80.                    (NOT (getdiskspace @default-dest))
  81.                )
  82.           (if (= (getAssign (getDevice @default-dest) "d") originalDisc) ;that isn't the coverdisk
  83.               (message removeCoverDisc @default-dest)
  84.               (message discRequest @default-dest)
  85.           )
  86.         )
  87.         (if (> arcSize (getDiskSpace @default-dest)) ;check for room
  88.             ((if (askbool (prompt "\n\nSorry but the current disc in " @default-dest formatCheck) (help @askbool-help))
  89.               (set finished 0) (abort "Ok, try using RAM or formatting the disc before hand.")
  90.              )
  91.              (if (AND (<   (getDiskSpace @default-dest) arcSize)
  92.                       (NOT (= finished 1)) )
  93.                   (abort "\n\nSorry, but " @default-dest " can only store " (getDiskSpace @default-dest) deviceTooSmall)
  94.              )
  95.             );use this for error checking
  96.             ((set finished 1))
  97.         )
  98.       )
  99.       (set @default-dest (getAssign (getDevice @default-dest) "d"))
  100.     )
  101.   )
  102. )
  103.  
  104. (procedure @expertUnArc
  105.   (if (AND (= (getDevice @default-dest) "RAM") (> arcSize totalMem))
  106.     (abort lowMem)
  107.     (if (AND (> arcSize (getDiskSpace @default-dest)) (NOT (= (getDevice @default-dest) "RAM")) )
  108.         (abort "\n\nSorry, but " @default-dest " only has\n" (getDiskSpace @default-dest) noRoom"\n")
  109.     )
  110.   )
  111.   (if (> (run unArc) 0) (abort extractionError))
  112. )
  113.  
  114. ;*********************************************************************
  115.  
  116. (user 2)
  117.  
  118. (if (NOT (exists "c:lzx")) (message "-=* WARNING *=-\n\nI don't seem to be able to find the\nprogram Lzx on the current c: command path.\n\n\nIf a Lzx error is reported, you will need to\ncopy the Lzx program from disk one onto your\nhard drive/floppy's C drawer.\n\nHard Drive users can use the HD-SetUp icon, floppy users should boot using the cover disk."))
  119.  
  120. (if  (< (/ (getversion) 65536) requiredKick)
  121.   (message wrongKick) )
  122.  
  123. (message hello)
  124. (user level)
  125. (welcome)
  126.  
  127. (if (= @user-level 0)
  128.   ((user 2) (@noviceGetDest) (set @default-dest destination) (@noviceUnArc) (user 0))
  129.   ((@getdefault-dest))
  130. )
  131.  
  132. (user 2)
  133. (complete 10)
  134.  
  135. (if (NOT (= (substr @default-dest (- (strlen @default-dest) 1) 1) ":")) 
  136.     (set @default-dest (cat @default-dest "/"))
  137. )
  138.  
  139. (set unArc (cat "lzx x -m -x \"" @icon "\" \"" @default-dest "\""))
  140.  
  141. (working "\n\n\n\nExtracting " @app-name " to " @default-dest ",\n\nplease wait....")
  142. (@expertUnArc)
  143.  
  144. (complete 100)
  145. (if (= xInstall 1) (set xInstall (cat @app-name " should be installed from your chosen destination, otherwise it may not work correctly")) )
  146. (exit "\nInstallation complete!\n\n\n\n\n" @app-name " has been successfully extracted,\n\nand can be found in " @default-dest ".\n\n\n" xInstall (quiet)) ;don't use standard exit message
  147.