Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"maxVersion" is not respected by "winget configure" #4539

Closed
akitson-degreed opened this issue Jun 4, 2024 · 1 comment
Closed

"maxVersion" is not respected by "winget configure" #4539

akitson-degreed opened this issue Jun 4, 2024 · 1 comment
Milestone

Comments

@akitson-degreed
Copy link

Brief description of your issue

The winget configured command does not respect the maxVersion parameter in a configuration file.

It works correctly if I use the cli command to do it.

PS> winget install OpenJS.NodeJS -v "18.11.0"
Found an existing package already installed. Trying to upgrade the installed package...
Found Node.js [OpenJS.NodeJS] Version 18.11.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://nodejs.org/dist/v18.11.0/node-v18.11.0-x64.msi
  ██████████████████████████████  29.2 MB / 29.2 MB
Successfully verified installer hash
Starting package install...
Successfully installed

Steps to reproduce

I have the following resource defined in my configuration file:

- resource: Microsoft.WinGet.DSC/WinGetPackage
      id: npm
      directives:
        description: Install Node version 18.11.x
        allowPrerelease: true
        maxVersion: "18.11.0"
      settings:
        id: OpenJS.Nodejs
        source: winget

Expected behavior

I expect it to install a version no higher than 18.11.0.

Actual behavior

When winget configure runs, it installs the latest version.

PS> npm version
{
  npm: '10.7.0',
  node: '22.2.0',
  acorn: '8.11.3',
  ada: '2.7.8',
  ares: '1.28.1',
  base64: '0.5.2',
  brotli: '1.1.0',
  cjs_module_lexer: '1.2.2',
  cldr: '45.0',
  icu: '75.1',
  llhttp: '9.2.1',
  modules: '127',
  napi: '9',
  nghttp2: '1.61.0',
  nghttp3: '0.7.0',
  ngtcp2: '1.3.0',
  openssl: '3.0.13+quic',
  simdjson: '3.9.2',
  simdutf: '5.2.8',
  tz: '2024a',
  undici: '6.13.0',
  unicode: '15.1',
  uv: '1.48.0',
  uvwasi: '0.0.21',
  v8: '12.4.254.14-node.12',
  zlib: '1.3.0.1-motley-7d77fb7'
}

Environment

machine is a fresh VM on Azure


Windows Package Manager v1.7.11261
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.3593
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.11261.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Jun 4, 2024
@akitson-degreed
Copy link
Author

akitson-degreed commented Jun 4, 2024

nevermind.. I figured out I had the version in the wrong place.
should be

- resource: Microsoft.WinGet.DSC/WinGetPackage
  id: npm
  directives:
    description: Install Node version 18.10.x
    allowPrerelease: true
  settings:
    id: OpenJS.Nodejs
    source: winget
    version: "18.10.0"

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Triage Issue need to be triaged label Jun 4, 2024
@denelon denelon added this to the 1.8 Client milestone Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants