-
Notifications
You must be signed in to change notification settings - Fork 5
Config.Json
The config.json file is a single file that is added to a PSF enabled package to configure all of the PSF components in the package.
While an XML file may have been more conventional for this kind of purpose, Microsoft decided to use a json formatted file. After criticism, Microsoft introduced an alternative XML format and converter from the XML form to json. However, the PSF components in the package only understand the json form so the use of the XML seems to be limited to third-party developers that prefer XML and perform the conversion before writing into packages. As the converter has not been maintained since originally provided, it is up to those third-party developers to keep their own conversions up-to-date.
Many of the values in the json file utilize a RegEx pattern syntax which might be unfamiliar to many. This syntax is often confusing to those not used to working with it and they may incorrectly assume it is standard cmd shell wildcard syntaxes in use. There are several flavors of regex defined, and the PSF utilizes the ECML (aka javaScript) flavor of the syntax. While the flavors are generally quite close, each flavor has quirks and you need to be sure to use the right flavor. The website RegEx101 is an excellent site to test a regex pattern against potential input strings. The site will not only let you know what matches occur against your input strings, it will also help you to understand the meaning of your test pattern.
The config.json file consists of top level entries, and two arrays: applications and processes.
enableReportError is a boolean value that defaults to true. This was to control what happens in a scripting error, but is now obsolete.
debugLevel is a numeric value that controls the amount of debug logging that the PSF will output to the debug console port.
You can use a tool like DebugView to see the content (possibly saving for the community tool ParsePsfDebugLog to help with the viewing).
The values are defined as:
| Value | Purpose |
|---|---|
| 0 | Disable all debug output |
| 1 | Exceptions only |
| 2 | Process launching debug only |
| 3 | Add Runtime Intercept Basic level |
| 4 | Add Runtime Intercept Intermediate level |
| 9 | Maximum level output |
We recommend using level 2 to start, which is the default, and advancing to level 4 when more information is needed.
Prior to adding this feature, you would use the debug build of the PSF in order to get logging of the runtime intercepts. All logging is now available in the release build and you only need to modify this setting.
The applications' entry is an array of applicationvalues. The PsfLauncher processes (via PsfRuntime) use these values to find an application entry that matches the Id of their application. This matching is not done by using the name of the PsfLauncher process, but instead of the AppID of the process running in the container. This AppID is referenced in the AppXManifest file of the package as theId` of an application entry of the manifest.
For more information on how the launcher locates and interprets this configuration, see the wiki documentation on PsfLauncher.
The processes entry is an array of process values.
The copy of PsfRuntime dll injected into processes in the container reads the processes section looking for the first match to the process running.
This process value will consist of an entry called fixups. The value of fixups will be an array of fixups and their configurations.
The wiki page PsfRuntime Dll and PsfRunDll Exe provides more detail on how this is read, but individual fixups have their own wiki pages which should be consulted.