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