Embed Windows app icon via windres
This commit is contained in:
parent
3bf786533a
commit
bf2ec70ffe
|
|
@ -60,6 +60,19 @@ echo " Target: windows/amd64"
|
||||||
echo " Compiler: x86_64-w64-mingw32-gcc"
|
echo " Compiler: x86_64-w64-mingw32-gcc"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# Generate Windows resource file for app icon (if windres is available)
|
||||||
|
RC_FILE="$PROJECT_ROOT/scripts/videotools.rc"
|
||||||
|
SYMBOL_FILE="$PROJECT_ROOT/videotools_windows_amd64.syso"
|
||||||
|
if [ -f "$RC_FILE" ]; then
|
||||||
|
if command -v x86_64-w64-mingw32-windres &> /dev/null; then
|
||||||
|
x86_64-w64-mingw32-windres "$RC_FILE" -O coff -o "$SYMBOL_FILE" || true
|
||||||
|
elif command -v windres &> /dev/null; then
|
||||||
|
windres "$RC_FILE" -O coff -o "$SYMBOL_FILE" || true
|
||||||
|
else
|
||||||
|
echo "WARNING: windres not found; Windows icon will not be embedded in the EXE"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Set Windows build environment
|
# Set Windows build environment
|
||||||
export GOOS=windows
|
export GOOS=windows
|
||||||
export GOARCH=amd64
|
export GOARCH=amd64
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,17 @@ if %ERRORLEVEL% neq 0 (
|
||||||
echo [OK] Dependencies downloaded
|
echo [OK] Dependencies downloaded
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
|
REM ----------------------------
|
||||||
|
REM Embed Windows icon (if windres is available)
|
||||||
|
REM ----------------------------
|
||||||
|
where windres >nul 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 (
|
||||||
|
windres scripts\videotools.rc -O coff -o videotools_windows_amd64.syso
|
||||||
|
) else (
|
||||||
|
echo [WARN] windres not found; Windows icon will not be embedded in the EXE
|
||||||
|
)
|
||||||
|
echo.
|
||||||
|
|
||||||
REM ----------------------------
|
REM ----------------------------
|
||||||
REM Build VideoTools (Windows GUI mode)
|
REM Build VideoTools (Windows GUI mode)
|
||||||
REM Note: CGO is required for Fyne/OpenGL on Windows
|
REM Note: CGO is required for Fyne/OpenGL on Windows
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,18 @@ Write-Host ""
|
||||||
Write-Host "🔨 Building VideoTools..." -ForegroundColor Yellow
|
Write-Host "🔨 Building VideoTools..." -ForegroundColor Yellow
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
|
|
||||||
|
# Embed Windows icon if windres is available
|
||||||
|
$rcFile = Join-Path $PROJECT_ROOT "scripts\videotools.rc"
|
||||||
|
$sysoFile = Join-Path $PROJECT_ROOT "videotools_windows_amd64.syso"
|
||||||
|
if (Test-Path $rcFile) {
|
||||||
|
$windres = Get-Command windres -ErrorAction SilentlyContinue
|
||||||
|
if ($windres) {
|
||||||
|
& $windres.Path $rcFile -O coff -o $sysoFile | Out-Null
|
||||||
|
} else {
|
||||||
|
Write-Host "⚠️ windres not found; Windows icon will not be embedded in the EXE" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Fyne needs CGO for GLFW/OpenGL bindings
|
# Fyne needs CGO for GLFW/OpenGL bindings
|
||||||
$env:CGO_ENABLED = "1"
|
$env:CGO_ENABLED = "1"
|
||||||
|
|
||||||
|
|
|
||||||
1
scripts/videotools.rc
Normal file
1
scripts/videotools.rc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
1 ICON "assets/logo/VT_Icon.ico"
|
||||||
Loading…
Reference in New Issue
Block a user