Next to the database definitions of [[Settings]], every Invantive product keeps settings of the user, such as the language of the user interface, the window layout, the recently opened files and the favourite databases of [[Favorite Databases]]. These are held in three files:
| File | Contents | Location |
|---|---|---|
| `user.settings` | settings shared by all Invantive products and installations of one user | the configuration master folder, by default `%USERPROFILE%\Invantive` |
| `product-user.settings` | settings of one product for one user | the folder of the product |
| `product-installation-user.settings` | settings of one installation of one product for one user | the folder of the product installation |
The files hold no passwords: log on codes and passwords are held in [[Invantive Keychain]].
## Format
From release 27.0 onwards each of these files is also written in JSON format, with the extension `.json` added to the name, such as `user.settings.json`. The copy in JSON format is the one read; the file in XML format keeps being written, so an older release on the same workstation keeps working.
| Release | Behaviour |
|---|---|
| 26.0 and earlier | the file in XML format is written and read; a file in JSON format is ignored. |
| 26.1 (BETA of 27.0) | both formats are written; the file in JSON format is read. |
| 27.0 | both formats are written; the file in JSON format is read. |
| 28.0 | only the file in JSON format is written and read. |
Release 26.1 is the BETA of release 27.0 and behaves identically to it; see [[Settings.xml]] for the release numbering.
Should the file in JSON format be unreadable, the file in XML format is read instead, so a manual edit which goes wrong does not stop a product from starting. That fall-back disappears with release 28.0.
## How the Files are Written
The files are written in full on every change. From release 27.0 onwards that happens such that they stay usable when a write does not finish:
- The new contents are written to a file of their own next to the settings file, read back and checked. Only then does that file take the place of the settings file.
- The previous contents remain available with the extension `.bak`, such as `user.settings.bak`.
- A file with `.tmp-` in its name is a write which did not finish. It is cleaned up automatically after a day and can be removed safely.
Before release 27.0 a settings file which was half written was discarded and replaced by an empty one, whereby the settings of that user were lost.