|
From: creedon <icr...@us...> - 2006-02-02 07:41:17
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/startup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7009 Modified Files: startupScript Log Message: deleted some unneeded commented code Index: startupScript =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/startup/startupScript,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** startupScript 21 Jan 2006 02:47:35 -0000 1.15 --- startupScript 2 Feb 2006 07:41:01 -0000 1.16 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.startup.startupScript ! ÇChanges Ç1/20/06; 1:54:05 PM by TAC Çdisable agents for all startups, not just for first root run Çthere was a problem with Tools starting up and its agent manipulating menus at the same time and causing a crash Ç12/24/05; 12:33:32 PM by TAC Çprefs.root now has a #startup script, deal with it Ç11/10/05; 4:24:48 PM by TAC Çmoved system.temp.Frontier/starting up after first if firstRootRun check was causing startup problem Ç11/5/05; 12:00:32 PM by TAC Çmoved system.temp.Frontier check back to top of script Ç10/9/05; 3:39:07 PM by TAC Çwhen storing prefs.root path, store realative path Çuse table.copyUndefinedContents to copy some item Çmove some of the user prefs initializations into Frontier.data.userPrefs Çrearrange script so that some initializations can happen outside of the first root run, this should make it easier to add new items and not have them get missed because the first root run had already been run once Ç10/4/05; 7:26:36 PM by TAC Çupon check for presence of Psapi.dll, don't use hard coded application name Ç9/26/05; 4:30:14 PM by TAC Çadded user.prefs.flReplaceDialogExpertMode Ç8/23/05; 7:22:18 PM by TAC Çadded user.prefs.flCompactModalMenus Ç7/14/05; 10:35:39 AM by TAC Çsystem.menus.data.currentMenuType set to nil so agent will update modal menu properly upon relaunch Ç7/6/05; 12:21:38 PM by TAC Çchanged user.callbacks.sendmail to user.callbacks.tcpSendMail Çadded user.prefs.mailHostPort Ç6/15/05; 6:52:11 PM by TAC Çrewrite for Open Source release, bring in code from startup.startupScript, userland.firstRootRun, userland.finishInstall, and userland.cleanRoot ÇOld code Çstartup.startupScript <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/startup/startupScript?rev=1.1> Çuserland.firstRootRun <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/firstRootRun?rev=1.1> Çuserland.finishInstall <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/finishInstall?rev=1.1> Çuserland.cleanRoot <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/cleanRoot?rev=1.1> Ç06/08/01; 11:24:35 PM by JES ÇWhen opening databases defined at user.databases, skip objects which aren't tables. This avoids the condition where startup wouldn't complete, if there's an item #1 in the user.databases table. Ç06/02/01; 8:34:20 PM by PBS ÇDo the web-based install and open the Control Panel if this is the first root run. Ç04/28/01; 7:48:46 PM by JES ÇCall Frontier.tools.startup in a try block, so that the startup process will finish even if Tools installation fails. Ç04/20/01; 4:49:05 PM by JES ÇCall tools.startup to install Tools at startup. Ç10/7/99; 4:20:26 PM by PBS ÇOnly run the #startup script in a guest database if runStartupScript exists and is true. Previously, it would be run whether runStartupScript was true or false. Çhttp://frontier.userland.com/stories/storyReader$1760 Ç10/6/99; 10:21:35 PM by PBS ÇOnly set the taskTime for the overnight task if it's in the past. This fixes a bug when the taskTime was before midnight, but it was being set for the next day, so the overnight task wouldn't run. Çhttp://frontier.userland.com/stories/storyReader$1761 Ç8/19/99; 6:44:48 AM by DW ÇMake sure that taskTimes in user.scheduler.tasks are in the future. ÇWe do this much more quickly than scheduler.monitor would. Çhttp://discuss.userland.com/msgReader$9658 ÇThis script runs when Frontier opens the Frontier.root file. if defined (system.temp.Frontier) { // only run the startup script once return}; local (flEnableAgents = true, flOpenDatabases = true, flEnableHttpServer = true); // can be set by the external startup script local (flFirstRootRun = true); bundle { // miscellaneous initializations, checks, and etc., phase 1 of 2 Frontier.enableAgents (false); // try to keep agents from reporting errors and causing problems Frontier.pathString = file.folderFromPath (frontier.getFilePath ()); if defined (user.prefs.firstRootRun) { flFirstRootRun = user.prefs.firstRootRun}}; if flFirstRootRun { // hide all windows, wipe temp and user while window.frontmost () != "" { // open windows can mess things up later on window.hide (window.frontmost ())}; Çreturn (false) // enable for testing new (tableType, @system.temp); new (tableType, @root.user)}; bundle { // system.temp.Frontier, we are starting up new (tableType, @system.temp.Frontier); system.temp.Frontier.startupTime = clock.now (); system.temp.Frontier.startingUp = true}; backups.init (); batchExporter.init (); export.init (); rootUpdates.init (); // set up user.rootUpdates, even though root updates uses tcp, its ok to set up here as no tcp calls are made at this time webEdit.init (); bundle { // set up user.prefs if flFirstRootRun { new (tableType, @user.prefs); bundle { // set up user.prefs.commonStyles case sys.os () { "MacOS" { if system.environment.isCarbon { user.prefs.commonStyles = Frontier.data.commonStylesMacCarbon} else { user.prefs.commonStyles = Frontier.data.commonStylesMac}}; "Win95"; "WinNT" { user.prefs.commonStyles = Frontier.data.commonStylesWin}}}}; table.copyUndefinedContents (@Frontier.data.userPrefs, @user.prefs); bundle { // set up user.prefs.dialogs if flFirstRootRun { new (tableType, @user.prefs.dialogs)}; table.copyUndefinedContents (@Frontier.data.userPrefs.dialogs, @user.prefs.dialogs)}; bundle { // set up user.prefs.search if flFirstRootRun { new (tableType, @user.prefs.search)}; table.copyUndefinedContents (@Frontier.data.userPrefs.search, @user.prefs.search); if not (defined (user.prefs.search.replaceWith)) { user.prefs.search.replaceWith = Frontier.version ()}}; Frontier.setupUserPrefsFonts ()}; if flFirstRootRun { bundle { // set up the quick script window clipboard.putvalue ("dialog.notify (\"Hello World!\")"); window.quickScript (); editmenu.selectall (); editmenu.paste (); window.close ("Quick Script")}; bundle { // set up root window local (w = "root"); window.open (w); window.setPosition (w, 0, 0); editMenu.setFont (user.prefs.fonts.tableFont); editMenu.setFontSize (user.prefs.fonts.tableFontSize); window.zoom (w)}; bundle { // set up user.callbacks new (tableType, @user.callbacks); new (tableType, @user.callbacks.closeWindow); new (tableType, @user.callbacks.cmd2click); new (tableType, @user.callbacks.compileChangedScript); new (tableType, @user.callbacks.control2click); new (tableType, @user.callbacks.fileWriteWholeFile); new (tableType, @user.callbacks.opCollapse); new (tableType, @user.callbacks.opCursorMoved); new (tableType, @user.callbacks.openWindow); new (tableType, @user.callbacks.opExpand); new (tableType, @user.callbacks.opInsert); new (tableType, @user.callbacks.opReturnKey); new (tableType, @user.callbacks.opRightClick); new (tableType, @user.callbacks.opStruct2Click); new (tableType, @user.callbacks.option2click); new (tableType, @user.callbacks.resume); new (tableType, @user.callbacks.saveWindow); new (tableType, @user.callbacks.shutdown); new (tableType, @user.callbacks.startup); new (tableType, @user.callbacks.statusMessage); new (tableType, @user.callbacks.suspend); new (tableType, @user.callbacks.systemTrayIcon2Click); new (tableType, @user.callbacks.systemTrayIconRightClick); new (tableType, @user.callbacks.tcpSendMail)}; bundle { // clear applications paths in system.verbs.apps local (adrAppsTable = @system.verbs.apps, i); for i = 1 to sizeof (adrAppsTable^) { local (adrAppInfo = @adrAppsTable^ [i].appInfo); if defined (adrAppInfo^) { adrAppInfo^.path = ""}}}; bundle { // set up Frontier.tools.thread Frontier.tools.thread.ct = 0; Frontier.tools.thread.enabled = true}; bundle { // set up workspace new (tableType, @root.workspace); new (outlineType, @workspace.notepad)}; bundle { // miscellaneous new (tableType, @root.scratchpad); new (tableType, @system.deskscripts); new (tableType, @user.databases); new (tableType, @user.protocols); }};Çnew (tableType, @websites.["#data"]) bundle { // set up user.menus if flFirstRootRun { new (tableType, @user.menus)}; Çuser.menus.bookmarkMenu = userland.virginBookmarkMenu if not (defined (user.menus.customMenu)) { user.menus.customMenu = Frontier.data.virginCustomMenu}}; if flFirstRootRun { // open mainResponder.root and prefs.root bundle { // open mainResponder.root, hidden and add to user.databases local (appFolder = Frontier.getSubFolder ("apps")); if not defined ( [appFolder + "mainResponder.root"] ) { Frontier.installApp ("mainResponder.root", false)}}; bundle { // open prefs.root, hidden and add to user.databases local (f = Frontier.getSubFolder ("www") + "prefs.root"); if not (defined ([f])) { fileMenu.open (f, true);}; //open hidden ÇAdd an entry to the user.databases table. local (adrTable = @user.databases.["prefs.root"]); new (tableType, adrTable); adrTable^.f = file.getPathChar () + (f - Frontier.pathString); adrTable^.openOnStartup = true; adrTable^.runStartupScript = true; adrTable^.supportsSubscribe = false; bundle { // run the startup script local (adrStartupScript = @[adrTable^.f].["#startup"]); if defined (adrStartupScript^) { adrStartupScript^ ()}}}}; // run the startup script Çbundle //initialize responders Çuser.webserver.responders.websiteFramework.data.docTree.samples = @websites.samples Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.allSites) Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.contents) Ç Çif defined (user.webserver.responders.manilaEdit) Çdelete (@user.webserver.responders.manilaEdit) ÇfileMenu.save () bundle { // miscellaneous variable initializations and checks, phase 2 of 2 system.menus.data.currentsuite = ""; system.menus.data.currentMenuType = nil; system.menus.data.currentmenu = 0; bundle { // check for presence of Psapi.dll if sys.os () == "WinNT" { if not (sys.appIsRunning (file.fileFromPath (Frontier.getProgramPath ()))) { // 11/27/04; 12:14:40 PM by TAC - would it be possible for Frontier to install this on its own? dialog.alert ("You need to run the Frontier Psapi Installer for certain Frontier verbs to work properly.")}}}}; bundle { //open the about window if the pref says we should Çadded 12/16/98; 6:47:28 PM by DW if not defined (user.prefs.openAboutWindow) { user.prefs.openAboutWindow = true}; if user.prefs.openAboutWindow { window.about ()}}; bundle { //initialize the log, next bit of code could add a log item Çadded 12/16/98; 6:52:40 PM by DW if defined (log.startup) { log.startup ()}}; bundle { //run the external startup script local (fname = "frontierStartupCommands.txt"); local (f = file.folderFromPath (Frontier.getProgramPath ()) + fname); if file.exists (f) { try { evaluate (string (file.readWholeFile (f)))} else { log.add ("Error running " + fname + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}; bundle { // tcp based services webserver.init (); // needs to load first betty.init (); // needs to load second soap.init ()}; bundle { // people based services people.init (); // needs to load first custody.init (); webEditServer.init ()}; bundle { //open all the databases that have openOnStartup true Çadded 12/16/98; 6:23:16 PM by DW if defined (user.databases) { if flOpenDatabases { local (i, flmsg = false); for i = 1 to sizeof (user.databases) { if typeOf (user.databases[i]) == tableType { //06/08/01 JES: avert item #1 errors with user.databases [i] { local (flopened = false); try { if openOnStartup { msg (this + ": Opening " + file.fileFromPath (f)); flmsg = true; fileMenu.open (f, hidden:true); flopened = true}} else { log.add ("Startup error opening guest database " + nameof (user.databases [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}; if flopened { if defined (runStartupScript) { if runStartupScript { //PBS 10/7/99: check the value of runStartupScript: only run the script if the boolean is true local (adrscript = @[filespec (f)].["#startup"]); if defined (adrscript^) { try { adrscript^ ()} else { log.add ("Error running #startup script in guest database " + nameof (user.databases [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}}}}}}; if flmsg { msg ("")}}}}; try { //04/28/2001 JES: prevent startup from failing if Tool installation fails. Frontier.tools.startup ()}; scheduler.init (); html.init (); bundle { // webBrowser webBrowser.init (); if system.environment.isMac { try {new (tableType, @user.odbEditors.data.openFiles)}}; //Empty out the list of externally-edited files. if system.environment.isWindows { user.webBrowser.winDefaultBrowserApp = file.findApplication ("htm")}}; bundle { // first root run, phase 2 of 3 if flFirstRootRun { bundle { // set up websites table and related with websites.["#ftpSite"] { folder = file.folderFromPath (Frontier.getProgramPath ()) + "Websites" + file.getPathChar (); Çfile.sureFolder (folder) url = file.fileToURL (folder); isLocal = true}; user.html.sites.default = websites.["#ftpSite"]}; bundle { // personalize this copy of Frontier, configure network settings, and complete the installation local (flWebBasedInstall = true); if flWebBasedInstall { Ç11/29/04; 11:17:45 AM by TAC - the following seems like it should be done as part of mainRepsonder startup, init. IIRC, members.root is a feature of mainResponder bundle { //create the Admin membership group if needed local (adrRoot = @[system.temp.mainResponder.membersRootFile]); local (adrGroup = @adrRoot^.admin); if not defined (adrGroup^) { new (tableType, adrGroup)}; if not defined (adrGroup^.callbacks) { new (tableType, @adrGroup^.callbacks)}; if not defined (adrGroup^.cookieDomain) { adrGroup^.cookieDomain = ""}; if not defined (adrGroup^.cookieExpires) { adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; if not defined (adrGroup^.cookieName) { adrGroup^.cookieName = "Admin"}; if not defined (adrGroup^.mailReturnAddress) { adrGroup^.mailReturnAddress = user.prefs.mailAddress}; if not defined (adrGroup^.mailSubject) { adrGroup^.mailSubject = "Admin"}; if not defined (adrGroup^.mailTemplate) { wp.newTextObject ("", @adrGroup^.mailTemplate)}; if not defined (adrGroup^.openToPublic) { adrGroup^.openToPublic = false}; if not defined (adrGroup^.users) { new (tableType, @adrGroup^.users)}}; bundle { // prep for web based install via mainResponder admin website local (portString = ""); if user.inetd.config.http2.port != 80 { portString = ":" + user.inetd.config.http2.port}; if not defined (system.temp.Frontier.setupFrontier) { new (tableType, @system.temp.Frontier.setupFrontier)}; system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = true; local (setupUrl = "http://127.0.0.1" + portString + "/setupFrontier"); if not defined (system.temp.installer) { new (tableType, @system.temp.installer)}; system.temp.installer.urlToOpen = setupUrl}} else { on infoDialog () { //prompt the user for name, org and initials on kernelCall (adrName, adrInitials, adrOrg, adrEmail) { kernel (dialog.getUserInfo)}; local (name, initials, organization, email); case sys.os () { "Win95"; "WinNT" { if not (kernelCall (@name, @initials, @organization, @email)) { return (false)}; if initials == "" { dialog.alert ("You must specify your initials."); infoDialog ()}; user.prefs.name = name; user.prefs.initials = initials; user.prefs.organization = organization; user.prefs.mailAddress = email}; "MacOS" { bundle { //initialize user.prefs.name etc using info from Internet Config try { name = ic.geticpreference (ic.eventinfo.realName)}; try { organization = ic.geticpreference (ic.eventinfo.organization)}; try { email = ic.geticpreferece (ic.eventinfo.emailAddress)}; user.prefs.name = name; user.prefs.organization = organization; if name != "" { local (i); user.prefs.initials = name [1]; for i = 3 to sizeof (name) { if name [i] == ' ' { user.prefs.initials = user.prefs.initials + name [i+1]}}}}; card.run (@system.cards.userInfoDialog)}}; return (true)}; infoDialog ()}}; //AR 09/27/04 : personalize install ÇrootUpdates.getCurrent ("Frontier") // 11/29/04; 6:57:54 PM by TAC - if we get a root update then we'll need to use rootUpdates.update bundle { // about window local (w); window.about (); w = window.frontMost (); window.zoom (w); menus.scripts.styleCommand ("medium"); window.setPosition (w, 25, 75); };Çwindow.close (s) bundle { // license edit (@system.startup.license); // 12/4/04; 9:26:35 PM by TAC - i rather do this near the beginning of phase 1 firstRootRun but had a problem with this window and setting up the quick script window wp.setSelect (0, 0)}}}; system.callbacks.startup (); //call user's startup scripts bundle { // build menu bar system.menus.buildMenuBar (); system.menus.buildSuitesSubmenu ()}; //5.0 Frontier.enableAgents (flEnableAgents); if flEnableHttpServer { //6.0, daemons don't start up until all the startup code has run new (tableType, @user.inetd.listens); inetd.start ()}; //start up all daemons with startup set true if flFirstRootRun { // open a url and set first root run to false if defined (system.temp.installer.urlToOpen) { Çwindow.update ("About Frontier") webBrowser.openUrl (system.temp.installer.urlToOpen); webBrowser.bringToFront ()}; user.prefs.firstRootRun = false}; system.temp.Frontier.startingUp = false; //signal to all who care, let the hits begin! msg (""); fileMenu.save (); Ç Çbundle //license agreement Çlocal (editLicense = false) Çif sys.os () == "MacOS" Çon itemhit (itemnumber) Çcase (itemnumber) Ç1 Çyes ÇeditLicense = true Çreturn (false) Çstop processing the dialog Ç2 Çno Çreturn (false) Çstop processing the dialog Çreturn (true) Çkeep processing the dialog Çdialog.run (517, 1, @itemhit) Çelse Çif dialog.yesNo ("Frontier is licensed software. Do you want to read the license agreement now?") ÇeditLicense = true Çif editLicense Çbundle //get root update ÇproxyInit () Çif user.prefs.serialNumber != "" and not (string.lower (user.prefs.serialNumber) contains "trial") ÇrootUpdates.init () \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.startup.startupScript ! ÇChanges Ç2/1/06; 1:27:51 PM by TAC Çdeleted some unneeded commented code Ç1/20/06; 1:54:05 PM by TAC Çdisable agents for all startups, not just for first root run Çthere was a problem with Tools starting up and its agent manipulating menus at the same time and causing a crash Ç12/24/05; 12:33:32 PM by TAC Çprefs.root now has a #startup script, deal with it Ç11/10/05; 4:24:48 PM by TAC Çmoved system.temp.Frontier/starting up after first if firstRootRun check was causing startup problem Ç11/5/05; 12:00:32 PM by TAC Çmoved system.temp.Frontier check back to top of script Ç10/9/05; 3:39:07 PM by TAC Çwhen storing prefs.root path, store realative path Çuse table.copyUndefinedContents to copy some item Çmove some of the user prefs initializations into Frontier.data.userPrefs Çrearrange script so that some initializations can happen outside of the first root run, this should make it easier to add new items and not have them get missed because the first root run had already been run once Ç10/4/05; 7:26:36 PM by TAC Çupon check for presence of Psapi.dll, don't use hard coded application name Ç9/26/05; 4:30:14 PM by TAC Çadded user.prefs.flReplaceDialogExpertMode Ç8/23/05; 7:22:18 PM by TAC Çadded user.prefs.flCompactModalMenus Ç7/14/05; 10:35:39 AM by TAC Çsystem.menus.data.currentMenuType set to nil so agent will update modal menu properly upon relaunch Ç7/6/05; 12:21:38 PM by TAC Çchanged user.callbacks.sendmail to user.callbacks.tcpSendMail Çadded user.prefs.mailHostPort Ç6/15/05; 6:52:11 PM by TAC Çrewrite for Open Source release, bring in code from startup.startupScript, userland.firstRootRun, userland.finishInstall, and userland.cleanRoot ÇOld code Çstartup.startupScript <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/startup/startupScript?rev=1.1> Çuserland.firstRootRun <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/firstRootRun?rev=1.1> Çuserland.finishInstall <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/finishInstall?rev=1.1> Çuserland.cleanRoot <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/cleanRoot?rev=1.1> Ç06/08/01; 11:24:35 PM by JES ÇWhen opening databases defined at user.databases, skip objects which aren't tables. This avoids the condition where startup wouldn't complete, if there's an item #1 in the user.databases table. Ç06/02/01; 8:34:20 PM by PBS ÇDo the web-based install and open the Control Panel if this is the first root run. Ç04/28/01; 7:48:46 PM by JES ÇCall Frontier.tools.startup in a try block, so that the startup process will finish even if Tools installation fails. Ç04/20/01; 4:49:05 PM by JES ÇCall tools.startup to install Tools at startup. Ç10/7/99; 4:20:26 PM by PBS ÇOnly run the #startup script in a guest database if runStartupScript exists and is true. Previously, it would be run whether runStartupScript was true or false. Çhttp://frontier.userland.com/stories/storyReader$1760 Ç10/6/99; 10:21:35 PM by PBS ÇOnly set the taskTime for the overnight task if it's in the past. This fixes a bug when the taskTime was before midnight, but it was being set for the next day, so the overnight task wouldn't run. Çhttp://frontier.userland.com/stories/storyReader$1761 Ç8/19/99; 6:44:48 AM by DW ÇMake sure that taskTimes in user.scheduler.tasks are in the future. ÇWe do this much more quickly than scheduler.monitor would. Çhttp://discuss.userland.com/msgReader$9658 ÇThis script runs when Frontier opens the Frontier.root file. if defined (system.temp.Frontier) { // only run the startup script once return}; local (flEnableAgents = true, flOpenDatabases = true, flEnableHttpServer = true); // can be set by the external startup script local (flFirstRootRun = true); bundle { // miscellaneous initializations, checks, and etc., phase 1 of 2 Frontier.enableAgents (false); // try to keep agents from reporting errors and causing problems Frontier.pathString = file.folderFromPath (frontier.getFilePath ()); if defined (user.prefs.firstRootRun) { flFirstRootRun = user.prefs.firstRootRun}}; if flFirstRootRun { while window.frontmost () != "" { // open windows can mess things up later on window.hide (window.frontmost ())}; Çreturn (false) // enable for testing new (tableType, @system.temp); new (tableType, @root.user)}; bundle { // system.temp.Frontier, we are starting up new (tableType, @system.temp.Frontier); system.temp.Frontier.startupTime = clock.now (); system.temp.Frontier.startingUp = true}; backups.init (); batchExporter.init (); export.init (); rootUpdates.init (); // set up user.rootUpdates, even though root updates uses tcp, its ok to set up here as no tcp calls are made at this time webEdit.init (); bundle { // set up user.prefs if flFirstRootRun { new (tableType, @user.prefs); bundle { // set up user.prefs.commonStyles case sys.os () { "MacOS" { if system.environment.isCarbon { user.prefs.commonStyles = Frontier.data.commonStylesMacCarbon} else { user.prefs.commonStyles = Frontier.data.commonStylesMac}}; "Win95"; "WinNT" { user.prefs.commonStyles = Frontier.data.commonStylesWin}}}}; table.copyUndefinedContents (@Frontier.data.userPrefs, @user.prefs); bundle { // set up user.prefs.dialogs if flFirstRootRun { new (tableType, @user.prefs.dialogs)}; table.copyUndefinedContents (@Frontier.data.userPrefs.dialogs, @user.prefs.dialogs)}; bundle { // set up user.prefs.search if flFirstRootRun { new (tableType, @user.prefs.search)}; table.copyUndefinedContents (@Frontier.data.userPrefs.search, @user.prefs.search); if not (defined (user.prefs.search.replaceWith)) { user.prefs.search.replaceWith = Frontier.version ()}}; Frontier.setupUserPrefsFonts ()}; if flFirstRootRun { bundle { // set up the quick script window clipboard.putvalue ("dialog.notify (\"Hello World!\")"); window.quickScript (); editmenu.selectall (); editmenu.paste (); window.close ("Quick Script")}; bundle { // set up root window local (w = "root"); window.open (w); window.setPosition (w, 0, 0); editMenu.setFont (user.prefs.fonts.tableFont); editMenu.setFontSize (user.prefs.fonts.tableFontSize); window.zoom (w)}; bundle { // set up user.callbacks new (tableType, @user.callbacks); new (tableType, @user.callbacks.closeWindow); new (tableType, @user.callbacks.cmd2click); new (tableType, @user.callbacks.compileChangedScript); new (tableType, @user.callbacks.control2click); new (tableType, @user.callbacks.fileWriteWholeFile); new (tableType, @user.callbacks.opCollapse); new (tableType, @user.callbacks.opCursorMoved); new (tableType, @user.callbacks.openWindow); new (tableType, @user.callbacks.opExpand); new (tableType, @user.callbacks.opInsert); new (tableType, @user.callbacks.opReturnKey); new (tableType, @user.callbacks.opRightClick); new (tableType, @user.callbacks.opStruct2Click); new (tableType, @user.callbacks.option2click); new (tableType, @user.callbacks.resume); new (tableType, @user.callbacks.saveWindow); new (tableType, @user.callbacks.shutdown); new (tableType, @user.callbacks.startup); new (tableType, @user.callbacks.statusMessage); new (tableType, @user.callbacks.suspend); new (tableType, @user.callbacks.systemTrayIcon2Click); new (tableType, @user.callbacks.systemTrayIconRightClick); new (tableType, @user.callbacks.tcpSendMail)}; bundle { // clear applications paths in system.verbs.apps local (adrAppsTable = @system.verbs.apps, i); for i = 1 to sizeof (adrAppsTable^) { local (adrAppInfo = @adrAppsTable^ [i].appInfo); if defined (adrAppInfo^) { adrAppInfo^.path = ""}}}; bundle { // set up Frontier.tools.thread Frontier.tools.thread.ct = 0; Frontier.tools.thread.enabled = true}; bundle { // set up workspace new (tableType, @root.workspace); new (outlineType, @workspace.notepad)}; bundle { // miscellaneous new (tableType, @root.scratchpad); new (tableType, @system.deskscripts); new (tableType, @user.databases); new (tableType, @user.protocols)}}; Çnew (tableType, @websites.["#data"]) bundle { // set up user.menus if flFirstRootRun { new (tableType, @user.menus)}; Çuser.menus.bookmarkMenu = userland.virginBookmarkMenu if not (defined (user.menus.customMenu)) { user.menus.customMenu = Frontier.data.virginCustomMenu}}; if flFirstRootRun { bundle { // open mainResponder.root, hidden and add to user.databases local (appFolder = Frontier.getSubFolder ("apps")); if not defined ( [appFolder + "mainResponder.root"] ) { Frontier.installApp ("mainResponder.root", false)}}; bundle { // open prefs.root, hidden and add to user.databases local (f = Frontier.getSubFolder ("www") + "prefs.root"); if not (defined ([f])) { fileMenu.open (f, true);}; //open hidden ÇAdd an entry to the user.databases table. local (adrTable = @user.databases.["prefs.root"]); new (tableType, adrTable); adrTable^.f = file.getPathChar () + (f - Frontier.pathString); adrTable^.openOnStartup = true; adrTable^.runStartupScript = true; adrTable^.supportsSubscribe = false; bundle { // run the startup script local (adrStartupScript = @[adrTable^.f].["#startup"]); if defined (adrStartupScript^) { adrStartupScript^ ()}}}}; // run the startup script Çbundle //initialize responders Çuser.webserver.responders.websiteFramework.data.docTree.samples = @websites.samples Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.allSites) Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.contents) Ç Çif defined (user.webserver.responders.manilaEdit) Çdelete (@user.webserver.responders.manilaEdit) ÇfileMenu.save () bundle { // miscellaneous variable initializations and checks, phase 2 of 2 system.menus.data.currentsuite = ""; system.menus.data.currentMenuType = nil; system.menus.data.currentmenu = 0; bundle { // check for presence of Psapi.dll if sys.os () == "WinNT" { if not (sys.appIsRunning (file.fileFromPath (Frontier.getProgramPath ()))) { // 11/27/04; 12:14:40 PM by TAC - would it be possible for Frontier to install this on its own? dialog.alert ("You need to run the Frontier Psapi Installer for certain Frontier verbs to work properly.")}}}}; bundle { //open the about window if the pref says we should Çadded 12/16/98; 6:47:28 PM by DW if not defined (user.prefs.openAboutWindow) { user.prefs.openAboutWindow = true}; if user.prefs.openAboutWindow { window.about ()}}; bundle { //initialize the log, next bit of code could add a log item Çadded 12/16/98; 6:52:40 PM by DW if defined (log.startup) { log.startup ()}}; bundle { //run the external startup script local (fname = "frontierStartupCommands.txt"); local (f = file.folderFromPath (Frontier.getProgramPath ()) + fname); if file.exists (f) { try { evaluate (string (file.readWholeFile (f)))} else { log.add ("Error running " + fname + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}; bundle { // tcp based services webserver.init (); // needs to load first betty.init (); // needs to load second soap.init ()}; bundle { // people based services people.init (); // needs to load first custody.init (); webEditServer.init ()}; bundle { //open all the databases that have openOnStartup true Çadded 12/16/98; 6:23:16 PM by DW if defined (user.databases) { if flOpenDatabases { local (i, flmsg = false); for i = 1 to sizeof (user.databases) { if typeOf (user.databases[i]) == tableType { //06/08/01 JES: avert item #1 errors with user.databases [i] { local (flopened = false); try { if openOnStartup { msg (this + ": Opening " + file.fileFromPath (f)); flmsg = true; fileMenu.open (f, hidden:true); flopened = true}} else { log.add ("Startup error opening guest database " + nameof (user.databases [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}; if flopened { if defined (runStartupScript) { if runStartupScript { //PBS 10/7/99: check the value of runStartupScript: only run the script if the boolean is true local (adrscript = @[filespec (f)].["#startup"]); if defined (adrscript^) { try { adrscript^ ()} else { log.add ("Error running #startup script in guest database " + nameof (user.databases [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}}}}}}; if flmsg { msg ("")}}}}; try { //04/28/2001 JES: prevent startup from failing if Tool installation fails. Frontier.tools.startup ()}; scheduler.init (); html.init (); bundle { // webBrowser webBrowser.init (); if system.environment.isMac { try {new (tableType, @user.odbEditors.data.openFiles)}}; //Empty out the list of externally-edited files. if system.environment.isWindows { user.webBrowser.winDefaultBrowserApp = file.findApplication ("htm")}}; if flFirstRootRun { bundle { // set up websites table and related with websites.["#ftpSite"] { folder = file.folderFromPath (Frontier.getProgramPath ()) + "Websites" + file.getPathChar (); Çfile.sureFolder (folder) url = file.fileToURL (folder); isLocal = true}; user.html.sites.default = websites.["#ftpSite"]}; bundle { // personalize this copy of Frontier, configure network settings, and complete the installation local (flWebBasedInstall = true); if flWebBasedInstall { Ç11/29/04; 11:17:45 AM by TAC - the following seems like it should be done as part of mainRepsonder startup, init. IIRC, members.root is a feature of mainResponder bundle { //create the Admin membership group if needed local (adrRoot = @[system.temp.mainResponder.membersRootFile]); local (adrGroup = @adrRoot^.admin); if not defined (adrGroup^) { new (tableType, adrGroup)}; if not defined (adrGroup^.callbacks) { new (tableType, @adrGroup^.callbacks)}; if not defined (adrGroup^.cookieDomain) { adrGroup^.cookieDomain = ""}; if not defined (adrGroup^.cookieExpires) { adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; if not defined (adrGroup^.cookieName) { adrGroup^.cookieName = "Admin"}; if not defined (adrGroup^.mailReturnAddress) { adrGroup^.mailReturnAddress = user.prefs.mailAddress}; if not defined (adrGroup^.mailSubject) { adrGroup^.mailSubject = "Admin"}; if not defined (adrGroup^.mailTemplate) { wp.newTextObject ("", @adrGroup^.mailTemplate)}; if not defined (adrGroup^.openToPublic) { adrGroup^.openToPublic = false}; if not defined (adrGroup^.users) { new (tableType, @adrGroup^.users)}}; bundle { // prep for web based install via mainResponder admin website local (portString = ""); if user.inetd.config.http2.port != 80 { portString = ":" + user.inetd.config.http2.port}; if not defined (system.temp.Frontier.setupFrontier) { new (tableType, @system.temp.Frontier.setupFrontier)}; system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = true; local (setupUrl = "http://127.0.0.1" + portString + "/setupFrontier"); if not defined (system.temp.installer) { new (tableType, @system.temp.installer)}; system.temp.installer.urlToOpen = setupUrl}} else { on infoDialog () { //prompt the user for name, org and initials on kernelCall (adrName, adrInitials, adrOrg, adrEmail) { kernel (dialog.getUserInfo)}; local (name, initials, organization, email); case sys.os () { "Win95"; "WinNT" { if not (kernelCall (@name, @initials, @organization, @email)) { return (false)}; if initials == "" { dialog.alert ("You must specify your initials."); infoDialog ()}; user.prefs.name = name; user.prefs.initials = initials; user.prefs.organization = organization; user.prefs.mailAddress = email}; "MacOS" { bundle { //initialize user.prefs.name etc using info from Internet Config try { name = ic.geticpreference (ic.eventinfo.realName)}; try { organization = ic.geticpreference (ic.eventinfo.organization)}; try { email = ic.geticpreferece (ic.eventinfo.emailAddress)}; user.prefs.name = name; user.prefs.organization = organization; if name != "" { local (i); user.prefs.initials = name [1]; for i = 3 to sizeof (name) { if name [i] == ' ' { user.prefs.initials = user.prefs.initials + name [i+1]}}}}; card.run (@system.cards.userInfoDialog)}}; return (true)}; infoDialog ()}}; //AR 09/27/04 : personalize install ÇrootUpdates.getCurrent ("Frontier") // 11/29/04; 6:57:54 PM by TAC - if we get a root update then we'll need to use rootUpdates.update bundle { // about window local (w); window.about (); w = window.frontMost (); window.zoom (w); menus.scripts.styleCommand ("medium"); window.setPosition (w, 25, 75)}; Çwindow.close (s) bundle { // license edit (@system.startup.license); // 12/4/04; 9:26:35 PM by TAC - i rather do this near the beginning of phase 1 firstRootRun but had a problem with this window and setting up the quick script window wp.setSelect (0, 0)}}; system.callbacks.startup (); //call user's startup scripts bundle { // build menu bar system.menus.buildMenuBar (); system.menus.buildSuitesSubmenu ()}; //5.0 Frontier.enableAgents (flEnableAgents); if flEnableHttpServer { //6.0, daemons don't start up until all the startup code has run new (tableType, @user.inetd.listens); inetd.start ()}; //start up all daemons with startup set true if flFirstRootRun { if defined (system.temp.installer.urlToOpen) { Çwindow.update ("About Frontier") webBrowser.openUrl (system.temp.installer.urlToOpen); webBrowser.bringToFront ()}; user.prefs.firstRootRun = false}; system.temp.Frontier.startingUp = false; //signal to all who care, let the hits begin! msg (""); fileMenu.save () \ No newline at end of file |