microsoft / winget-pkgs

The Microsoft community Windows Package Manager manifest repository
MIT License
8.5k stars 4.39k forks source link

Winget downloads incorrect locale version of SSMS #102724

Open RobThree opened 1 year ago

RobThree commented 1 year ago

Brief description of your issue

I have an "ENU" version of SSMS installed on my Dutch locale Windows 11. When I tried to update it with WinGet it downloaded a "DEU" version (German / Deutsch) which then failed to install.

Steps to reproduce

winget upgrade --id Microsoft.SQLServerManagementStudio

Expected behavior

Download correct version (ENU, not DEU)

Actual behavior

image

In (relevant) text:

winget upgrade --id Microsoft.SQLServerManagementStudio
Found Microsoft SQL Server Management Studio [Microsoft.SQLServerManagementStudio] Version 19.0.2
Downloading https://go.microsoft.com/fwlink/?linkid=2226343&clcid=0x407
Successfully verified installer hash
Installer failed with exit code: 1626
Installer log is available at: C:\Users\Rob\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.SQLServerManagementStudio.19.0.2-2023-04-14-10-54-02.025.log

The problem appears to be in the clcid=0x407 part of the URL WinGet uses to download:

https://go.microsoft.com/fwlink/?linkid=2226343&clcid=0x407

Which results in the DEU version downloaded. When I strip that querystring parameter from the link the correct version (ENU) is downloaded:

https://go.microsoft.com/fwlink/?linkid=2226343

Environment

winget --info
Windows Package Manager (Preview) v1.5.441-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.1555
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.441.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

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

Other software:

Microsoft SQL Server Management Studio 19.0.1 / 19.0.2

Trenly commented 1 year ago

@denelon - This one can probably be moved to pkgs; Confirmed the issue is with the URL

PS D:\Git\winget-pkgs> Get-UrlResponse 'https://go.microsoft.com/fwlink/?linkid=2226343&clcid=0x407'

Name                           Value
----                           -----
ResponseCode                   200
ResponseUrl                    https://download.microsoft.com/download/9/f/8/9f8197f4-0f71-42a3-8717-b2817c77b820/SSMS-Setup-DEU.exe
Headers                        {Server, ETag, Last-Modified, x-ms-blob-content-md5...}
Response                       https://download.microsoft.com/download/9/f/8/9f8197f4-0f71-42a3-8717-b2817c77b820/SSMS-Setup-DEU.exe
Url                            https://go.microsoft.com/fwlink/?linkid=2226343&clcid=0x407
ContentLength                  676960496

PS D:\Git\winget-pkgs> Get-UrlResponse 'https://go.microsoft.com/fwlink/?linkid=2226343'

Name                           Value
----                           -----
ResponseCode                   200
ResponseUrl                    https://download.microsoft.com/download/9/f/8/9f8197f4-0f71-42a3-8717-b2817c77b820/SSMS-Setup-ENU.exe
Headers                        {Server, ETag, Last-Modified, x-ms-blob-content-md5...}
Response                       https://download.microsoft.com/download/9/f/8/9f8197f4-0f71-42a3-8717-b2817c77b820/SSMS-Setup-ENU.exe
Url                            https://go.microsoft.com/fwlink/?linkid=2226343
ContentLength                  659373600
Trenly commented 1 year ago

Or maybe I'm incorrect here . . . .

The manifest does seem to have the correct URL's, but perhaps it's because the host machine locale is Dutch? I think I've confused myself

SandroG commented 1 year ago

I have a similar problem: my machine has Windows 10 with an Italian locale and I have an "ENU" version of SSMS 18 installed. When I run "winget upgrade" it downloads and installs the 19 version with Italian locale, not "ENU" as the previous one. I seems the same issue, the clclid used is 0x410 Italian

