The following topics are available.


CFGMaint Tool

Export

Import

Color Export / Import

Repair

Error Log File

Modifying / Editing the Export File


Introduction


The SPFLite.CFG file contains all your personal preferences, color schemes, file profiles, SET tables, Keyboard configuration etc.  The settings in this file are those you have slowly customized since your first execution of SPFLite.  Loss or damage to this file could mean a considerable effort to re-establish all your preferences.


Although a Backup of the file can of course be done using normal backup tools, there are many users who miss the ability to examine and modify the settings by looking at the old INI files that used to contain all this data.


Modifying the INI files in this way was always discouraged since there was no validation performed that changes were indeed valid. But if you were careful it could be done.


CFGMaint Tool


Welcome to CFGMaint.EXE.  This is a completely separate program from SPFLite itself which allows you to Export or Import CFG file data, or actually validate and repair a CFG file "in place".


Note: CFGMaint will only execute if there are no instances of SPFLite running. otherwise the run is aborted with an error message.


Syntax:   CFGMaint {  [ -EXPORT  [ table-Name ]  [ -EXPMAX nn] [ -QUIET] ] 

                    | [ -IMPORT  [ file-name ]

                    | [ -REPAIR ] 

                    | [ -EXPCOLOR instance-name

                    | [ -IMPCOLOR instance-name ]                                             

                                                }

    

If no function parameters are specified  -EXPORT -EXPMAX 3 -QUIET will be assumed.

If -EXPORT and no -EXPMAX is provided, the last used EXPMAX value will be used. (or the default of 3)


Lets look at its various functions.


Export


The Export function will extract all data from the production SPFLite.CFG file, format it and write the data to a normal Windows TXT file.  This file can be Browsed (or Edited) like any other TXT file.


The format is similar to that of a normal INI file. Although no details are provided for each parameter, anyone familiar with the INI file format will find it quite simple to follow. Each table from the CFG file will be formatted as:


[TableName]

Data-item-1

Data-Item-2

.

.

=====================================


The format of the Data-Item varies  depending on the type of table.


The first character of each Tablename indicates the type of CFG file table.

      • O - An Option table for an SPFLite Instance
      • K - A Keyboard mapping table
      • P - A file Profile table
      • S - A SET table
      • R - A Retrieve table
      • B - A Backup control table
      • E - An Extended File table


If you have never used multiple SPFLite Instances, then the names will be ODEFAULT. KDEFAULT, SDEFAULT etc.


To invoke an Export, run CFGMaint with the following command line.


CFGMaint -EXPORT  [ table-name ]  [ -EXPMAX nn ]  [ -QUIET ]


This will create the Export file in the normal SPFLite Home folder (the one that holds your CFG file.  The file will be dated and timestamped in this format.


CFGMaint Exp 2020-10-27 13.42.TXT


or, if table-name was provided


CFGMaint Exp 2020-10-27 13.42.[table-name].TXT



Because the file is timestamped, SPFLite can also provide automatic file maintenance.  This is controlled with the optional -EXPMAX nn operand.

If -EXPMAX 0 is specified, SPFLite will simply create the Export file, it is up to you to maintain them.


If -EXPMAX n is specified, then SPFLite will keep n versions of the Export file, older versions will be automatically deleted.  The default for -EXPMAX is 3.  Note: Export files for specific table-names are exempt from retention processing.


Note: The last used EXPMAX value is saved and will be re-used until a run with a different EXPMAX value is specified.


The -QUIET  option is used when CFGMaint is run unattended and will suppress any error Pop-Up windows. Errors will always be written to the LOG file which will be created as


CFGMaint Log 2020-10-27 13.42.TXT


In fact the default for CFGMaint, if executed without any command line operands is -EXPORT -EXPMAX 3 -QUIET


An execution of CFGMaint to create an Export file can be easily scheduled via Windows Task Scheduler at whatever time and interval you prefer.


Import


Import is obviously the opposite of Export.  It is invoked using a command line operand of -IMPORT.  If you do not provide the optional specific file-name on the command line, CFGMaint will prompt you to select the particular Export file you wish to Import.  


 Import will validate the contents of the file, reporting via a pop-up each error it finds and providing you with correction options.  After validating the entire file, it will then prompt you again for permission to actually load the data into the CFG file. 


 Note: When a specific file-name is provided, CFGMaint will treat the run as a -QUIET run, no pop-ups for errors will be done nor will you be prompted to proceed with the actual table loading.


Import will reload data into the current production CFG file.  Each table in the Import file will completely replace the table in the CFG file.


If no CFG file exists, Import will create one.


If there are no System Registry entries indicating the location of the SPFLite folders, the CFG file will be created in the normal default location.

Users\You\Documents\SPFLite


Color Export / Import


The CFG file contains all your screen color choices (amongst all the other options). There are times when you may want to copy your color 'theme' without also copying all the other options within the CFG file.

e.g.

      • To copy between multiple Instances within the CFG file (if you use multiple Instances).
      • To share your color theme with other SPFLite users.


CFGMaint recognizes two commands specifically created to support this need.


-EXPCOLOR instance-name                to export current colors to an Export file

   and

-IMPCOLOR instance-name                to import colors from an Export file into a specific Instance


For users who do not use multiple Instances, the instance-name will always be ODEFAULT. This operand must always be specified, even though it is the normal default.


For users who do use multiple instances, instance-name should specify the exact Instance to be used for the Export / Import activity.


-EXPCOLOR will export all color related settings to a file in the normal SPFLite Home folder (the one that holds your CFG file.  The file will be dated and timestamped in this format.


CFGMaint Exp 2020-10-27 13.42.[instance-name Colors].TXT


-IMPCOLOR will validate that the instance-name currently exists in the CFG file (it must) and then will prompt you to select the Export file which is to be imported. Note: the selected file must be a vallid file created by an EXPCOLOR run, it will not process any other Export files created by the normal _EXPORT command.


Repair


CFGMaint has a -REPAIR option.  In this mode it will examine all tables in the CFG file and perform validation of the entries.  If errors are detected it will display a pop-up describing the error and asking for your permission to perform the correction.  The needed changes are done to the production CFG file.


Note: If you run REPAIR and have been a long time SPFLite user, you will undoubtedly receive numerous pop-ups related to Options and Profile settings that have been obsoleted over the years. It will offer to delete these entries, in this case you should allow it to do so.


Error Log File


CFGMaint maintains a log of it's activity during each run.  If no errors are encountered, the log file is not even created. If errors are encountered, the log file is written to the same folder as the Export files.  It is named


CFGMaint Log 2020-10-27 13.42.TXT


If created by an Export run, the timestamp will match the Export file being processed.


Modifying / Editing the Export file


Just as with INI files, we do not recommend editing the Export and them Importing it to make bulk changes to the CFG file.


Realistically though, we know many of you will still consider doing so.  So here are some points to consider, in no particular order.


Be careful!


    • The modified Export file need not contain all tables from the CFG file. It is fine for it to contain as little as one table (or even none!).



    • Normally, each Options and Profile table's entries should be complete, it you provide only a selected subset of the various entries, the line items you do not specify will be set to the SPFLite default. Note: For Profiles this is not the values from the standard Default Profile. You can not update single entries within a table and leave remaining entries with their current values (unless you provide these unmodified entries).


The table in the CFG file is emptied and then reloaded with the contents of the Export file and missing entries are set to their default.value. 


    • The delimiter line of ===================== must be present at the end of each table (even if only one table is present).


    • Option and Profile tables are entirely keyword=value style, like the old INI files.


    • The SET, BKP and RTR tables have a count as the first line, this must match the number of entries.  The entries must be numbered appropriately.


    • The various tables have different characteristics which must be adhered to.


      • Keyboard table is fixed and must not be re-arranged, the order is critical
      • The "O" and "P" tables (Options and Profiles) are old INI style, the order is not important.
      • The Retrieve table - order doesn't matter.
      • The BKP table should be left alone, there is nothing to be gained via modification but trouble.
      • The SET table, while seemingly simple, should also be left alone.  If PUSH / POP have been used, the format is critical - leave it alone.


    • You may create new tables (like Profiles), and they will be loaded.  If you create SET, KBD, BKP or RTR tables, it is up to you to link them to their proper Option table.


Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your documentation