Sw4   >   Configuration   >   Startup Settings

Startup Settings

The StudioWorks application's startup settings are controlled by the startupsettings.txt file located in the APP/startupitems folder.

The startupsettings.txt file is optional. You will only need to create the file if you want to change default settings, preset properties, or control the logon process of the end users.

Logon Settings

By default StudioWorks uses the last saved logon settings when an StudioWorks application is reopened. You can force an StudioWorks application to always use specific logon settings each time it is opened. To do so you add a logon property group to the APP/startupsettings.txt file.

The following are some examples of a logon properties group that could be added to the startupsettings.txt file.

Logon settings for logging onto an Omnis data file located in the user's APP/data folder.

logon {

     damname = OMSQLDAM ;
     hostname = APP/data/localdatafile ;
     pingdatabase = FALSE ;

}

Logon Settings for logging on as the tables owner to a FrontBase database located on a server on the local area network.

logon {

     damname = FRONTBASEDAM ;
     hostname = 192.168.1.7 ;
     databasename = LiveData ;
     tablesownerlogon = TRUE ;
     pingdatabase = TRUE ;

}

Note

Be sure to include the ; semi-colon character after each property. The semi-colon is the delimiter.

Auto Sign-In

An StudioWorks application can be configured to automatically sign-in the client when the main library is opened. The primary reason for having this feature is to be able to open a StudioWorks Omnis web application on a server without user intervention. The other reason you might do this is to save the user from needing to enter their name and password in the Sign-In window each time they open a low security application.

To configure the StudioWorks application for auto sign-in you need to do two things:

  1. Create an encrypted autosignin.txt file.
  2. Modify the startupsetting.txt file to include an autosignin property.

To create the autosignin.txt file:

  1. Go to System Administration > Users
  2. Select the user who you want to enable for auto sign-in, and click the Edit button.
  3. In the edit user window toolbar Special menu, select Create Auto Sign-In File.

    StudioWorks will create the encrypted autosignin.txt file in the APP/startupitems folder and report back to you when it is done.

To modify the startupsetting.txt file:

  1. Using a text editor open the startupsetting.txt located in the APP/startupitems folder
  2. Find or create a constants properties group in the file and add an autosignin property to the group.

    constants {

         autosignin = TRUE ;

    }



    Note

    Be sure to include the ; semi-colon character after each property. The semi-colon is the delimiter.

Web App Mode

A StudioWorks application can be configured to run as an Omnis web server app.

When running on a web server, the StudioWorks application needs to startup without user intervention and in the event of an error the web app must not halt code execution with an OK message or a modal prompt window. Doing so would halt the Omnis application running on the server. HTTP requests being sent to the Omnis web app server would not be processed. The server administrator would need to use remote desktop software (VNC) to connect to the server, click the OK button, so that the code would continue. Not a good thing.

To configure an StudioWorks application to run as a web application need to modify the startupsetting.txt file:

  1. Using a text editor open the startupsetting.txt located in the APP/startupitems folder
  2. Find or create a constants properties group in the file and add an appmode property to the group.

    constants {

         autosignin = TRUE ;
         appmode = web;

    }



    Note

    Be sure to include the ; semi-colon character after each property. The semi-colon is the delimiter.

With the appmode set to web the StudioWorks framework does the following when the application is opened:

  1. cn.$:AppMode is set to web.
  2. errhndlr.$:DeveloperErrorPrompts is set to kFalse. This stops the error handler from opening OK debug messages for developer versions of Omnis Studio since the developer version can be run as a web app server.
  3. errhndlr.$:PromptUsingTraceLog is set to kTrue. This causes the $promptonceLastError method to send the last error to the trace log and then open the trace log, rather than opening a modal prompt window.
Note

You must also configure the Logon Settings and Auto Sign-In if you set the appmode to web.

Email Settings

If you are instantiating the oEmail object using the Startup_Task task variable eml you should set the applicable oConstants properties either by overridding and setting them manually in the oConstants object in your main library, or by setting them from the startupsettings.txt file.

To set the contants which apply to oEmail in your startupsettings.txt file you will need to include a constants group with properties and values as follows:

constants {

    SysAdminEmailAddr = TheSysAdminEmailAddress ;
    SysAdminFormalName = TheSysAdminFormalName ;
    SMTPServer = TheSMTPServerName ;

}

Example properties and values:

constants {

    SysAdminEmailAddr = support@vencor.ca ;
    SysAdminFormalName = Vencor Support ;
    SMTPServer = mail.vencor.ca ;

}

Alternately you can override the following methods in oConstants of your main library and return the values you want to use for your application.