(1/4) Trovato Microsoft SQL Server Management Studio [Microsoft.SQLServerManagementStudio] Versione 19.0.2
Questa applicazione viene concessa in licenza dal proprietario.
Microsoft non è responsabile né concede alcuna licenza a pacchetti di terze parti.
Download in corso https://go.microsoft.com/fwlink/?linkid=2226343&clcid=0x410
  ██████████████████████████████   645 MB /  645 MB
Verifica dell'hash di installazione completata
Avvio installazione pacchetto in corso...
Installazione riuscita
RobThree commented 1 year ago

The manifest does seem to have the correct URL's, but perhaps it's because the host machine locale is Dutch? I think I've confused myself

I don't think the locale is relevant; when updating it should keep the locale version that's currently installed, regardless of machine settings.

makersky commented 1 year ago

Hold on tight, my system is PL, I'm using EN version of SSMS but winget downloaded DE language.

❯ systeminfo
System Locale:             pl;Polski
Input Locale:              pl;Polski

Installation log:

Initializing numeric variable 'InstallerLcid' to value '1031'

SSMSInstalledLanguage1031 = 0
SSMSInstalledLanguage1033 = 1
SSMSInstalledLanguageKeyExists = 1
SSMSInstalledLanguageMatch = 0
LinAGKar commented 1 year ago

I also got the German version on a Swedish machine. Previously installed version wasn't localized, it was just in English

willembeens commented 9 months ago

Same issue here. Windows 10 Dutch, SSMS is installed by winget in German.

Dragon1573 commented 8 months ago

I haven't installed SSMS before. But I set $.installBehavior.preferences.locale using winget config.

{"installBehavior": {"preferences": {"locale": ["zh-CN", "zh-TW", "en-US"]}}}

It seems winget.exe will prefer zh-CN > zh-TW > en-US.

pwsh> systeminfo.exe
系统区域设置:     zh-cn;中文(中国)
输入法区域设置:   zh-cn;中文(中国)

pwsh> winget download -e Microsoft.SQLServerManagementStudio                                                       
已找到 Microsoft SQL Server Management Studio [Microsoft.SQLServerManagementStudio] 版本 19.2
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
正在下载 https://go.microsoft.com/fwlink/?linkid=2252307&clcid=0x804
已取消

pwsh> (Invoke-WebRequest -Method HEAD "https://go.microsoft.com/fwlink/?linkid=2252307&clcid=0x804").Headers["x-ms-copy-source"]
https://dmsstager3tx7y9x22.blob.core.windows.net/626e40a7-449e-418d-9726-33b523a1e336/ssms-setup-chs.exe?sv=2019-02-02&sr=b&se=2023-11-16T21%3A18%3A52Z&sp=r&api-version=2019-02-02

If I add ja-JP before zh-CN, then winget.exe will prefer ja-JP > zh-CN regardless of my system locale.

pwsh> winget download -e Microsoft.SQLServerManagementStudio                                                       
已找到 Microsoft SQL Server Management Studio [Microsoft.SQLServerManagementStudio] 版本 19.2
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
正在下载 https://go.microsoft.com/fwlink/?linkid=2252307&clcid=0x411
已取消

pwsh> (Invoke-WebRequest -Method HEAD "https://go.microsoft.com/fwlink/?linkid=2252307&clcid=0x411").Headers["x-ms-copy-source"]
https://dmsstager3tx7y9x22.blob.core.windows.net/626e40a7-449e-418d-9726-33b523a1e336/ssms-setup-jpn.exe?sv=2019-02-02&sr=b&se=2023-11-16T21%3A17%3A30Z&sp=r&api-version=2019-02-02

For users who didn't configure, winget.exe will always use system locale as default.


winget.exe supports --locale switch for manually download and upgrade packages for another locale. Try using it as a walkaround.

For users who prefer a different locale than system default for ALL packages, try manually set $.installBehavior.preferences.locale with winget config.

Mr1008 commented 5 months ago

On my machine it also installs German locale version while my PC is Polish. The currently installed locale for SSMS is English.

slonio commented 1 month ago

winget install --id Microsoft.SQLServerManagementStudio --locale en-US --> for me, this is the solution.