Settings.md (12498B)
1 # WinGet CLI Settings 2 3 You can configure WinGet by editing the `settings.json` file. Running `winget settings` will open the file in the default json editor; if no editor is configured, Windows will prompt for you to select an editor, and Notepad is a sensible option if you have no other preference. 4 5 ## File Location 6 7 Settings file is located in %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json 8 9 If you are using the non-packaged WinGet version by building it from source code, the file will be located under %LOCALAPPDATA%\Microsoft\WinGet\Settings\settings.json 10 11 ## Source 12 13 The `source` settings involve configuration to the WinGet source. 14 15 ```json 16 "source": { 17 "autoUpdateIntervalInMinutes": 3 18 }, 19 ``` 20 21 ### autoUpdateIntervalInMinutes 22 23 A positive integer represents the update interval in minutes. The check for updates only happens when a source is used. A zero will disable the check for updates to a source. Any other values are invalid. 24 25 - Disable: 0 26 - Default: 15 27 28 To manually update the source use `winget source update` 29 30 ## Visual 31 32 The `visual` settings involve visual elements that are displayed by WinGet 33 34 ### progressBar 35 36 Style of the progress spinner and bar that WinGet displays when not specified by arguments. In addition, all options except `disabled` send [Virtual Terminal progress](https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC) updates that any supporting terminal may display visually. 37 38 |Value|Description|Release| 39 |---|---|---| 40 |`accent` (default)|Use the [Windows Accent color](https://support.microsoft.com/en-us/windows/change-colors-in-windows-d26ef4d6-819a-581c-1581-493cfcc005fe)|1.0| 41 |`retro`|Use the current foreground terminal color|1.0| 42 |`rainbow`|Progress through a rainbow of colors|1.0| 43 |`sixel`|Use sixel images; requires a terminal that supports displaying sixels, such as [Windows Terminal](https://github.com/microsoft/terminal/releases) 1.22.2362 or later|1.9| 44 |`disabled`|No progress will be displayed|1.9| 45 46 ```json 47 "visual": { 48 "progressBar": "accent" 49 }, 50 ``` 51 52 ### anonymizeDisplayedPaths 53 54 Replaces some known folder paths with their respective environment variable. Defaults to true. 55 56 ```json 57 "visual": { 58 "anonymizeDisplayedPaths": true 59 }, 60 ``` 61 62 ### enableSixels 63 64 Enables output of sixel images in certain contexts. Defaults to false. 65 66 ```json 67 "visual": { 68 "enableSixels": true 69 }, 70 ``` 71 72 ## Install Behavior 73 74 The `installBehavior` settings affect the default behavior of installing and upgrading (where applicable) packages. 75 76 ### Disable Install Notes 77 78 The `disableInstallNotes` behavior affects whether installation notes are shown after a successful install. Defaults to `false` if value is not set or is invalid. 79 80 ```json 81 "installBehavior": { 82 "disableInstallNotes": true 83 }, 84 ``` 85 86 ### Portable Package User Root 87 88 The `portablePackageUserRoot` setting affects the default root directory where packages are installed to under `User` scope. This setting only applies to packages with the `portable` installer type. Defaults to `%LOCALAPPDATA%/Microsoft/WinGet/Packages/` if value is not set or is invalid. 89 90 > Note: This setting value must be an absolute path. 91 92 ```json 93 "installBehavior": { 94 "portablePackageUserRoot": "C:/Users/FooBar/Packages" 95 }, 96 ``` 97 98 ### Portable Package Machine Root 99 100 The `portablePackageMachineRoot` setting affects the default root directory where packages are installed to under `Machine` scope. This setting only applies to packages with the `portable` installer type. Defaults to `%PROGRAMFILES%/WinGet/Packages/` if value is not set or is invalid. 101 102 > Note: This setting value must be an absolute path. 103 104 ```json 105 "installBehavior": { 106 "portablePackageMachineRoot": "C:/Program Files/Packages/Portable" 107 }, 108 ``` 109 110 ### Skip Dependencies 111 112 The 'skipDependencies' behavior affects whether dependencies are installed for a given package. Defaults to 'false' if value is not set or is invalid. 113 114 ```json 115 "installBehavior": { 116 "skipDependencies": true 117 }, 118 ``` 119 120 ### Archive Extraction Method 121 122 The `archiveExtractionMethod` behavior affects how installer archives are extracted. Currently there are two supported values: `Tar` or `ShellApi`. 123 `Tar` indicates that the archive should be extracted using the tar executable ('tar.exe') while `shellApi` indicates using the Windows Shell API. Defaults to `shellApi` if value is not set or is invalid. 124 125 ```json 126 "installBehavior": { 127 "archiveExtractionMethod": "tar" | "shellApi" 128 }, 129 ``` 130 131 ### Preferences and Requirements 132 133 Some of the settings are duplicated under `preferences` and `requirements`. `preferences` affect how the various available options are sorted when choosing the one to act on. For instance, the default scope of package installs is for the current user, but if that is not an option then a machine level installer will be chosen. `requirements` filter the options, potentially resulting in an empty list and a failure to install. In the previous example, a user scope requirement would result in no applicable installers and an error. 134 135 Any arguments passed on the command line will effectively override the matching `requirement` setting for the duration of that command. 136 137 > [!NOTE] 138 > 139 > - These settings are only applied for the `winget install` command. 140 > - Other commands like `winget configure` are not affected by these settings. 141 142 ### Scope 143 144 The `scope` behavior affects the choice between installing a package for the current user or for the entire machine. The matching parameter is `--scope`, and uses the same values (`user` or `machine`). 145 146 ```json 147 "installBehavior": { 148 "preferences": { 149 "scope": "user" 150 } 151 }, 152 ``` 153 154 ### Locale 155 156 The `locale` behavior affects the choice of installer based on installer locale. The matching parameter is `--locale`, and uses bcp47 language tag. 157 158 ```json 159 "installBehavior": { 160 "preferences": { 161 "locale": [ "en-US", "fr-FR" ] 162 } 163 }, 164 ``` 165 166 ### Architectures 167 168 The `architectures` behavior affects what architectures will be selected when installing a package. The matching parameter is `--architecture`. Note that only architectures compatible with your system can be selected. 169 170 ```json 171 "installBehavior": { 172 "preferences": { 173 "architectures": ["x64", "arm64"] 174 } 175 }, 176 ``` 177 178 ### Installer Types 179 180 The `installerTypes` behavior affects what installer types will be selected when installing a package. The matching parameter is `--installer-type`. 181 182 ```json 183 "installBehavior": { 184 "preferences": { 185 "installerTypes": ["msi", "msix"] 186 } 187 }, 188 ``` 189 190 ### Default install root 191 192 The `defaultInstallRoot` affects the install location when a package requires one. This can be overridden by the `--location` parameter. This setting is only used when a package manifest includes `InstallLocationRequired`, and the actual location is obtained by appending the package ID to the root. 193 194 ```json 195 "installBehavior": { 196 "defaultInstallRoot": "C:/installRoot" 197 }, 198 ``` 199 200 ### Maximum resumes 201 202 The `maxResumes` setting determines the maximum number of times that a command may be resumed automatically. The default value is 3. 203 204 ```json 205 "installBehavior": { 206 "maxResumes": 3 207 }, 208 ``` 209 210 > Note: [The resume behavior is an experimental feature.](#resume) 211 212 ## Uninstall Behavior 213 214 The `uninstallBehavior` settings affect the default behavior of uninstalling (where applicable) packages. 215 216 ### Purge Portable Package 217 218 The `purgePortablePackage` behavior affects the default behavior for uninstalling a portable package. If set to `true`, uninstall will remove all files and directories relevant to the `portable` package. This setting only applies to packages with the `portable` installer type. Defaults to `false` if value is not set or is invalid. 219 220 ```json 221 "uninstallBehavior": { 222 "purgePortablePackage": true 223 }, 224 ``` 225 226 ## Configure Behavior 227 228 The `configureBehavior` settings affect the default behavior of applying a configuration. 229 230 ### Default Module Root 231 232 The `defaultModuleRoot` behavior affects the default root directory where modules are installed to. Defaults to `%LOCALAPPDATA%/Microsoft/WinGet/Configuration/Modules` if value is not set or is invalid. 233 234 > Note: This setting value must be an absolute path. 235 236 ```json 237 "configureBehavior": { 238 "defaultModuleRoot": "C:/Program Files/Modules/" 239 }, 240 ``` 241 242 ## Telemetry 243 244 The `telemetry` settings control whether winget writes ETW events that may be sent to Microsoft on a default installation of Windows. 245 246 See [details on telemetry](../README.md#datatelemetry), and our [primary privacy statement](../PRIVACY.md). 247 248 ### disable 249 250 ```json 251 "telemetry": { 252 "disable": true 253 }, 254 ``` 255 256 If set to true, the `telemetry.disable` setting will prevent any event from being written by the program. 257 258 ## Logging 259 260 The `logging` settings control the level of detail in log files. 261 262 ### level 263 264 `--verbose-logs` will override this setting and always creates a verbose log. 265 Defaults to `info` if value is not set or is invalid. 266 267 ```json 268 "logging": { 269 "level": "verbose" | "info" | "warning" | "error" | "critical" 270 }, 271 ``` 272 273 ### channels 274 275 The valid values in this array are defined in the function `GetChannelFromName` in the [logging code](../src/AppInstallerSharedLib/AppInstallerLogging.cpp). These align with the ***channel identifier*** found in the log files. For example, ***`CORE`*** in: 276 277 ```plaintext 278 2023-12-06 19:17:07.988 [CORE] WinGet, version [1.7.0-preview], activity [{24A91EA8-46BE-47A1-B65C-CEBCE90B8675}] 279 ``` 280 281 In addition, there are special values that cover multiple channels. `default` is the default set of channels, while `all` is all of the channels. Invalid values are ignored. 282 283 ```json 284 "logging": { 285 "channels": ["default"] 286 }, 287 ``` 288 289 ## Network 290 291 The `network` settings influence how winget uses the network to retrieve packages and metadata. 292 293 ### Downloader 294 295 The `downloader` setting controls which code is used when downloading packages. The default is `default`, which may be any of the options based on our determination. 296 `wininet` uses the [WinINet](https://docs.microsoft.com/windows/win32/wininet/about-wininet) APIs, while `do` uses the 297 [Delivery Optimization](https://support.microsoft.com/windows/delivery-optimization-in-windows-10-0656e53c-15f2-90de-a87a-a2172c94cf6d) service. 298 299 The `doProgressTimeoutInSeconds` setting updates the number of seconds to wait without progress before fallback. The default number of seconds is 60, minimum is 1 and the maximum is 600. 300 301 ```json 302 "network": { 303 "downloader": "do", 304 "doProgressTimeoutInSeconds": 60 305 } 306 ``` 307 308 ## Interactivity 309 310 The `interactivity` settings control whether winget may show interactive prompts during execution. Note that this refers only to prompts shown by winget itself and not to those shown by package installers. 311 312 ### disable 313 314 ```json 315 "interactivity": { 316 "disable": true 317 }, 318 ``` 319 320 If set to true, the `interactivity.disable` setting will prevent any interactive prompt from being shown. 321 322 ## Experimental Features 323 324 To allow work to be done and distributed to early adopters for feedback, settings can be used to enable "experimental" features. 325 326 The `experimentalFeatures` settings involve the configuration of these "experimental" features. Individual features can be enabled under this node. The example below shows sample experimental features. 327 328 ```json 329 "experimentalFeatures": { 330 "experimentalCmd": true, 331 "experimentalArg": false 332 }, 333 ``` 334 335 ### directMSI 336 337 This feature enables the Windows Package Manager to directly install MSI packages with the MSI APIs rather than through msiexec. 338 Note that when silent installation is used this is already in affect, as MSI packages that require elevation will fail in that scenario without it. 339 You can enable the feature as shown below. 340 341 ```json 342 "experimentalFeatures": { 343 "directMSI": true 344 }, 345 ``` 346 347 ### resume 348 349 This feature enables support for some commands to resume. 350 You can enable the feature as shown below. 351 352 ```json 353 "experimentalFeatures": { 354 "resume": true 355 }, 356 ``` 357 358 ### fonts 359 360 This feature enables support for fonts via `winget settings`. The `winget font list` command will list installed font families and the number of installed font faces. 361 362 ```json 363 "experimentalFeatures": { 364 "fonts": true 365 }, 366 ```