Barvna shema: Temna
Trenutno dejavna stran: start » en » Documentation » Microsoft Access development tools » WKL Office SDK » WKL Office SDK reference » SDK settings: settings.json

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:

  1. the project file (.acproj), for the settings it has a property for;
  2. the environment variable of the setting;
  3. settings.json;
  4. 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

EntryValuesDefaultEnvironment variableMeaning
newProjects.rootfoldernone–wkl-office new creates a project given by name only (new Customers) in this folder.
newProjects.sourceFolderfolder namesource–SourceRoot of a new project.
newProjects.buildFolderfolder namebuild–BaseOutputPath of a new project and the folder in its .gitignore.
newProjects.deliveryFolderfolder namedelivery–DeliveryRoot of a new project.
newProjects.neutralLanguagelanguage codenone–NeutralLanguage of a new project, for example sl.
newProjects.targetAccessx86, x64, anyany–TargetAccess of a new project.
newProjects.configurationsnames separated by ;Debug and Release–The configurations a new project declares besides Debug and Release (Configurations).
paths.packagesfoldernoneWKL_PACKAGESThe folder of the release packages (<product>\<version>); a new delivery suggests the newest version of each WKL library from it.
paths.templatesfolders separated by ;noneWKL_ACCESS_TEMPLATESWhere a project's Template is searched when it is not found relative to the project.
paths.controlBlocksfoldernoneWKL_ACCESS_CONTROL_BLOCKSThe control blocks of WKL Forms Object Library, when neither the project nor its template names a folder.
paths.bootstrapperManagerfilethe installed versionWKL_BOOTSTRAPPER_MANAGERThe database of the Bootstrapper Manager, instead of the newest installed version.
behavior.exportOnSavetrue, falsetrue–Whether saving in the VBA editor exports the changes, for a project you have not switched on or off yourself.
behavior.checkCodeBeforeBuildtrue, falsefalse–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.askBeforeReopentrue, falsetrue–Whether Build and reopen and Rebuild and reopen ask before they close the database.
behavior.languageen, de, sl, hr, itthe language of OfficeWKL_SDK_LANGUAGEThe language of the add-in and the command line.
behavior.terminalShellpwsh, powershell, cmdPowerShell 7, else Windows PowerShell–The shell of the add-in's terminal.
publisher.templatefilenone–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:

SettingWhere
Trusted locations, macro settings, add-insAccess: File › Options › Trust Center
Start form, navigation pane, ribbon of a databaseAccess: File › Options › Current Database (in the project: `source/application/properties.json`)
Default file format, default database folderAccess: File › Options › General
Require Variable Declaration, Auto Syntax Check, font, tab widthVBA editor: Tools › Options
Compile On Demand, Break on ErrorsVBA editor: Tools › Options › General

Remarks

  • Format. format is 1. 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 and wkl-office settings ends 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 newProjects apply to wkl-office new only.

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.

en/wiki/msaccess/sdk/reference/settings.txt · Zadnja sprememba: uporabnika Wolfgang van der Stille