bdukes / Chocolatey-Packages

Packages for the Windows installation utility
Apache License 2.0
7 stars 14 forks source link

Imagemagick's ffmpeg hijacks the ffmpeg package #41

Closed brian6932 closed 2 years ago

brian6932 commented 3 years ago

Apparently this was fixed in the installer, but not the choco package: https://github.com/ImageMagick/ImageMagick/issues/422

I would say that ideally this should be off by default, and have an argument to turn it on, but I would understand not wanting to do that, at the very least an argument would be good

image_43 Terminal logs:

Admin C:\Windows\System32
❯ ffmpeg
ffmpeg version 4.4-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

Admin C:\Windows\System32
❯ choco install imagemagick
Chocolatey v0.11.2
Installing the following packages:
imagemagick
By installing, you accept licenses for the packages.
Progress: Downloading imagemagick.app 7.1.0.10... 100%
Progress: Downloading imagemagick 7.1.0.10... 100%

imagemagick.app v7.1.0.10 [Approved]
imagemagick.app package files install completed. Performing other installation steps.
Installing 64-bit imagemagick.app...
imagemagick.app has been installed.
  imagemagick.app can be automatically uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of imagemagick.app was successful.
  Software installed to 'C:\Program Files\ImageMagick-7.1.0-Q16-HDRI\'

imagemagick v7.1.0.10 [Approved]
imagemagick package files install completed. Performing other installation steps.
 The install of imagemagick was successful.
  Software install location not explicitly set, it could be in package or
  default install location of installer.

Chocolatey installed 2/2 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Admin C:\Windows\System32  20.474s
❯ refreshenv
Refreshing environment variables from the registry for powershell.exe. Please wait...
Finished

Admin C:\Windows\System32
❯ ffmpeg
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

Admin C:\Windows\System32
❯ choco uninstall imagemagick imagemagick.app
Chocolatey v0.11.2
Uninstalling the following packages:
imagemagick;imagemagick.app

imagemagick v7.1.0.10
 Skipping auto uninstaller - No registry snapshot.
 imagemagick has been successfully uninstalled.

imagemagick.app v7.1.0.10
 Running auto uninstaller...
 Auto uninstaller has successfully uninstalled imagemagick.app or detected previous uninstall.
 imagemagick.app has been successfully uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).

Chocolatey uninstalled 2/2 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Admin C:\Windows\System32  15.695s
❯ refreshenv
Refreshing environment variables from the registry for powershell.exe. Please wait...
Finished

Admin C:\Windows\System32
❯ ffmpeg
ffmpeg version 4.4-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

Admin C:\Windows\System32
❯
brian6932 commented 3 years ago

Not sure how helpful this may be, but scoop's package doesn't exhibit this issue, they just append a .old to the ffmpeg.exe file: "post_install": "Rename-Item $dir\\ffmpeg.exe $dir\\ffmpeg.exe.old", Terminal logs:

Admin C:\Windows\System32
❯ scoop install imagemagick
Installing '7zip' (19.00) [64bit]
7z1900-x64.msi (1.7 MB) [==============================================================================] 100%
Checking hash of 7z1900-x64.msi ... ok.
install-context.reg (764 B) [==========================================================================] 100%
Checking hash of install-context.reg ... ok.
uninstall-context.reg (498 B) [========================================================================] 100%
Checking hash of uninstall-context.reg ... ok.
Extracting 7z1900-x64.msi ... done.
Running pre-install script...
Linking ~\scoop\apps\7zip\current => ~\scoop\apps\7zip\19.00
Creating shim for '7z'.
Creating shortcut for 7-Zip (7zFM.exe)
Persisting Codecs
Persisting Formats
'7zip' (19.00) was installed successfully!
Notes
-----
Add 7-Zip as a context menu option by running: "C:\Users\username\scoop\apps\7zip\current\install-context.reg"
Installing 'innounp' (0.50) [64bit]
innounp050.rar (138.3 KB) [============================================================================] 100%
Checking hash of innounp050.rar ... ok.
Extracting innounp050.rar ... done.
Linking ~\scoop\apps\innounp\current => ~\scoop\apps\innounp\0.50
Creating shim for 'innounp'.
'innounp' (0.50) was installed successfully!
Installing 'imagemagick' (7.1.0-13) [64bit]
ImageMagick-7.1.0-13-Q16-HDRI-x64-dll.exe (36.2 MB) [==================================================] 100%
Checking hash of ImageMagick-7.1.0-13-Q16-HDRI-x64-dll.exe ... ok.
Extracting ImageMagick-7.1.0-13-Q16-HDRI-x64-dll.exe ... done.
Linking ~\scoop\apps\imagemagick\current => ~\scoop\apps\imagemagick\7.1.0-13
Running post-install script...
'imagemagick' (7.1.0-13) was installed successfully!
Notes
-----
- The bundled ffmpeg has been renamed to 'ffmpeg.exe.old' to prevent conflict with a standalone ffmpeg
installation - if you need it for ImageMagick tools, rename it back to 'ffmpeg.exe'.
- 'convert.exe' is deprecated in v7 (it also conflicts with the builtin Windows 'convert' utility). Use 'magick
convert ...' instead.
BinToss commented 2 years ago

The Scoop install procedure merely renames the file after installation.

The task responsible for installing ImageMagick's outdated FFmpeg 4.2.3 is named "install_FFmpeg". https://github.com/ImageMagick/VisualMagick/blob/main/installer/inc/tasks-install-ffmpeg.isx

https://github.com/bdukes/Chocolatey-Packages/blob/master/automatic/imagemagick.app/tools/chocolateyInstall.ps1 This part of the choco package shows how it uses PackageParameters to append arguments to the installer command line,

Taking both of those into account, this disables the install_FFmpeg task. image

I'm working on a Pull Request now.