From 003dcc7cf9064350d85f934a92f15a11b36bf1f8 Mon Sep 17 00:00:00 2001 From: Max Litruv Boonzaayer Date: Sat, 19 Jul 2025 19:45:57 +1000 Subject: [PATCH] work pls --- .github/workflows/build-windows.yml | 21 +++++++++++++++++++++ build-windows.bat | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 0862602..600329b 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -30,6 +30,27 @@ jobs: Write-Host "Project file exists: $(Test-Path 'project.godot')" Get-ChildItem -Path . -Filter "*.cfg" | Select-Object Name + - name: Setup Export Templates + run: | + $templateDir = "C:\WINDOWS\ServiceProfiles\NetworkService\AppData\Roaming\Godot\export_templates\4.4.1.stable" + if (-not (Test-Path $templateDir)) { + Write-Host "Creating export template directory..." + New-Item -ItemType Directory -Force -Path $templateDir + + Write-Host "Downloading export templates..." + Invoke-WebRequest -Uri "https://downloads.tuxfamily.org/godotengine/4.4.1/Godot_v4.4.1-stable_export_templates.tpz" -OutFile "templates.tpz" + + Write-Host "Extracting templates..." + Expand-Archive -Path "templates.tpz" -DestinationPath "temp_templates" -Force + Copy-Item -Path "temp_templates\templates\*" -Destination $templateDir -Recurse -Force + Remove-Item -Path "temp_templates" -Recurse -Force + Remove-Item -Path "templates.tpz" -Force + + Write-Host "Export templates installed to: $templateDir" + } else { + Write-Host "Export templates already exist at: $templateDir" + } + - name: Windows Build run: .\build-windows.bat shell: cmd diff --git a/build-windows.bat b/build-windows.bat index 0e54c1c..aa79f2d 100644 --- a/build-windows.bat +++ b/build-windows.bat @@ -6,6 +6,31 @@ echo Building PNGTuber Plus for Windows... rem Create build directory if not exist "build\windows" mkdir "build\windows" +rem Install export templates if they don't exist +echo Checking for export templates... +set TEMPLATE_DIR=%APPDATA%\Godot\export_templates\4.4.1.stable +if not exist "%TEMPLATE_DIR%" ( + echo Export templates not found. Installing... + "D:\Godot\Godot_v4.4.1-stable_win64.exe" --headless --export-pack + timeout /t 5 /nobreak >nul + + rem Download templates if the export-pack didn't work + if not exist "%TEMPLATE_DIR%" ( + echo Downloading export templates... + powershell -Command "& {Invoke-WebRequest -Uri 'https://downloads.tuxfamily.org/godotengine/4.4.1/Godot_v4.4.1-stable_export_templates.tpz' -OutFile 'templates.tpz'}" + + rem Extract templates + powershell -Command "& {Expand-Archive -Path 'templates.tpz' -DestinationPath 'temp_templates' -Force}" + if not exist "%APPDATA%\Godot\export_templates" mkdir "%APPDATA%\Godot\export_templates" + move "temp_templates\templates" "%TEMPLATE_DIR%" + rmdir /s /q "temp_templates" + del "templates.tpz" + echo Export templates installed. + ) +) else ( + echo Export templates found. +) + rem Build the project echo Running Godot export... "D:\Godot\Godot_v4.4.1-stable_win64.exe" --headless --export-release "Windows Desktop" "build\windows\PNGTuber-Plus.exe"