microsoft / winget-pkgs

The Microsoft community Windows Package Manager manifest repository
MIT License
8.77k stars 4.58k forks source link

[Package Issue]: Gyan.FFmpeg is still broken, as are many other command line tools #120360

Open chexo3 opened 1 year ago

chexo3 commented 1 year ago

Please confirm these before moving forward

Category of the issue

Installation issue.

Brief description of your issue

This issue has been present for months and still has not been fixed. Gyan.FFmpeg and several other similar packages (command line tools mostly, I've experienced this with aria2, rclone, and nano) are not functioning because the directory added to the path is the root directory of the package in %LOCALAPPDATA%\Microsoft\WinGet\Packages\<package> instead of the bin directory/executable or a shortcut to such. For packages where the executable(s) are already in the root directory of the package this works of course (such as yt-dlp) but all the others I've mentioned have this issue.

Steps to reproduce

  1. Install a package, such as ffmpeg
  2. Attempt to use the commands from that package.
  3. :(

Actual behavior

Windows Command Prompt can't find the executable of the program that was just installed. I believe this is because the path is set incorrectly for these packages.

Expected behavior

The package command runs, producing the usual output for that program.

Environment

Windows Package Manager v1.5.2201                                                                                                                                                                                                                                            Copyright (c) Microsoft Corporation. All rights reserved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Windows: Windows.Desktop v10.0.19043.2364                                                                                                                                                                                                                                    System Architecture: X64                                                                                                                                                                                                                                                     Package: Microsoft.DesktopAppInstaller v1.20.2201.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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 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

Screenshots and Logs

2023-09-21 00:03:19.523 [CORE] WinGet, version [1.5.2201], activity [{ACCFD57F-8009-4023-A551-7E36F2595303}]
2023-09-21 00:03:19.523 [CORE] OS: Windows.Desktop v10.0.19043.2364
2023-09-21 00:03:19.523 [CORE] Command line Args: winget  install Gyan.FFmpeg
2023-09-21 00:03:19.523 [CORE] Package: Microsoft.DesktopAppInstaller v1.20.2201.0
2023-09-21 00:03:19.523 [CORE] IsCOMCall:0; Caller: winget-cli
2023-09-21 00:03:19.530 [CLI ] WinGet invoked with arguments: 'install' 'Gyan.FFmpeg'
2023-09-21 00:03:19.530 [CLI ] Found subcommand: install
2023-09-21 00:03:19.530 [CLI ] Leaf command to execute: root:install
2023-09-21 00:03:19.532 [CLI ] Executing command: install
2023-09-21 00:03:19.533 [REPO] Default source requested, multiple sources available, adding all to source references.
2023-09-21 00:03:19.533 [REPO] Adding to source references msstore
2023-09-21 00:03:19.533 [REPO] Adding to source references winget
2023-09-21 00:03:19.533 [REPO] Multiple sources available, creating aggregated source.
2023-09-21 00:03:19.533 [REPO] Adding to aggregated source: msstore
2023-09-21 00:03:19.533 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-09-21 00:03:19.645 [REPO] Response status: 200
2023-09-21 00:03:19.645 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-09-21 00:03:19.666 [REPO] Response status: 200
2023-09-21 00:03:19.666 [REPO] Adding to aggregated source: winget
2023-09-21 00:03:19.675 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-09-21 00:03:19.675 [CORE] Found matching extension.
2023-09-21 00:03:19.691 [REPO] Opening SQLite Index for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.921.121.271_neutral__8wekyb3d8bbwe\Public\index.db'
2023-09-21 00:03:19.691 [SQL ] Opening SQLite connection #1: 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.921.121.271_neutral__8wekyb3d8bbwe\Public\index.db' [1, 40]
2023-09-21 00:03:19.692 [REPO] Opened SQLite Index with version [1.6], last write [2023-09-20 20:20:41.000]
2023-09-21 00:03:19.912 [REPO] Creating PredefinedInstalledSource with filter [None]
2023-09-21 00:03:19.912 [REPO] Creating new SQLite Index with version [Latest] at ':memory:'
2023-09-21 00:03:19.912 [SQL ] Opening SQLite connection #2: ':memory:' [6, 0]
2023-09-21 00:03:19.945 [REPO] Reading MSI UpgradeCodes
2023-09-21 00:03:19.948 [REPO] Examining ARP entries for Machine | X64
2023-09-21 00:03:20.045 [REPO] Examining ARP entries for Machine | X86
2023-09-21 00:03:20.047 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\Schema\1_0\Interface_1_0.cpp(197)\WindowsPackageManager.dll!00007FFAC65C9DF5: (caller: 00007FFAC65CFC79) Exception(1) tid(251c) 800700B7 Cannot create a file when that file already exists.

2023-09-21 00:03:20.047 [REPO] Ignoring duplicate ARP entry Machine|X86|Audacity_is1 [Audacity 2.4.2]
2023-09-21 00:03:20.088 [REPO] Reading MSI UpgradeCodes
2023-09-21 00:03:20.091 [REPO] Examining ARP entries for User | X64
2023-09-21 00:03:20.284 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\REDACTED\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db'
2023-09-21 00:03:20.284 [SQL ] Opening SQLite connection #3: 'C:\Users\REDACTED\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db' [2, 0]
2023-09-21 00:03:20.284 [REPO] Opened SQLite Index with version [1.5], last write [2023-01-01 19:18:59.000]
2023-09-21 00:03:20.316 [REPO] Sending http POST request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/manifestSearch
2023-09-21 00:03:20.407 [REPO] Response status: 200
2023-09-21 00:03:20.415 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\REDACTED\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db'
2023-09-21 00:03:20.415 [SQL ] Opening SQLite connection #4: 'C:\Users\REDACTED\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db' [2, 0]
2023-09-21 00:03:20.416 [REPO] Opened SQLite Index with version [1.6], last write [2023-07-15 19:46:40.000]
2023-09-21 00:03:20.447 [REPO] Finding installed package from tracking package using system reference search: Query:[none] Include:NormalizedNameAndPublisher='ffmpeg'+'gyan'[Exact]
2023-09-21 00:03:20.462 [REPO] Downloading manifest
2023-09-21 00:03:20.462 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/manifests/g/Gyan/FFmpeg/6.0/37af-Gyan.FFmpeg.yaml
2023-09-21 00:03:20.473 [CORE] Download hash: 81b9723c44f992a81d63b5edfc8316224fe3766c0193bf05ecd1488ec72dddc4
2023-09-21 00:03:20.473 [CORE] Download completed.
2023-09-21 00:03:20.475 [REPO] Downloading manifest
2023-09-21 00:03:20.475 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/manifests/g/Gyan/FFmpeg/5.1.2/5a5a-Gyan.FFmpeg.yaml
2023-09-21 00:03:20.475 [CORE] Download hash: a5f1cfbbb57ee49c8549e3774cb05490a188bb574f50439e9ccf8f9d87839e06
2023-09-21 00:03:20.475 [CORE] Download completed.
2023-09-21 00:03:20.476 [REPO] Finding installed package from available package using system reference search: Query:[none] Include:NormalizedNameAndPublisher='ffmpeg'+'gyan'[Exact]
2023-09-21 00:03:20.484 [REPO] Opening pinning index
2023-09-21 00:03:20.484 [REPO] Opening existing pinning index
2023-09-21 00:03:20.484 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\REDACTED\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db'
2023-09-21 00:03:20.484 [SQL ] Opening SQLite connection #5: 'C:\Users\REDACTED\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db' [2, 0]
2023-09-21 00:03:20.485 [REPO] Opened Pinning Index with version [1.0], last write [2023-07-11 22:07:47.000]
2023-09-21 00:03:20.487 [CLI ] Found one app. App id: Gyan.FFmpeg App name: FFmpeg
2023-09-21 00:03:20.489 [REPO] Downloading manifest
2023-09-21 00:03:20.489 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/manifests/g/Gyan/FFmpeg/6.0/37af-Gyan.FFmpeg.yaml
2023-09-21 00:03:20.489 [CORE] Download hash: 81b9723c44f992a81d63b5edfc8316224fe3766c0193bf05ecd1488ec72dddc4
2023-09-21 00:03:20.489 [CORE] Download completed.
2023-09-21 00:03:20.490 [CLI ] Starting installer selection.
2023-09-21 00:03:20.490 [CLI ] Completed installer selection.
2023-09-21 00:03:20.490 [CLI ] Manifest fields: Name [FFmpeg], Version [6.0]
2023-09-21 00:03:20.497 [CLI ] Found existing installer file at 'C:\Users\REDACTED\AppData\Local\Temp\WinGet\Gyan.FFmpeg.6.0\ffmpeg-6.0-full_build.zip'. Verifying file hash.
2023-09-21 00:03:20.676 [CLI ] Existing installer file hash matches. Will use existing installer.
2023-09-21 00:03:20.676 [CLI ] Installer hash verified
2023-09-21 00:03:20.676 [CORE] Started applying motw to C:\Users\REDACTED\AppData\Local\Temp\WinGet\Gyan.FFmpeg.6.0\ffmpeg-6.0-full_build.zip with zone: 2
2023-09-21 00:03:20.679 [CORE] Finished applying motw
2023-09-21 00:03:20.783 [CLI ] Extracting archive to: C:\Users\REDACTED\AppData\Local\Temp\WinGet\Gyan.FFmpeg.6.0\extracted
2023-09-21 00:03:26.588 [CLI ] Successfully extracted archive
2023-09-21 00:03:26.707 [REPO] Creating new Portable Index with version [Latest] at 'C:\Users\REDACTED\AppData\Local\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe.db'
2023-09-21 00:03:26.707 [SQL ] Opening SQLite connection #6: 'C:\Users\REDACTED\AppData\Local\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe.db' [6, 0]
2023-09-21 00:03:26.723 [CORE] Renaming directory to: C:\Users\REDACTED\AppData\Local\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-6.0-full_build
2023-09-21 00:03:26.730 [CORE] Failed to create symlink at: C:\Users\REDACTED\AppData\Local\Microsoft\WinGet\Links\ffmpeg.exe
2023-09-21 00:03:26.730 [CORE] Appending portable target directory to PATH registry: C:\Users\REDACTED\AppData\Local\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-6.0-full_build\bin
2023-09-21 00:03:26.750 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\REDACTED\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db'
2023-09-21 00:03:26.750 [SQL ] Opening SQLite connection #7: 'C:\Users\REDACTED\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db' [2, 0]
2023-09-21 00:03:26.751 [REPO] Opened SQLite Index with version [1.6], last write [2023-07-15 19:46:40.000]
2023-09-21 00:03:26.787 [CLI ] Removing installer: C:\Users\REDACTED\AppData\Local\Temp\WinGet\Gyan.FFmpeg.6.0\extracted
2023-09-21 00:03:26.787 [CLI ] Leaf command succeeded: root:install
stephengillie commented 1 year ago

I believe this might be the main Issue for this issue:

mdanish-kh commented 1 year ago

Did you install the package from an admin shell or user shell? Do you have developer mode enabled in Windows or not? Is this an installation of ffmpeg from a previous version of WinGet?

You may want to uninstall and reinstall the package. There was an issue with uninstalls of portable packages with WinGet 1.5, so I would suggest following the steps here https://github.com/microsoft/winget-pkgs/issues/95349#issuecomment-1565687097

microsoft-github-policy-service[bot] commented 1 year ago

Hello @chexo3,

It seems that your input is required to address the reported issue.

Template: msftbot/needsAuthorFeedback

chexo3 commented 1 year ago

Did you install the package from an admin shell or user shell? Do you have developer mode enabled in Windows or not? Is this an installation of ffmpeg from a previous version of WinGet?

You may want to uninstall and reinstall the package. There was an issue with uninstalls of portable packages with WinGet 1.5, so I would suggest following the steps here #95349 (comment)

User shell. AFAIK dev mode is not enabled. I have uninstalled and reinstalled multiple times. A previous broken uninstall required manual registry editing to fix. The package’s file were gone, but it was still listed as installed. So I had to delete a registry key so it wouldn’t be.

I’ve checked my path, the folder it adds to it doesn’t contain any executables, which is why I believe the package itself is broken.

elisimpson commented 1 year ago

Can confirm the install fails from a user shell. reinstall from admin shell works, but still installs the files to the user local app settings folder. Also I noticed that the user shell installs don't create the link in the "Links" folder but admin shell installs do.

mstevens83 commented 1 year ago

Tried upgrading to gyan.ffmpeg v6.1 but both install and uninstall keep hanging. I tried to run them as admin but it doesn't make a difference.

pikcube commented 1 year ago

Tried upgrading to gyan.ffmpeg v6.1 but both install and uninstall keep hanging. I tried to run them as admin but it doesn't make a difference.

@mstevens83 I've been trying to fix this all week, and after digging through the logs I got it working on my system. Uninstall was failing because the package was never properly installed in "\AppData\Local\Microsoft\WinGet\Packages\", and running the installer with the --force flag was hanging immediately after extracting all the data and setting the package data values.

Based on this, I assumed this was, like many weird bugs where Windows hangs in circles, a case of bad registry values triggering a weird loop. I went into the Windows Registry, navigated to "Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\" and deleted the entry associated with ffmpeg.

Ran winget install ffmeg, immediately installed and is working perfectly.

I think it goes without saying that hanging without an error message isn't great, having to go into the Windows registry to fix the error isn't great, and the fact that there isn't a --repair flag I can pass when things seem to be in an invalid state to revalidate and repair isn't great either.

mstevens83 commented 1 year ago

Tried upgrading to gyan.ffmpeg v6.1 but both install and uninstall keep hanging. I tried to run them as admin but it doesn't make a difference.

@mstevens83 I've been trying to fix this all week, and after digging through the logs I got it working on my system. Uninstall was failing because the package was never properly installed in "\AppData\Local\Microsoft\WinGet\Packages", and running the installer with the --force flag was hanging immediately after extracting all the data and setting the package data values.

Based on this, I assumed this was, like many weird bugs where Windows hangs in circles, a case of bad registry values triggering a weird loop. I went into the Windows Registry, navigated to "Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall" and deleted the entry associated with ffmpeg.

Ran winget install ffmeg, immediately installed and is working perfectly.

I think it goes without saying that hanging without an error message isn't great, having to go into the Windows registry to fix the error isn't great, and the fact that there isn't a --repair flag I can pass when things seem to be in an invalid state to revalidate and repair isn't great either.

Thanks a lot for digging into this @pikcube! Your solutions work for me. Also, I 100% agree with all the "not great" points raised.

ZhiZe-ZG commented 8 months ago

run winget install --id Gyan.FFmpeg as an admin can add path but other users can't. this problem exists for years. hope it can be solved.

ZhiZe-ZG commented 8 months ago

In Gyan's manifest (https://github.com/microsoft/winget-pkgs/blob/master/manifests/g/Gyan/FFmpeg/6.1/Gyan.FFmpeg.installer.yaml):

  NestedInstallerFiles:
  - RelativeFilePath: ffmpeg-6.1-full_build\bin\ffmpeg.exe
    PortableCommandAlias: ffmpeg
  - RelativeFilePath: ffmpeg-6.1-full_build\bin\ffplay.exe
    PortableCommandAlias: ffplay
  - RelativeFilePath: ffmpeg-6.1-full_build\bin\ffprobe.exe
    PortableCommandAlias: ffprobe

It seems that these configurations just call the winget interface. And it also shows that alias is added every time it is installed. So this may be a problem with winget.

HunterZ commented 4 months ago

Winget appears to install this, but then seems to immediately forget that it happened. You can install it over and over again. yt-dlp and probably other dependent packages are broken as a result.

Edit: Running winget as admin does NOT help with this, so it's not a #95349 regression.

potpiefox commented 1 month ago

Can confirm this problem is still present as of now.

HunterZ commented 4 weeks ago

Today's update installed fine for me.