home *** CD-ROM | disk | FTP | other *** search
/ Knowledge Land / KNOWLEDGELA.ISO / pc / support / macsetup / samples / pysetup.ace < prev   
Encoding:
Text File  |  1996-08-25  |  11.5 KB  |  240 lines

  1. Refer to P:\SKY\ACE\ITEM\VALUE\LIST\STRING\STRING.ACE.
  2. Refer to P:\SKY\ACE\ITEM\OBJECT\XYOBJECT\STRINGBO\STRINGBO.ACE.
  3.  
  4. //Record that the system is trace_printing.
  5.  
  6. // Install splash screen: tylor
  7. Set the window title to "Pyramid: Challenge of the Pharaoh's Dream Install".
  8. Call a transparent screen the_screen.
  9. In the_screen,
  10.     Make _splash. Set it to a picture of SUPPORT\INSTIMG.CMP at 320,240.
  11. [
  12.     Make _cursor. Set it to a picture of SUPPORT\CMN\CONSOLE\NW.CMP at 320,240.
  13.     Control _cursor with the mouse.
  14. ]
  15. Fade the_screen to black in 0 seconds.
  16. Display the_screen.
  17. Fade the_screen from black in 1 seconds.
  18. Wait until the next cycle.
  19. Call the color 127,127,127 @ 0% the_color.
  20. Call a pen of SUPPORT\CMN\CONSOLE\LOADSAVE.FNT with black on the_color the_pen.
  21. In the_pen,
  22.     Set leftmargin to 5.
  23.     Set rightmargin to 5.
  24.     Set paragraphindent to 0.
  25. Record that the_pen is centered.
  26.  
  27. // Ari: We bring up the save file dialog in order to determine where to install the product.
  28. Make a library named SaveLib of "SaveFile".
  29. Make a libFunction named saveFile of "SaveFile" from SaveLib.
  30. In saveFile,
  31.         Make prompt.  Set it to "Where do you want to install Pyramid?".
  32.         Make defName.  Set it to "Pyramid".
  33.         Make macPath.  Set it to a fixedString with length 255.
  34.         Make p1.  Set it to a list.  In it,
  35.                 Make macPathLen.  Set it to 0.
  36.         Make macVol.  Set it to a fixedString with length 32.
  37.         Make p2.  Set it to a list.  In it,
  38.                 Make macVolLen.  Set it to 0.
  39.         Make pcPath.  Set it to a fixedString with length 255.
  40.         Make p3.  Set it to a list.  In it,
  41.                 Make pcPathLen.  Set it to 0.
  42. Call saveFile.
  43.  
  44. [ Tylor: changed to work the opposite way, as directed by Mark D.
  45. // Ari: We end the program if the user has decided to cancel the install.
  46. If saveFile's result equals 0, // "is 0"
  47.     trace_print "savefile's result equals 0".
  48.     Detach saveFile.
  49.     Detach SaveLib.
  50.     End this program.
  51.     Wait until the next cycle.
  52. ]
  53.     // Ari: We create new strings for the volumes and paths that don't have the padding of the fixed strings.
  54. If saveFile's result equals 1, // didn't cancel
  55.     Make spstart.  Set it to a stringpoint before character 1 of saveFile's macVol.
  56.     Make spend.  Set it to a stringpoint after character (saveFile's p2's macVolLen) of saveFile's macVol.
  57.     Make macVol.  Set it to the string between spstart and spend.
  58.     trace_print_concatenation {"macVol = ", macVol}.
  59.  
  60.     Set spstart to a stringpoint before character 1 of saveFile's macPath.
  61.     Set spend to a stringpoint after character (saveFile's p1's macPathLen) of saveFile's macPath.
  62.     Make macPath. Set it to the string between spstart and spend.
  63.     trace_print_concatenation {"macPath = ", macPath}.
  64.  
  65.     Set spstart to a stringpoint before character 1 of saveFile's pcPath.
  66.     Set spend to a stringpoint after character (saveFile's p3's pcPathLen) of saveFile's pcPath.
  67.     Make pcPath. Set it to the string between spstart and spend.
  68.     trace_print_concatenation {"pcPath = ", pcPath}.
  69.  
  70.     Wait until the next cycle.
  71.  
  72.     // Ari: We can hard code the volume name.
  73.     Call "pyramid1" the_volume.
  74.  
  75.     // Ari: We ensure that the necessary volume is mounted.
  76.     If the volume the_volume is not mounted,
  77.         Call a picture of SUPPORT\CMN\CONSOLE\INSERT1.CMP at 150,330 the_picture.
  78.         Append the_picture to the_screen.
  79.         Wait until the volume the_volume is mounted.
  80.         Detach the_picture.
  81.         Wait until the next cycle.
  82.  
  83.     // Ari: We set these weird Mac constructs, knowing that they won't be saved to the INI.
  84.     Set CD root to volume the_volume.
  85.     Set HD root to volume macVol.
  86.  
  87.     // tylor: show the cursor again
  88.     In the_screen,
  89.         Make _cursor. Set it to a picture of SUPPORT\CMN\CONSOLE\NW.CMP at 320,240.
  90.         Control _cursor with the mouse.
  91.     Wait until the next cycle.
  92.  
  93.     If (the free disk space on $PRODUCTHDROOT\) is less than (15 * 1024 * 1024),
  94.         Call a picture of SUPPORT\CMN\CONSOLE\BLANKBOX.CMP at 320,240 the_picture.
  95.         In the_picture,
  96.             Make _text. Set it to stringbox(SUPPORT\CMN\CONSOLE\SETPSPAC.TXT, the_pen, 20,80, (the_picture's size's x - 20 pixels),(the_picture's size's y - 20 pixels)).
  97.             In _text,
  98.                 Set backgroundcolor to transparent.
  99.                 Set palette to the_picture's bitmap's palette.
  100.             Make _ok_box. Set it to stringbox(SUPPORT\CMN\CONSOLE\OKAY.TXT, the_pen, 20,20, (the_picture's size's x - 20 pixels),(50 pixels)).
  101.             In _ok_box,
  102.                 Set backgroundcolor to transparent.
  103.                 //Call (a copy of the_pen) the_blue_pen.
  104.                 //Set the_blue_pen's color to blue.
  105.                 //Set _ok_box's pen to the_blue_pen.
  106.                 Set palette to the_picture's bitmap's palette.
  107.             Make _response. Set it to a null.
  108.             When the left mousebutton is pressed,
  109.                 Set _response to true.
  110.         Append the_picture to the_screen.
  111.         Wait until the_picture's _response is not a null.
  112.         Detach the_picture.
  113.  
  114.     Otherwise,
  115.         Fade the_screen's _splash to 70 percent black in .5 seconds.
  116.  
  117.         Call a picture of SUPPORT\CMN\CONSOLE\BLANKBOX.CMP at 320,240 the_picture.
  118.         In the_picture,
  119.             Make _text. Set it to stringbox(SUPPORT\CMN\CONSOLE\PLESWAIT.TXT, the_pen, 20,80, (the_picture's size's x - 20 pixels),(the_picture's size's y - 20 pixels)).
  120.             In _text,
  121.                 Set backgroundcolor to transparent.
  122.                 //trace_print the_picture.
  123.                 //trace_print palette(the_picture).
  124.                 //trace_print palette.
  125.                 Set palette to the_picture's bitmap's palette.
  126.         Append the_picture to the_screen.
  127.         // Tylor: want to get rid of the cursor picture during the copy process
  128.         Hide the_screen's _cursor.
  129.  
  130.         Wait until the next cycle.
  131.  
  132.         Make hdRootPath. Set it to concatenation {"$productHDroot", pcPath, "\\"}.
  133.  
  134.         // Tylor: adding thingee to check install time
  135.         Call now the_start_time.
  136.  
  137.         // Ari: We copy the install directory - given that the copy is not recursive, we may need to go in and copy some other stuff by hand.
  138.         //copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\" to hdRootPath.
  139.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\CURRENT" to hdRootPath.
  140.  
  141.         // Rename installed folder to preserve case sensitivity
  142.         Make a library named renameLib of "rename".
  143.         Make a libFunction named rename of "rename" from renameLib.
  144.         In rename,
  145.             Make oldPath. Set it to macPath.
  146.             Make newName. Set it to oldPath.
  147.         Call rename.
  148.  
  149.         Append ":" to macPath.
  150.         copy Macintosh file "pyramid1:support:mac:pyramid" to macPath.
  151.         copy Macintosh file "pyramid1:support:mac:cmdline.txt" to macPath.
  152.         copy Macintosh file "pyramid1:support:mac:default.ini" to macPath.
  153.         copy Macintosh file "pyramid1:support:mac:override.res" to macPath.
  154.         copy Macintosh file "pyramid1:support:mac:cdswap" to macPath.
  155.         copy Macintosh file "pyramid1:support:mac:apppath" to macPath.
  156.  
  157.         copy bale "$PRODUCTCDROOT\\SUPPORT\\CMN\\CONSOLE" to hdRootPath.
  158.         copy bale "$PRODUCTCDROOT\\SUPPORT\\CMN\\JOURNAL" to hdRootPath.
  159.         copy bale "$PRODUCTCDROOT\\SUPPORT\\CMN\\MSG" to hdRootPath.
  160.         copy bale "$PRODUCTCDROOT\\SUPPORT\\CMN\\MUSIC" to hdRootPath.
  161.         copy bale "$PRODUCTCDROOT\\SUPPORT\\CMN\\NEW" to hdRootPath.
  162.  
  163.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\START.DAC" to hdRootPath.
  164.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\START.DNA" to hdRootPath.
  165.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\START.DNF" to hdRootPath.
  166.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\START.INF" to hdRootPath.
  167.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\START.PAC" to hdRootPath.
  168.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\STATM.DAT" to hdRootPath.
  169.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\VALULIST.DAT" to hdRootPath.
  170.  
  171.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\CURRENT\\" to concatenation {hdRootPath, "CURRENT\\"}.
  172.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\GAME1\\" to concatenation {hdRootPath, "GAME1\\"}.
  173.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\GAME2\\" to concatenation {hdRootPath, "GAME2\\"}.
  174.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\GAME3\\" to concatenation {hdRootPath, "GAME3\\"}.
  175.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\GAME4\\" to concatenation {hdRootPath, "GAME4\\"}.
  176.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\GAME5\\" to concatenation {hdRootPath, "GAME5\\"}.
  177.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\GAME6\\" to concatenation {hdRootPath, "GAME6\\"}.
  178.         copy file "$PRODUCTCDROOT\\SUPPORT\\CMN\\GAME7\\" to concatenation {hdRootPath, "GAME7\\"}.
  179.  
  180.         //Tylor: time stuff
  181.         trace_print_concatenation{"Time to copy files: ", now - the_start_time}.
  182.         Set the_start_time to now.
  183.  
  184.         // Ari: We setup the INI correctly.
  185.         Set currentinisection to an inisection of "MAIN" from file "PYRAMID.INI".
  186.         trace_print currentinisection.
  187.  
  188.         Set currentinisection's MACPATH to macPath.
  189.         Set currentinisection's MACVOL to macVol.
  190.         Set currentinisection's PCPATH to pcPath.
  191.  
  192.         Set currentinisection's COMMON to concatenation {"$PRODUCTHDROOT", pcPath}.
  193.         Set currentinisection's CONSOLE to concatenation {"$PRODUCTHDROOT", pcPath, "\\CONSOLE"}.
  194.         Set currentinisection's CURRENT to concatenation {"$PRODUCTHDROOT", pcPath, "\\CURRENT"}.
  195.         Set currentinisection's JOURNAL to concatenation {"$PRODUCTHDROOT", pcPath, "\\JOURNAL"}.
  196.         Set currentinisection's MUSIC to concatenation {"$PRODUCTHDROOT", pcPath, "\\MUSIC"}.
  197.         Set currentinisection's NEW to concatenation {"$PRODUCTHDROOT", pcPath, "\\NEW"}.
  198.  
  199.         Set currentinisection's VOLUME1 to "PYRAMID1".
  200.         Set currentinisection's VOLUME2 to "PYRAMID2".
  201.         Set currentinisection's GAME1 to "*PYRAMID1:\\GAME".
  202.         Set currentinisection's GAME2 to "*PYRAMID2:\\GAME".
  203.         Set currentinisection's TuneFileExtension to ".MGM".
  204.  
  205.         Set currentinisection's allowTrueColorMode to "false".
  206.         Set currentinisection's borderColor to "0,0,0".
  207.         Set currentinisection's displaySoundErrors to "No".
  208.         Set currentinisection's DontNeedQuickTime to "Yes".
  209.         Set currentinisection's hideWaitCursor to "yes".
  210.         Set currentinisection's kidProof to "yes".
  211.         Set currentinisection's LANG to "ENG".
  212.         Set currentinisection's MaxCacheSize to "5".
  213.         Set currentinisection's MEM_CACHE to "2750".
  214.         Set currentinisection's MEM_POOL to "1000".
  215.         Set currentinisection's TUNE_ACTIVE to "NO".
  216.         Set currentinisection's wantTrueColorMode to "false".
  217.         Set currentinisection's WAITINTERVAL to "1500".
  218.         Set currentinisection's ILVBS to "320".
  219.  
  220.         // Tylor: time info
  221.  
  222.         trace_print_concatenation {"Time to write to INI: ", now - the_start_time}.
  223.  
  224.         Detach the_picture.
  225.         Wait until the next cycle.
  226.  
  227.         // Open the mac folder it was installed to
  228.         Append "Pyramid" to macPath.
  229.         Call macPath the_macpath.
  230.  
  231.         Make a library named openFldrLib of "openFldr".
  232.         Make a libFunction named openFldr of "openFldr" from openFldrLib.
  233.         In openFldr,
  234.             Make macPath.  Set it to the_macpath.
  235.         Call openFldr.
  236.  
  237. Fade the_screen from 70 percent to 100 percent black in .5 seconds.
  238. End this program.
  239.  
  240.