home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Sound / Tracker / STUDIO16-3'0.DMS / in.adf / Studio16.Install < prev   
Encoding:
Text File  |  1994-01-26  |  13.8 KB  |  626 lines

  1. ; $VER: Studio16.Install 1.3 (14.12.93)
  2. ; Installer script for install Studio16 3.0
  3. ;
  4. ; USAGE: Installer Studio16.Install
  5. ;
  6.  
  7. (complete 0)
  8.  
  9. ;=============================================================================
  10. ; the name of the disk
  11. (set #s16-disk1-name "Studio16_1")
  12. (set #s16-disk2-name "Studio16_2")
  13.  
  14. ;=============================================================================
  15. ; some other handy names
  16. (set #s16-app-name  "Studio16 3.0")
  17. (set #s16-base-name "Studio16_3")
  18. (set #s16-base-dir  "Studio16_3:")
  19. (set #s16-orig-base-name "Studio16")
  20.  
  21. ;=============================================================================
  22. ; English strings
  23.  
  24. (if (= @language "english")
  25. (
  26. (set #bad-kick
  27. (cat "You must be using Kickstart 2.04 or higher to install " #s16-app-name
  28. ))
  29.  
  30. (set #confirm-target
  31. (cat "\n" #s16-app-name " appears to already be installed in \"%s\".\n\n"
  32.      #s16-app-name " will now be installed on your hard drive.\n"
  33.      "The previous version already present will be replaced.  If applicable, "
  34.      "certain files from previous releases will be deleted.\n\n"
  35.      "Are you sure you want " #s16-app-name " installed in the \"%s\" drawer?"
  36. ))
  37.  
  38. (set #confirm-target-help
  39. (cat "\nThe installer has determined that you may already have the " #s16-app-name " "
  40.      "software installed on your system.  If this is wrong or you want "
  41.      "to install the new " #s16-app-name " software elsewhere, select \"NO\".\n\n"
  42.      "If you want to proceed with the installation in \"%s\", select "
  43.      "\"YES\".  Proceeding with the installation will cause any " #s16-app-name " "
  44.      "files in this drawer to be replaced with newer files.\n\n"
  45.      "WARNING!: OBSOLETE FILES WILL BE DELETED."
  46. ))
  47.  
  48. (set #confirm-copy-fastfilesys
  49. (cat "Copying new version of FastFileSystem to your L: drawer."
  50. ))
  51.  
  52. (set #confirm-copy-fastfilesys-help
  53. (cat @copylib-help
  54. ))
  55.  
  56. (set #confirm-copy-hdtoolbox
  57. (cat "Copy new version of HDToolBox to your SYS:Tools drawer."
  58. ))
  59.  
  60. (set #confirm-copy-hdtoolbox-help
  61. (cat @copylib-help
  62. ))
  63.  
  64.  
  65. (set #which-disk
  66. (cat "Where should " #s16-app-name " be installed?\n"
  67.      "(A new \"" #s16-base-name "\" drawer will be created)"
  68. ))
  69.  
  70. (set #which-disk-help
  71. (cat "\nThis section lets you choose on which hard drive partition the "
  72.      #s16-app-name " files will be installed. These should normally go in the "
  73.      "same location as the current " #s16-app-name " files.\n\n"
  74.      @askdir-help
  75. ))
  76.  
  77.  
  78. (set #ask-s16-disk
  79. (cat "\n\nPlease insert the \"%s\" disk in any floppy drive."
  80. ))
  81.  
  82. (set #msg-send-reg-card
  83. (cat    "\nNow would be a good time to fill out your registration card.  "
  84.         "This form must be mailed to receive software updates and technical support."
  85. ))
  86.  
  87. (set #msg-no-cards
  88. (cat    "\nI could not find any audio cards!\n"
  89.         "Check Installation, or install card(s)."
  90. ))
  91.  
  92. (set #msg-no-AD1012-handler
  93. (cat    "\n" #s16-app-name " does not include the AD1012 handler.\n"
  94. ))
  95.  
  96. (set #msg-num-cards
  97. (cat    "\nI found%s.\n"
  98.         "Is this correct?"
  99. ))
  100.  
  101. (set #msg-num-cards-ad516    " %ld AD516")
  102. (set #msg-num-cards-ad1012    " %ld AD1012")
  103. (set #msg-num-cards-card    " card")
  104. (set #msg-num-cards-cards    " cards")
  105.  
  106. (set #msg-fix-cards
  107. (cat    "\nMake sure your audio cards are installed properly "
  108.         "before installing " #s16-app-name "."
  109. ))
  110.  
  111. (set #msg-update-old-version
  112. (cat "\nInstaller has found a copy of %s that may be obsolete.\n"
  113.      "You may need to update to a later version of %s "
  114.      "to work with " #s16-app-name ".\n"
  115. ))
  116.  
  117.  
  118. (set #msg-update-old-version
  119. (cat "\nInstaller has found a copy of %s that may be obsolete.\n"
  120.      "You may need to update to a later version of %s "
  121.      "to work with " #s16-app-name ".\n"
  122. ))
  123.  
  124.  
  125. (set #working-deletefiles
  126. (cat "\n\nRemoving obsolete files..."
  127. ))
  128.  
  129. (set #working-movefiles
  130. (cat "\n\nMoving obsolete " #s16-app-name " files to OLD..."
  131. ))
  132.  
  133. (set #working-copyfiles
  134. (cat "\n\nInstalling " #s16-app-name " files..."
  135. ))
  136.  
  137. (set #working-startup
  138. (cat "\n\nUpdating S:User-Startup..."
  139. ))
  140.  
  141. (set #startup-assign
  142. (cat "Assign " #s16-base-dir " \"%s\"\n"
  143. ))
  144.  
  145. (set #startup-s16
  146. (cat "\n\nThe following lines need to be added to your User-Startup file:\n\n"
  147.      #startup-assign
  148. ))
  149.  
  150. (set #all-done
  151. (cat "\n" #s16-app-name " Installation completed."
  152. ))
  153.  
  154. ))
  155.  
  156.  
  157. ;=============================================================================
  158. ; Procedure to copy the sound card handlers....
  159. ;
  160. ; put number of cards in       'num_cards'.
  161. ; put the handler file name in 'handler_name'
  162. ;
  163. (procedure copy_handlers
  164. (
  165.     (if (> num_cards 0)
  166.     (
  167.         (set handler_src    (tackon (tackon target "Dormant") handler_name))
  168.         (set handler_dest (tackon target "Drivers"))
  169.  
  170.         (if (> num_cards 1)
  171.         (
  172.             (set handler_name (cat handler_name "%ld"))
  173.  
  174.             (set n 0)
  175.             (while (< n num_cards)
  176.             (
  177.                 (set n (+ n 1))
  178.  
  179.                 (copyfiles    (source    handler_src)
  180.                                 (dest        handler_dest)
  181.                                 (newname    (handler_name n))
  182.                                 (infos)
  183.                 )
  184.             ))
  185.  
  186.             (delete    handler_src)
  187.             (delete    (cat handler_src ".info"))
  188.         )
  189. ;        else
  190.         (
  191.             (set    handler_dest    (tackon    handler_dest    handler_name))
  192.  
  193.             (rename    handler_src    handler_dest)
  194.             (rename    (cat handler_src ".info")    (cat handler_dest    ".info"))
  195.         ))
  196.     ))
  197. ))
  198.  
  199. ;=============================================================================
  200. ; procedure to call on exit...
  201.  
  202. (procedure TERMINATE
  203.    (makeassign "S16.1")
  204.    (makeassign "S16.2")
  205. )
  206.  
  207.  
  208. ;=============================================================================
  209. ; termination stuff
  210.  
  211. (onerror (TERMINATE))
  212.  
  213.  
  214. ;=============================================================================
  215. ; make sure we are running under V37 or higher...
  216.  
  217. (if (< (/ (getversion) 65536) 37)
  218. (
  219.     (abort #bad-kick)
  220. ))
  221.  
  222.  
  223. ;=============================================================================
  224. ; do a bit of set up...
  225.  
  226. (delopts "oknodelete" "force" "askuser")
  227.  
  228.  
  229. ;=============================================================================
  230. ; Greetings...
  231.  
  232. (welcome)
  233. (set old_level @user-level)
  234.  
  235. ; We really want the questions to be asked...
  236. (user 2)
  237.  
  238. ;=============================================================================
  239. ; Check for audio cards...
  240. ;
  241. ; We do this before we begin the installation...
  242. ;
  243. (set num_AD1012_cards    0)
  244. (set num_AD516_cards        0)
  245.  
  246. (if (= (run ("ScanCard MANUFACTURER 2127 PRODUCT 1 ENVNAME num_cards") (safe)) 0)
  247. (
  248.     (set num_AD1012_cards (+ (getenv "num_cards") 0))
  249. ))
  250.  
  251. (if (= (run ("ScanCard MANUFACTURER 2127 PRODUCT 2 ENVNAME num_cards") (safe)) 0)
  252. (
  253.     (set num_AD516_cards  (+ (getenv "num_cards") 0))
  254. ))
  255.  
  256. (run ("UnSetEnv num_cards") (safe))
  257.  
  258. (if (> (+ num_AD1012_cards num_AD516_cards) 0)
  259. (
  260.     (set    card-txt    "")
  261.  
  262.     (if (> num_AD1012_cards 0)
  263.     (
  264.         (set card-txt (cat card-txt (#msg-num-cards-ad1012 num_AD1012_cards)))
  265.     ))
  266.  
  267.     (if (> num_AD516_cards 0)
  268.     (
  269.         (if card-txt
  270.         (
  271.             (set card-txt (cat card-txt " and"))
  272.         ))
  273.         (set card-txt (cat card-txt (#msg-num-cards-ad516 num_AD516_cards)))
  274.     ))
  275.  
  276.     (if (> (+ num_AD1012_cards num_AD516_cards) 1)
  277.     (
  278.         (set card-txt (cat card-txt #msg-num-cards-cards))
  279.     )
  280. ;    else
  281.     (
  282.         (set card-txt (cat card-txt #msg-num-cards-card))
  283.     ))
  284.  
  285.     (if    (NOT    (askbool    (prompt    (#msg-num-cards card-txt))
  286.                                 (help        @askbool-help)
  287.                                 (default    1)
  288.                     )
  289.             )
  290.     (
  291.         (abort    #msg-fix-cards)
  292.     ))
  293. )
  294. ;else
  295. (
  296.     (abort    #msg-no-cards)
  297. ))
  298.  
  299. ;=============================================================================
  300. ; Let the user know that we don't work with AD1012 cards yet...
  301. (if (> num_AD1012_cards 0)
  302. (
  303.     (if (> num_AD516_cards 0)
  304.     (
  305.         (message    #msg-no-AD1012-handler)
  306.     )
  307. ;    else
  308.     (
  309.         (abort    #msg-no-AD1012-handler)
  310.     ))
  311. ))
  312.  
  313. ;=============================================================================
  314. ; get target drawer where Studio16 is to be installed
  315.  
  316. (set target (getassign #s16-base-dir "a"))
  317.  
  318. (if target
  319. (
  320.     (set target (pathonly target))
  321. )
  322. ;else
  323. (
  324.     (set target @default-dest)
  325. ))
  326.  
  327. (set ask_again TRUE)
  328.  
  329. (while (= ask_again TRUE)
  330. (
  331.     (set ask_again FALSE)
  332.     (set virgin_install TRUE)
  333.  
  334.     (set target    (askdir    (prompt    #which-disk)
  335.                                 (help        #which-disk-help)
  336.                                 (default    target)
  337.                                 (disk)
  338.                     )
  339.     )
  340.  
  341.     ; check if the user picked a "Studio16_3" drawer by accident.
  342.     ;
  343.     (if (patmatch #s16-base-name (fileonly target))
  344.     (
  345.         (set target (pathonly target))
  346.     )
  347. ;    else
  348.     (
  349.         ; check if the user picked a "Studio16" drawer by accident.
  350.         ;
  351.         (if (patmatch #s16-orig-base-name (fileonly target))
  352.         (
  353.             (set target (pathonly target))
  354.         ))
  355.     ))
  356.  
  357.     (if (exists (tackon target #s16-base-name))
  358.     (
  359.         (set virgin_install FALSE)
  360.  
  361.         (if    (not    (askbool    (prompt    (#confirm-target target target))
  362.                                     (help        (#confirm-target-help target))
  363.                                     (default    1)
  364.                         )
  365.                 )
  366.         (
  367.             (set ask_again TRUE)
  368.         ))
  369.     )
  370. ;    else
  371.     (
  372.         (makedir    (tackon target #s16-base-name) (infos))
  373.     ))
  374. ))
  375.  
  376. (user old_level)
  377.  
  378. (set target (tackon target #s16-base-name))
  379. (set @default-dest target)
  380.  
  381. ;=============================================================================
  382. ; Delete any files that are obsolete now...
  383.  
  384. (if (= virgin_install FALSE)
  385. (
  386.     (working #working-deletefiles)
  387.  
  388.     (set n 0)
  389.     (while    (set oldfile    (select n    "0 DiskIO"
  390.                                                     "0 RealtimeDelay"
  391.                                                     "0 Transport"
  392.                                                     "0 OpenList"
  393.                                                     "0 MessageMonitor"
  394.                                                     "0 ModList"
  395.                                                     "0 AD516Handler"
  396.                                                     "0 AD1012Handler"
  397.                                                     "1 Drivers"
  398.                                                     "1 Config"
  399.                                                     "2 SMPTEOutput"
  400.                                                     ""
  401.                                     )
  402.                 )
  403.     (
  404.         (set n (+ n 1))
  405.  
  406.         (set oldop        (substr oldfile 0 1))
  407.         (set oldfile    (substr oldfile 2))
  408.  
  409.         (select (+ oldop 0)
  410.  
  411.             ;    operation 0 - Delete from    target/Apps,
  412.             ;                                        target/Drivers,
  413.             ;                                        target/Utilities,
  414.             ;                                        target/ProjectMenu,
  415.             ;                                        target/Dormant,
  416.             (
  417.                 (set dircount 0)
  418.                 (while    (set    targetdir    (select    dircount        "Apps"
  419.                                                                                 "Drivers"
  420.                                                                                 "Utilities"
  421.                                                                                 "ProjectMenu"
  422.                                                                                 "Dormant"
  423.                                                                                 ""
  424.                                                     )
  425.                             )
  426.                 (
  427.                     (set dircount (+ dircount 1))
  428.  
  429.                     (if (exists (tackon (tackon target targetdir) oldfile))
  430.                     (
  431.                         (delete    (tackon (tackon target targetdir) oldfile))
  432.                         (delete    (cat (tackon (tackon target targetdir) oldfile) ".info"))
  433.                     ))
  434.                 ))
  435.             )
  436.  
  437.             ;    operation 1 - Copy to OLD/(drawer) from target/(drawer)
  438.             ;
  439.             (
  440.                 ; check if the 'oldfile' is actually a drawer...
  441.                 ;
  442.                 (if (= (exists (tackon target oldfile)) 2)
  443.                 (
  444.                     (set olddir (tackon target "OLD"))
  445.  
  446.                     (if (NOT (exists olddir))
  447.                     (
  448.                         (makedir    olddir)
  449.                     ))
  450.  
  451.                     (if (NOT (exists (tackon olddir oldfile)))
  452.                     (
  453.                         (makedir    (tackon olddir oldfile))
  454.                     ))
  455.  
  456.                     (foreach    (tackon target oldfile) "#?"
  457.                     (
  458.                         (copyfiles    (source    (tackon (tackon target oldfile) @each-name))
  459.                                         (dest        (tackon olddir oldfile))
  460.                         )
  461.  
  462.                         (delete    (tackon (tackon target oldfile) @each-name))
  463.                     ))
  464.                 ))
  465.             )
  466.  
  467.             ;    operation 2 - Check for        target/Apps,
  468.             ;                                        target/Drivers,
  469.             ;                                        target/Utilities,
  470.             ;                                        target/ProjectMenu,
  471.             ;                                        target/Dormant,
  472.             (
  473.                 (set dircount 0)
  474.                 (while    (set    targetdir    (select    dircount        "Apps"
  475.                                                                                 "Drivers"
  476.                                                                                 "Utilities"
  477.                                                                                 "ProjectMenu"
  478.                                                                                 "Dormant"
  479.                                                                                 ""
  480.                                                     )
  481.                             )
  482.                 (
  483.                     (set dircount (+ dircount 1))
  484.  
  485.                     (if (exists (tackon (tackon target targetdir) oldfile))
  486.                     (
  487.                         (message    #msg-update-old-version oldfile oldfile)
  488.                     ))
  489.                 ))
  490.             )
  491.  
  492.         )
  493.     ))
  494.  
  495.     (complete 5)
  496. ))
  497.  
  498. ;=============================================================================
  499. ; ask for Disk 1
  500.  
  501. (askdisk    (prompt    (#ask-s16-disk #s16-disk1-name))
  502.             (help        @askdisk-help)
  503.             (dest        #s16-disk1-name)
  504.             (newname    "S16.1")
  505. )
  506.  
  507. ;=============================================================================
  508. ; Now show the reg-card message and eventually collect the serial number
  509.  
  510. (message #msg-send-reg-card)
  511.  
  512.  
  513. ;=============================================================================
  514. ; Now copy some files from Disk 1...
  515.  
  516. (working #working-copyfiles)
  517.  
  518. (copyfiles    (source    "S16.1:Studio16")
  519.                 (dest        target)
  520.                 (all)
  521. )
  522.  
  523. (copyfiles    (source    "S16.1:Studio16.info")
  524.                 (dest        (pathonly target))
  525.                 (newname    (cat #s16-base-name ".info"))
  526. )
  527.  
  528. (copyfiles    (source    "S16.1:Read_Me")
  529.                 (dest        target)
  530.                 (infos)
  531. )
  532.  
  533. (complete 50)
  534.  
  535. ;=============================================================================
  536. ; ask for Disk 2
  537.  
  538. (askdisk    (prompt    (#ask-s16-disk #s16-disk2-name))
  539.             (help        @askdisk-help)
  540.             (dest        #s16-disk2-name)
  541.             (newname    "S16.2")
  542. )
  543.  
  544. ;=============================================================================
  545. ; Now copy some files from Disk 2...
  546.  
  547. (working #working-copyfiles)
  548.  
  549. (copyfiles    (source    "S16.2:Studio16")
  550.                 (dest        target)
  551.                 (all)
  552. )
  553.  
  554. (complete 70)
  555.  
  556. (copyfiles    (source    "S16.2:Extras")
  557.                 (dest        (tackon target "Extras"))
  558.                 (pattern "~(#?.lha)")
  559.                 (files)
  560.                 (infos)
  561. )
  562.  
  563. (complete 75)
  564.  
  565. (copylib        (prompt    #confirm-copy-fastfilesys)
  566.                 (help        #confirm-copy-fastfilesys-help)
  567.                 (source    "S16.2:Extras/L/FastFileSystem")
  568.                 (dest        "L:")
  569.                 (confirm)
  570.                 (optional)
  571. )
  572.  
  573. (copylib        (prompt    #confirm-copy-hdtoolbox)
  574.                 (help        #confirm-copy-hdtoolbox-help)
  575.                 (source    "S16.2:Extras/Tools/HDToolBox")
  576.                 (dest        "SYS:Tools")
  577.                 (confirm)
  578.                 (optional)
  579.                 (infos)
  580. )
  581.  
  582. (complete 80)
  583.  
  584. ;=============================================================================
  585. ; Install the AD1012 handlers... (don't have an AD1012 handler yet...)
  586. ;
  587. ;(set num_cards            num_AD1012_cards)
  588. ;(set handler_name        "AD1012Handler")
  589. ;(copy_handlers)
  590. ;
  591. ;(complete 85)
  592.  
  593. ;=============================================================================
  594. ; Install the AD516 handlers...
  595.  
  596. (set num_cards            num_AD516_cards)
  597. (set handler_name        "AD516Handler")
  598. (copy_handlers)
  599.  
  600. (complete 90)
  601.  
  602. ;=============================================================================
  603. ; update startup-sequence
  604.  
  605. (working #working-startup)
  606.  
  607. (startup @app-name    (prompt    (#startup-s16 ("%s" target) start-options))
  608.                             (help        @startup-help)
  609.                             (command (#startup-assign target))
  610. )
  611.  
  612. ; Make the assignment so the user doesn't have to reboot...
  613. ;
  614. (makeassign #s16-base-name target)
  615. (run "avail flush")
  616.  
  617. (complete 100)
  618.  
  619. ;=============================================================================
  620. ; "END OF LINE."
  621. ;
  622. (TERMINATE)
  623.  
  624. (exit #all-done)
  625.  
  626.