home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / PlainTalk Developer / Text-to-Speech / Installer Source / BuildEnglishTTS next >
Encoding:
Text File  |  1995-04-17  |  13.7 KB  |  366 lines  |  [TEXT/MPS ]

  1. #
  2. # Build the installer and disk set for English Text-to-Speech.
  3. # This is for development testing only; this script is not used by
  4. # SCM for actual builds.
  5. #
  6. # There is an option, -s, to just rebuild the installer script without
  7. # processing all the files to be installed.  This option can only be used
  8. # if you have run this script previously without the -s option.  If you
  9. # make a change that affects anything besides the installer script (e.g.
  10. # change, add, delete, or move a file to be installed) you need to run
  11. # this build script without the -s option.
  12. #
  13. # Assumes that the files to be installed have all been built, and that
  14. # the installer source pieces have all been checked out into the
  15. # current directory.
  16. #
  17. # This script could be more parameterized but it doesn't seem worth the
  18. # effort and complexity.  For example, the fact that there are three
  19. # disks generated is explicit in several places in the script, instead
  20. # of just in the definitions.
  21. #
  22. # This script could be done over as a MakeFile so that it's easy to only
  23. # redo the steps that are actually needed.
  24.  
  25.  
  26. # -------------------------------------------------------------------------------------------
  27. # Definitions
  28. # -------------------------------------------------------------------------------------------
  29.  
  30. Set Here            "`Directory`"                    # Main directory.
  31.  
  32. Set ExternalPiecesDir "{Here}ExternalPieces:"        # Location of files we didn't build.
  33.  
  34. Set AssemblyDir        "{Here}EnglishTTSAssembly:"        # Holds intermediate working files.
  35.  
  36. Set NetInstallDir    "{Here}English TTS:"            # Where the results go.
  37.  
  38. Set ScriptName        "English TTS Install Script"    # Result installer script.
  39.  
  40. Set Commands         "{Commands},{ExternalPiecesDir}" # There are some tools we use.
  41.  
  42.  
  43. # The names of the folder corresponding to each result floppy.
  44. # These names must match those in a .r file as well.
  45.  
  46. Set Disk1Dir        "{NetInstallDir}English TTS 1:"    # Folders for each result disk.
  47. Set Disk2Dir        "{NetInstallDir}English TTS 2:"
  48. Set Disk3Dir        "{NetInstallDir}English TTS 3:"
  49. Set Disk4Dir        "{NetInstallDir}English TTS 4:"
  50. Set Disk5Dir        "{NetInstallDir}English TTS 5:"
  51.  
  52.  
  53. # The names of the files (which have been copied to the assembly area) to include
  54. # in each compressed package.
  55. # These names must match those in a .r file as well.
  56.  
  57. Set Tome1Files        "∂"{AssemblyDir}MacinTalk 3∂"                    ∂
  58.                      ∂"{AssemblyDir}Voices:Ben∂"                    ∂
  59.                      ∂"{AssemblyDir}Voices:Boris∂"                    ∂
  60.                      ∂"{AssemblyDir}Voices:Brenda∂"                    ∂
  61.                      ∂"{AssemblyDir}Voices:Mariel∂"                    ∂
  62.                      ∂"{AssemblyDir}Voices:Marvin∂"                    ∂
  63.                      ∂"{AssemblyDir}Voices:Mr. Hughes∂"                ∂
  64.                      ∂"{AssemblyDir}Voices:Otis∂"                    ∂
  65.                      ∂"{AssemblyDir}Voices:RoboVox∂"                ∂
  66.                      ∂"{AssemblyDir}Voices:Xero∂"                    ∂
  67.                      ∂"{AssemblyDir}Voices:Deranged∂"                ∂
  68.                      ∂"{AssemblyDir}Voices:Pipe Organ∂"                ∂
  69.                      ∂"{AssemblyDir}Voices:Princess∂"                ∂
  70.                      ∂"{AssemblyDir}Voices:Ralph∂"                    ∂
  71.                      ∂"{AssemblyDir}Voices:Zarvox∂"                    "
  72.  
  73. Set Tome2Files        "∂"{AssemblyDir}Bruce∂"                            ∂
  74.                      ∂"{AssemblyDir}MacinTalk 2∂"                    "
  75.  
  76. # Agnes.rsrc2 and Victoria.rsrc2 are added separately to Tome3.
  77. Set Tome3Files        "∂"{AssemblyDir}MacinTalk Pro∂"                    ∂
  78.                      ∂"{AssemblyDir}Speech∂"                        ∂
  79.                      ∂"{AssemblyDir}Speech Manager∂"                ∂
  80.                      ∂"{AssemblyDir}Voices:Votron∂"                    ∂
  81.                      ∂"{AssemblyDir}Voices:Albert∂"                    ∂
  82.                      ∂"{AssemblyDir}Voices:Bad News∂"                ∂
  83.                      ∂"{AssemblyDir}Voices:Bahh∂"                    ∂
  84.                      ∂"{AssemblyDir}Voices:Bells∂"                    ∂
  85.                      ∂"{AssemblyDir}Voices:Boing∂"                    ∂
  86.                      ∂"{AssemblyDir}Voices:Bubbles∂"                ∂
  87.                      ∂"{AssemblyDir}Voices:Cellos∂"                    ∂
  88.                      ∂"{AssemblyDir}Voices:Fred∂"                    ∂
  89.                      ∂"{AssemblyDir}Voices:Good News∂"                ∂
  90.                      ∂"{AssemblyDir}Voices:Hysterical∂"                ∂
  91.                      ∂"{AssemblyDir}Voices:Junior∂"                    ∂
  92.                      ∂"{AssemblyDir}Voices:Kathy∂"                    ∂
  93.                      ∂"{AssemblyDir}Voices:Trinoids∂"                ∂
  94.                      ∂"{AssemblyDir}Voices:Whisper∂"                "
  95.  
  96. # Tome 4 has Agnes.rsrc1, done specially.
  97.  
  98. # Tome 5 has Victoria.rsrc1, done specially.
  99.  
  100.  
  101. # The names of the compressed packages; these appear on the result disks.
  102. # These names must match those in a .r file as well.
  103.  
  104. Set Tome1Name        "English TTS Tome 1"
  105. Set Tome2Name        "English TTS Tome 2"
  106. Set Tome3Name        "English TTS Tome 3"
  107. Set Tome4Name        "English TTS Tome 4"
  108. Set Tome5Name        "English TTS Tome 5"
  109.  
  110.  
  111. Set ScriptOnly        0                                # Assume build everything.
  112.  
  113.  
  114. # -------------------------------------------------------------------------------------------
  115. # Arguments
  116. # -------------------------------------------------------------------------------------------
  117.  
  118. If {#} >= 1  &&  "{1}" == "-s"
  119.     Set ScriptOnly 1
  120.     Shift
  121. End
  122.  
  123. If {#} != 1
  124.     Echo "### Argument error.  Syntax: {0} [-s] <files directory>"
  125.     Echo "###   -s                 Rebuild script only (don't rebuild files)"
  126.     Echo "###   <files directory>  Location of files to be installed"
  127.     Exit 1
  128. End
  129.  
  130.  
  131. # Convert the already built pieces directory to a full path name.  The standard format
  132. # makes using the variable much easier.
  133.  
  134. Set BuiltPiecesDir `Files -f -o -d -i "{1}"`
  135.  
  136.  
  137. # -------------------------------------------------------------------------------------------
  138. # Build the script
  139. # -------------------------------------------------------------------------------------------
  140.  
  141. Make -f "Installer Script.make" "{ScriptName}" -d For800K=1 > Make.out
  142. Execute Make.out
  143.  
  144.  
  145. # -------------------------------------------------------------------------------------------
  146. # Set up folder structure
  147. #
  148. # We really need to start with a clean slate because various tools will add to existing
  149. # files which really messes things up.
  150. # -------------------------------------------------------------------------------------------
  151.  
  152. If ! {ScriptOnly}
  153.     For dir in "{AssemblyDir}" "{NetInstallDir}" "{Disk1Dir}" "{Disk2Dir}" "{Disk3Dir}" ∂
  154.                                                                 "{Disk4Dir}" "{Disk5Dir}"
  155.         Delete -i -y "{dir}"
  156.         NewFolder "{dir}"
  157.     End
  158. End
  159.  
  160.  
  161. # -------------------------------------------------------------------------------------------
  162. # Copy built pieces to assembly area
  163. # -------------------------------------------------------------------------------------------
  164.  
  165. Duplicate -y "{ScriptName}"                                    "{AssemblyDir}"
  166.  
  167. If ! {ScriptOnly}
  168.     Duplicate -y "{BuiltPiecesDir}MacinTalk 2"                    "{AssemblyDir}"
  169.     Duplicate -y "{BuiltPiecesDir}MacinTalk 3"                    "{AssemblyDir}"
  170.     Duplicate -y "{BuiltPiecesDir}MacinTalk Pro"                "{AssemblyDir}"
  171.     Duplicate -y "{BuiltPiecesDir}Agnes"                        "{AssemblyDir}"
  172.     Duplicate -y "{BuiltPiecesDir}Bruce"                        "{AssemblyDir}"
  173.     Duplicate -y "{BuiltPiecesDir}Victoria"                        "{AssemblyDir}"
  174.     Duplicate -y "{BuiltPiecesDir}Speech Manager"                "{AssemblyDir}"
  175.     Duplicate -y "{BuiltPiecesDir}Speech"                        "{AssemblyDir}"
  176.     Duplicate -y "{BuiltPiecesDir}Voices:"                        "{AssemblyDir}Voices"
  177.     Duplicate -y "{BuiltPiecesDir}Using English Text-to-Speech" "{AssemblyDir}"
  178. End
  179.  
  180.  
  181. # -------------------------------------------------------------------------------------------
  182. # Copy non-built pieces to assembly area
  183. # -------------------------------------------------------------------------------------------
  184.  
  185. If ! {ScriptOnly}
  186.     Duplicate -y "{ExternalPiecesDir}SimpleText"                "{AssemblyDir}"
  187.     Duplicate -y "{ExternalPiecesDir}Installer"                    "{AssemblyDir}"
  188. End
  189.  
  190.  
  191. # -------------------------------------------------------------------------------------------
  192. # Set versions and dates
  193. # -------------------------------------------------------------------------------------------
  194.  
  195. # Hack for now.  Really need to use the SCM tools to do this.
  196.  
  197. If ! {ScriptOnly}
  198.     Echo "Include ∂"{AssemblyDir}Speech Manager∂" ∂'vers∂';" ∂
  199.         | Rez -o EnglishTTSVersions.rsrc -t 'rsrc' -c 'RSED'    # Must be in different directory.
  200.         
  201.     For file in `Files -f -o -s -r "{AssemblyDir}"`
  202.         Echo "Include ∂"EnglishTTSVersions.rsrc∂";" ∂
  203.             | Rez -a -o "{file}"
  204.         SetFile -d . -m . "{file}"
  205.     End
  206. End
  207.  
  208. If {ScriptOnly}
  209.     Echo "Include ∂"EnglishTTSVersions.rsrc∂";" ∂
  210.         | Rez -a -o "{AssemblyDir}{ScriptName}"
  211.     SetFile -d . -m . "{AssemblyDir}{ScriptName}"
  212. End
  213.  
  214.  
  215. # -------------------------------------------------------------------------------------------
  216. # Split files
  217. #
  218. # The split size needs to be hand tuned for each file to make maximum use of the
  219. # space on a floppy.  This is because the file is compressed after splitting, so
  220. # you have to guess what the compressed size will be.
  221. #
  222. # We need to set the file type and creator of the split pieces back to the
  223. # the original file's type and creator to get around a problem when
  224. # running ScriptCheck.  When ScriptCheck tries to get the version of the
  225. # file to fill in in the 'infa' it (or the atom extender) thinks it can't find
  226. # the file because the type and creator or wrong.  Oddly, there is no problem
  227. # getting the file's size though.  Also, we have to copy the 'vers' 1 resource
  228. # to the split pieces so that there is a version for ScriptCheck to find.
  229. # -------------------------------------------------------------------------------------------
  230.  
  231. If ! {ScriptOnly}
  232.     FileAndRsrcSplitterTool "{AssemblyDir}Agnes" -s 810000
  233.     SetFile -t 'ttvf' -c 'gala' "{AssemblyDir}Agnes.rsrc1"
  234.     SetFile -t 'ttvf' -c 'gala' "{AssemblyDir}Agnes.rsrc2"
  235.     Echo "Include ∂"{AssemblyDir}Agnes∂" 'vers' (1);" ∂
  236.             | Rez -a -o "{AssemblyDir}Agnes.rsrc1"
  237.     Echo "Include ∂"{AssemblyDir}Agnes∂" 'vers' (1);" ∂
  238.             | Rez -a -o "{AssemblyDir}Agnes.rsrc2"
  239.  
  240.     FileAndRsrcSplitterTool "{AssemblyDir}Victoria" -s 830000
  241.     SetFile -t 'ttvf' -c 'gala' "{AssemblyDir}Victoria.rsrc1"
  242.     SetFile -t 'ttvf' -c 'gala' "{AssemblyDir}Victoria.rsrc2"
  243.     Echo "Include ∂"{AssemblyDir}Victoria∂" 'vers' (1);" ∂
  244.             | Rez -a -o "{AssemblyDir}Victoria.rsrc1"
  245.     Echo "Include ∂"{AssemblyDir}Victoria∂" 'vers' (1);" ∂
  246.             | Rez -a -o "{AssemblyDir}Victoria.rsrc2"
  247. End
  248.  
  249.  
  250. # -------------------------------------------------------------------------------------------
  251. # Build Tomes
  252. # -------------------------------------------------------------------------------------------
  253.  
  254. If ! {ScriptOnly}
  255.  
  256.     # Tome 1
  257.     
  258.     Delete -i "{AssemblyDir}{Tome1Name}"
  259.     For file in {Tome1Files} 
  260.         Echo "# Compressing ∂"{file}∂"…"
  261.         InstaCompOneTool "{file}" -o "{AssemblyDir}{Tome1Name}"
  262.     End
  263.     Echo "Include ∂"{ExternalPiecesDir}Tome Resources∂" not 'ckid';" ∂
  264.         | Rez -a -o "{AssemblyDir}{Tome1Name}"            # Error message for double-click on tome.
  265.     SetFile -a C -c kakc -t idcp "{AssemblyDir}{Tome1Name}"
  266.     
  267.     
  268.     # Tome 2
  269.     
  270.     Delete -i "{AssemblyDir}{Tome2Name}"
  271.     For file in {Tome2Files} 
  272.         Echo "# Compressing ∂"{file}∂"…"
  273.         InstaCompOneTool "{file}" -o "{AssemblyDir}{Tome2Name}"
  274.     End
  275.     Echo "Include ∂"{ExternalPiecesDir}Tome Resources∂" not 'ckid';" ∂
  276.         | Rez -a -o "{AssemblyDir}{Tome2Name}"            # Error message for double-click on tome.
  277.     SetFile -a C -c kakc -t idcp "{AssemblyDir}{Tome2Name}"
  278.     
  279.     
  280.     # Tome 3
  281.     
  282.     Delete -i "{AssemblyDir}{Tome3Name}"
  283.     For file in {Tome3Files} 
  284.         Echo "# Compressing ∂"{file}∂"…"
  285.         InstaCompOneTool "{file}" -o "{AssemblyDir}{Tome3Name}"
  286.     End
  287.     
  288.     Echo "# Compressing ∂"{AssemblyDir}Agnes.rsrc2∂"…"
  289.     InstaCompOneTool -e -f "Agnes" "{AssemblyDir}Agnes.rsrc2"  -o "{AssemblyDir}{Tome3Name}"
  290.     
  291.     Echo "# Compressing ∂"{AssemblyDir}Victoria.rsrc2∂"…"
  292.     InstaCompOneTool -e -f "Victoria" "{AssemblyDir}Victoria.rsrc2"  -o "{AssemblyDir}{Tome3Name}"
  293.     
  294.     Echo "Include ∂"{ExternalPiecesDir}Tome Resources∂" not 'ckid';" ∂
  295.         | Rez -a -o "{AssemblyDir}{Tome3Name}"            # Error message for double-click on tome.
  296.     SetFile -a C -c kakc -t idcp "{AssemblyDir}{Tome3Name}"
  297.  
  298.     Echo "Include ∂"{AssemblyDir}MacinTalk 2∂" 'ttsp' (1) AS 'ttsp' (2);  ∂
  299.           Include ∂"{AssemblyDir}MacinTalk 3∂" 'ttsp' (1) AS 'ttsp' (3);" ∂
  300.             | Rez -a -o "{AssemblyDir}{Tome3Name}"
  301.  
  302.  
  303.     # Tome 4
  304.     
  305.     Delete -i "{AssemblyDir}{Tome4Name}"
  306.     Echo "# Compressing ∂"{AssemblyDir}Agnes.rsrc1∂"…"
  307.     InstaCompOneTool -e -f "Agnes" "{AssemblyDir}Agnes.rsrc1"  -o "{AssemblyDir}{Tome4Name}"
  308.     Echo "Include ∂"{ExternalPiecesDir}Tome Resources∂" not 'ckid';" ∂
  309.         | Rez -a -o "{AssemblyDir}{Tome4Name}"            # Error message for double-click on tome.
  310.     SetFile -a C -c kakc -t idcp "{AssemblyDir}{Tome4Name}"
  311.  
  312.  
  313.     # Tome 5
  314.     
  315.     Delete -i "{AssemblyDir}{Tome5Name}"
  316.     Echo "# Compressing ∂"{AssemblyDir}Victoria.rsrc1∂"…"
  317.     InstaCompOneTool -e -f "Victoria" "{AssemblyDir}Victoria.rsrc1"  -o "{AssemblyDir}{Tome5Name}"
  318.     Echo "Include ∂"{ExternalPiecesDir}Tome Resources∂" not 'ckid';" ∂
  319.         | Rez -a -o "{AssemblyDir}{Tome5Name}"            # Error message for double-click on tome.
  320.     SetFile -a C -c kakc -t idcp "{AssemblyDir}{Tome5Name}"
  321. End
  322.  
  323.  
  324. # -------------------------------------------------------------------------------------------
  325. # Create net install
  326. # -------------------------------------------------------------------------------------------
  327.  
  328. Duplicate -y "{AssemblyDir}{ScriptName}"                    "{NetInstallDir}"
  329. #Duplicate -y "{AssemblyDir}{ScriptName}"                    "{Disk1Dir}"
  330.  
  331. If ! {ScriptOnly}
  332.     Duplicate -y "{AssemblyDir}Installer"                        "{NetInstallDir}"
  333.     Duplicate -y "{AssemblyDir}Using English Text-to-Speech"    "{NetInstallDir}"
  334.     
  335.     Duplicate -y "{AssemblyDir}Installer"                        "{Disk1Dir}"
  336.     Duplicate -y "{AssemblyDir}{Tome1Name}"                        "{Disk1Dir}"
  337.     Duplicate -y "{AssemblyDir}SimpleText"                        "{Disk1Dir}"
  338.     Duplicate -y "{AssemblyDir}Using English Text-to-Speech"    "{Disk1Dir}"
  339.     
  340.     Duplicate -y "{AssemblyDir}{Tome2Name}"                        "{Disk2Dir}"
  341.     
  342.     Duplicate -y "{AssemblyDir}{Tome3Name}"                        "{Disk3Dir}"
  343.  
  344.     Duplicate -y "{AssemblyDir}{Tome4Name}"                        "{Disk4Dir}"
  345.  
  346.     Duplicate -y "{AssemblyDir}{Tome5Name}"                        "{Disk5Dir}"
  347. End
  348.  
  349.  
  350. # -------------------------------------------------------------------------------------------
  351. # Run ScriptCheck
  352. #
  353. # Besides checking the script and files also fills in some info in the script and so is an
  354. # essential step.
  355. #
  356. # Ignore the error messages about the 'icmt's not being referenced; the messages
  357. # are spurious.
  358. # -------------------------------------------------------------------------------------------
  359.  
  360. Duplicate -y "{ExternalPiecesDir}InstaCompOneSCExt.rsrc" "{NetInstallDir}{ScriptName}.scx"
  361. Directory "{NetInstallDir}"                                # ScriptCheck can't take long names.
  362. ScriptCheck -h -a -d "{ScriptName}"
  363. Directory "{Here}"
  364. Duplicate -y "{NetInstallDir}{ScriptName}" "{Disk1Dir}"
  365. Delete "{NetInstallDir}{ScriptName}.scx"
  366.