All DG3 based applications have a global path and a global setting that can be accessed anywhere in the application. This documents describes how the global paths are setup and configured. This is always the first that is done in an application before anything else can be done. Without the global paths, the application would not be able to know where to read it's startup.conf document that holds global settings for the application.

Calculating the paths

The startup process of the applications involves calculating all the paths that the application need to be able to load it's settings, forms, application templates, scripting engines etc.It is complicated and flexible. It supports the possibility to share space with other applications without interfering with the other applications forms, templates etc. It is also used for calculating and creating it's own work area when generating it's own applications.

The process of setting up the paths can be confusing. Here is how it works.

The method can take the following named parameters: startpath, prefix and sharebuild. It creates a global instance of GobalPaths the first time called, and after that just returning the global paths object. This means that it only obeys the parameters the first time called.

startpathNoneThe name of the directory used for storing startup.conf and the root of all data created by the application. Application data can be definitions of other applications generated by this application and custom modules.
prefixNoneThe prefix used by all Defintion paths. Used to make it possible for more than one application to be installed in the same directory without the applications sharing the form, defaults and template defintions.
sharebuildFalseMakes it possible to share templates and defintions for generating new applications without having to share the form definitions.
getpaths(startpath='My DEReporter',prefix='DEReporter')

This defintion created a My DEReporter folder in My Documents and has a separate folder for both the forms and the templates.

All the defined paths

startappthe exe file that started this application with absolute path
executablepathwhere the exe files like python.exe is located
pythonpythonw.exe with absolute path
pythonshellpython.exe with absolute path
apppathabsolute path to the dg3 libraries
defpathDefintion path. It is the root of all forms. The default is apppath + Definitions but a prefix is added with that parameter is set.
formpathThe root of the application forms. This is normally defpath + forms
builddefThe folder for the templates and defaults for app generation. Usually the same as defpath unless sharebuild is True, then this will be the same as apppath + Definitions
templatepathWhere code templates are found. This is the same as buildddef + templates
defaultpathWhere defaults for code builders are stored. This is the same as builddef + defaults
helppath
imgpathFollows the same pattern as defpath, that is apppath + Img and then the prefix added if that is defined
iconpathimgpath + Icons
silkiconpathimgpaths + Icons + silk + icons (relic not in use any more, will be removed)
myappsThis is the path where you will store your application data. The default is to use My documents folder + this name as the place to store your data. You can set any directory you like by using a absolute path. The user can override your path by adding a redirect file (no extentions) with the absolute path with trailing path separator at the end. Ex. E:\Projects\DG3Projects\ in a redirect file will make the application use this instead. The startup.conf file is always stored in the myapps folder.
myappDefault None but can be used to set myapp to inside the application.