Sw4   >   Configuration   >   Folders and Files

Folders and Files

The StudioWorks files are stored in a specific folders and files structure. Developers can change the folders and files struture but it is recommended that you stick with the default structure while you are writing your first StudioWorks application. Later on when you are ready to release the application you will have more experience with StudioWorks and it will be much easier for you to make a change to the default folders and files structure.

For purposes of documentation, StudioWorks refers to three different root folders:

  1. APP - Is the root folder of your StudioWorks application. Your application's main library and custom module libraries are contained inside the APP folder.
  2. OMNIS - Is the folder where the Omnis program is located. On the Mac it is normally located in the Applications folder. On Windows it is normally located in the Program Files folder.
  3. PREFS - Is the folder where the StudioWorks stores user preferences for the StudioWorks application. On the Mac it is normally located in the ~User/Library/Preferences/Omnis/[StartupLibName] folder. On Windows it is normally located in the C:\Documents and Settings\Administrator\Local Settings\Application Data\[StartupLibName] folder.

The APP folder can be any name you or your user want to name it. Moving or renaming the folder will have zero impact on your StudioWorks application.

Enclosed in the APP folder you may find the following folders and files.

  1. data - This optional folder is only present if the StudioWorks app is being used in single user mode with the Omnis data file and the data file is located inside the APP folder.
  2. libraries - This folder is where the main library is stored. The libraries folder contains a modules subfolder where your StudioWorks application's custom libraries are stored.
  3. startupitems - This folder is where the startupsettings.txt file is stored. The encrypted tablesownerlogon.txt and autosignin.txt files if applicable are located in this folder.
  4. open_MyApp.lbs - This library file acts like an alias or shortcut file. When the library is opened it looks for the libraries folder in the same directory and then opens any libraries inside the libraries folder. Normally the only library file located at the first level of the libraries folder is the main library. (More on the main library later) The _MyApp portion of the open_MyApp.lbs file should be renamed to the name of your appliation. e.g. openClientTracker.lbs.

    The open_MyApp.lbs library file could be replaced with an AutoUpdater library. You would configure the AutoUpdater library to check for any newer version files and download them from a server to the client prior to opening the main library and any of the sub-libraries or StudioWorks libraries. See StudioTips > Utilities for more information on AutoUpdater.
  5. studioworks - This folder contains all of the StudioWorks folders and files. When StudioWorks starts up it opens all the libraries located in this folder and drills down recursively into all subfolders opening any library files it finds. You can locate the studioworks folder in your APP folder, or it can be located in the OMNIS folder or an Omnis Startup folder. When you are starting to learn StudioWorks it is easiest to keep it in the APP folder. Later on to avoid having multiple copies of StudioWorks on your computer you may want to move the studioworks folder to your OMNIS folder or an Omnis Startup folder which you can create inside the Applications (Mac) or Programs Folder (Win).

Enclosed in the PREFS folder you may find the following StudioWorks related folders:

  1. logs - StudioWorks creates the logs folder and a subfolder inside the logs folder for each StudioWorks application. The subfolder name matches StudioWorks application's main library default name. The log files are then creates inside the subfolder.
  2. local_prefs.df1 - StudioWorks creates a local_prefs data file where the local user preferences are then stored for the StudioWorks application. Last user who signed in, last language used, are examples of the types of information stored in the local_prefs data file.

Folders Configuration

The StudioWorks default folders configuration can be controlled in two places.

  1. startupsettings.txt file located in the startupitems folder.
  2. oPaths object located in the main library.

You can change the StudioWorks default folder names by adding a paths properties group to the startupsettings.txt file. The following is a sample of what you could include in the startupsettings.txt file:

paths {

  OmnisStartupFolderName = My Application Name ;
  PreferencesParentFolderName = My Application Name ;

}

The name of the preferences folder for your StudioWorks app will default to the $name property of your main library. If you want the preferences folder for your StudioWorks app to be a nicer looking name add an $:AppName property method to your main library Startup_Task and return the actual name of your application from that method. The oPaths object will use the return value for your StudioWorks app's preferences folder name.

; $:AppName method - add to main library Startup_Task.
Quit method 'My App Name'

You can control any of the folder locations and names by modifying methods of the oPaths object located in your main library. Only do this if you have a good reason for doing so. If a new release of StudioWorks has a modified oPaths object the intent is that you simply replace your old main library oPaths object with the new oPaths object. Modifying the oPaths object will give you more work because you will then have to compare your oPaths object with the new oPaths object and manually make the changes.