|
| 1 | +# Copy GStreamer dlls |
| 2 | +# ---------------------------------------------------------- |
| 3 | +$sourcePath = "C:\Program Files\gstreamer\1.0\msvc_x86_64\bin" |
| 4 | +$destinationPath = "./cmake-build-release/bin" |
| 5 | +$excludeFiles = @("cairo-2.dll", "cairo-gobject-2.dll", "cairo-script-interpreter-2.dll", "gstd3dshader-1.0-0.dll", "gstwebrtc-1.0-0.dll", "gstwebrtcnice-1.0-0.dll", "nice-10.dll", "opencore-amrnb-0.dll", "opencore-amrwb-0.dll", "soup-3.0-0.dll", "sqlite3-0.dll", "SvtAv1Enc.dll", "rsvg-2-2.dll", "libsrt.dll", "libssl-3-x64.dll", "libstdc++-6.dll", "libcrypto-3-x64.dll", "libspandsp-2.dll") |
| 6 | + |
| 7 | +if (-not (Test-Path $destinationPath)) |
| 8 | +{ |
| 9 | + New-Item -ItemType Directory -Path $destinationPath |
| 10 | +} |
| 11 | + |
| 12 | +# Get all dll files |
| 13 | +Get-ChildItem -Path $sourcePath -Filter "*.dll" -File | Where-Object { $excludeFiles -notcontains $_.Name } | ForEach-Object { |
| 14 | + $sourceFilePath = $_.FullName |
| 15 | + $destinationFilePath = Join-Path $destinationPath $_.Name |
| 16 | + Copy-Item -Path $sourceFilePath -Destination $destinationFilePath -Exclude $excludeFiles |
| 17 | +} |
| 18 | + |
| 19 | +# Copy GStreamer plugin dlls |
| 20 | +# ---------------------------------------------------------- |
| 21 | +$sourcePathPlugin = "C:\Program Files\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0" |
| 22 | +$destinationPathPlugin = "./cmake-build-release/bin/gstreamer-1.0" |
| 23 | +$excludeFilesPlugin = @("gstwebview2.dll", "gstvpx.dll", "gstrav1e.dll", "gstquinn.dll", "gstelevenlabs.dll", "gstsvtav1.dll", "gstsrt.dll", "gstrsvg.dll", "gstwebrtc.dll", "gstwebrtcdsp.dll", "gstwebrtchttp.dll", "gstrswebrtc.dll", "gstpython.dll", "gstaws.dll") |
| 24 | + |
| 25 | +if (-not (Test-Path $destinationPathPlugin)) |
| 26 | +{ |
| 27 | + New-Item -ItemType Directory -Path $destinationPathPlugin |
| 28 | +} |
| 29 | + |
| 30 | +# Get all dll files |
| 31 | +Get-ChildItem -Path $sourcePathPlugin -Filter "*.dll" -File | Where-Object { $excludeFilesPlugin -notcontains $_.Name } | ForEach-Object { |
| 32 | + $sourceFilePath = $_.FullName |
| 33 | + $destinationFilePath = Join-Path $destinationPathPlugin $_.Name |
| 34 | + Copy-Item -Path $sourceFilePath -Destination $destinationFilePath -Exclude $excludeFiles |
| 35 | +} |
| 36 | + |
| 37 | +# Set icon |
| 38 | +# ---------------------------------------------------------- |
| 39 | +Write-Host "Setting icon..." |
| 40 | + |
| 41 | +$fileName = "rcedit-x64.exe" |
| 42 | +$downloadUrl = "https://github.com/electron/rcedit/releases/download/v2.0.0/$fileName" |
| 43 | +$targetPath = Join-Path -Path $PWD.Path -ChildPath $fileName |
| 44 | + |
| 45 | +if (-not (Test-Path -Path $targetPath -PathType Leaf)) |
| 46 | +{ |
| 47 | + Write-Host "File $fileName does not exist, downloading from $downloadUrl ..." -ForegroundColor Cyan |
| 48 | + |
| 49 | + try |
| 50 | + { |
| 51 | + Invoke-WebRequest -Uri $downloadUrl -OutFile $targetPath -UseBasicParsing -ErrorAction Stop |
| 52 | + Write-Host "File $fileName downloaded, saved to $targetPath" -ForegroundColor Green |
| 53 | + } |
| 54 | + catch |
| 55 | + { |
| 56 | + Write-Error "Download failed! Error: $( $_.Exception.Message )" |
| 57 | + exit 1 |
| 58 | + } |
| 59 | +} |
| 60 | +else |
| 61 | +{ |
| 62 | + Write-Host "File $fileName exists, download is not needed" -ForegroundColor Gray |
| 63 | +} |
| 64 | + |
| 65 | +./rcedit-x64.exe "cmake-build-release/bin/aviateur.exe" --set-icon "assets/logo.ico" |
| 66 | + |
| 67 | +Write-Host "Set icon successfully!" |
0 commit comments