home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Utilities / ACDPlay / Install-ACDPlay < prev    next >
Text File  |  1998-07-23  |  15KB  |  521 lines

  1. ;===========================================================================;
  2. ;
  3. ;                    Installer script for ACDPlay V1.6
  4. ;                            by Martin Kresse
  5. ;                            and Marc Altmann
  6. ;
  7. ;                   $VER: Install_ACDPlay 1.6 (22.07.98)
  8. ;
  9. ;===========================================================================;
  10.  
  11.  
  12. (set #welcome
  13.     (cat "Welcome to the installation of\nACDPlay V1.6\n"
  14.          "a CDDA player for SCSI/ATAPI CD-ROM drives.\n"
  15.          "We have worked pretty hard to accomplish this "
  16.          "release of ACDPlay, so please fulfill one of the "
  17.          "conditions of using ACDPlay and send us an email.")
  18. )
  19.  
  20. (set #installmode-prompt
  21.     (cat "Do you want to do a completely new installation or do "
  22.          "you want to update to an earlier version of ACDPlay?")
  23. )
  24.  
  25. (set #installmode-help
  26.     (cat "By doing a completely new installation configurations "
  27.          "and preferences of a supposed earlier installation "
  28.          "will be overwritten.\n"
  29.          "By updating to an earlier version of ACDPlay the configuration "
  30.          "file will be converted to the new ACDPlay 1.5 config file format. "
  31.          "Tooltypes will be kept as well.")
  32. )
  33.  
  34. (set #acdpdir_install-prompt
  35.     (cat "In which directory do you want to install ACDPlay?\n"
  36.          "(a drawer named \"ACDPlay\" will be created)")
  37. )
  38. (set #acdpdir_install-help
  39.     (cat "You may now choose a directory in which an own drawer "
  40.          "drawer named \"ACDPlay\" will be created. ACDPlay will be "
  41.          "copied to the resulting path with all files belonging to it.\n\n"
  42.          @askdir-help)
  43. )
  44.  
  45. (set #acdpdir_update-prompt
  46.     (cat "Please select the directory where the ACDPlay executable "
  47.          "is installed.\n"
  48.          "ACDPlay will then be updated.")
  49. )
  50. (set #acdpdir_update-help
  51.     (cat "Because ACDPlay doesn't set up any assigns during its installation "
  52.          "you have to specify the drawer that contains the ACDPlay executable.\n"
  53.          "Normally the drawer's name is \"ACDPlay\", too.\n\n"
  54.          @askdir-help)
  55. )
  56.  
  57. (set #components-prompt
  58.     (cat "Which of ACDPlay's components do you want to install?")
  59. )
  60. (set #components-help
  61.     (cat "You may now select the individual components of the ACDPlay "
  62.          "package you want to install. All items should be selected for "
  63.          "a normal installation.\n\n"
  64.          "Main program:\nACDPlay executable, of course this is absolutely "
  65.          "necessary.\n\n"
  66.          "Documentation:\nSome of ACDPlay's functions (e.g. A-B repeat) "
  67.          "are not absolutely self-explaining. That's why there is an AmigaGuide "
  68.          "documentation in English.\n\n"
  69.          "Catalogs:\nACDPlay itself is multilingual. Just install your preferred "
  70.          "language catalog.\n\n"
  71.          "ARexx examples:\nNot useful for everybody, but for those who are using "
  72.          "ARexx we included some tiny example scripts for ACDPlay's huge ARexx port.\n\n"
  73.          "Title file examples:\nPretty useless, just as an example.\n\n"
  74.          "PickCDID:\nTool to cope with those large CDID-Collections. Pick out "
  75.          "only CDID files for CDs you really own.\n\n"
  76.          @askoptions-help)
  77. )
  78. (set #components-main "Main program")
  79. (set #components-docs "Documentation")
  80. (set #components-cats "Catalogs")
  81. (set #components-rexx "ARexx examples")
  82. (set #components-cdid "Title file examples")
  83. (set #components-pick "PickCDID V1.0")
  84.  
  85. (set #abort "No component chosen: installation aborted")
  86.  
  87. (set #magicwb-prompt "What icon set do you want to install?")
  88. (set #magicwb-help
  89.     (cat "If you have Martin Huttenloher's MagicWB package installed "
  90.          "on your machine, you should use ACDPlay's MagicWB icons too. "
  91.          "If it's the first time you hear the term MagicWB, it's a good "
  92.          "idea to install the standard icons to ensure a 'clear sight'.")
  93. )
  94.  
  95. (set #catalogs-prompt
  96.     (cat "For what language do you want to install the language catalogs?")
  97. )
  98. (set #catalogs-help
  99.     (cat "You may now choose the language in which ACDPlay "
  100.          "should appear. If your own language isn't supported, please contact one "
  101.          "of the programmers\n\n"
  102.          "Attention: In order to use the different languages ACDPlay needs "
  103.          "locale.library installed which is part of the operating system since "
  104.          "Workbench 2.1. Under older versions of the OS ACDPlay will always"
  105.          "appear in English.\n\n"
  106.          @askchoice-help)
  107. )
  108.  
  109. (set #catalogs-default 4)
  110.  
  111. (set #drivemode-prompt "With what kind of CD-ROM drive do you want to use ACDPlay?")
  112. (set #drivemode-help
  113.     (cat "You can use ACDPlay with both SCSI and ATAPI CD-ROM drives. "
  114.          "However, when using an ATAPI drive 'cd.device' is needed.\n\n"
  115.          @askbool-help)
  116. )
  117.  
  118. (set #getdev-prompt "Examining your SCSI device...")
  119.  
  120. (set #devicename-prompt "Enter the name of your SCSI device:")
  121. (set #devicename-help
  122.     (cat "In order to send commands to your CD-ROM drive ACDPlay must know "
  123.          "the name of your SCSI device driver. Because this can be different "
  124.          "on each system because of many different configurations it's hard "
  125.          "to determine the right one with 100% safity. "
  126.          "Please make sure with the help of your SCSI host adapters' manual "
  127.          "whether this 'guessed' name is the right one.\n\n"
  128.          @askstring-help)
  129. )
  130.  
  131. (set #getunit-prompt "Looking for CD-ROM drive...")
  132.  
  133. (set #deviceunit-prompt
  134.     (cat "Enter the unit of your CD-ROM drive:")
  135. )
  136. (set #deviceunit-help
  137.     (cat "Since a SCSI adapter is able to control up to 7 devices, "
  138.          "each one must be indentified by a number (0-7). "
  139.          "If ACDPlay doesn't work with the proposed number, you may "
  140.          "just try every number until it does.\n\n"
  141.          @asknumber-help)
  142. )
  143.  
  144. (set #convert1-prompt
  145.     (cat "ACDPlay config file on ENVARC: found.\n"
  146.          "The config file will now be checked for its version. Maybe it will "
  147.          "be converted to the new format.")
  148. )
  149.  
  150. (set #convert2-prompt
  151.     (cat "ACDPlay config file on ENV: found.\n"
  152.          "The config file will now be checked for its version. Maybe it will "
  153.          "be converted to the new format.")
  154. )
  155.  
  156. (set #convert-help
  157.     (cat "Configuration files saved by ACDPlay 1.0 or 1.1 cannot be read by "
  158.          "ACDPlay 1.6. In case you want to keep your old window positions etc. "
  159.          "they have to be converted.\n"
  160.          "The install script will now execute 'c/convert' to check and maybe "
  161.          "convert your config file.")
  162. )
  163.  
  164. (set #delcfg1-prompt
  165.     (cat "Found old configuration file.\nDeleting "
  166.          "old config file from ENVARC:...")
  167. )
  168. (set #delcfg2-prompt
  169.     (cat "Found old configuration file.\nDeleting "
  170.          "old config file from ENV:...")
  171. )
  172. (set #delcfg-help
  173.     (cat "An old ACDPlay configuration file was found. Because ACDPlay 1.6 "
  174.          "cannot cope with the file format of ACDPlay 1.0 and 1.1, not"
  175.          "deleting it would produce an error message.\n"
  176.          "To convert old config files into new ones, "
  177.          "start this script again or run 'c/convert <filename>'.")
  178. )
  179.  
  180. (welcome #welcome)
  181.  
  182. (complete 0)
  183.  
  184. ;---------------------------------------------------------- ask user options
  185.  
  186. (set installmode
  187.     (askchoice
  188.         (prompt  #installmode-prompt)
  189.         (help    #installmode-help)
  190.         (choices "Install" "Update")
  191.         (default 0)
  192.     )
  193. )
  194.  
  195. (if (= installmode 0)
  196.     (
  197.         (set rootdestdir
  198.             (askdir
  199.                 (prompt  #acdpdir_install-prompt)
  200.                 (help    #acdpdir_install-help)
  201.                 (default "Sys:Utilities")
  202.             )
  203.         )
  204.         (set destdir
  205.             (tackon rootdestdir "ACDPlay")
  206.         )
  207.     )
  208.     (set destdir
  209.         (askdir
  210.             (prompt  #acdpdir_update-prompt)
  211.             (help    #acdpdir_update-help)
  212.             (default "Sys:Utilities/ACDPlay")
  213.         )
  214.     )
  215. )
  216.  
  217. (set @default-dest destdir)
  218.  
  219. (set components
  220.     (askoptions
  221.         (prompt #components-prompt)
  222.         (help   #components-help)
  223.         (choices #components-main
  224.                  #components-docs
  225.                  #components-cats
  226.                  #components-rexx
  227.                  #components-cdid
  228.                  #components-pick)
  229.         (default 63)
  230.     )
  231. )
  232.  
  233. (if (= components 0)
  234.     (exit #abort (quiet))
  235. )
  236.  
  237. (complete 10)
  238.  
  239. (if (IN components 2)
  240.     (set catalogs
  241.         (askchoice
  242.             (prompt #catalogs-prompt)
  243.             (help   #catalogs-help)
  244.             (choices "Ãeótina"
  245.                      "Català"
  246.                      "Dansk"
  247.                      "Deutsch"
  248.                      "English"
  249.                      "Français"
  250.                      "Íslenska"
  251.                      "Italiano"
  252.                      "Nederlands"
  253.                      "Norsk"
  254.                      "Polski"
  255.                      "Svenska")
  256.             (default #catalogs-default)
  257.         )
  258.     )
  259. )
  260.  
  261. (set clanguage (select catalogs "ãeótina" "català" "dansk" "deutsch" "english" "français" "íslenska" "italiano" "nederlands" "norsk" "polski" "svenska"))
  262.  
  263. (complete 20)
  264.  
  265. (if (= installmode 0)
  266.     (
  267.         (set magicwb
  268.             (askchoice
  269.                 (prompt #magicwb-prompt)
  270.                 (help   #magicwb-help)
  271.                 (choices "Standard (4 colours)"
  272.                          "MagicWB  (8 colours)")
  273.                 (default 0)
  274.             )
  275.         )
  276.  
  277.         ; Fragen, ob SCSI oder ATAPI. Bei ATAPI wird jetzt noch nichts weiter
  278.         ; getan.
  279.         ; 0 == SCSI
  280.  
  281.         (set drivemode
  282.             (askchoice
  283.                 (prompt #drivemode-prompt)
  284.                 (help   #drivemode-help)
  285.                 (choices "SCSI"
  286.                          "ATAPI")
  287.                 (default 0)
  288.             )
  289.         )
  290.  
  291.         ; Nur, wenn SCSI gewählt wurde
  292.         (if (= drivemode 0)
  293.             (
  294.                 (run "c/FindDevice >ENV:scsi_device" (prompt #getdev-prompt))
  295.  
  296.                 (set devicename
  297.                     (askstring
  298.                         (prompt #devicename-prompt)
  299.                         (help   #devicename-help)
  300.                         (default (getenv "scsi_device"))
  301.                     )
  302.                 )
  303.  
  304.                 (run ("c/FindCDROM >ENV:scsi_unit %s" devicename) (prompt #getunit-prompt))
  305.  
  306.                 (set deviceunit
  307.                     (asknumber
  308.                         (prompt #deviceunit-prompt)
  309.                         (help   #deviceunit-help)
  310.                         (range 0 7)
  311.                         (default (getenv "scsi_unit"))
  312.                     )
  313.                 )
  314.             )
  315.         )
  316.     )
  317. )
  318.  
  319. (complete 30)
  320.  
  321.  
  322. ;----------------------------------------- now we can start the installation
  323.  
  324. ; ggf. Verzeichnis anlegen und mit Icon versehen
  325. (if (= installmode 0)
  326.     (
  327.         (makedir destdir)
  328.             ; MagicWB- oder normales Icon installieren
  329.         (if (= magicwb 1)
  330.                 (copyfiles
  331.                 (source "ACDPlay.info")
  332.                     (dest   rootdestdir)
  333.                 (noposition)
  334.                 )
  335.                 (copyfiles
  336.                 (source  "icons/ACDPlay-Dir.info")
  337.                     (dest    rootdestdir)
  338.                 (newname "ACDPlay.info")
  339.                     (noposition)
  340.             )
  341.         )
  342.         )
  343. )
  344.  
  345. (complete 40)
  346.  
  347. ; copy and configure main program
  348. ;
  349. (if (IN components 0)
  350.     (
  351.         (copyfiles
  352.             (source "ACDPlay/ACDPlay")
  353.             (dest   destdir)
  354.             (files)
  355.         )
  356.         
  357.         ; Iconbehandlung
  358.         (if (= installmode 0)
  359.             (
  360.                 ; Icon kopieren
  361.                 (copyfiles
  362.                     (source (if #magicwb "ACDPlay/ACDPlay.info" "Icons/ACDPlay.info"))
  363.                     (dest   destdir)
  364.                 )
  365.  
  366.                 ; Device- und Unit-Tooltypes setzen, falls SCSI-Modus
  367.                 ; gewählt wurde
  368.                 (if (= drivemode 0)
  369.                     (tooltype
  370.                         (dest (tackon destdir "ACDPlay"))
  371.                         (settooltype "(DEVICE")                 ; altes TT löschen
  372.                         (settooltype "DEVICE" devicename)
  373.                         (settooltype "(UNIT")                   ; altes TT löschen
  374.                         (settooltype "UNIT" ("%ld" deviceunit ))
  375.                         (noposition)
  376.                     )
  377.                 )
  378.             )
  379.             (
  380.                 ; Tooltypes auf den 1.6er Stand bringen
  381.                 (tooltype
  382.                     (dest (tackon destdir "ACDPlay"))
  383.                     (settooltype "SEARCHSECONDS")
  384.                     (settooltype "UPDATEDELAY" "5")
  385.                     (settooltype "QUITONCLOSE" "YES")
  386.                     (settooltype "PANELWIDTH" "28")
  387.                     (settooltype "PANELHEIGHT" "23")
  388.                     (settooltype "AUTOSTART" "NO")
  389.                     (settooltype "AUTOACTIVE" "YES")
  390.                     (settooltype "HIDEMODE" "APPICON")
  391.                     (settooltype "PLAYMODE" "CD")
  392.                     (noposition)
  393.                 )
  394.             )
  395.         )
  396.     )
  397. )
  398.  
  399. ; Konfigurationsfile konvertieren bzw. löschen
  400. (if installmode
  401.     (
  402.         (if (exists "ENVARC:ACDPlay.cfg")
  403.             (run "c/convert ENVARC:ACDPlay.cfg"
  404.                 (confirm 2)
  405.                 (prompt #convert1-prompt)
  406.                 (help #convert-help)
  407.             )
  408.         )
  409.         (if (exists "ENV:ACDPlay.cfg")
  410.             (run "c/convert ENV:ACDPlay.cfg"
  411.                 (confirm 2)
  412.                 (prompt #convert2-prompt)
  413.                 (help #convert-help)
  414.             )
  415.         )
  416.     )
  417.     (
  418.         ; Konfigdatei löschen
  419.         (if (exists "ENVARC:ACDPlay.cfg")
  420.             (delete "ENVARC:ACDPlay.cfg"
  421.                 (confirm 2)
  422.                 (prompt #delcfg1-prompt)
  423.                 (help #delcfg-help)
  424.             )
  425.         )
  426.         (if (exists "ENV:ACDPlay.cfg")
  427.             (delete "ENV:ACDPlay.cfg"
  428.                 (confirm 2)
  429.                 (prompt #delcfg2-prompt)
  430.                 (help #delcfg-help)
  431.             )
  432.         )
  433.     )
  434. )
  435.  
  436. ; copy documentation
  437. ;
  438. (if (IN components 1)
  439.   (
  440.     (copyfiles
  441.         (source "ACDPlay.guide")
  442.         (dest   destdir)
  443.         (infos)
  444.         (noposition)
  445.     )
  446.     (copyfiles
  447.         (source "Changes")
  448.         (dest   destdir)
  449.         (infos)
  450.     )
  451.     (if (= magicwb 0)                        ; 4 colour icons?
  452.       (copyfiles
  453.           (source "Icons/ACDPlay.guide.info")
  454.           (dest   destdir)
  455.       )
  456.     )
  457.   )
  458. )
  459.  
  460. (complete 60)
  461.  
  462. ; copy catalogs
  463. ;
  464. (if (IN components 2)
  465.   (if (<> clanguage "english")
  466.     (
  467.       (makedir (tackon destdir "catalogs"))
  468.       (copyfiles
  469.           (source (tackon "Catalogs" (tackon clanguage "ACDPlay.catalog")))
  470.           (dest   (tackon destdir (tackon "catalogs" clanguage)))
  471.       )
  472.     )
  473.   )
  474. )
  475.  
  476. (complete 70)
  477.  
  478. ; copy arexx examples
  479. ;
  480. (if (IN components 3)
  481.     (copyfiles
  482.         (source "Arexx")
  483.         (dest   (tackon destdir "ARexx"))
  484.         (all)
  485.     )
  486. )
  487.  
  488. (complete 80)
  489.  
  490. ; copy diskfiles
  491. ;
  492. (if (IN components 4)
  493.     (copyfiles
  494.         (source "Disks")
  495.         (dest   (tackon destdir "Disks"))
  496.         (all)
  497.     )
  498. )
  499.  
  500. (complete 90)
  501.  
  502. ; copy PickCDID
  503. ;
  504. (if (IN components 5)
  505.     (copyfiles
  506.         (source "PickCDID")
  507.         (dest   (tackon destdir "PickCDID"))
  508.         (infos)
  509.         (all)
  510.     )
  511. )
  512.  
  513. ;------------------------------------------------------------------ clean up
  514.  
  515. ; kill these global variables
  516. ;
  517. (delete "ENV:scsi_device" (safe))
  518. (delete "ENV:scsi_unit" (safe))
  519.  
  520. (complete 100)
  521.