Skip to content

DSCv3: installMode 'silent' uses SilentWithProgress switches instead of Silent #6248

@denelon

Description

@denelon

This issue was filed with GitHub Copilot assistance.

Relevant area(s)

  • DSC Resource
  • WinGet CLI

Relevant command(s)

  • winget dscv3

Brief description of your issue

When using a DSC v3 configuration file with installMode: silent specified for a package resource, WinGet uses SilentWithProgress switches instead of true Silent switches. For Inno Setup packages (e.g., Visual Studio Code), this results in /SILENT being passed to the installer rather than /VERYSILENT, causing a progress UI to appear.

Additionally, the manifest's Custom switch (/mergetasks=!runcode for VS Code) is not appended to the installer arguments.

Configuration files are designed for unattended, non-interactive operation. When a user specifies installMode: silent, they expect a truly silent experience with no UI. The current behavior defeats the purpose of specifying silent mode in a configuration.

Steps to reproduce

  1. Create a DSC v3 configuration file (e.g., VSCode.winget) with the following content:
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
metadata:
  winget:
    processor:
      identifier: dscv3
resources:
- type: Microsoft.WinGet/Package
  name: VSCode
  properties:
    id: Microsoft.VisualStudioCode
    source: winget
    useLatest: true
    installMode: silent
  metadata:
    description: Ensure Latest Version of Visual Studio Code is installed
  1. Run: winget configure <path-to-config>
  2. Observe the installer arguments in the WinGet log at %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\

Expected behavior

Installer should be invoked with the Silent switches for the installer type (Inno in this case):

VSCodeSetup.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /mergetasks=!runcode

  • /VERYSILENT = true silent (no UI)
  • /mergetasks=!runcode = manifest Custom switch, should always be appended

Actual behavior

Installer is invoked with SilentWithProgress switches:

VSCodeSetup.exe /SP- /SILENT /SUPPRESSMSGBOXES /NORESTART

  • /SILENT = shows progress bar (not truly silent)
  • Manifest Custom switch /mergetasks=!runcode is missing from arguments

Environment

Windows Package Manager v1.29.210.0
Windows: Windows.Desktop v10.0.26621.0
Package: Microsoft.DesktopAppInstaller v1.29.210.0

Additional context

The issue appears to be in how the DSCv3 package resource maps installMode: silent to the installer switch selection. The code in ShellExecuteInstallerHandler.cpp defaults to InstallerSwitchType::SilentWithProgress and only uses InstallerSwitchType::Silent when explicitly requested via --silent. The DSCv3 path may not be setting this flag correctly.

Relevant code paths:

  • src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp:81-142
  • src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp:1033-1061 (default switches)
  • src/AppInstallerCLICore/Commands/DscPackageResource.cpp (installMode mapping)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-ConfigureIssue related to WinGet ConfigurationCommand-DSCv3Issue related to DSC v3DSC-ResourceIssue related to DSC ResourcesIssue-BugIt either shouldn't be doing this or needs an investigation.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions