microsoft / winget-pkgs

The Microsoft community Windows Package Manager manifest repository
MIT License
8.51k stars 4.4k forks source link

[Package Issue]: Google.GoogleDrive - winget tries to install beta/testing version instead of stable #120035

Closed R-Adrian closed 12 months ago

R-Adrian commented 12 months ago

Please confirm these before moving forward

Category of the issue

Installation issue.

Brief description of your issue

i currently have installed Google Drive version 80.0.1.0

Trying to download Google Drive again from https://www.google.com/drive/download/ will result in the same version being downloaded from https://dl.google.com/drive-file-stream/GoogleDriveSetup.exe

but winget is trying to install a beta?/ release candidate? / testing? version 81.0.4.0 and it tries to download it from a non-standard / unique / personalized tracking URL dedicated for it: https://dl.google.com/release2/drive-file-stream/gw2fnns42seeqhgoo7wq5q2ara_81.0.4.0/setup.exe

Steps to reproduce

1) download and install Google Drive from the standard web page at Google: https://www.google.com/drive/download/ 2) run winget upgrade 3) find out that it tries to install a "newer" / beta? / testing? version

Actual behavior

winget tries to "upgrade" a stable version of a package to a beta / testing version

Expected behavior

When it is needed, Google Drive actually updates itself in the background while running and so far it has not attempted to do so.

winget should look at the official URL that Google publishes for download of the stable version https://dl.google.com/drive-file-stream/GoogleDriveSetup.exe

and not at the beta versions that are published only for testing bug fixes (and some of them probably have nasty bugs too)

Environment

PS C:\WINDOWS\system32> winget --info
Windows Package Manager v1.5.2201
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.3448
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.2201.0

Winget Directories
---------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Di…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\se…
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

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
PS C:\WINDOWS\system32>

PS C:\WINDOWS\system32> winget show Google.GoogleDrive
Found Google Drive [Google.GoogleDrive]
Version: 81.0.4.0
Publisher: Google LLC
Publisher Url: https://www.google.com/
Publisher Support Url: https://support.google.com/
Author: Google LLC
Moniker: google-drive
Description: Choose folders on your computer to sync with Google Drive or backup to Google Photos, and access all of your content directly from your PC or Mac
Homepage: https://www.google.com/drive/download/
License: Proprietary
License Url: https://www.google.com/drive/terms-of-service/
Privacy Url: https://policies.google.com/privacy
Copyright: Copyright(c) 2023 Google LLC. All Rights Reserved.
Tags:
  backup
  cloud
  cloud-drive
  download
  drive
  file
  netdisk
  share
  sync
  upload
Installer:
  Installer Type: exe
  Installer Url: https://dl.google.com/release2/drive-file-stream/gw2fnns42seeqhgoo7wq5q2ara_81.0.4.0/setup.exe
  Installer SHA256: 36b5273db07ef6c743fb5088048294d5d6ce01780f5dc20513c661dd69eac4a1
PS C:\WINDOWS\system32>

Screenshots and Logs

related commits: beta/testing version 81.0.3.0: https://github.com/microsoft/winget-pkgs/pull/119494 beta/testing version 81.0.4.0: https://github.com/microsoft/winget-pkgs/pull/119738

image

R-Adrian commented 12 months ago

side note: the tracking URLs for personalized/dedicated versions of GoogleDrive are probably a GDPR violation here in Europe because they seem to be created on purpose for tracking GoogleDrive installs via winget but there is no explicit/informed consent given / requested for such tracking.

SpecterShell commented 12 months ago

In terms of tracking: It's fine. The URL was obtained by querying their download/update API, which is also used by Google Chrome, Google Japanese IME, VPN by Google One and Google Web Designer AFAIK, without using any information. This URL is used for avoiding hash error if the original URL is used and they update the installer for the old URL. "k4xgxx52cs5jt3vy7ta6sgeaza" should be the UID of version 81.0.4.0 and similar codes can be seen in other versions and other Google products. I'm not and haven't been a staff from Google so I have no control on that. 😉

In terms of stable/beta: It seems that there are doing some A/B test so the client at 80.0.1.0 will have 5%? chance to be updated to 81.0.4.0 by changing the API response. 🤔

So in most time the response is like:

