home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / misc / emu / macv40.lha / InstallerScript < prev    next >
Encoding:
Text File  |  1994-02-15  |  13.2 KB  |  497 lines

  1. ;**************************************************
  2. ;
  3. ;$VER: MAC Emulation Installer v1.6 (14 Feb 1994)
  4. ;
  5. ; Title:
  6. ;    EMPLANT's MAC Emulation Software Installer
  7. ; Description:
  8. ;    The Commodore Installer Script for EMPLANT's
  9. ;    MAC emulation module software.
  10. ;
  11. ; Author:
  12. ;    Brian Walz & Jim Drew
  13. ;
  14. ;**************************************************
  15.  
  16. ; some useful variables
  17.    (set true 1)
  18.    (set false 0)
  19.    (set on true)
  20.    (set off false)
  21.    (set yes true)
  22.    (set no false)
  23.    (set is_a_file 1)
  24.    (set is_a_dir 2)
  25.    (set quote "\"")
  26.    (set newline "\n")
  27.    (set nothing "")
  28.    (set WB2 (< 2293760 (getversion "exec.library" (resident)))) ; true if under 2.0
  29.  
  30. ; set up our delete options
  31.    (delopts "AskUser" "OkNoDelete" "Force")
  32.  
  33.  
  34. ;****************************************
  35. ;***** FIGURE OUT WHERE STUFF GOES ******
  36. ;****************************************
  37.  
  38. ; now figure out the initial defaults for a bunch of things
  39.      (set EMPLANT_dir (getassign "EMPLANT"))
  40.      (set c_dir (getassign "C"))
  41.      (set libs_dir (getassign "LIBS"))
  42.      (set fonts_dir (getassign "FONTS"))
  43.      (set DEVS_dir (getassign "DEVS"))
  44.      (set s_dir (getassign "S"))
  45.  
  46.      (set Src_c "MacII:EMPLANT/c/")
  47.      (set Src_s "MacII:EMPLANT/s/")
  48.      (set Src_libs "MacII:EMPLANT/libs/")
  49.      (set Src_fonts "MacII:EMPLANT/fonts/")
  50.      (set Src_devs "MacII:EMPLANT/devs/")
  51.      (set Src_main "MacII:EMPLANT/")
  52.      (set Src_docs "MacII:EMPLANT/Documentation/")
  53.      (set Src_Video "MacII:EMPLANT/Video_Drivers/")
  54.      (set Src_Logo "MacII:EMPLANT/Logos/")
  55.      (set Src_ExtIO "MacII:EMPLANT/Ext_IO/")
  56.  
  57. ; see if we are doing an update
  58.    (if (<> EMPLANT_dir nothing)
  59.       (if (askbool
  60.             (prompt "\n\n\nSome version of the MAC emulation software already "
  61.                "exists in your drawer named: \n\n" quote EMPLANT_dir quote
  62.                "\n\nDo you want the update installed over it?")
  63.             (help
  64.                "\n\n\nThe installer has determined that you already have a "
  65.                "some version of the MAC emulation software installed "
  66.                "on your system.  If this is wrong or you want the update installed "
  67.                "elsewhere, select 'NO', otherwise select 'YES'."
  68.             )
  69.             (default 1)
  70.          )
  71.          ( ; the then clause
  72.             (set is_update true) 
  73.          )
  74.          ( ; the else clause
  75.             (set is_update false)
  76.             (set EMPLANT_dir
  77.                (askdir
  78.                   (prompt "Where would you like the updated software installed?")
  79.                   (help @askdir-help)
  80.                   (default @default-dest)
  81.                )
  82.             )
  83.             (set EMPLANT_dir
  84.                (tackon EMPLANT_dir "EMPLANT")
  85.             )
  86.             (makedir EMPLANT_dir
  87.             (infos)
  88.             )
  89.            
  90.          )
  91.       )
  92.    )
  93.  
  94. ; if EMPLANT_dir is still nothing then where do they want it?
  95.    (if (= EMPLANT_dir nothing)
  96.       ( ; then clause
  97.         (set EMPLANT_dir
  98.            (askdir
  99.               (prompt "Where would you like the software installed?")
  100.               (help @askdir-help)
  101.               (default @default-dest)
  102.            )
  103.         )
  104.         (set EMPLANT_dir
  105.            (tackon EMPLANT_dir "EMPLANT")
  106.         )
  107.         (makedir EMPLANT_dir
  108.         (infos)
  109.         )
  110.       )
  111.    )
  112.  
  113. ; tell the user of our progress
  114.    (complete 5)
  115.  
  116. ; lets make sure the C: stuff goes there
  117.    (set c_dir
  118.       (askdir
  119.          (prompt "Where would you like the C: files installed?")
  120.          (help @askdir-help)
  121.          (default c_dir)
  122.       )
  123.    )
  124.    
  125. ; first copy over the c: stuff
  126.    (working omp "Scanning C: directory on distribution disk...")
  127.    
  128.    (set c_dir
  129.       (copyfiles
  130.          (prompt "Select file(s) to be copied into your C: directory:")
  131.          (help "\n\nThis will copy RsrvMemII "
  132.             "to your system's C: directory.\n\n"
  133.             @copyfiles-help
  134.          )
  135.          (source Src_c)
  136.          (dest c_dir)
  137.          (pattern "#?MEM#?")
  138.          (confirm)
  139.       )
  140.    )
  141.    
  142. ; tell the user of our progress
  143.    (complete 10)
  144.  
  145.  
  146. ; lets make sure the Libs: stuff goes there
  147.    (set libs_dir
  148.       (askdir
  149.          (prompt "Where would you like the LIBS: files installed?")
  150.          (help @askdir-help)
  151.          (default libs_dir)
  152.          (newpath)
  153.       )
  154.    )
  155.  
  156. ; copy over the libs: stuff
  157.    (working omp "Scanning LIBS: directory on distribution disk...")
  158.    
  159.    (copyfiles
  160.       (prompt "Select file(s) to be copied into your LIBS: directory:")
  161.       (help "\n\nThis will copy the EMPLANT, SYBIL, and "
  162.          "JAM libraries into your system's LIBS: directory.\n\n"
  163.          @copylib-help
  164.       )
  165.       (source Src_libs)
  166.       (dest libs_dir)
  167.       (pattern "(EMPLANT#?|SYBIL#?|JAM#?)")
  168.       (confirm)
  169.      )
  170.  
  171. ; tell the user of our progress
  172.     (complete 20)
  173.  
  174. ; lets make sure the Devs: stuff goes there
  175.    (set DEVS_dir
  176.       (askdir
  177.          (prompt "Where would you like the DEVS: files installed?")
  178.          (help @askdir-help)
  179.          (default DEVS_dir)
  180.       )
  181.    )
  182.    
  183. ; first copy over the DEVS: stuff
  184.    (working omp "Scanning DEVS: directory on distribution disk...")
  185.    
  186.    (set DEVS_dir
  187.       (copyfiles
  188.          (prompt "Select file(s) to be copied into your DEVS: directory:")
  189.          (help "\n\nThis will copy the device drivers for the use with "
  190.             "EMPLANT's various ports.\n\n"
  191.             @copyfiles-help
  192.          )
  193.          (source Src_devs)
  194.          (dest DEVS_dir)
  195.          (pattern "#?.device")
  196.          (confirm)
  197.       )
  198.    )
  199.  
  200. ; tell the user of our progress
  201.     (complete 30)
  202.  
  203. ; Lets make sure the Fonts go there
  204.    (set Fonts_dir
  205.       (askdir
  206.          (prompt "Where would you like the font installed?")
  207.          (help @askdir-help)
  208.          (default fonts_dir)
  209.          (newpath)
  210.       )
  211.    )
  212.  
  213. ; copy over the fonts
  214.    (working omp "Scanning FONTS: on distribution disk...")
  215.  
  216.    (copyfiles
  217.       (prompt "Select file(s) to be copied into your FONTS: directory:")
  218.       (help "\n\nThis will copy over any fonts needed for the emulation.\n\n"
  219.          @copyfiles-help
  220.       )
  221.       (source Src_fonts)
  222.       (dest fonts_dir)
  223.       (pattern "(SCAIV#?)")
  224.       (fonts)
  225.       (confirm)
  226.     )
  227.  
  228. ; tell the user of our progress
  229.     (complete 40)
  230.  
  231.   
  232. ; Copy over the EMPLANT programs
  233.    (working omp "Scanning for Utilities and ReadMe files...")
  234.    
  235.    (set EMPLANT_dir
  236.       (copyfiles
  237.          (prompt "Select various files to be copied to the EMPLANT: directory:")
  238.          (help "\n\nThis will copy the utilities and some various "
  239.             "readme files.\n\n"
  240.             @copyfiles-help
  241.          )
  242.          (source Src_main)
  243.          (dest EMPLANT_dir)
  244.          (pattern "(Conv#?|Diag#?|Dump#?|Hard#?|MacII|Soft#?|EC#?|Rominfo|Read#?|InitRet#?|MAC_HDSetup#?|VBRMover#?|#?.info)")
  245.          (confirm)
  246.       )
  247.    )
  248.    
  249. ; tell the user of our progress
  250.    (complete 50)
  251.  
  252.  
  253. ; Ask user where to put Video Drivers
  254.   (Set VideoDrvr_dir
  255.      (askdir
  256.         (prompt "Where do you want to install the Video Drivers? "
  257.            "'Video_Drivers' will be automatically appended.")
  258.         (help @askdir-help)
  259.         (default EMPLANT_dir)
  260.      )
  261.   )
  262.  
  263.    (set VideoDrvr_dir
  264.       (tackon VideoDrvr_dir "Video_Drivers")
  265.    )
  266.  
  267.    (makedir VideoDrvr_dir
  268.       (infos)
  269.    )
  270.  
  271. ; Copy over Video Drivers
  272.    (Working omp "Scanning for Video Drivers on distribution disk...")
  273.  
  274.    (copyfiles
  275.       (prompt "Select file(s) to be copied into your Video_Drivers directory:")
  276.       (help "\n\nThis will copy the video drivers to your "
  277.          "system.  If you do not already have a drawer for them, "
  278.          "one will be created for you.\n\n"
  279.          @copyfiles-help
  280.       )
  281.       (source Src_video)
  282.       (dest VideoDrvr_dir)
  283.       (pattern "(#?video#?)")
  284.       (confirm)
  285.    )
  286.  
  287. ; tell the user of our progress
  288.     (complete 60)
  289.  
  290.  
  291. ; Ask user where to put External I/O Drivers
  292.   (Set ExtIODrvr_dir
  293.      (askdir
  294.         (prompt "Where do you want to install the External I/O Driver(s)? "
  295.            "'Ext_IO' will be automatically appended.")
  296.         (help @askdir-help)
  297.         (default EMPLANT_dir)
  298.      )
  299.   )
  300.  
  301.    (set ExtIODrvr_dir
  302.       (tackon ExtIODrvr_dir "Ext_IO")
  303.    )
  304.  
  305.    (makedir ExtIODrvr_dir
  306.       (infos)
  307.    )
  308.  
  309. ; Copy over External I/O Drivers
  310.    (Working omp "Scanning for External I/O Drivers on distribution disk...")
  311.  
  312.    (copyfiles
  313.       (prompt "Select file(s) to be copied into your Ext_IO directory:")
  314.       (help "\n\nThis will copy the External I/I drivers to your "
  315.          "system.  If you do not already have a drawer for them, "
  316.          "one will be created for you.\n\n"
  317.          @copyfiles-help
  318.       )
  319.       (source Src_ExtIO)
  320.       (dest ExtIODrvr_dir)
  321.       (pattern "(#?)")
  322.       (confirm)
  323.    )
  324.  
  325. ; tell the user of our progress
  326.     (complete 70)
  327.  
  328.  
  329. ; Ask user where to put logos
  330.   (Set Logos_dir
  331.      (askdir
  332.         (prompt "Where do you want to install the logos? "
  333.            "'Logos' will be automatically appended.")
  334.         (help @askdir-help)
  335.         (default EMPLANT_dir)
  336.      )
  337.   )
  338.  
  339.    (set Logos_dir
  340.       (tackon Logos_dir "Logos")
  341.    )
  342.  
  343.    (makedir Logos_dir
  344.       (infos)
  345.    )
  346.  
  347. ; Copy over logos
  348.    (Working omp "Scanning for logos on distribution disk...")
  349.  
  350.    (copyfiles
  351.       (prompt "Select file(s) to be copied into your Logos directory:")
  352.       (help "\n\nThis will copy the logos to your "
  353.          "system.  If you do not already have a drawer for them, "
  354.          "one will be created for you.\n\n"
  355.          @copyfiles-help
  356.       )
  357.       (source Src_logo)
  358.       (dest logos_dir)
  359.       (pattern "(#?logo#?)")
  360.       (confirm)
  361.    )
  362.  
  363. ; tell the user of our progress
  364.     (complete 80)
  365.  
  366. ; Ask where to put Documentation
  367.   (set Docs_dir
  368.      (askdir
  369.         (prompt "Where do you want the Documentation installed? "
  370.            "'Documentation' will be automatically appended.")
  371.         (help @askdir-help)
  372.         (default EMPLANT_dir)
  373.      )
  374.   )
  375.  
  376.   (set Docs_dir
  377.      (tackon Docs_dir "Documentation")
  378.   )
  379.  
  380.   (makedir Docs_dir
  381.      (infos)
  382.   )
  383.  
  384. ; copy over Documentation
  385.    (working omp "Scanning for Documentation...")
  386.  
  387.    (copyfiles
  388.       (prompt "Copying Documentation Files...")
  389.       (help "\n\nThis will copy the EMPLANT & emulation documentation to your "
  390.          "system.  If you do not already have a drawer for them, "
  391.          "one will be created for you.\n\n"
  392.          @copyfiles-help
  393.       )
  394.       (source Src_docs)
  395.       (dest Docs_dir)
  396.       (pattern "#?")
  397.       (confirm)
  398.     )
  399.  
  400. ; tell the user of our progress
  401.     (complete 90)
  402.  
  403. ; create a drawer for ROM images
  404.    (set ROM_dir
  405.       (askdir
  406.          (prompt "Where do you want the drawer for your ROM image(s)? "
  407.              "'ROM_Images' will be automatically appended.")
  408.          (help
  409.             "\n\nThis will create a drawer for you to store any ROM "
  410.             "images you make for EMPLANT.\n\n"
  411.             @askdir-help
  412.          )
  413.          (default EMPLANT_dir)
  414.       ) 
  415.    )
  416.  
  417.    (set ROM_dir
  418.       (tackon ROM_dir "ROM_Images")
  419.    )
  420.  
  421.    (makedir ROM_dir
  422.       (infos)
  423.    )
  424.  
  425. ; tell the user of our progress
  426.     (complete 95)
  427.  
  428.  
  429. ; add custom EMPLANT setup caller to Startup-Sequence
  430.  (if (not (exists "s:AssignEMPLANT"))
  431.    (if (askbool
  432.           (prompt "\nIn order for MAC emulation to work correctly, "
  433.              "the FIRST line in your STARTUP-SEQUENCE must be\n\n"
  434.              "'execute >NIL: s:SetupEMPLANT'\n\n"
  435.              "and the LAST line of your USER-STARTUP must be:\n\n"
  436.              "'execute >NIL: s:AssignEMPLANT'\n\n"
  437.              "These lines can be automatically added by this installer script.  Do you wish to "
  438.              "proceed?\n\n")
  439.           (help @askbool-help)
  440.           )
  441.  
  442.        (
  443.           (if (= @pretend 0)
  444.               (
  445.                   (
  446.                       (textfile
  447.                          (dest "ram:startup-sequence")
  448.                          (append "execute >NIL: s:SetupEMPLANT \n")
  449.                          (include "s:startup-sequence")
  450.                       )
  451.                       (rename "s:startup-sequence" "s:startup-sequence.old")
  452.                       (copyfiles
  453.                          (help @copyfiles-help)
  454.                          (source "ram:startup-sequence")
  455.                          (dest "s:")
  456.                       )
  457.                       (delete "ram:startup-sequence")
  458.  
  459.                       (textfile
  460.                          (dest "ram:user-startup")
  461.                          (include "s:user-startup")
  462.                          (append "execute >NIL: s:AssignEMPLANT \n")
  463.                       )
  464.                       (rename "s:user-startup" "s:user-startup.old")
  465.                       (copyfiles
  466.                          (help @copyfiles-help)
  467.                          (source "ram:user-startup")
  468.                          (dest "s:")
  469.                       )
  470.                       (delete "ram:user-startup")
  471.                    )
  472.                  )
  473.                )
  474.              )
  475.            )
  476.          )
  477.  
  478.    (working omp "Creating 'SetupEMPLANT' and 'AssignEMPLANT' files...")
  479.       
  480.                       (delete "s:SetupEMPLANT")
  481.                       (textfile
  482.                          (dest "s:SetupEMPLANT")
  483.                          (append "RsrvMemII >NIL: \n")
  484.                       )
  485.                       (delete "s:AssignEMPLANT")
  486.                       (textfile
  487.                          (dest "s:AssignEMPLANT")
  488.                          (append "Assign EMPLANT: " EMPLANT_dir "\n")
  489.                       )
  490.  
  491. ; tell the user of our progress
  492.    (complete 100)
  493.  
  494.    ; now for the real exit
  495.    (exit)
  496.