I have an AppleScript applet that is used by a range of people with various versions of macOS. A number of components are installed. One of those is FFmpeg. Some users are experiencing an error during the FFmpeg install process which I can't figure out. Here is the (I know, crude) code:
set ffmpeg_site to "https://evermeet.cx/pub/ffmpeg/" set FFmpeg_page to do shell script "curl " & ffmpeg_site & " | textutil -stdin -stdout -format html -convert txt -encoding UTF-8 " set ffmpeg_version_start to (offset of "version" in FFmpeg_page) + 8 set ffmpeg_version_end to (offset of "-tessus" in FFmpeg_page) - 1 set ffmpeg_version_new to text ffmpeg_version_start thru ffmpeg_version_end of FFmpeg_page set downloadsFolder_Path to "Users/[home]/Desktop" set ffmpeg_download_file to quoted form of (downloadsFolder_Path & "/ffmpeg-" & ffmpeg_version_new & ".zip") do shell script "curl -L " & ffmpeg_site & "ffmpeg-" & ffmpeg_version_new & ".zip" & " -o " & ffmpeg_download_file set copy_to_path to "/usr/local/bin/" try do shell script "unzip -o " & ffmpeg_download_file & " -d " & copy_to_path with administrator privileges do shell script "chmod a+x /usr/local/bin/ffmpeg" with administrator privileges on error number -128 -- Trap case where user cancels admin credentials dialog main_dialog() end try
Most users have no problem. But, a few users have reported the following:
error: cannot open zipfile [ /Users/[home]/Desktop/ffmpeg- 4.2.2.zip ]
Operation not permitted
unzip: cannot find or open /Users/[home]/Desktop/ffmpeg- 4.2.2.zip, /Users/[home]/Desktop/ffmpeg-4.2.2.zip.zip or /Users/[home]/Desktop/ffmpeg-4.2.2.zip.ZIP.
Those people are all using macOS Catalina. I can't figure out what is causing the error.
- I have tested the applet on a clean install of Catalina and had no errors.
- It appears those users do have permission to access /usr/local/bin – the applet installs another component in that folder earlier in the install sequence (in that case the executable is saved into /usr/local/bin using a call to "curl"). Users are also able to manually copy FFmpeg to that folder.
- The FFmpeg download is completed – users are able to extract the executable from the Zip file and move it to /usr/local/bin using other unarchive tools e.g. Keka – suggesting that the Zip file is not corrupted.
- Users confirm they have entered their admin credentials correctly.
I can't figure out why this is happening to just some users. I believe other users on macOS Catalina have had no trouble. My own testing on a Catalina clean install produced no errors.
My only guess at present is that there is a problem for UnZip with the permissions on the downloaded FFmpeg file. But, I have nothing to show tbat is the cause and why it would only affect a few Catalina users.
Can anyone help with ideas on the possilbe cause ?