Honor DSCv3 package installMode for silent and interactive#6249
Conversation
JohnMcPMS
left a comment
There was a problem hiding this comment.
I somehow just completely dropped using this value in the original change. I think it was a late addition and I must have gotten distracted after adding it to the surface to not consume it.
I don't know why the custom arg would not be present, but I don't think that this change would actually affect it. I'm investigating that portion locally.
| [Test] | ||
| public void Package_Set_SilentInstallMode_UsesSilentAndCustomSwitches() | ||
| { | ||
| string installDir = Path.GetTempPath(); |
There was a problem hiding this comment.
This seems like optimistic 🤖 here; the installDir is not a DSC property nor does it even attempt to pass it along. I think you would have to rely on the default install location or invent a new mechanism to pass it along in a side channel (like environment variable or known registry value). If you could update RunDSCv3Command to set an environment variable on the new process, that would be the safest way to not impact other tests.
There was a problem hiding this comment.
I just tried:
PS> @{id="Microsoft.Azd"; source="winget"; useLatest=$true; installMode="silent"} | ConvertTo-Json | wingetdev dscv3 package --setand see:
2026-05-26 11:27:29.274 <I> [CLI ] Installer args: /passive /norestart /log "%LOCALAPPDATA%\Packages\WinGetDevCLI_8wekyb3d8bbwe\LocalState\DiagOutputDir\Microsoft.Azd.1.25.300-26-05-26-11-27-29.log" INSTALLEDBY="winget"
Where https://github.com/microsoft/winget-pkgs/blob/9e3e07ee8ee60e7689f5f930a5f3852fe68fb03c/manifests/m/Microsoft/Azd/1.25.300/Microsoft.Azd.installer.yaml#L9 has the INSTALLEDBY="winget".
|
@Trenly , do you think you have a timeframe? Not trying to rush you but we are looking to branch the 1.29 RC soon and wanted to include this. If you can't get to it today, I can update the tests. |
If you want to update the tests, might be faster; I should be free in ~1hr but not sure the 🤖 knows exactly what it's doing Edit: Throwing the 🤖 at it now |
I pushed what I'm thinking, but the machine I'm on isn't building anything happily at the moment. Will let pipeline tell me if anything is wrong but you can also run with it if you get a chance before I do to circle back. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
* ##[warning]src\AppInstallerTestExeInstaller\main.cpp(622,27): Warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
📖 Description
When using DSCv3 Microsoft.WinGet/Package resource with installMode: silent specified, WinGet was not honoring the requested mode and instead defaulting to SilentWithProgress. This resulted in progress UI being shown and manifest custom switches being omitted from installer arguments.
This PR maps the installMode property (declared in DscPackageResource) to execution context args (--silent or --interactive) before install/update/reinstall workflows execute, ensuring:
🔗 References
Resolves #6248
🔍 Validation
Added DSCv3 E2E regression tests in DSCv3PackageResourceCommand.cs:
Environment note: Targeted test execution was attempted but blocked by missing Visual C++ MSBuild targets (MSB4278). Tests require Visual Studio build environment.
✅ Checklist
📋 Issue Type
Copilot assisted with this PR.