home *** CD-ROM | disk | FTP | other *** search
/ Knowledge Land / KNOWLEDGELA.ISO / pc / support / macsetup / fmsetup.ace < prev    next >
Encoding:
Text File  |  1996-10-02  |  18.8 KB  |  472 lines

  1.  
  2. A fileCopier is a kind of xyobject which has:
  3.  
  4.     A way to get a fileCopier of a number 'n' files from an xynumber 'a' to an xynumber 'b',
  5.  
  6.         Make new.  Set it to an xyobject from a to b.
  7.         Make it into a fileCopier.
  8.         Record that it is not timing.
  9.         In new,
  10.             Make count.  Set it to 0.
  11.             Make total.  Set it to n.
  12.             Make index.  Set it to 1.
  13.             Make data.   Set it to 0.
  14.             Make progressBar.  Set it to a black rectangle with blue border from 0,0 to size.
  15.             In it,
  16.                 Make projector.  Set it to a transparent rectangle with blue border from 0,0 to 0,(size's y).
  17.                 Make progress.  Set it to a blue rectangle from 0,0 to 0,(size's y).
  18.  
  19.             When downclicked,
  20.                 End this program.
  21.  
  22.         Detach it.  Return it.
  23.  
  24.     A way to display message a string 's' in it,
  25.         Do nothing.
  26.  
  27.     A way to copy file a string 'a' to a string 'b' in it,
  28.  
  29.         Call it f.
  30.         Project 1 to progress in f.
  31.         copy file a to b.
  32.         Add 1 to progress in f.
  33.  
  34.     A way to copy bale a string 'a' to a string 'b' in it,
  35.  
  36.         Call it f.
  37.         Project 1 to progress in f.
  38.         copy bale a to b.
  39.         Add 1 to progress in f.
  40.  
  41.     A way to copy macintosh file a string 'a' to a string 'b' in it,
  42.  
  43.         Call it f.
  44.         Project 1 to progress in f.
  45.         copy macintosh file a to b.
  46.         Add 1 to progress in f.
  47.  
  48.     A way to copy file a string 'a' to a string 'b' in it with a number 'n',
  49.  
  50.         Call it f.
  51.         Project n to progress in f.
  52.         copy file a to b.
  53.         Add n to progress in f.
  54.  
  55.     A way to copy bale a string 'a' to a string 'b' in it with a number 'n',
  56.  
  57.         Call it f.
  58.         Project n to progress in f.
  59.         copy bale a to b.
  60.         Add n to progress in f.
  61.  
  62.     A way to copy macintosh file a string 'a' to a string 'b' in it with a number 'n',
  63.  
  64.         Call it f.
  65.         Project n to progress in f.
  66.         copy macintosh file a to b.
  67.         Add n to progress in f.
  68.  
  69.     A way to project a number 'n' to progress in it,
  70.  
  71.         Call it f.
  72.         f's count += n.
  73.         Set f's progressBar's projector's end's x to (((f's count) / (f's total)) *
  74.         f's progressBar's size's x).
  75.         Wait until the next cycle.
  76.  
  77.     A way to add a number 'n' to progress in it,
  78.  
  79.         Call it f.
  80.         Set f's progressBar's progress's end's x to (((f's count) / (f's total)) *
  81.         f's progressBar's size's x).
  82.         Wait until the next cycle.
  83.  
  84. To remove the last character from a string 's',
  85.     Detach s's character # (the number of characters in s).
  86.  
  87. To get a string 's' from the CD,
  88.     Make t.  Set it to the application path.
  89.     Append s to t.
  90.     log t.
  91.     Return t.
  92.  
  93. To get a string 's' from the mac CD,
  94.     Make t.  Set it to the application mac path.
  95.     Append s to t.
  96.     log t.
  97.     Return t.
  98.  
  99. To get cat string1 and string2,
  100.     Make s. set it to string1.
  101.     append string2 to s.
  102.     Return s.
  103.  
  104. To get cat string1 and number1,
  105.     Make s. set it to string1.
  106.     print number1 to string1.
  107.     Return s.
  108.  
  109. To get the install volume,
  110.     Make p.  Set it to the application mac path.
  111.     Make v.  Set it to "".
  112.     Make colon.  Set it to ":".
  113.     For each character 'c' in p,
  114.         If c = colon's character,
  115.             End this loop.
  116.         Otherwise,
  117.             Append c to v.
  118.     log cat "volume:  " and v.
  119.     Return v.
  120.  
  121. Record that system is not logpaused.
  122.  
  123. A logwindow is a kind of stringbox which has:
  124.  
  125.     A way to get a logwindow of a string 's' using a pen 'p' from an xynumber 'a' to an xynumber 'b',
  126.  
  127.         Make a stringbox of s using p from a to b.
  128.         Make it into a logwindow.  In it,
  129.             Make buffer.  Set it to s.
  130.         Set its backgroundcolor to p's backgroundcolor.
  131.         Detach it.  Return it.
  132.  
  133.     A way to log a string 's' in it,
  134.  
  135.         Append "<p>" to its buffer.
  136.         Append s to its buffer.
  137.         Set its beginning to the beginning of its buffer.
  138.         Record that system is not ready.
  139.         If system is logpaused,
  140.             Wait until system is ready.
  141.  
  142.     A way to log a string 's',
  143.  
  144.         Log s in mainscreen's logwindow.
  145.  
  146.     A way to log a number 'n',
  147.  
  148.         Make s.  Set it to "".
  149.         Print n to s.
  150.         Log s.
  151.  
  152.     A way to enable logging,
  153.  
  154.         Show mainScreen's logwindow.
  155.  
  156.     A way to disable logging,
  157.  
  158.         Hide mainScreen's logwindow.
  159.  
  160. In system,
  161.     Make whitePen.  Set it to a pen of ARIAL10.FNT with white on transparent.
  162.     In it,
  163.         Set leftmargin to 5.
  164.         Set rightmargin to 5.
  165.         Set paragraphIndent to 0.
  166.     Record that it is centered.
  167.  
  168.     Make BlackPen.  Set it to a pen of ARIAL10.FNT with black on white.
  169.     In it,
  170.         Set leftmargin to 5.
  171.         Set rightmargin to 5.
  172.         Set paragraphIndent to 0.
  173.  
  174.     Make answer.  Set it to "".
  175.  
  176. Record that system is not indialog.
  177.  
  178. A yesnodialog is a kind of picture which has:
  179.  
  180.     A way to get a yes or no dialog asking a string 'a',
  181.  
  182.         Make new.  Set it to a picture of ART\DI_YESNO.CMP from 160,160 to 455,309.
  183.         Make it into a yesnodialog.
  184.         In it,
  185.             Make a stringbox of a using blackPen from 12,35 to 282,114.
  186.             Set its backgroundcolor to blackPen's backgroundcolor.
  187.             Make yes.  Set it to an xyobject from 172,5 to 219,31.
  188.             In it,
  189.                 Make a picture of ART\DI_YESDN.CMP from 0,0 to 47,26.
  190.                 Hide it.
  191.                 When downclicked,
  192.                     Show this object's picture.
  193.                 When upclicked,
  194.                     Hide this object's picture.
  195.                     Set answer to "yes".
  196.                     Record that system is not indialog.
  197.                     Detach this object's container.
  198.  
  199.             Make no.  Set it to an xyobject from 228,5 to 275,31.
  200.             In it,
  201.                 Make a picture of ART\DI_NODN.CMP from 0,0 to 47,26.
  202.                 Hide it.
  203.                 When downclicked,
  204.                     Show this object's picture.
  205.                 When upclicked,
  206.                     Hide this object's picture.
  207.                     Set answer to "no".
  208.                     Record that system is not indialog.
  209.                     Detach this object's container.
  210.  
  211.         Record that system is indialog.
  212.         Detach new.  Return it.
  213.  
  214. A messagedialog is a kind of picture which has:
  215.  
  216.     A way to get a message dialog of a string 's',
  217.  
  218.         Make new.  Set it to a picture of ART\DI_OK.CMP from 160,160 to 455,309.
  219.         Make it into a messagedialog.
  220.         In it,
  221.             Make a stringbox of s using blackPen from 12,35 to 282,114.
  222.             Set its backgroundcolor to blackPen's backgroundcolor.
  223.             Make ok.  Set it to an xyobject from 222,5 to 269,31.
  224.             In it,
  225.                 Make a picture of ART\DI_OKDN.CMP from 0,0 to 47,26.
  226.                 Hide it.
  227.                 When downclicked,
  228.                     Show this object's picture.
  229.                 When upclicked,
  230.                     Hide this object's picture.
  231.                     Set answer to "ok".
  232.                     Record that system is not indialog.
  233.                     Detach this object's container.
  234.         Record that system is indialog.
  235.         Detach new.  Return it.
  236.  
  237. Set the window title to "Installing Knowledge Land".
  238. Make system's mainScreen.  Set it to a screen.
  239. In it,
  240.     Make background.  Set it to a picture of ART\SI_BACK.CMP from 0,0 to 640,480.
  241.     Make a logwindow of "" using blackPen from 0,30 to 640,480.
  242.     Make cursor. Set it to a picture of ART\NW.CMP at 320,240.
  243.     Control cursor with the mouse.
  244.     When keyed,
  245.         If the key is the escape key,
  246.             End this program.
  247.         If the key is the F2 key,
  248.             Record that system is ready.
  249.         If the key is the F9 key,
  250.             If mainScreen's logwindow is visible,
  251.                 disable logging.
  252.             Otherwise,
  253.                 enable logging.
  254.         If the key is the F10 key,
  255.             If system is logpaused,
  256.                 Record that system is not logpaused.
  257.             Otherwise,
  258.                 Record that system is logpaused.
  259. Display it.
  260. disable logging.
  261.  
  262. Wait until the next cycle.
  263. //Record that system is not ready.
  264.  
  265. Log "Hit F2 to continue".
  266.  
  267. //Wait until system is ready.
  268.  
  269. Log "Bringing up save dialog.".
  270.  
  271. // Ari: We bring up the save file dialog in order to determine where to install the product.
  272. Make a library named SaveLib of "SaveFile".
  273. Make a libFunction named saveFile of "SaveFile" from SaveLib.
  274. In saveFile,
  275.         Make prompt.  Set it to "Where would you like to install Knowledge Land?".
  276.         Make defName.  Set it to "KnowledgeLand".
  277.         Make macPath.  Set it to a fixedString with length 255.
  278.         Make p1.  Set it to a list.  In it,
  279.                 Make macPathLen.  Set it to 0.
  280.         Make macVol.  Set it to a fixedString with length 32.
  281.         Make p2.  Set it to a list.  In it,
  282.                 Make macVolLen.  Set it to 0.
  283.         Make pcPath.  Set it to a fixedString with length 255.
  284.         Make p3.  Set it to a list.  In it,
  285.                 Make pcPathLen.  Set it to 0.
  286. Call saveFile.
  287.  
  288. In system,
  289.     Make install.  Set it to 1.
  290.  
  291. If saveFile's result equals 1, // didn't cancel
  292.  
  293.     In mainScreen,
  294.         Make a yes or no dialog asking INSTALL.TXT.
  295.     Wait until system is not indialog.
  296.  
  297.     If answer is alphabetically equal to "no",
  298.         Set system's install to 2.
  299.     Otherwise,
  300.         Set system's install to 1.
  301.  
  302.     In mainScreen,
  303.         Make progressBox.  Set it to a fileCopier of 70 files from 0,0 to 640,28.
  304.         Make a stringbox of "Please wait, or hit ESC to cancel." using whitePen from 0,0 to 640,28.
  305.         Set its backgroundcolor to whitePen's backgroundcolor.
  306.  
  307.     Make spstart.  Set it to a stringpoint before character 1 of saveFile's macVol.
  308.     Make spend.  Set it to a stringpoint after character (saveFile's p2's macVolLen) of saveFile's macVol.
  309.     Make macVol.  Set it to the string between spstart and spend.
  310.  
  311.     // trace_print_concatenation {"macVol = ", macVol}.
  312.  
  313.     Set spstart to a stringpoint before character 1 of saveFile's macPath.
  314.     Set spend to a stringpoint after character (saveFile's p1's macPathLen) of saveFile's macPath.
  315.     Make macPath. Set it to the string between spstart and spend.
  316.  
  317.     // trace_print_concatenation {"macPath = ", macPath}.
  318.     log cat "mac path:  " and macpath.
  319.  
  320.     Set spstart to a stringpoint before character 1 of saveFile's pcPath.
  321.     Set spend to a stringpoint after character (saveFile's p3's pcPathLen) of saveFile's pcPath.
  322.     Make pcPath. Set it to the string between spstart and spend.
  323.  
  324.     // trace_print_concatenation {"pcPath = ", pcPath}.
  325.     log cat "pc path:  " and pcpath.
  326.  
  327.     Wait until the next cycle.
  328.  
  329.     //Call "KnowledgeLand" the_volume.
  330.     Make the_volume.  Set it to the install volume.
  331.  
  332.     // Ari: We ensure that the necessary volume is mounted.
  333.     If the volume the_volume is not mounted,
  334.         Display message "Knowledge Land is not mounted!" in mainScreen's progressBox.
  335.         Wait until the volume the_volume is mounted.
  336.  
  337.     Log cat "Mac volume:  " and macVol.
  338.  
  339.     // Ari: We set these weird Mac constructs, knowing that they won't be saved to the INI.
  340.     Set CD root to volume the_volume.
  341.     Set HD root to volume macVol.
  342.  
  343.     Make macHDRoot.  Set it to the drive of volume macvol.  Append "\\" to it.
  344.     [
  345.     Make cdvol.  Set it to the volume of drive the_volume.
  346.     Make hdvol.  Set it to the volume of drive macVol.
  347.  
  348.     log cdvol.
  349.     log hdvol.
  350.     ]
  351.  
  352.     // tylor: show the cursor again
  353.     log "free space?".
  354.     log the free disk space on macHDRoot.
  355.     Make neededspace.
  356.     If install = 1,
  357.         Set neededspace to (30 * 1024).
  358.     Otherwise,
  359.         Set neededspace to (5 * 1024).
  360.     If ((the free disk space on macHDRoot) / 1024) is less than neededspace,
  361.         Make msg.  Set it to NOSPACE.TXT.
  362.         Print neededspace to it.
  363.         Append BYTES.TXT to it.
  364.         In mainScreen,
  365.             Make a message dialog of msg.
  366.         Wait until system is not indialog.
  367.     Otherwise,
  368.         Make macDir.  Set it to macPath.
  369.  
  370.         // Rename installed folder to preserve case sensitivity
  371.         Make a library named renameLib of "rename".
  372.         Make a libFunction named rename of "rename" from renameLib.
  373.         In rename,
  374.             Make oldPath. Set it to macDir.
  375.             log oldPath.
  376.             Make newName. Set it to oldPath.
  377.         Call rename.
  378.         Wait until the next cycle.
  379.  
  380.         Make hdRootPath. Set it to "$PRODUCTHDROOT".
  381.         Append pcPath to it.
  382.         Append "\\" to it.
  383.  
  384.         log hdRootPath.
  385.         Call now the_start_time.
  386.  
  387.         copy file "SUPPORT\\MAC\\ACE" from the CD to hdRootPath in mainScreen's progressBox.
  388.         copy bale "SUPPORT\\MAC\\QUICKSND" from the CD to hdRootPath in mainScreen's progressBox with 6.
  389.         // copy bale "SUPPORT\\CMN\\DEMO" from the CD to hdRootPath in mainScreen's progressBox with 6.
  390.         // copy bale "SUPPORT\\CMN\\PSDEMO" from the CD to hdRootPath in mainScreen's progressBox with 6.
  391.  
  392.         copy file "SUPPORT\\CMN\\COM\\" from the CD to cat hdRootPath and "COM\\" in mainScreen's progressBox with 3.
  393.         copy file "SUPPORT\\CMN\\LIB\\" from the CD to cat hdRootPath and "LIB\\" in mainScreen's progressBox with 6.
  394.         copy file "SUPPORT\\CMN\\LEX\\" from the CD to cat hdRootPath and "LEX\\" in mainScreen's progressBox.
  395.         If platform is "Mac",
  396.             copy file "SUPPORT\\CMN\\LEX\\MAC\\" from the CD to cat hdRootPath and "LEX\\MAC\\" in mainScreen's progressBox with 2.
  397.         Otherwise,
  398.             copy file "SUPPORT\\CMN\\LEX\\PC\\" from the CD to cat hdRootPath and "LEX\\PC\\" in mainScreen's progressBox with 2.
  399.         If install = 1,
  400.             copy bale "SUPPORT\\OPT\\FMAV0001" from the CD to hdRootPath in mainScreen's progressBox with 26.
  401.         Otherwise,
  402.             copy bale "SUPPORT\\OPT\\FMAV0002" from the CD to hdRootPath in mainScreen's progressBox with 26.
  403.  
  404.         copy file "SUPPORT\\CMN\\MOD\\" from the CD to cat hdRootPath and "MOD\\" in mainScreen's progressBox.
  405.         copy file "SUPPORT\\CMN\\MOD\\MAIN\\" from the CD to cat hdRootPath and "MOD\\MAIN\\" in mainScreen's progressBox.
  406.         copy file "SUPPORT\\CMN\\MOD\\LOGIN\\" from the CD to cat hdRootPath and "MOD\\LOGIN\\" in mainScreen's progressBox.
  407.         copy file "SUPPORT\\CMN\\MOD\\PROFILE\\" from the CD to cat hdRootPath and "MOD\\PROFILE\\" in mainScreen's progressBox.
  408.         copy file "SUPPORT\\CMN\\MOD\\HAND\\" from the CD to cat hdRootPath and "MOD\\HAND\\" in mainScreen's progressBox.
  409.         copy file "SUPPORT\\CMN\\MOD\\AVATAR\\" from the CD to cat hdRootPath and "MOD\\AVATAR\\" in mainScreen's progressBox.
  410.         copy file "SUPPORT\\CMN\\MOD\\TRADE\\" from the CD to cat hdRootPath and "MOD\\TRADE\\" in mainScreen's progressBox.
  411.         copy file "SUPPORT\\CMN\\MOD\\SCRAP\\" from the CD to cat hdRootPath and "MOD\\SCRAP\\" in mainScreen's progressBox.
  412.         copy file "SUPPORT\\CMN\\MOD\\INTRO\\" from the CD to cat hdRootPath and "MOD\\INTRO\\" in mainScreen's progressBox.
  413.  
  414.         copy file "SUPPORT\\CMN\\FMD01ENG\\" from the CD to cat hdRootPath and "FMD01ENG\\" in mainScreen's progressBox.
  415.         copy bale "SUPPORT\\CMN\\FMD01ENG\\CARDS" from the CD to cat hdRootPath and "FMD01ENG\\" in mainScreen's progressBox with 3.
  416.         copy file "SUPPORT\\CMN\\FMD01ENG\\MAIN\\" from the CD to cat hdRootPath and "FMD01ENG\\MAIN\\" in mainScreen's progressBox.
  417.         copy bale "SUPPORT\\CMN\\FMD01ENG\\MAIN\\SCENES" from the CD to cat hdRootPath and "FMD01ENG\\MAIN\\" in mainScreen's progressBox with 2.
  418.         copy file "SUPPORT\\CMN\\FMD01ENG\\LOGIN\\" from the CD to cat hdRootPath and "FMD01ENG\\LOGIN\\" in mainScreen's progressBox.
  419.         copy file "SUPPORT\\CMN\\FMD01ENG\\PROFILE\\" from the CD to cat hdRootPath and "FMD01ENG\\PROFILE\\" in mainScreen's progressBox.
  420.         copy file "SUPPORT\\CMN\\FMD01ENG\\HAND\\" from the CD to cat hdRootPath and "FMD01ENG\\HAND\\" in mainScreen's progressBox.
  421.         copy file "SUPPORT\\CMN\\FMD01ENG\\AVATAR\\" from the CD to cat hdRootPath and "FMD01ENG\\AVATAR\\" in mainScreen's progressBox.
  422.         copy file "SUPPORT\\CMN\\FMD01ENG\\TRADE\\" from the CD to cat hdRootPath and "FMD01ENG\\TRADE\\" in mainScreen's progressBox.
  423.         copy file "SUPPORT\\CMN\\FMD01ENG\\SCRAP\\" from the CD to cat hdRootPath and "FMD01ENG\\SCRAP\\" in mainScreen's progressBox.
  424.         copy file "SUPPORT\\CMN\\FMD01ENG\\BROWSER\\" from the CD to cat hdRootPath and "FMD01ENG\\BROWSER\\" in mainScreen's progressBox.
  425.         copy file "SUPPORT\\CMN\\FMD01ENG\\INTRO\\" from the CD to cat hdRootPath and "FMD01ENG\\INTRO\\" in mainScreen's progressBox.
  426.  
  427.         Append ":" to macPath.
  428.         log macPath.
  429.         copy Macintosh file "SUPPORT:MAC:KnowledgeLand" from the mac CD to macPath in mainScreen's progressBox with 3.
  430.         copy Macintosh file "SUPPORT:MAC:CMDLINE.TXT" from the mac CD to macPath in mainScreen's progressBox.
  431.         copy Macintosh file "OVERRIDE.RES" from the mac CD to macPath in mainScreen's progressBox.
  432.         copy Macintosh file "HELPME" from the mac CD to macPath in mainScreen's progressBox.
  433.         copy Macintosh file "default.ini" from the mac CD to macPath in mainScreen's progressBox.
  434.  
  435.         Wait until the next cycle.
  436.  
  437.         // Ari: We setup the INI correctly.
  438.         Make macFullPath.  Set it to macVol.
  439.         Append pcPath to it.
  440.  
  441.         Make strinstall.  Set it to "".
  442.         print system's install to strinstall.
  443.  
  444.         Set currentinisection to an inisection of "LAND".
  445.  
  446.         Set currentinisection's CDRoot to "KnowledgeLand".
  447.         Set currentinisection's lang to "eng".
  448.         Set currentinisection's kidproof to "yes".
  449.         Set currentinisection's bordercolor to "0,0,0.".
  450.         Set currentinisection's tunefileExtension to ".MGM".
  451.         Set currentinisection's LOGO_DROP to "few".
  452.         Set currentinisection's ProductName to "Knowledge Land".
  453.         Set currentinisection's ProductID to "FM".
  454.         Set currentinisection's ProductLang to "ENG".
  455.         Set currentinisection's FirstModule to "intro".
  456.         Set currentinisection's FirstRoom to "1".
  457.         Set currentinisection's TTS to "yes".
  458.         Set currentinisection's VoiceOver to "yes".
  459.         Set currentinisection's FM to strinstall.
  460.  
  461.         // Open the mac folder it was installed to
  462.         Append "KnowledgeLand" to macPath.
  463.         Call macPath the_macpath.
  464.  
  465.         Make a library named openFldrLib of "openFldr".
  466.         Make a libFunction named openFldr of "openFldr" from openFldrLib.
  467.         In openFldr,
  468.             Make macPath.  Set it to the_macpath.
  469.         Call openFldr.
  470.  
  471. End this program.
  472.