Skip to content

Commit ca6672d

Browse files
committed
Add packing script for Windows
1 parent 523728b commit ca6672d

File tree

4 files changed

+73
-2
lines changed

4 files changed

+73
-2
lines changed

pack-for-windows.ps1

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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!"

set_windows_icon.ps1

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/gui/settings_tab.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "resources/default_resource.h"
44
#include "resources/theme.h"
55

6-
const std::string AVIATEUR_VERSION = "0.1.6";
6+
const std::string AVIATEUR_VERSION = "0.1.7";
77
const std::string AVIATEUR_REPO = "https://github.com/OpenIPC/aviateur";
88

99
void open_explorer(const std::string& dir) {

src/player/gst/video_player.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
VideoPlayerGst::VideoPlayerGst(std::shared_ptr<Pathfinder::Device> device, std::shared_ptr<Pathfinder::Queue> queue)
1111
: VideoPlayer(device, queue) {
12+
// Set GST_PLUGIN_PATH for release build.
13+
#if defined(NDEBUG) && defined(_WIN32)
14+
_putenv("GST_PLUGIN_PATH=./gstreamer-1.0/");
15+
#endif
16+
1217
gst_init(NULL, NULL);
1318

1419
gst_debug_set_default_threshold(GST_LEVEL_WARNING);

0 commit comments

Comments
 (0)