<?xml version="1.0" encoding="UTF-8"?>
<response protocol="3.0" server="prod">
  <daystart elapsed_days="6103" elapsed_seconds="17216"/>
  <app appid="{6BBAE539-2232-434A-A4E5-9A33560C6283}" cohort="1:fj3:nir@0.5,nj9@0.05,nix@0.25,nj3@0.1" cohortname="Stable" status="ok">
    <updatecheck status="ok">
      <urls>
        <url codebase="http://edgedl.me.gvt1.com/edgedl/release2/drive-file-stream/k4xgxx52cs5jt3vy7ta6sgeaza_80.0.1.0/"/>
        <url codebase="https://edgedl.me.gvt1.com/edgedl/release2/drive-file-stream/k4xgxx52cs5jt3vy7ta6sgeaza_80.0.1.0/"/>
        <url codebase="http://dl.google.com/release2/drive-file-stream/k4xgxx52cs5jt3vy7ta6sgeaza_80.0.1.0/"/>
        <url codebase="https://dl.google.com/release2/drive-file-stream/k4xgxx52cs5jt3vy7ta6sgeaza_80.0.1.0/"/>
        <url codebase="http://www.google.com/dl/release2/drive-file-stream/k4xgxx52cs5jt3vy7ta6sgeaza_80.0.1.0/"/>
        <url codebase="https://www.google.com/dl/release2/drive-file-stream/k4xgxx52cs5jt3vy7ta6sgeaza_80.0.1.0/"/>
      </urls>
      <manifest version="80.0.1.0">
        <actions>
          <action arguments="/quiet /norestart MSI_UILEVEL=2 " event="install" run="setup.exe"/>
          <action event="postinstall"/>
        </actions>
        <packages>
          <package fp="1.7827fbb63ecd62fc4eebaceed01b7a4d8b0220f70c9665cb73e887b3ab19619d" hash="/RSkKnn1Sy3OWZU3IypUa+vGOO8=" hash_sha256="7827fbb63ecd62fc4eebaceed01b7a4d8b0220f70c9665cb73e887b3ab19619d" name="setup.exe" required="true" size="161230624"/>
        </packages>
      </manifest>
    </updatecheck>
  </app>
</response>

but there is a 5%? chance that the response is like:

<?xml version="1.0" encoding="UTF-8"?>
<response protocol="3.0" server="prod">
  <daystart elapsed_days="6103" elapsed_seconds="17253"/>
  <app appid="{6BBAE539-2232-434A-A4E5-9A33560C6283}" cohort="1:fj3/nj9:" cohortname="Stable-5-Percent" status="ok">
    <updatecheck status="ok">
      <urls>
        <url codebase="http://edgedl.me.gvt1.com/edgedl/release2/drive-file-stream/gw2fnns42seeqhgoo7wq5q2ara_81.0.4.0/"/>
        <url codebase="https://edgedl.me.gvt1.com/edgedl/release2/drive-file-stream/gw2fnns42seeqhgoo7wq5q2ara_81.0.4.0/"/>
        <url codebase="http://dl.google.com/release2/drive-file-stream/gw2fnns42seeqhgoo7wq5q2ara_81.0.4.0/"/>
        <url codebase="https://dl.google.com/release2/drive-file-stream/gw2fnns42seeqhgoo7wq5q2ara_81.0.4.0/"/>
        <url codebase="http://www.google.com/dl/release2/drive-file-stream/gw2fnns42seeqhgoo7wq5q2ara_81.0.4.0/"/>
        <url codebase="https://www.google.com/dl/release2/drive-file-stream/gw2fnns42seeqhgoo7wq5q2ara_81.0.4.0/"/>
      </urls>
      <manifest version="81.0.4.0">
        <actions>
          <action arguments="/quiet /norestart MSI_UILEVEL=2 " event="install" run="setup.exe"/>
          <action event="postinstall"/>
        </actions>
        <packages>
          <package fp="1.36b5273db07ef6c743fb5088048294d5d6ce01780f5dc20513c661dd69eac4a1" hash="057duCm+1MW9GC9omnGQ4QFLU3E=" hash_sha256="36b5273db07ef6c743fb5088048294d5d6ce01780f5dc20513c661dd69eac4a1" name="setup.exe" required="true" size="162103584"/>
        </packages>
      </manifest>
    </updatecheck>
  </app>
</response>

I submitted the new version once a new version is detected and I was not aware of that. I will update my script and removed the A/B beta version later.

R-Adrian commented 11 months ago

image

Google Drive .. seems that version 82.0.1.0 is yet another testing / beta version because the official download link still gives me version 81.0.5.0 https://dl.google.com/drive-file-stream/GoogleDriveSetup.exe

related change: https://github.com/microsoft/winget-pkgs/pull/121754