| Server IP : 121.121.20.254 / Your IP : 216.73.217.109 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /ProgramData/chocolatey/lib/ffmpeg-full/tools/ |
Upload File : |
$ErrorActionPreference = 'Stop'
$toolsPath = Split-Path $MyInvocation.MyCommand.Definition
$packageArgs = @{
PackageName = $env:ChocolateyPackageName
FileFullPath64 = "$toolsPath\ffmpeg-release-full.7z"
Destination = $toolsPath
}
Get-ChildItem $toolsPath\* | Where-Object { $_.PSISContainer } | Remove-Item -Recurse -Force #remove older package dirs
Get-ChocolateyUnzip @packageArgs
Write-Host "Removing extracted archive."
Remove-Item $packageArgs['FileFullPath64'] -ea 0
$maxTries = 3
for ($tries = 0; $tries -lt $maxTries; $tries++) {
Write-Host "Sleeping for 2 seconds to allow anti-viruses to finish scanning..."
Start-Sleep -Seconds 2
try {
Write-Host "Renaming ffmpeg directory to common name (Try $($tries + 1) / $maxTries)"
Move-Item $toolsPath\ffmpeg-* $toolsPath\ffmpeg
Write-Host "Successfully renamed directory."
break
}
catch {
if (($tries + 1) -eq $maxTries) {
throw "Unable to rename directory, and max tries achieved. Aborting installation..."
}
else {
Write-Warning "Unable to rename directory. Retrying..."
}
}
}