home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 17 / amigaformatcd17.iso / -screenplay- / shareware / graal / hd_install < prev    next >
Text File  |  1997-06-29  |  12KB  |  399 lines

  1. ; ====================
  2. ; PERFORMANCE SOFTWARE
  3. ; ====================
  4. ; GRAAL 2.2 Installer Script
  5. ; (c) 1997 Per Thulin
  6. (welcome)
  7.  
  8. ; Set up some variables
  9. (set #path (pathonly @icon))
  10.  
  11. (set #diskname_a "GRAAL 2.2 - Disk A")
  12. (set #diskname_b "GRAAL 2.2 - Disk B")
  13. (set #diskname_c "GRAAL 2.2 - Disk C")
  14. (set #diskname_d "GRAAL 2.2 - Disk D")
  15.  
  16. (set #source_a (cat #diskname_a ":"))
  17. (set #source_b (cat #diskname_b ":"))
  18. (set #source_c (cat #diskname_c ":"))
  19. (set #source_d (cat #diskname_d ":"))
  20.  
  21. (set #diskprompt_a (cat "Please insert disk " #source_a))
  22. (set #diskprompt_b (cat "Please insert disk " #source_b))
  23. (set #diskprompt_c (cat "Please insert disk " #source_c))
  24. (set #diskprompt_d (cat "Please insert disk " #source_d))
  25.  
  26. (set #hd_run 1)
  27.  
  28. ; if all the above exists in current dir, we assume ALL files
  29. ; are in the same dir!
  30.  
  31. (if (not (exists "GRAAL_2" (noreq)))
  32.   (set #hd_run 0)
  33.   ) ; end if
  34. (if (not (exists "Demo_Solution.text" (noreq)))
  35.   (set #hd_run 0)
  36.   ) ; end if
  37. (if (not (exists "GRAAL.guide" (noreq)))
  38.   (set #hd_run 0)
  39.   ) ; end if
  40. (if (not (exists "gpro" (noreq)))
  41.   (set #hd_run 0)
  42.   ) ; end if
  43.  
  44. (set #helpdisk
  45.   (cat
  46.     "Installation from diskettes requires the disks to be named exactly"
  47.     " as requested. If you have created the disks from the Aminet archives,"
  48.     " just rename them properly before running the installer."
  49.     )
  50.   )
  51.  
  52. (select
  53.   (askchoice
  54.     (prompt "Please select the type of installation you want to perform:")
  55.     (help
  56.       (cat "Install the GRAAL 2.2 system:\n\n"
  57.         "Choose this if you have not installed or used GRAAL before,"
  58.         " or if you want to install the new demo adventure"
  59.         " or the updated manual.\n\n"
  60.         "Update a development drawer:\n\n"
  61.         "Choose this if you just want to update the GRAAL tools and"
  62.         " documentation in an existing directory, without harming the rest"
  63.         " of its contents."
  64.         ) ; end cat
  65.       ) ; end help
  66.     (choices
  67.       "Install the GRAAL 2.2 system"
  68.       "Update a development drawer"
  69.       ) ; end choices
  70.     (default 0)
  71.     ) ; end askdir
  72.  
  73.   ( ; Installation sequence
  74.     (complete 5)
  75.     (set #instoptions
  76.       (askoptions
  77.         (prompt "Please select the parts you wish to install:")
  78.         (help
  79.           (cat
  80.             "All selected parts will be copied to the same (new)"
  81.             " hard disk drawer.\n\n"
  82.             "Demo Adventure:\n\n"
  83.             "This installs the graal driver program and all files"
  84.             " necessary to run the demo adventure.\n\n"
  85.             "Developer files:\n\n"
  86.             "This installs all programs and documentation necessary"
  87.             " to develop GRAAL adventures.\n\n"
  88.             "Manual\n\n"
  89.             "This installs the GRAAL Manual.\n\n"
  90.             ) ; end cat
  91.           ) ; end help
  92.           (choices
  93.             "Demo adventure"
  94.             "Developer files"
  95.             "GRAAL 2.2 Manual"
  96.             ) ; end choices
  97.         ) ; end askoptions
  98.       ) ; end set #instoptions
  99.     ; 
  100.     ; Set the installation directory
  101.     ; 
  102.     (complete 10)
  103.     (set #instdir
  104.       (askdir
  105.         (prompt
  106.           (cat
  107.             "Please select the place where GRAAL should be installed."
  108.             " A new drawer called GRAAL_2 will be created in the chosen"
  109.             " location."
  110.             ) ; end cat
  111.           ) ; end prompt
  112.         (help
  113.           (cat
  114.             "You do not need to make any assigns to use GRAAL. However,"
  115.             " keeping the GRAAL tools and the adventure script files in"
  116.             " the same drawer is important.)"
  117.             ) ; end cat
  118.           ) ; end help
  119.         (default @default-dest)
  120.         ) ; end askdir
  121.       ) ; end set #instdir
  122.     ; 
  123.     ; Check if drawer needs to be created
  124.     ; 
  125.     (complete 15)
  126.     (set #instdir (tackon #instdir "GRAAL_2"))
  127.     (set @default-dest #instdir)
  128.     (if (not (exists #instdir))
  129.       (makedir #instdir (infos))
  130.       ) ; end if
  131.  
  132.     (if (= #hd_run 0)
  133.       (
  134.       ; 
  135.       ; Check if we should install demo files
  136.       ; 
  137.       (if (in #instoptions 0)
  138.         ( ; demo installation sequence - fd
  139.           (askdisk
  140.             (prompt #diskprompt_a)
  141.             (help #helpdisk)
  142.             (dest #diskname_a)
  143.             ) ; end askdisk
  144.           (copyfiles
  145.             (source #source_a)
  146.             (dest #instdir)
  147.             (all)
  148.             (infos)
  149.             ) ; end copyfiles
  150.           (askdisk
  151.             (prompt #diskprompt_b)
  152.             (help #helpdisk)
  153.             (dest #diskname_b)
  154.             ) ; end askdisk
  155.           (copyfiles
  156.             (source #source_b)
  157.             (dest #instdir)
  158.             (all)
  159.             (infos)
  160.             ) ; end copyfiles
  161.           ) ; end demo installation sequence - fd
  162.         ) ; end if instoptions = demofiles
  163.       ; 
  164.       ; Check if we should install developer files
  165.       ; 
  166.       (complete 50)
  167.       (if (in #instoptions 1)
  168.         ( ; developer installation sequence - fd
  169.           (if (not (exists (tackon #instdir "GRAAL_2")))
  170.             (
  171.             ( ; install driver
  172.               (askdisk
  173.                 (prompt #diskprompt_a)
  174.                 (help #helpdisk)
  175.                 (dest #diskname_a)
  176.                 ) ; end askdisk
  177.               (copyfiles
  178.                 (source #source_a)
  179.                 (dest #instdir)
  180.                 (choices "GRAAL_2")
  181.                 (infos)
  182.                 ) ; end copyfiles
  183.               ) ; end install driver
  184.             )
  185.             ) ; end if
  186.           (askdisk
  187.             (prompt #diskprompt_c)
  188.             (help #helpdisk)
  189.             (dest #diskname_c)
  190.             ) ; end askdisk
  191.           (copyfiles
  192.             (source #source_c)
  193.             (dest #instdir)
  194.             (choices
  195.               "GRAAL_Editor"
  196.               "GRAAL.guide"
  197.               "GRAAL22.readme"
  198.               ) ; end choices
  199.             (infos)
  200.             ) ; end copyfiles
  201.           (askdisk
  202.             (prompt #diskprompt_d)
  203.             (help #helpdisk)
  204.             (dest #diskname_d)
  205.             ) ; end askdisk
  206.           (copyfiles
  207.             (source #source_d)
  208.             (dest #instdir)
  209.             (choices
  210.               "gpro"
  211.               "gdc"
  212.               "grep"
  213.               ) ; end choices
  214.             (infos)
  215.             ) ; end copyfiles
  216.           ) ; end developer installation sequence - fd
  217.         ) ; end if instoptions = developerfiles
  218.       ; 
  219.       ; Check if we should install manual
  220.       ; 
  221.       (complete 90)
  222.       (if (in #instoptions 2)
  223.         ( ; manual installation sequence - fd
  224.           (askdisk
  225.             (prompt #diskprompt_d)
  226.             (help #helpdisk)
  227.             (dest #diskname_d)
  228.             ) ; end askdisk
  229.           (copyfiles
  230.             (source #source_d)
  231.             (dest #instdir)
  232.             (choices "GRAAL_Manual.text")
  233.             (infos)
  234.             ) ; end copyfiles
  235.           ) ; end manual installation sequence - fd
  236.         ) ; end if instoptions = manual
  237.         )
  238.       ) ; end if #hd_run = 0
  239.     ; 
  240.     ; "hd" installation - all files copied from the installation
  241.     ; script's directory!!!
  242.     ; 
  243.     (if (= #hd_run 1)
  244.       ( ; hd installation sequence
  245.       (if (in #instoptions 0)
  246.         ( ; demo installation sequence - hd
  247.           (copyfiles
  248.             (source #path)
  249.             (dest #instdir)
  250.             (all)
  251.             (infos)
  252.             ) ; end copyfiles
  253.           ) ; end demo installation sequence - hd
  254.         ) ; end if instoptions = demofiles
  255.       ; 
  256.       ; Check if we should install developer files
  257.       ; 
  258.       (complete 50)
  259.       (if (in #instoptions 1)
  260.         ( ; developer installation sequence - hd
  261.           (if (not (exists (tackon #instdir "GRAAL_Editor")))
  262.             (
  263.             (copyfiles
  264.               (source #path)
  265.               (dest #instdir)
  266.               (choices
  267.                 "GRAAL_2"
  268.                 "GRAAL_Editor"
  269.                 "GRAAL.guide"
  270.                 "GRAAL22.readme"
  271.                 ) ; end choices
  272.               (infos)
  273.               ) ; end copyfiles
  274.             )
  275.             ) ; end if not copied before
  276.           ) ; end developer installation sequence - hd
  277.         ) ; end if instoptions = developer files
  278.       ; 
  279.       ; Check if we should install manual
  280.       ; 
  281.       (complete 90)
  282.       (if (in #instoptions 2)
  283.         ( ; manual installation sequence - hd
  284.           (copyfiles
  285.             (source #path)
  286.             (dest #instdir)
  287.             (choices "GRAAL_Manual.text")
  288.             (infos)
  289.             ) ; end copyfiles
  290.           ) ; end manual installation sequence - hd
  291.         ) ; end if instoptions = manual
  292.         ) ; end hd installation sequence
  293.       ) ; end if #hd_run = 1
  294.  
  295.     ) ; end of installation sequence
  296.  
  297.   ( ; Update sequence
  298.     (complete 5)
  299.     (set #instdir
  300.       (askdir
  301.         (prompt
  302.           (cat
  303.             "Please point to the development directory to be updated with"
  304.             " the new GRAAL tools and documentation."
  305.             ) ; end cat
  306.           ) ; end prompt
  307.         (help
  308.           (cat
  309.             "All old GRAAL tools and documentation files will be removed"
  310.             " and replaced with the new versions. However, renamed copies of"
  311.             " GRAAL_2 (or the older versions GRAAL_Dev or GRAAL_Run) will NOT"
  312.             " be handled automatically.\n\n"
  313.             "When the installation has finished, you must deal with them"
  314.             " and optionally rename the new GRAAL_2 file to your liking"
  315.             " manually."
  316.             ) ; end cat
  317.           ) ; end help
  318.         (default @default-dest)
  319.         ) ; end askdir
  320.       ) ; end set #instdir
  321.     (set @default-dest #instdir)
  322.     (complete 10)
  323.     (delete (tackon #instdir "GRAAL_2") (infos))
  324.     (delete (tackon #instdir "GRAAL_Run") (infos))
  325.     (delete (tackon #instdir "GRAAL_Dev") (infos))
  326.     (delete (tackon #instdir "GRAAL_Manual.text") (infos))
  327.     (delete (tackon #instdir "GRAAL_Editor") (infos))
  328.     (delete (tackon #instdir "GRAAL.guide") (infos))
  329.     (if (= #hd_run 0)
  330.       ( ; developer update sequence - fd
  331.         (askdisk
  332.           (prompt #diskprompt_a)
  333.           (help #helpdisk)
  334.           (dest #diskname_a)
  335.           ) ; end askdisk
  336.         (copyfiles
  337.           (source #source_a)
  338.           (dest #instdir)
  339.           (choices "GRAAL_2")
  340.           (infos)
  341.           ) ; end copyfiles
  342.         (complete 30)
  343.         (askdisk
  344.           (prompt #diskprompt_c)
  345.           (help #helpdisk)
  346.           (dest #diskname_c)
  347.           ) ; end askdisk
  348.         (copyfiles
  349.           (source #source_c)
  350.           (dest #instdir)
  351.           (all)
  352.           (infos)
  353.           ) ; end copyfiles
  354.         (complete 70)
  355.         (askdisk
  356.           (prompt #diskprompt_d)
  357.           (help #helpdisk)
  358.           (dest #diskname_d)
  359.           ) ; end askdisk
  360.         (copyfiles
  361.           (source #source_d)
  362.           (dest #instdir)
  363.           (choices
  364.             "gpro"
  365.             "gdc"
  366.             "grep"
  367.             ) ; end choices
  368.           (infos)
  369.           ) ; end copyfiles
  370.         ) ; end developer update sequence - fd
  371.       ) ; end if hd_run = 0
  372.     (if (= #hd_run 1)
  373.       ( ; developer update sequence - hd
  374.         (copyfiles
  375.           (source #path)
  376.           (dest #instdir)
  377.           (choices
  378.             "GRAAL_2"
  379.             "GRAAL_Editor"
  380.             "GRAAL.guide"
  381.             "GRAAL22.readme"
  382.             "gpro"
  383.             "gdc"
  384.             "grep"
  385.             ) ; end choices
  386.           (infos)
  387.           ) ; end copyfiles
  388.         ) ; end developer update sequence - hd
  389.       ) ; end if hd_run = 1
  390.     ) ; end of update sequence
  391.  
  392.   ) ; end select
  393.  
  394. (complete 100)
  395.