SDK settings: settings.json
Signature
{
"format": 1,
"newProjects": {
"root": "D:\\Projects",
"sourceFolder": "source",
"buildFolder": "build",
"deliveryFolder": "delivery",
"neutralLanguage": "sl",
"targetAccess": "x64",
"configurations": "Debug;Release;Customer"
},
"paths": {
"packages": "D:\\Packages",
"templates": "D:\\Templates;%USERPROFILE%\\Templates",
"controlBlocks": "%LOCALAPPDATA%\\WKL\\Access Components\\2.0.0\\control-blocks",
"bootstrapperManager": "D:\\Tools\\Wkl.Bootstrapper.Manager.accdb"
},
"behavior": {
"exportOnSave": true,
"checkCodeBeforeBuild": true,
"askBeforeReopen": false,
"language": "en",
"terminalShell": "pwsh"
},
"publisher": {
"template": "D:\\Publisher\\publisher.json"
}
}
Summary
The settings of the SDK belong to your Windows user, not to a project: defaults for new projects, the folders where the SDK finds release packages, templates, control blocks and the Bootstrapper Manager, how the add-in behaves, and a publisher template. The add-in (Settings in the group Tools) and the command line (`wkl-office settings`) read and write the same file.
The file is %APPDATA%\WKL\Office SDK\settings.json, in the roaming part of your profile, so it follows a roaming
profile to another PC and stays when you install another version of the SDK. Without the file, the defaults of the SDK
apply. The environment variable WKL_SDK_SETTINGS names another
file, for example on a build server.
Order of precedence
A value applies in this order; the first one that names a value wins:
- the project file (
.acproj), for the settings it has a property for; - the environment variable of the setting;
settings.json;- the default of the SDK.
The dialog SDK Settings and wkl-office settings list show where each value comes from. A value you write to the file
does not apply while its environment variable is set; both say so.
Entries
| Entry | Values | Default | Environment variable | Meaning |
|---|---|---|---|---|
newProjects.root | folder | none | – | wkl-office new creates a project given by name only (new Customers) in this folder. |
newProjects.sourceFolder | folder name | source | – | SourceRoot of a new project. |
newProjects.buildFolder | folder name | build | – | BaseOutputPath of a new project and the folder in its .gitignore. |
newProjects.deliveryFolder | folder name | delivery | – | DeliveryRoot of a new project. |
newProjects.neutralLanguage | language code | none | – | NeutralLanguage of a new project, for example sl. |
newProjects.targetAccess | x86, x64, any | any | – | TargetAccess of a new project. |
newProjects.configurations | names separated by ; | Debug and Release | – | The configurations a new project declares besides Debug and Release (Configurations). |
paths.packages | folder | none | WKL_PACKAGES | The folder of the release packages (<product>\<version>); a new delivery suggests the newest version of each WKL library from it. |
paths.templates | folders separated by ; | none | WKL_ACCESS_TEMPLATES | Where a project's Template is searched when it is not found relative to the project. |
paths.controlBlocks | folder | none | WKL_ACCESS_CONTROL_BLOCKS | The control blocks of WKL Forms Object Library, when neither the project nor its template names a folder. |
paths.bootstrapperManager | file | the installed version | WKL_BOOTSTRAPPER_MANAGER | The database of the Bootstrapper Manager, instead of the newest installed version. |
behavior.exportOnSave | true, false | true | – | Whether saving in the VBA editor exports the changes, for a project you have not switched on or off yourself. |
behavior.checkCodeBeforeBuild | true, false | false | – | Build and reopen and Rebuild and reopen first check the code; an error stops the build before the database is closed, warnings do not. |
behavior.askBeforeReopen | true, false | true | – | Whether Build and reopen and Rebuild and reopen ask before they close the database. |
behavior.language | en, de, sl, hr, it | the language of Office | WKL_SDK_LANGUAGE | The language of the add-in and the command line. |
behavior.terminalShell | pwsh, powershell, cmd | PowerShell 7, else Windows PowerShell | – | The shell of the add-in's terminal. |
publisher.template | file | none | – | A publisher.json copied into the DeliveryRoot of a project when its delivery is set up and it has no publisher.json yet. |
Folders and files may contain environment variables (%USERPROFILE%). A folder name has no path.
Not in the settings
The SDK does not repeat what Access and the VBA editor already offer. Change these where they are:
| Setting | Where |
|---|---|
| Trusted locations, macro settings, add-ins | Access: File › Options › Trust Center |
| Start form, navigation pane, ribbon of a database | Access: File › Options › Current Database (in the project: `source/application/properties.json`) |
| Default file format, default database folder | Access: File › Options › General |
| Require Variable Declaration, Auto Syntax Check, font, tab width | VBA editor: Tools › Options |
| Compile On Demand, Break on Errors | VBA editor: Tools › Options › General |
Remarks
- Format.
formatis1. A file of a newer format is refused with a message instead of being read in part: the dialog SDK Settings then offers nothing to change andwkl-office settingsends with exit code 3, so the file is never overwritten. Use the version of the SDK that wrote it, or remove the file. - Unknown entries are refused with the list of entries, so a mistyped name never goes unnoticed.
- A file that cannot be read counts as missing for every other command, which works with the defaults.
- Existing projects keep their settings: the entries under
newProjectsapply towkl-office newonly.
Code example
wkl-office settings set paths.packages D:\Packages wkl-office settings set behavior.askBeforeReopen false wkl-office settings get paths.packages paths.packages = D:\Packages (settings) wkl-office settings set paths.packages
The last line removes the entry; the default applies again.