|
From: creedon <icr...@us...> - 2005-07-06 19:47:17
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/startup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv795 Modified Files: startupScript Log Message: changed user.callbacks.sendmail to user.callbacks.tcpSendMail, added user.prefs.mailHostPort Index: startupScript =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/startup/startupScript,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** startupScript 16 Jun 2005 22:28:25 -0000 1.5 --- startupScript 6 Jul 2005 19:46:48 -0000 1.6 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.startup.startupScript ! ÇThis script runs when Frontier opens the Frontier.root file. ÇChanges Ç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&view=markup> Çuserland.firstRootRun <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/firstRootRun?rev=1.1&view=markup> Çuserland.finishInstall <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/finishInstall?rev=1.1&view=markup> Çuserland.cleanRoot <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/cleanRoot?rev=1.1&view=markup> Ç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 local (flEnableAgents = true, flOpenDatabases = true, flEnableHttpServer = true); // can be set by the external startup script local (flFirstRootRun = true); bundle { // miscellaneous variable initializations and checks, phase 1 of 2 Frontier.pathString = file.folderFromPath (frontier.getFilePath ())}; bundle { // first root run, phase 1 of 2 if defined (user.prefs.firstRootRun) { flFirstRootRun = user.prefs.firstRootRun}; if flFirstRootRun { // license agreement, finish cleanup on user's machine Frontier.enableAgents (false); // try to keep agents from reporting errors 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); 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 new (tableType, @user.prefs); user.prefs.firstRootRun = true; user.prefs.flShortTimeStamp = true; user.prefs.flWinStandardMaximize = true; user.prefs.frontierIsServer = false; user.prefs.initials = ""; user.prefs.mailAddress = ""; user.prefs.mailHost = ""; user.prefs.name = ""; user.prefs.openAboutWindow = false; user.prefs.organization = ""; Frontier.setupUserPrefsFonts (); bundle { // set up user.prefs.dialogs new (tableType, @user.prefs.dialogs); user.prefs.dialogs.newSuiteName = ""; user.prefs.dialogs.jumpAddress = "websites"}; // or should this be workspace? bundle { // set up user.prefs.search new (tableType, @user.prefs.search); user.prefs.search.searchFor = "9.0.1"; user.prefs.search.replaceWith = Frontier.version (); user.prefs.search.caseSensitive = false; user.prefs.search.closeWindows = true; user.prefs.search.flatSearch = false; user.prefs.search.frontWindowOnly = false; user.prefs.search.wholeWords = false; user.prefs.search.wrapAround = true; user.prefs.search.winStandardFindCommand = false}; 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}}}}; 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.sendmail); 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)}; bundle { // set up user.menus new (tableType, @user.menus); Çuser.menus.bookmarkMenu = userland.virginBookmarkMenu user.menus.customMenu = Frontier.data.virginCustomMenu}; 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 { // 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 = f; adrTable^.openOnStartup = true; adrTable^.runStartupScript = false; adrTable^.supportsSubscribe = false}; Ç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 { // system.temp.Frontier if defined (system.temp.Frontier) { //only run the startup script once return}; new (tableType, @system.temp.Frontier); system.temp.Frontier.startupTime = clock.now (); system.temp.Frontier.startingUp = true}; bundle { // miscellaneous variable initializations and checks, phase 2 of 2 system.menus.data.currentsuite = ""; system.menus.data.currentmenu = 0; bundle { // check for presence of Psapi.dll if sys.os () == "WinNT" { if not (sys.appIsRunning ("Frontier.exe")) { // 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, disabled until mR can be rewritten from the perspective of the open source release 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 bundle { // first root run, phase 3 of 3 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 (); Ç Ç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 ! ÇThis script runs when Frontier opens the Frontier.root file. ÇChanges Ç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 local (flEnableAgents = true, flOpenDatabases = true, flEnableHttpServer = true); // can be set by the external startup script local (flFirstRootRun = true); bundle { // miscellaneous variable initializations and checks, phase 1 of 2 Frontier.pathString = file.folderFromPath (frontier.getFilePath ())}; bundle { // first root run, phase 1 of 2 if defined (user.prefs.firstRootRun) { flFirstRootRun = user.prefs.firstRootRun}; if flFirstRootRun { // license agreement, finish cleanup on user's machine Frontier.enableAgents (false); // try to keep agents from reporting errors 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); 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 new (tableType, @user.prefs); user.prefs.firstRootRun = true; user.prefs.flShortTimeStamp = true; user.prefs.flWinStandardMaximize = true; user.prefs.frontierIsServer = false; user.prefs.initials = ""; user.prefs.mailAddress = ""; user.prefs.mailHost = ""; user.prefs.mailHostPort = 25; // port is the most common port user.prefs.name = ""; user.prefs.openAboutWindow = false; user.prefs.organization = ""; Frontier.setupUserPrefsFonts (); bundle { // set up user.prefs.dialogs new (tableType, @user.prefs.dialogs); user.prefs.dialogs.newSuiteName = ""; user.prefs.dialogs.jumpAddress = "websites"}; // or should this be workspace? bundle { // set up user.prefs.search new (tableType, @user.prefs.search); user.prefs.search.searchFor = "9.0.1"; user.prefs.search.replaceWith = Frontier.version (); user.prefs.search.caseSensitive = false; user.prefs.search.closeWindows = true; user.prefs.search.flatSearch = false; user.prefs.search.frontWindowOnly = false; user.prefs.search.wholeWords = false; user.prefs.search.wrapAround = true; user.prefs.search.winStandardFindCommand = false}; 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}}}}; 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 { // set up user.menus new (tableType, @user.menus); Çuser.menus.bookmarkMenu = userland.virginBookmarkMenu user.menus.customMenu = Frontier.data.virginCustomMenu}; 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 { // 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 = f; adrTable^.openOnStartup = true; adrTable^.runStartupScript = false; adrTable^.supportsSubscribe = false}; Ç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 { // system.temp.Frontier if defined (system.temp.Frontier) { //only run the startup script once return}; new (tableType, @system.temp.Frontier); system.temp.Frontier.startupTime = clock.now (); system.temp.Frontier.startingUp = true}; bundle { // miscellaneous variable initializations and checks, phase 2 of 2 system.menus.data.currentsuite = ""; system.menus.data.currentmenu = 0; bundle { // check for presence of Psapi.dll if sys.os () == "WinNT" { if not (sys.appIsRunning ("Frontier.exe")) { // 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, disabled until mR can be rewritten from the perspective of the open source release 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 bundle { // first root run, phase 3 of 3 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 (); Ç Ç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 |