[RETHINK] Setup/Init process
This issue describes what happens when starting an HSE application.
Determination Mechanism
HSE applications determine the <%BaseLocation%> (the base path for the "_Config" and "_Data" folders) in this order:
-
<%APP-NAME%>.iniconfig file next to the .exe- if found, read
configdiranddatadirkeys from file
- if found, read
- One level up from application directory
- look for
<%APP-NAME%>_Config\and<%APP-NAME%>_Data\folders - if found, use those
- look for
- In
<%ProgramData%>\<%COMP-NAME%>\- look for
<%APP-NAME%>_Config\and<%APP-NAME%>_Data\folders - if found, use those
- look for
- Use first match (if none is found, see below)
- Log selected paths in
startup.vi
The preferred location for the <%BaseLocation%> is <%ProgramData%>\<%COMP-NAME%>\
Execution Sequence
When running the app, it will check the following in the <%BaseLocation%>:
- "_Config" folder
- looks for
<%APP-NAME%>_Config\ - if this folder does not exist, see case "A"
- looks for
- Shipping configuration
- if this does not exist, see case "B"
- Main configuration file
- looks for
<%APP-NAME%>_Config\config.ini - if this file does not exist, see case "C"
- if it exists, get configured unit -> <%UNIT%>
- if configured unit is "Default", see case "D"
- looks for
- Configured Unit folder
- looks for
<%APP-NAME%>_Config\Unit_<%UNIT%>\ - if this folder does not exist, see case "E"
- looks for
Scenarios
- Case A: No _Config folder at all
- throw error and exit
- Case B: No shipping config
- throw error and exit
- Case C: No
config.ini- copy
config.ini.defaulttoconfig.ini - goto case D
- copy
- Case D: Default unit configured
- parse "_config" folder for potentially existing Unit folders
- ask user to select existing Unit or provide new Unit name
- if new name: duplicate Unit_Default to provided Unit_NewName
- update
config.iniaccordingly with new unit name
- Case E: Configured unit folder missing
- goto case D
For each case, the application has to take care of setting access rights on <%BaseLocation%>\ accordingly.
In the future, we will look into cascading configs and UI-based config editors.
Notes
- Program Data (like in a Windows
ProgramDatafolder) stores configuration files, settings, and shared data for computer programs, often hidden and protected. Program data is essential for a program's operation. - Public documents (in a
Public Documentsfolder) are user-created files and documents meant to be shared with other users of the same computer or network. Public documents are content provided by users for general access and sharing.
Todos
-
Create VI to set permissions
Edited by Joerg Hampel