home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / mem_util / pwrvisr1.lha / InstallPV < prev    next >
Text File  |  1992-09-26  |  14KB  |  554 lines

  1. ;PowerVisor installation script for AmigaDOS 2.0 ('Installer' only
  2. ;works in AmigaDOS 2.0. I didn't realize this when I wrote this script.
  3. ;Therefore this script is written as if it is possible to run from
  4. ;within AmigaDOS 1.3. Maybe someone will write an Installer program that
  5. ;works on AmigaDOS 1.3).
  6. ;
  7. ;Normally this script expects all files in the same source directory. Since
  8. ;this is not possible when you don't have a harddisk, you can also put
  9. ;the document files (the 'docs' subdirectory) and the 'PVDevelop'
  10. ;subdirectory on another disk. This script will automatically ask for
  11. ;the right disk.
  12. ;
  13. ;PowerVisor V1.20
  14.  
  15. (complete 0)
  16.  
  17.  
  18. (set kick13 (< (/ (getversion) 65536) 37))
  19.  
  20. (set PVName
  21.     (tackon
  22.         (askdir
  23.             (prompt "In which disk or drawer should PowerVisor V1.20 be installed?")
  24.             (help @askdir-help)
  25.             (default @default-dest)
  26.         )
  27.         "PV"
  28.     )
  29. )
  30.  
  31. (set SourceName
  32.     (tackon
  33.         (askdir
  34.             (prompt "Where can I find the uninstalled PowerVisor?")
  35.             (help @askdir-help)
  36.             (default (pathonly @icon))
  37.         )
  38.         ""
  39.     )
  40. )
  41.  
  42. (makedir PVName (infos))
  43. ;(makeassign "PV" PVName)
  44. (set @default-dest PVName)
  45.  
  46. (set together
  47.     (not
  48.         (askchoice
  49.             (prompt "Do you want all PowerVisor files together in the same subdirectory?")
  50.             (help
  51.                 "If you select 'yes' ALL PowerVisor files will be placed in the \"" PVName
  52.                 "\" subdirectory. This install script will not copy files to other places "
  53.                 "on your disk.\n\n"
  54.                 "The advantage of this is that you "
  55.                 "can easily find all files belonging to PowerVisor. The disadvantage is that "
  56.                 "you have to use the AmigaDOS 2.0 multiple assign feature for libs: and s: "
  57.                 "so that PowerVisor can find the powervisor.library and the scripts. "
  58.                 "These assigns are automatically added to your s:user-startup file (later "
  59.                 "on) so you need not worry about these. If you have AmigaDOS 1.3, you "
  60.                 "better select 'no', since you can't use the multiple assign feature.\n\n"
  61.                 "If you select 'no' the PowerVisor files will be put in the right subdirectories "
  62.                 "(libraries in libs:, scripts in s:, ...)"
  63.             )
  64.             (choices "Yes" "No")
  65.             (default 1)
  66.         )
  67.     )
  68. )
  69.  
  70. (set otherkick
  71.     (askbool
  72.         (prompt
  73.             (if kick13
  74.                 "You have AmigaDOS 1.3, do you want the AmigaDOS 2.0 files and executables?"
  75.                 "You have AmigaDOS 2.0, do you want the AmigaDOS 1.3 files and executables?"
  76.             )
  77.         )
  78.         (help
  79.             (if kick13
  80.                 (cat
  81.                     "You have AmigaDOS 1.3. If you choose 'yes' this install script will "
  82.                     "also copy all files needed for the AmigaDOS 2.0 version of PowerVisor. "
  83.                     "The AmigaDOS 2.0 executables in the \"" (tackon PVName "c") "\" subdirectory will "
  84.                     "all end with '20'."
  85.                 )
  86.                 (cat
  87.                     "You have AmigaDOS 2.0. If you choose 'yes' this install script will "
  88.                     "also copy all files needed for the AmigaDOS 1.3 version of PowerVisor. "
  89.                     "The AmigaDOS 1.3 executables in the \"" (tackon PVName "c") "\" subdirectory will "
  90.                     "all end with '13'.\n"
  91.                     "In the AmigaDOS 2.0 version of PowerVisor, the online help and error files "
  92.                     "are located in the same directory as the PowerVisor executable. This feature "
  93.                     "is not possible in AmigaDOS 1.3 (PROGDIR: is a new feature in AmigaDOS 2.0). "
  94.                     "If you choose 'yes' this install script will therefore copy the online "
  95.                     "help and error files to the \""
  96.                         (if together
  97.                             (tackon PVName "s")
  98.                             "s:"
  99.                         )
  100.                     "\" directory so that the AmigaDOS 1.3 version has access to these files. "
  101.                     "Note that this is not the recommended place for these files if you have "
  102.                     "AmigaDOS 2.0."
  103.                 )
  104.             )
  105.         )
  106.         (default 0)
  107.     )
  108. )
  109.  
  110. (set copy13 (if kick13 1 otherkick))
  111. (set copy20 (if kick13 otherkick 1))
  112.  
  113. (copyfiles
  114.     (prompt "Copying various files...")
  115.     (help @copyfiles-help)
  116.     (source SourceName)
  117.     (dest PVName)
  118.     (choices "ReadThisFirst" "pv.bugs" "HowToGetTheSource")
  119.     (infos)
  120. )
  121.  
  122. (complete 8)
  123.  
  124. (if copy13
  125.     (copyfiles
  126.         (prompt "Copying AmigaDOS 1.3 executables...")
  127.         (help @copyfiles-help)
  128.         (source (tackon SourceName "c"))
  129.         (dest (tackon PVName "c"))
  130.         (choices "pv13" "MStruct13" "ArcFiles13" "Help13" "MakeHelp13" "dc")
  131.         (infos)
  132.     )
  133. )
  134.  
  135. (complete 16)
  136.  
  137. (if copy20
  138.     (copyfiles
  139.         (prompt "Copying AmigaDOS 2.0 executables...")
  140.         (help @copyfiles-help)
  141.         (source (tackon SourceName "c"))
  142.         (dest (tackon PVName "c"))
  143.         (choices "pv" "MStruct" "ArcFiles" "Help" "makeHelp" "dc")
  144.         (infos)
  145.     )
  146. )
  147.  
  148. (complete 24)
  149.  
  150. (if (and copy20 kick13)
  151.     (
  152.         (foreach (tackon PVName "c") "~(#?13)"
  153.             (rename @each-name (cat @each-name "20")
  154.             )
  155.         )
  156.     )
  157. )
  158. (if kick13
  159.     (
  160.         (rename "pv13" "pv")
  161.         (rename "MStruct13" "MStruct")
  162.         (rename "MakeHelp13" "MakeHelp")
  163.         (rename "ArcFiles13" "ArcFiles")
  164.         (rename "Help13" "Help")
  165.     )
  166. )
  167.  
  168. (complete 32)
  169.  
  170. (if together
  171.     (
  172.         (copyfiles
  173.             (source (tackon SourceName "libs/powervisor.library"))
  174.             (dest (tackon PVName "libs"))
  175.         )
  176.         (copyfiles
  177.             (source
  178.                 (tackon SourceName
  179.                     (if kick13 "libs13/reqtools.library" "libs/reqtools.library")
  180.                 )
  181.             )
  182.             (dest (tackon PVName "libs"))
  183.         )
  184.     )
  185.     (
  186.         (copylib
  187.             (prompt "Should I copy the newer powervisor.library?")
  188.             (help
  189.                 "Note that PowerVisor needs this library to run."
  190.             )
  191.             (source (tackon SourceName "libs/powervisor.library"))
  192.             (dest "LIBS:")
  193.             (confirm)
  194.         )
  195.         (copylib
  196.             (prompt "Should I copy the newer reqtools.library? (© Nico François)")
  197.             (help
  198.                 "PowerVisor does not really need this library, but makes rather "
  199.                 "good use of it. And anyway, it is a very good library so you really "
  200.                 "should have it."
  201.             )
  202.             (source
  203.                 (tackon SourceName
  204.                     (if kick13 "libs13/reqtools.library" "libs/reqtools.library")
  205.                 )
  206.             )
  207.             (dest "LIBS:")
  208.             (confirm)
  209.         )
  210.     )
  211. )
  212.  
  213. (complete 40)
  214.  
  215. (set OnlineHelpDest
  216.     (if (or kick13 copy13)
  217.         (if together
  218.             (tackon PVName "s")
  219.             "s:"
  220.         )
  221.         (tackon PVName "c")
  222.     )
  223. )
  224.  
  225. (copyfiles
  226.     (prompt "Copying online help and error files...")
  227.     (help
  228.         "These files are needed by PowerVisor for the online help and "
  229.         "for readable error messages. You don't strictly need them, but "
  230.         "they make life a lot easier."
  231.     )
  232.     (source (tackon SourceName "s"))
  233.     (dest OnlineHelpDest)
  234.     (if copy20
  235.         (choices "PowerVisor-help.qq" "PowerVisor-ctrl" "PowerVisor-errors"
  236.                  "PowerVisor-menus")
  237.         (choices "PowerVisor-help.qq" "PowerVisor-ctrl" "PowerVisor-errors")
  238.     )
  239.     (infos)
  240.     (confirm)
  241. )
  242.  
  243. (if (exists (tackon OnlineHelpDest "PowerVisor-help.qq"))
  244.     (
  245.         (run
  246.             (cat
  247.                 "\""
  248.                 (tackon (tackon PVName "c") "dc")
  249.                 "\" \""
  250.                 (tackon OnlineHelpDest "PowerVisor-help.qq")
  251.                 "\" \""
  252.                 (tackon OnlineHelpDest "PowerVisor-help")
  253.                 "\" 4"
  254.             )
  255.         )
  256.         (delete (tackon OnlineHelpDest "PowerVisor-help.qq"))
  257.     )
  258. )
  259. (delete (tackon (tackon PVName "c") "dc"))
  260.  
  261. (complete 48)
  262.  
  263. (if
  264.     (askbool
  265.         (prompt
  266.             "Do you want the standard PowerVisor-startup file?"
  267.         )
  268.         (help
  269.             "This file is a PowerVisor script that is automatically executed when "
  270.             "PowerVisor starts. This file is not really needed, but many useful "
  271.             "new aliases and features are installed there so I highly recommend that "
  272.             "you copy this file.\n"
  273.             "If you already have a PowerVisor-script, this old script will be renamed "
  274.             "to PowerVisor-script.bak so you don't loose any work.\n"
  275.             "Note that this script uses various other scripts so you should also copy "
  276.             "the PowerVisor script files (next question) if you copy this file."
  277.         )
  278.         (default 1)
  279.     )
  280.     (
  281.         (set sd
  282.             (if together
  283.                 (tackon PVName "s")
  284.                 "s:"
  285.             )
  286.         )
  287.         (if (exists (tackon sd "PowerVisor-startup"))
  288.             (rename (tackon sd "PowerVisor-startup") (tackon sd "PowerVisor-startup.bak"))
  289.         )
  290.         (copyfiles
  291.             (prompt "Copying startup script file...")
  292.             (help @copyfiles-help)
  293.             (source (tackon SourceName "s/PowerVisor-startup"))
  294.             (dest sd)
  295.             (infos)
  296.         )
  297.     )
  298. )
  299.  
  300. (complete 56)
  301.  
  302. (copyfiles
  303.     (prompt "Copying PowerVisor script files...")
  304.     (help
  305.         "Copy various example script files (ARexx and PowerVisor scripts). "
  306.         "Note that some of these scripts are needed by the standard PowerVisor-startup "
  307.         "script, so you should copy these script files if you have copied the "
  308.         "PowerVisor-startup file (previous question)."
  309.     )
  310.     (source (tackon SourceName "s/pv"))
  311.     (dest
  312.         (if together
  313.             (tackon PVName "s/pv")
  314.             "s:pv"
  315.         )
  316.     )
  317.     (all)
  318.     (infos)
  319.     (confirm)
  320. )
  321.  
  322. (complete 64)
  323.  
  324. (set answer1
  325.     (askbool
  326.         (prompt "Should the Example Files be installed?")
  327.         (help
  328.             "You can use the examples to learn how to use PowerVisor. "
  329.             "The manual refers to some of these examples but they are not "
  330.             "really needed.\n"
  331.             "Some other source files (to use the powervisor.library from within "
  332.             "your own programs and the source for the previous examples) are also "
  333.             "copied."
  334.         )
  335.         (default 1)
  336.     )
  337. )
  338.  
  339. (if answer1
  340.     (
  341.         (copyfiles
  342.             (prompt "Copying example files...")
  343.             (help @copyfiles-help)
  344.             (source (tackon SourceName "Examples"))
  345.             (dest (tackon PVName "Examples"))
  346.             (all)
  347.             (infos)
  348.         )
  349.         (copyfiles
  350.             (prompt "Copying source files for examples...")
  351.             (help @copyfiles-help)
  352.             (source (tackon SourceName "Source"))
  353.             (dest (tackon PVName "Source"))
  354.             (all)
  355.             (infos)
  356.         )
  357.         (copyfiles
  358.             (prompt "Copying PowerVisor library source files...")
  359.             (help @copyfiles-help)
  360.             (source (tackon SourceName "PowerVisorLib"))
  361.             (dest (tackon PVName "PowerVisorLib"))
  362.             (all)
  363.             (infos)
  364.         )
  365.     )
  366. )
  367.  
  368. (complete 72)
  369.  
  370. (set answer1
  371.     (askbool
  372.         (prompt "Do you want the PowerVisor manual (warning: about 800 Kbytes)?")
  373.         (help
  374.             "These manual files are in hypertext format for the AmigaGuide "
  375.             "program. If you don't have AmigaGuide you can still read them "
  376.             "as normal ascii files. If you have AmigaGuide you can use this "
  377.             "manual as a better online help system (highly recommended!)\n"
  378.             "Note that this manual is a far better way to learn how to use PowerVisor "
  379.             "than the previously installed online help file."
  380.         )
  381.         (default 1)
  382.     )
  383. )
  384.  
  385. (if answer1
  386.     (
  387.         (while (not (exists (tackon SourceName "docs")))
  388.             (set SourceName
  389.                 (tackon
  390.                     (askdir
  391.                         (prompt "Where can I find the PowerVisor manual? (Insert right "
  392.                                         "disk if necessary, disk must contain a 'Docs' subdirectory)")
  393.                         (help @askdir-help)
  394.                         (default (pathonly @icon))
  395.                     )
  396.                     ""
  397.                 )
  398.             )
  399.         )
  400.  
  401.         (copyfiles
  402.             (prompt "Copying manual...")
  403.             (help @copyfiles-help)
  404.             (source (tackon SourceName "docs"))
  405.             (dest (tackon PVName "docs"))
  406.             (all)
  407.             (infos)
  408.         )
  409.  
  410.         (if
  411.             (askbool
  412.                 (prompt
  413.                     "Do you want to convert the AmigaGuide manual to a somewhat more "
  414.                     "readable document format? (only do this if you don't have AmigaGuide)"
  415.                 )
  416.                 (help
  417.                     "When you choose 'yes' all manual files will be converted to a more "
  418.                     "readable format. This is only useful if you don't have AmigaGuide and "
  419.                     "you want to be able to comfortably read the manual with a normal text "
  420.                     "reader.\n"
  421.                     "Note that you can always convert these manuals at a later time. "
  422.                     "Simply use the 'convertguide2doc' utility in the 'docs' subdirectory "
  423.                     "to do this (redirect the output of this utility to the desired file)."
  424.                 )
  425.                 (default 0)
  426.             )
  427.  
  428.             (
  429.                 (working
  430.                     (prompt "Converting manual...")
  431.                 )
  432.                 (foreach (tackon PVName "docs") "#?.guide"
  433.                     (
  434.                         (execute
  435.                             (cat
  436.                                 "\""
  437.                                 (tackon (tackon PVName "docs") "ConvertDoc.script")
  438.                                 "\" \""
  439.                                 (tackon PVName "docs")
  440.                                 "\" \""
  441.                                 @each-name
  442.                                 "\""
  443.                             )
  444.                         )
  445.                         (tooltype
  446.                             (dest (cat (tackon (tackon PVName "docs") @each-name) ".info"))
  447.                             (noposition)
  448.                         )
  449.                     )
  450.                 )
  451.             )
  452.  
  453.         )
  454.  
  455.         (delete (tackon (tackon PVName "docs") "doc.info"))
  456.         (delete (tackon (tackon PVName "docs") "ConvertDoc.script"))
  457.  
  458.     )
  459. )
  460.  
  461. (complete 80)
  462.  
  463. (set answer1
  464.     (askbool
  465.         (prompt "Do you want the PowerVisor develop files?")
  466.         (help
  467.             "You only need these files if you plan to write sophisticated"
  468.             "PowerVisor scripts (machinelanguage or C scripts). These files"
  469.             "are certainly not healthy for the beginning PowerVisor user."
  470.         )
  471.         (default 0)
  472.     )
  473. )
  474.  
  475. (if answer1
  476.     (
  477.         (while (not (exists (tackon SourceName "PVDevelop")))
  478.             (set SourceName
  479.                 (tackon
  480.                     (askdir
  481.                         (prompt "Where can I find the PV develop files? (Insert right "
  482.                                         "disk if necessary, disk must contain a 'PVDevelop' subdirectory)")
  483.                         (help @askdir-help)
  484.                         (default (pathonly @icon))
  485.                     )
  486.                     ""
  487.                 )
  488.             )
  489.         )
  490.  
  491.         (copyfiles
  492.             (prompt "Copying PowerVisor develop files...")
  493.             (help @copyfiles-help)
  494.             (source (tackon SourceName "PVDevelop"))
  495.             (dest (tackon PVName "PVDevelop"))
  496.             (all)
  497.             (infos)
  498.         )
  499.     )
  500. )
  501.  
  502. (while (not (exists (tackon SourceName "c")))
  503.     (set SourceName
  504.         (tackon
  505.             (askdir
  506.                 (prompt "Please insert the first PowerVisor disk")
  507.                 (help @askdir-help)
  508.                 (default (pathonly @icon))
  509.             )
  510.             ""
  511.         )
  512.     )
  513. )
  514.  
  515. (complete 88)
  516.  
  517. (set fddir
  518.     (askdir
  519.         (prompt "Where are your fd files?")
  520.         (help
  521.             "Fd-files are files containing information about the Amiga libraries. "
  522.             "PowerVisor makes very good use of these files so they are highly recommended. "
  523.             "Simply answer a dummy directory (like 'ram:') if you don't have these files. "
  524.             "Note that you can find the AmigaDOS 1.3 fd-files on the Extras 1.3 disk."
  525.         )
  526.         (default "work:fd")
  527.     )
  528. )
  529.  
  530. (complete 96)
  531.  
  532. (startup "PowerVisor"
  533.     (prompt
  534.         "Some instructions need to be added to the \"S:user-startup\" "
  535.         "so that your system will be properly configured to use PowerVisor.")
  536.     (help @startup-help)
  537.     (if (and together (not kick13))
  538.         (command
  539.             "Assign PV: \"" PVName "\"\n"
  540.             "Assign FD: \"" fddir "\"\n"
  541.             "Assign LIBS: \"" (tackon PVName "libs") "\" add\n"
  542.             "Assign S: \"" (tackon PVName "s") "\" add\n"
  543.             "Path pv:c add\n"
  544.         )
  545.         (command
  546.             "Assign PV: \"" PVName "\"\n"
  547.             "Assign FD: \"" fddir "\"\n"
  548.             "Path pv:c add\n"
  549.         )
  550.     )
  551. )
  552.  
  553. (exit)
  554.