home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / debug-utils / pv / installpv < prev    next >
Encoding:
Text File  |  1992-11-02  |  13.9 KB  |  578 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.42
  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.42 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" "History" "pv.bugs" "HowToGetTheSource" "HowToInstall")
  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.     (files)
  235.     (if copy20
  236.         (pattern "PowerVisor-(help|help.qq|ctrl|errors|menus)")
  237.         (pattern "PowerVisor-(help|help.qq|ctrl|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.  
  260. (complete 48)
  261.  
  262. (if
  263.     (askbool
  264.         (prompt
  265.             "Do you want the standard PowerVisor-startup file?"
  266.         )
  267.         (help
  268.             "This file is a PowerVisor script that is automatically executed when "
  269.             "PowerVisor starts. This file is not really needed, but many useful "
  270.             "new aliases and features are installed there so I highly recommend that "
  271.             "you copy this file.\n"
  272.             "If you already have a PowerVisor-script, this old script will be renamed "
  273.             "to PowerVisor-script.bak so you don't loose any work.\n"
  274.             "Note that this script uses various other scripts so you should also copy "
  275.             "the PowerVisor script files (next question) if you copy this file."
  276.         )
  277.         (default 1)
  278.     )
  279.     (
  280.         (set sd
  281.             (if together
  282.                 (tackon PVName "s")
  283.                 "s:"
  284.             )
  285.         )
  286.         (if (exists (tackon sd "PowerVisor-startup"))
  287.             (rename (tackon sd "PowerVisor-startup") (tackon sd "PowerVisor-startup.bak"))
  288.         )
  289.         (copyfiles
  290.             (prompt "Copying startup script file...")
  291.             (help @copyfiles-help)
  292.             (source (tackon SourceName "s/PowerVisor-startup"))
  293.             (dest sd)
  294.             (infos)
  295.         )
  296.     )
  297. )
  298.  
  299. (complete 56)
  300.  
  301. (copyfiles
  302.     (prompt "Copying PowerVisor script files...")
  303.     (help
  304.         "Copy various example script files (ARexx and PowerVisor scripts). "
  305.         "Note that some of these scripts are needed by the standard PowerVisor-startup "
  306.         "script, so you should copy these script files if you have copied the "
  307.         "PowerVisor-startup file (previous question)."
  308.     )
  309.     (source (tackon SourceName "s/pv"))
  310.     (dest
  311.         (if together
  312.             (tackon PVName "s/pv")
  313.             "s:pv"
  314.         )
  315.     )
  316.     (all)
  317.     (infos)
  318.     (confirm)
  319. )
  320.  
  321. (complete 64)
  322.  
  323. (set answer1
  324.     (askbool
  325.         (prompt "Should the Example Files be installed?")
  326.         (help
  327.             "You can use the examples to learn how to use PowerVisor. "
  328.             "The manual refers to some of these examples but they are not "
  329.             "really needed.\n"
  330.             "Some other source files (to use the powervisor.library from within "
  331.             "your own programs and the source for the previous examples) are also "
  332.             "copied."
  333.         )
  334.         (default 1)
  335.     )
  336. )
  337.  
  338. (if answer1
  339.     (
  340.         (copyfiles
  341.             (prompt "Copying example files...")
  342.             (help @copyfiles-help)
  343.             (source (tackon SourceName "Examples"))
  344.             (dest (tackon PVName "Examples"))
  345.             (all)
  346.             (infos)
  347.         )
  348.         (copyfiles
  349.             (prompt "Copying source files for examples...")
  350.             (help @copyfiles-help)
  351.             (source (tackon SourceName "Source"))
  352.             (dest (tackon PVName "Source"))
  353.             (all)
  354.             (infos)
  355.         )
  356.         (copyfiles
  357.             (prompt "Copying PowerVisor library source files...")
  358.             (help @copyfiles-help)
  359.             (source (tackon SourceName "PowerVisorLib"))
  360.             (dest (tackon PVName "PowerVisorLib"))
  361.             (all)
  362.             (infos)
  363.         )
  364.     )
  365. )
  366.  
  367. (complete 72)
  368.  
  369. (set answer1
  370.     (askbool
  371.         (prompt "Do you want the PowerVisor manual (warning: about 800 Kbytes)?")
  372.         (help
  373.             "These manual files are in hypertext format for the AmigaGuide or MultiView"
  374.             "program. If you don't have one of these programs you can still read them "
  375.             "as normal ascii files. If you have MultiView you can use this "
  376.             "manual as a better online help system (highly recommended!)\n"
  377.             "Note that this manual is a far better way to learn how to use PowerVisor "
  378.             "than the previously installed online help file."
  379.         )
  380.         (default 1)
  381.     )
  382. )
  383.  
  384. (if answer1
  385.     (
  386.         (while (not (exists (tackon SourceName "docs")))
  387.             (set SourceName
  388.                 (tackon
  389.                     (askdir
  390.                         (prompt "Where can I find the PowerVisor manual? (Insert right "
  391.                                         "disk if necessary, disk must contain a 'Docs' subdirectory)")
  392.                         (help @askdir-help)
  393.                         (default (pathonly @icon))
  394.                     )
  395.                     ""
  396.                 )
  397.             )
  398.         )
  399.  
  400.         (copyfiles
  401.             (prompt "Copying manual...")
  402.             (help @copyfiles-help)
  403.             (source (tackon SourceName "docs"))
  404.             (dest (tackon PVName "docs"))
  405.             (all)
  406.             (infos)
  407.         )
  408.  
  409.         (if (exists (tackon (tackon PVName "docs") "CommandRef.guide.qq"))
  410.             (
  411.                 (run
  412.                     (cat
  413.                         "\""
  414.                         (tackon (tackon PVName "c") "dc")
  415.                         "\" \""
  416.                         (tackon (tackon PVName "docs") "CommandRef.guide.qq")
  417.                         "\" \""
  418.                         (tackon (tackon PVName "docs") "CommandRef.guide")
  419.                         "\" 4"
  420.                     )
  421.                 )
  422.                 (delete (tackon (tackon PVName "docs") "CommandRef.guide.qq"))
  423.                 (rename
  424.                     (tackon (tackon PVName "docs") "CommandRef.guide.qq.info")
  425.                     (tackon (tackon PVName "docs") "CommandRef.guide.info")
  426.                 )
  427.             )
  428.         )
  429.  
  430.         (if
  431.             (askbool
  432.                 (prompt
  433.                     "Do you want to convert the AmigaGuide manual to a somewhat more "
  434.                     "readable document format? (only do this if you don't have AmigaGuide "
  435.                     "or MultiView)"
  436.                 )
  437.                 (help
  438.                     "When you choose 'yes' all manual files will be converted to a more "
  439.                     "readable format. This is only useful if you don't have AmigaGuide or "
  440.                     "MultiView and "
  441.                     "you want to be able to comfortably read the manual with a normal text "
  442.                     "reader.\n"
  443.                     "Note that you can always convert these manuals at a later time. "
  444.                     "Simply use the 'convertguide2doc' utility in the 'docs' subdirectory "
  445.                     "to do this (redirect the output of this utility to the desired file)."
  446.                 )
  447.                 (default 0)
  448.             )
  449.  
  450.             (
  451.                 (working
  452.                     (prompt "Converting manual...")
  453.                 )
  454.                 (foreach (tackon PVName "docs") "#?.guide"
  455.                     (
  456.                         (execute
  457.                             (cat
  458.                                 "\""
  459.                                 (tackon (tackon PVName "docs") "ConvertDoc.script")
  460.                                 "\" \""
  461.                                 (tackon PVName "docs")
  462.                                 "\" \""
  463.                                 @each-name
  464.                                 "\""
  465.                             )
  466.                         )
  467.                         (tooltype
  468.                             (dest (cat (tackon (tackon PVName "docs") @each-name) ".info"))
  469.                             (noposition)
  470.                         )
  471.                     )
  472.                 )
  473.             )
  474.  
  475.         )
  476.  
  477.         (delete (tackon (tackon PVName "docs") "doc.info"))
  478.         (delete (tackon (tackon PVName "docs") "ConvertDoc.script"))
  479.  
  480.     )
  481. )
  482.  
  483. (complete 80)
  484.  
  485. (set answer1
  486.     (askbool
  487.         (prompt "Do you want the PowerVisor develop files?")
  488.         (help
  489.             "You only need these files if you plan to write sophisticated"
  490.             "PowerVisor scripts (machinelanguage or C scripts). These files"
  491.             "are certainly not healthy for the beginning PowerVisor user."
  492.         )
  493.         (default 0)
  494.     )
  495. )
  496.  
  497. (if answer1
  498.     (
  499.         (while (not (exists (tackon SourceName "PVDevelop")))
  500.             (set SourceName
  501.                 (tackon
  502.                     (askdir
  503.                         (prompt "Where can I find the PV develop files? (Insert right "
  504.                                         "disk if necessary, disk must contain a 'PVDevelop' subdirectory)")
  505.                         (help @askdir-help)
  506.                         (default (pathonly @icon))
  507.                     )
  508.                     ""
  509.                 )
  510.             )
  511.         )
  512.  
  513.         (copyfiles
  514.             (prompt "Copying PowerVisor develop files...")
  515.             (help @copyfiles-help)
  516.             (source (tackon SourceName "PVDevelop"))
  517.             (dest (tackon PVName "PVDevelop"))
  518.             (all)
  519.             (infos)
  520.         )
  521.     )
  522. )
  523.  
  524. (while (not (exists (tackon SourceName "c")))
  525.     (set SourceName
  526.         (tackon
  527.             (askdir
  528.                 (prompt "Please insert the first PowerVisor disk")
  529.                 (help @askdir-help)
  530.                 (default (pathonly @icon))
  531.             )
  532.             ""
  533.         )
  534.     )
  535. )
  536.  
  537. (complete 88)
  538.  
  539. (set fddir
  540.     (askdir
  541.         (prompt "Where are your fd files?")
  542.         (help
  543.             "Fd-files are files containing information about the Amiga libraries. "
  544.             "PowerVisor makes very good use of these files so they are highly recommended. "
  545.             "Simply answer a dummy directory (like 'ram:') if you don't have these files. "
  546.             "Note that you can find the AmigaDOS 1.3 fd-files on the Extras 1.3 disk."
  547.         )
  548.         (default "work:fd")
  549.     )
  550. )
  551.  
  552. (complete 96)
  553.  
  554. (delete (tackon (tackon PVName "c") "dc"))
  555.  
  556. (startup "PowerVisor"
  557.     (prompt
  558.         "Some instructions need to be added to the \"S:user-startup\" "
  559.         "so that your system will be properly configured to use PowerVisor.")
  560.     (help @startup-help)
  561.     (if (and together (not kick13))
  562.         (command
  563.             "Assign PV: \"" PVName "\"\n"
  564.             "Assign FD: \"" fddir "\"\n"
  565.             "Assign LIBS: \"" (tackon PVName "libs") "\" add\n"
  566.             "Assign S: \"" (tackon PVName "s") "\" add\n"
  567.             "Path pv:c add\n"
  568.         )
  569.         (command
  570.             "Assign PV: \"" PVName "\"\n"
  571.             "Assign FD: \"" fddir "\"\n"
  572.             "Path pv:c add\n"
  573.         )
  574.     )
  575. )
  576.  
  577. (exit)
  578.