This issue was filed with GitHub Copilot assistance.
Relevant area(s)
Relevant command(s)
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
- 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
- Run:
winget configure <path-to-config>
- 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)
Relevant area(s)
Relevant command(s)
Brief description of your issue
When using a DSC v3 configuration file with
installMode: silentspecified for a package resource, WinGet usesSilentWithProgressswitches instead of trueSilentswitches. For Inno Setup packages (e.g., Visual Studio Code), this results in/SILENTbeing passed to the installer rather than/VERYSILENT, causing a progress UI to appear.Additionally, the manifest's
Customswitch (/mergetasks=!runcodefor 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
VSCode.winget) with the following content:winget configure <path-to-config>%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 appendedActual behavior
Installer is invoked with SilentWithProgress switches:
VSCodeSetup.exe /SP- /SILENT /SUPPRESSMSGBOXES /NORESTART/SILENT= shows progress bar (not truly silent)Customswitch/mergetasks=!runcodeis missing from argumentsEnvironment
Additional context
The issue appears to be in how the DSCv3 package resource maps
installMode: silentto the installer switch selection. The code inShellExecuteInstallerHandler.cppdefaults toInstallerSwitchType::SilentWithProgressand only usesInstallerSwitchType::Silentwhen explicitly requested via--silent. The DSCv3 path may not be setting this flag correctly.Relevant code paths:
src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp:81-142src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp:1033-1061(default switches)src/AppInstallerCLICore/Commands/DscPackageResource.cpp(installMode mapping)