home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / HF-SCL1.DMS / in.adf / Install-Secal < prev    next >
Encoding:
Text File  |  1996-09-01  |  7.6 KB  |  306 lines

  1. ; $VER: Install-Secal 1.0 (5.4.96)
  2. ; This is the installation script for Secal version 1.0
  3. ; Copyright (c) 1996 TDS Development. All Rights Reserved.
  4.  
  5.  
  6.  
  7. ;--- GLOBAL CONSTANTS ------------------
  8.  
  9. (set requiredspace 2000000)
  10.  
  11. (set hlp_instmethod (cat
  12.   "Secal can be installed to a hard disk (recommended), or to floppy disks. "
  13.   "Please choose one of these."
  14. ))
  15. (set hlp_destdir (cat
  16.   "Secal stores its files in its own drawer. Please specify the location of "
  17.   "this drawer. (Approx. 2 Mbyte of space is required)"
  18. ))
  19. (set hlp_prepopts (cat
  20.   "Secal needs an assignment and the extending of the search path. The required "
  21.   "instructions can be placed into the User-Startup file, or a script can be "
  22.   "created in the Secal drawer, which can be activated with the Prepare icon."
  23. ))
  24.  
  25. (set hlp_startup
  26.   "You have selected to modify the User-Startup file, this will happen now."
  27. )
  28.  
  29. (set hlp_askdisk "Please insert the correct disk to any drive.")
  30.  
  31. (set msg_work_prg "Extracting program files...")
  32. (set msg_work_inclib "Extracting include and lib files...")
  33. (set msg_work_silly "Extracting example project...")
  34. (set msg_work_xmp "Extracting rest of the examples...")
  35.  
  36. (set msg_err_prg "Error while extracting.")
  37. (set msg_err_inclib "Error while extracting.")
  38. (set msg_err_silly "Error while extracting.")
  39. (set msg_err_xmp "Error while extracting.")
  40. (set msg_err_prep "Error while extracting.")
  41.  
  42. (set msg_ok_harddisk "Please reboot before starting Secal.")
  43. (set msg_ok_floppy (cat
  44.   "Installation complete!\n" "Secal can be found on your disks.\n\n"
  45.   "TIP: If you use Secal on floppy disks, you can greatly reduce the number of "
  46.   "disk swaps by changing the Secal preferences. Remove anything unnecessary "
  47.   "from the list of directories, in which Secal looks for included files."
  48. ))
  49.  
  50.  
  51.  
  52. ;--- METHOD SELECTION ------------------
  53.  
  54. (procedure main (
  55.   (complete 0)
  56.  
  57.   (set method
  58.     (askchoice
  59.       (prompt "Select installation method")
  60.       (choices
  61.         "Install to hard disk" 
  62.         "Install to 3 DD floppy disks" 
  63.         "Install to 2 HD floppy disks" 
  64.       )
  65.       (default 0)
  66.       (help hlp_instmethod)
  67.     )
  68.   )
  69.  
  70.   (if (= method 0) (
  71.     (harddisk)
  72.   )(
  73.     (if (= method 1) (setdd) (sethd))
  74.     (floppydisks)
  75.   ))
  76. ))
  77.  
  78.  
  79.  
  80. ;--- HARDDISK INSTALLATION -------------
  81.  
  82. (procedure harddisk (
  83.   (set destdir (askdir
  84.     (prompt "Please indicate where you want the Secal drawer to be located.")
  85.     (default @default-dest)
  86.     (help hlp_destdir)
  87.   ))
  88.  
  89.   (set destspace (getdiskspace destdir))
  90.   (message
  91.     "\nSecal is about to be installed into \"" destdir "\".\n\n"
  92.     "About " requiredspace " bytes of free space is required.\n\n"
  93.     "Specified location has " destspace " bytes of free space.\n\n"
  94.     (if (< destspace requiredspace) (cat
  95.       "\nWarning! Specified location does not appear to have enough space, "
  96.       "Secal may not fit!"
  97.     ))
  98.   )
  99.  
  100.   (makedir "RAM:_SecalInstT")
  101.  
  102.   (askinstdisk1)
  103.   (copyfiles (source "SecalInstall1:LHEX") (dest "RAM:_SecalInstT"))
  104.  
  105.   (set destdir (tackon destdir "Secal"))
  106.   (makedir destdir (infos))
  107.   (complete 10)
  108.  
  109.   (askinstdisk1)
  110.   (working msg_work_prg)
  111.   (set cmd ("RAM:_SecalInstT/LHEX \"-qfw=%s\" x SecalInstall1:prg.lha" destdir))
  112.   (if (> (run cmd) 1) (abort msg_err_prg))
  113.   (complete 30)
  114.  
  115.   (askinstdisk1)
  116.   (working msg_work_inclib)
  117.   (set cmd ("RAM:_SecalInstT/LHEX \"-qfw=%s\" x SecalInstall1:inclib.lha" destdir))
  118.   (if (> (run cmd) 1) (abort msg_err_inclib))
  119.   (complete 50)
  120.  
  121.   (askinstdisk1)
  122.   (working msg_work_silly)
  123.   (set cmd ("RAM:_SecalInstT/LHEX \"-qfw=%s\" x SecalInstall1:silly.lha" destdir))
  124.   (if (> (run cmd) 1) (abort msg_err_silly))
  125.   (complete 70)
  126.  
  127.   (askinstdisk2)
  128.   (working msg_work_xmp)
  129.   (set cmd ("RAM:_SecalInstT/LHEX \"-qfw=%s\" x SecalInstall2:xmp.lha" destdir))
  130.   (if (> (run cmd) 1) (abort msg_err_xmp))
  131.   (complete 90)
  132.  
  133.   (set prepopts
  134.     (askoptions
  135.       (prompt "Secal needs an assignment and the extending of the search path. Select desired operation.")
  136.       (choices
  137.         "Modify your User-Startup file"
  138.         "Create Prepare script in Secal drawer"
  139.       )
  140.       (default %01)
  141.       (help hlp_prepopts)
  142.     )
  143.   )
  144.  
  145.   (if (bitand prepopts %10) (
  146.     (askinstdisk2)
  147.     (set cmd ("RAM:_SecalInstT/LHEX \"-qfw=%s\" x SecalInstall2:prep.lha" destdir))
  148.     (if (> (run cmd) 1) (abort msg_err_prep))
  149.   ))
  150.   (complete 95)
  151.  
  152.   (if (bitand prepopts %01) (
  153.     (startup "Secal"
  154.       (prompt "\nAbout to modify the User-Startup file.")
  155.       (command
  156.         ("Assign SECAL: \"%s\"\n" destdir)
  157.         "Path SECAL:C Add\n"
  158.       )
  159.       (help hlp_startup)
  160.     )
  161.   ))
  162.   (complete 100)
  163.  
  164.   (delete "RAM:_SecalInstT/LHEX")
  165.   (delete "RAM:_SecalInstT")
  166.  
  167.   (set @default-dest destdir)
  168.   (exit msg_ok_harddisk)
  169. ))
  170.  
  171.  
  172.  
  173. ;--- DD FLOPPY (PREPARATION) -----------
  174.  
  175. (procedure setdd (
  176.   (message
  177.     "\nYou will need 3 empty DD diskettes. Please format them to the following names:\n\n"
  178.     "SecalStart\n" "Secal\n" "SecalExamples"
  179.   )
  180.   (set dest_inclib  "Secal")
  181.   (set dest_prg     "SecalStart")
  182.   (set dest_silly   "SecalStart")
  183.   (set dest_xmp     "SecalExamples")
  184. ))
  185.  
  186.  
  187.  
  188. ;--- HD FLOPPY (PREPARATION) -----------
  189.  
  190. (procedure sethd (
  191.   (message
  192.     "\nYou will need 2 empty HD diskettes. Please format them to the following names:\n\n"
  193.     "Secal\n" "SecalProjects"
  194.   )
  195.   (set dest_inclib  "Secal")
  196.   (set dest_prg     "Secal")
  197.   (set dest_silly   "SecalProjects")
  198.   (set dest_xmp     "SecalProjects")
  199. ))
  200.  
  201.  
  202.  
  203. ;--- FLOPPY INSTALL (DD/HD) ------------
  204.  
  205. (procedure floppydisks (
  206.   (makedir "RAM:_SecalInstT")
  207.  
  208.   (askinstdisk1)
  209.   (copyfiles (source "SecalInstall1:LHEX") (dest "RAM:_SecalInstT"))
  210.  
  211.   (askinstdisk1)
  212.   (copyfiles (source "SecalInstall1:prg.lha") (dest "RAM:_SecalInstT"))
  213.  
  214.   (set destdisk dest_prg)
  215.   (askdestdisk)
  216.   (working msg_work_prg)
  217.   (set cmd ("RAM:_SecalInstT/LHEX \"-qfw=%s:\" x RAM:_SecalInstT/prg.lha" destdisk))
  218.   (if (> (run cmd) 1) (abort msg_err_prg))
  219.   (complete 25)
  220.   (delete "RAM:_SecalInstT/prg.lha")
  221.  
  222.   (rename ("%s:C/Secal" destdisk) ("%s:Secal" destdisk))
  223.   (complete 26)
  224.   (rename ("%s:C/SclC" destdisk) ("%s:SclC" destdisk))
  225.   (complete 27)
  226.  
  227.  
  228.   (askinstdisk1)
  229.   (copyfiles (source "SecalInstall1:silly.lha") (dest "RAM:_SecalInstT"))
  230.  
  231.   (set destdisk dest_silly)
  232.   (askdestdisk)
  233.   (working msg_work_silly)
  234.   (set cmd ("RAM:_SecalInstT/LHEX \"-qfw=%s:\" x RAM:_SecalInstT/silly.lha" destdisk))
  235.   (if (> (run cmd) 1) (abort msg_err_silly))
  236.   (complete 50)
  237.   (delete "RAM:_SecalInstT/silly.lha")
  238.  
  239.  
  240.   (askinstdisk1)
  241.   (copyfiles (source "SecalInstall1:inclib.lha") (dest "RAM:_SecalInstT"))
  242.  
  243.   (set destdisk dest_inclib)
  244.   (askdestdisk)
  245.   (working msg_work_inclib)
  246.   (set cmd ("RAM:_SecalInstT/LHEX \"-qfw=%s:\" x RAM:_SecalInstT/inclib.lha" destdisk))
  247.   (if (> (run cmd) 1) (msg_err_inclib))
  248.   (complete 75)
  249.   (delete "RAM:_SecalInstT/inclib.lha")
  250.  
  251.  
  252.   (askinstdisk2)
  253.   (copyfiles (source "SecalInstall2:xmp.lha") (dest "RAM:_SecalInstT"))
  254.  
  255.   (set destdisk dest_xmp)
  256.   (askdestdisk)
  257.   (working msg_work_xmp)
  258.   (set cmd ("RAM:_SecalInstT/LHEX \"-qfw=%s:\" x RAM:_SecalInstT/xmp.lha" destdisk))
  259.   (if (> (run cmd) 1) (abort msg_err_xmp))
  260.   (complete 100)
  261.   (delete "RAM:_SecalInstT/xmp.lha")
  262.  
  263.   (delete "RAM:_SecalInstT/LHEX")
  264.   (delete "RAM:_SecalInstT")
  265.  
  266.   (message msg_ok_floppy)
  267.   (exit (quiet))
  268. ))
  269.  
  270.  
  271.  
  272. (procedure askinstdisk1 (
  273.   (askdisk
  274.     (dest "SecalInstall1")
  275.     (prompt "\nPlease insert Secal install disk 1 (\"SecalInstall1\").")
  276.     (help hlp_askdisk)
  277.   )
  278. ))
  279.  
  280.  
  281.  
  282. (procedure askinstdisk2 (
  283.   (askdisk
  284.     (dest "SecalInstall2")
  285.     (prompt "\nPlease insert Secal install disk 2 (\"SecalInstall2\").")
  286.     (help hlp_askdisk)
  287.   )
  288. ))
  289.  
  290.  
  291.  
  292. (procedure askdestdisk (
  293.   (askdisk
  294.     (dest destdisk)
  295.     (prompt ("\nPlease insert the formatted destination disk named \"%s\"." destdisk))
  296.     (help hlp_askdisk)
  297.   )
  298. ))
  299.  
  300.  
  301.  
  302. ;--- MAIN PROGRAM ----------------------
  303.  
  304. (main)
  305.  
  306.