home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Utilities / ACDPlay / src / V1.5 / Install-ACDPlay < prev    next >
Text File  |  1997-03-31  |  9KB  |  363 lines

  1. ;===========================================================================;
  2. ;
  3. ;                    Installer script for ACDPlay V1.5
  4. ;                            by Martin Kresse
  5. ;                            and Marc Altmann
  6. ;
  7. ;                   $VER: Install_ACDPlay 1.5 (31.03.97)
  8. ;
  9. ;===========================================================================;
  10.  
  11.  
  12. (set #welcome
  13.     (cat "Welcome to the installation of\nACDPlay V1.1\n"
  14.          "a CDDA player for SCSI CD-ROM drives.")
  15. )
  16.  
  17. (set #acdpdir-prompt
  18.     (cat "In which directory do you want to install ACDPlay?\n"
  19.          "(a drawer named \"ACDPlay\" will be created)")
  20. )
  21. (set #acdpdir-help
  22.     (cat "You may now choose a directory in which an own drawer "
  23.          "drawer named \"ACDPlay\" will be created. ACDPlay will be "
  24.          "copied to the resulting path with all files belonging to it.\n\n"
  25.          @askdir-help)
  26. )
  27.  
  28. (set #backup-prompt
  29.     (cat "ACDPlay is already present.\nDo you wish a backup of "
  30.          "the old version to be made?")
  31. )
  32. (set #backup-help
  33.     (cat "You may now decide if the old version is to be moved "
  34.          "into a subdirectory, before the new one is installed.")
  35. )
  36. (set #backup-dir "old")
  37.  
  38. (set #components-prompt
  39.     (cat "Which of ACDPlay's components do you want to install?")
  40. )
  41. (set #components-help
  42.     (cat "You may now select the individual components of the ACDPlay "
  43.          "package you want to install. All items should be selected for "
  44.          "a normal installation.\n\n"
  45.          @askoptions-help)
  46. )
  47. (set #components-main "main program")
  48. (set #components-docs "documentation")
  49. (set #components-cats "catalogs")
  50. (set #components-rexx "ARexx examples")
  51. (set #components-cdid "title files")
  52.  
  53. (set #abort "No component chosen: installation aborted")
  54.  
  55. (set #magicwb-prompt "Do you prefer MagicWB icons?")
  56. (set #magicwb-help
  57.     (cat "If you have Martin Huttenloher's MagicWB package installed "
  58.          "on your machine, you should use ACDPlay's MagicWB icons too. "
  59.          "If it's the first time you hear the term MagicWB, it's a good "
  60.          "idea to install the standard icons to ensure a 'clear sight'.")
  61. )
  62.  
  63. (set #catalogs-prompt
  64.     (cat "For what language do you want to install catalogs and documentation?")
  65. )
  66. (set #catalogs-help
  67.     (cat "You may now choose the language in which ACDPlay and the documentation "
  68.          "should appear. If your own language isn't supported, please contact one "
  69.          "of the programmers\n\n"
  70.          "Attention: In order to use the different languages ACDPlay needs "
  71.          "locale.library installed which is part of the operating system since "
  72.          "Workbench 2.1. Under older versions of the OS ACDPlay will always"
  73.          "appear in English.\n\n"
  74.          @askchoice-help)
  75. )
  76. (set #catalogs-german    "German")
  77. (set #catalogs-english   "English")
  78. (set #catalogs-norwegian "Norwegian")
  79. (set #catalogs-default 0)
  80.  
  81. (set #getdev-prompt "Examining your SCSI device...")
  82.  
  83. (set #devicename-prompt "Enter the name of your SCSI device:")
  84. (set #devicename-help
  85.     (cat "In order to send commands to your CD-ROM drive ACDPlay must know "
  86.          "the name of your SCSI device driver. Because this can be different "
  87.          "on each system because of many different configurations it's hard "
  88.          "to determine the right one with 100% safity. "
  89.          "Please make sure with the help of your SCSI host adapters' manual "
  90.          "whether this 'guessed' name is the right one.\n\n"
  91.          @askstring-help)
  92. )
  93.  
  94. (set #getunit-prompt "Looking for CD-ROM drive...")
  95.  
  96. (set #deviceunit-prompt
  97.     (cat "Enter the unit of your CD-ROM drive:")
  98. )
  99. (set #deviceunit-help
  100.     (cat "Since a SCSI adapter is able to control up to 7 devices, "
  101.          "each one must be indentified by a number (0-7). "
  102.          "If ACDPlay doesn't work with the proposed number, you may "
  103.          "just try every number until it does.\n\n"
  104.          @asknumber-help)
  105. )
  106.  
  107. (set #copycdlib-prompt "Copying 'cdplay.library' to LIBS:")
  108. (set #copycdlib-help
  109.     (cat "Patrick Hess' 'cdplay.library' is badly needed by ACDPlay "
  110.          "In order to be found and used it must be situated "
  111.          "within the logical device LIBS:.\n\n"
  112.          @copylib-help)
  113. )
  114.  
  115.  
  116.  
  117.  
  118. (welcome #welcome)
  119.  
  120. (complete 0)
  121.  
  122. ;---------------------------------------------------------- ask user options
  123.  
  124. (set installmode
  125.     (askchoice
  126.         (prompt  #installmode-prompt)
  127.         (help    #installmode-help)
  128.         (choices "Install" "Update")
  129.         (default 0)
  130.     )
  131. )
  132.  
  133. (set rootdestdir
  134.     (askdir
  135.         (prompt  #acdpdir-prompt)
  136.         (help    #acdpdir-help)
  137.         (default "Sys:Utilities")
  138.     )
  139. )
  140.  
  141. (set destdir (tackon rootdestdir "ACDPlay"))
  142.  
  143. (if (= (exists destdir (noreq)) 2)
  144.     (set backup
  145.         (askbool
  146.             (prompt #backup-prompt)
  147.             (help   #backup-help)
  148.             (default 1)
  149.         )
  150.     )
  151. )
  152.  
  153. (set @default-dest destdir)
  154.  
  155. (set components
  156.     (askoptions
  157.         (prompt #components-prompt)
  158.         (help   #components-help)
  159.         (choices #components-main
  160.                  #components-docs
  161.                  #components-cats
  162.                  #components-rexx
  163.                  #components-cdid)
  164.         (default 31)
  165.     )
  166. )
  167.  
  168. (if (= components 0)
  169.     (exit #abort (quiet))
  170. )
  171.  
  172. (complete 10)
  173.  
  174. (set magicwb
  175.     (askbool
  176.         (prompt #magicwb-prompt)
  177.         (help   #magicwb-help)
  178.         (default 0)
  179.     )
  180. )
  181.  
  182. (set catalogs
  183.     (askchoice
  184.         (prompt #catalogs-prompt)
  185.         (help   #catalogs-help)
  186.         (choices #catalogs-german
  187.                  #catalogs-english
  188.                  #catalogs-norwegian)
  189.         (default #catalogs-default)
  190.     )
  191. )
  192.  
  193. (set language (select catalogs "deutsch" "english" "norsk"))
  194.  
  195. (complete 20)
  196.  
  197. (run "c/FindDevice >ENV:scsi_device" (prompt #getdev-prompt))
  198.  
  199. (set devicename
  200.     (askstring
  201.         (prompt #devicename-prompt)
  202.         (help   #devicename-help)
  203.         (default (getenv "scsi_device"))
  204.     )
  205. )
  206.  
  207. (run ("c/FindCDROM >ENV:scsi_unit %s" devicename) (prompt #getunit-prompt))
  208.  
  209. (set deviceunit
  210.     (asknumber
  211.         (prompt #deviceunit-prompt)
  212.         (help   #deviceunit-help)
  213.         (range 0 7)
  214.         (default (getenv "scsi_unit"))
  215.     )
  216. )
  217.  
  218. (complete 30)
  219.  
  220.  
  221. ;----------------------------------------- now we can start the installation
  222.  
  223.  
  224. (makedir destdir)
  225. (if (= magicwb 1)
  226.     (copyfiles
  227.         (source "ACDPlay.info")
  228.         (dest   rootdestdir)
  229.         (noposition)
  230.     )
  231.     (copyfiles
  232.         (source  "icons/ACDPlay-Dir.info")
  233.         (dest    rootdestdir)
  234.         (newname "ACDPlay.info")
  235.         (noposition)
  236.     )
  237. )
  238.  
  239. ; backup directory
  240. ;
  241. (if (= backup 1)
  242.   (
  243.     (makedir (tackon destdir #backup-dir)
  244.              (infos)
  245.     )
  246.     (copyfiles
  247.         (source  destdir)
  248.         (dest    (tackon destdir #backup-dir))
  249.         (pattern ("~(%s|%s.info)" #backup-dir #backup-dir))
  250.     )
  251.   )
  252. )
  253.  
  254. (complete 40)
  255.  
  256. ; copy cdplay.library
  257. ;
  258. (copylib
  259.     (prompt #copycdlib-prompt)
  260.     (help   #copycdlib-help)
  261.     (source "libs/cdplay.library")
  262.     (dest   "LIBS:")
  263.     (confirm)
  264.     (optional oknodelete askuser)
  265. )
  266.  
  267. (complete 50)
  268.  
  269. ; copy and configure main program
  270. ;
  271. (if (IN components 0)
  272.   (
  273.     (copyfiles
  274.         (source "ACDPlay/ACDPlay")
  275.         (dest   destdir)
  276.         (files)
  277.         (infos)
  278.     )
  279.     (if (= magicwb 0)                        ; 4 colour icons?
  280.       (copyfiles
  281.           (source "Icons/ACDPlay.info")
  282.           (dest   destdir)
  283.       )
  284.     )
  285.     (tooltype
  286.         (dest (tackon destdir "ACDPlay"))
  287.         (settooltype "(DEVICE")
  288.         (settooltype "DEVICE" devicename)
  289.         (settooltype "(UNIT")
  290.         (settooltype "UNIT" ("%ld" deviceunit ))
  291.         (noposition)
  292.     )
  293.   )
  294. )
  295.  
  296. ; copy documentation
  297. ;
  298. (if (IN components 1)
  299.   (
  300.     (copyfiles
  301.         (source (tackon "docs" (tackon language "ACDPlay.guide")))
  302.         (dest   destdir)
  303.         (infos)
  304.         (noposition)
  305.     )
  306.     (if (= magicwb 0)                        ; 4 colour icons?
  307.       (copyfiles
  308.           (source "Icons/ACDPlay.guide.info")
  309.           (dest   destdir)
  310.       )
  311.     )
  312.   )
  313. )
  314.  
  315. (complete 60)
  316.  
  317. ; copy catalogs
  318. ;
  319. (if (IN components 2)
  320.   (if (<> language "english")
  321.     (
  322.       (makedir (tackon destdir "catalogs"))
  323.       (copyfiles
  324.           (source (tackon "Catalogs" (tackon language "ACDPlay.catalog")))
  325.           (dest   (tackon destdir (tackon "catalogs" language)))
  326.       )
  327.     )
  328.   )
  329. )
  330.  
  331. (complete 70)
  332.  
  333. ; copy arexx examples
  334. ;
  335. (if (IN components 3)
  336.     (copyfiles
  337.         (source "Arexx")
  338.         (dest   (tackon destdir "ARexx"))
  339.         (all)
  340.     )
  341. )
  342.  
  343. (complete 80)
  344.  
  345. ; copy diskfiles
  346. ;
  347. (if (IN components 4)
  348.     (copyfiles
  349.         (source "Disks")
  350.         (dest   (tackon destdir "Disks"))
  351.         (all)
  352.     )
  353. )
  354.  
  355. ;------------------------------------------------------------------ clean up
  356.  
  357. ; kill these global variables
  358. ;
  359. (delete "ENV:scsi_device" (safe))
  360. (delete "ENV:scsi_unit" (safe))
  361.  
  362. (complete 100)
  363.