Sync from GitHub main #1

Open
nomad wants to merge 145 commits from sync/from-github into main
Showing only changes of commit 1fbfc3a51b - Show all commits
+57 -53
View File
@@ -1,53 +1,57 @@
@echo off @echo off
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
echo. echo.
echo ================================================================================ echo ================================================================================
echo Commonwealth Online - Qt Host Deployment echo Commonwealth Online - Qt Host Deployment
echo ================================================================================ echo ================================================================================
echo. echo.
set QT6_PATH= set QT6_PATH=
if exist "C:\Qt\6.11.1\msvc2022_64\bin" set QT6_PATH=C:\Qt\6.11.1\msvc2022_64 if exist "C:\Qt\6.11.1\msvc2022_64\bin" set QT6_PATH=C:\Qt\6.11.1\msvc2022_64
if "!QT6_PATH!"=="" if exist "C:\Qt\6.10.2\msvc2022_64\bin" set QT6_PATH=C:\Qt\6.10.2\msvc2022_64 if "!QT6_PATH!"=="" if exist "C:\Qt\6.10.2\msvc2022_64\bin" set QT6_PATH=C:\Qt\6.10.2\msvc2022_64
if "!QT6_PATH!"=="" if exist "C:\Qt\6.8.0\msvc2022_64\bin" set QT6_PATH=C:\Qt\6.8.0\msvc2022_64 if "!QT6_PATH!"=="" if exist "C:\Qt\6.8.0\msvc2022_64\bin" set QT6_PATH=C:\Qt\6.8.0\msvc2022_64
if "!QT6_PATH!"=="" ( if "!QT6_PATH!"=="" (
echo ERROR: Could not find Qt6 installation. echo ERROR: Could not find Qt6 installation.
exit /b 1 exit /b 1
) )
set DEPLOY_DIR=%cd%\build\bin\Release set DEPLOY_DIR=%cd%\build\bin\Release
if not exist "!DEPLOY_DIR!\CommonwealthOnlineHost.exe" ( if not exist "!DEPLOY_DIR!\CommonwealthOnlineHost.exe" (
echo ERROR: Host executable not found. Run build.bat first. echo ERROR: Host executable not found. Run build.bat first.
exit /b 1 exit /b 1
) )
set DLLS=Qt6Core.dll Qt6Gui.dll Qt6Widgets.dll Qt6Network.dll Qt6Concurrent.dll Qt6DBus.dll Qt6Xml.dll set DLLS=Qt6Core.dll Qt6Gui.dll Qt6Widgets.dll Qt6Network.dll Qt6Concurrent.dll Qt6DBus.dll Qt6Xml.dll
for %%D in (%DLLS%) do ( for %%D in (%DLLS%) do (
if exist "!QT6_PATH!\bin\%%D" copy /Y "!QT6_PATH!\bin\%%D" "!DEPLOY_DIR!\%%D" >nul if exist "!QT6_PATH!\bin\%%D" copy /Y "!QT6_PATH!\bin\%%D" "!DEPLOY_DIR!\%%D" >nul
) )
if not exist "!DEPLOY_DIR!\plugins" mkdir "!DEPLOY_DIR!\plugins" if not exist "!DEPLOY_DIR!\plugins" mkdir "!DEPLOY_DIR!\plugins"
xcopy /Y /Q /I "!QT6_PATH!\plugins\platforms" "!DEPLOY_DIR!\plugins\platforms\" >nul xcopy /Y /Q /I "!QT6_PATH!\plugins\platforms" "!DEPLOY_DIR!\plugins\platforms\" >nul
xcopy /Y /Q /I "!QT6_PATH!\plugins\styles" "!DEPLOY_DIR!\plugins\styles\" >nul 2>&1 xcopy /Y /Q /I "!QT6_PATH!\plugins\styles" "!DEPLOY_DIR!\plugins\styles\" >nul 2>&1
xcopy /Y /Q /I "!QT6_PATH!\plugins\imageformats" "!DEPLOY_DIR!\plugins\imageformats\" >nul 2>&1 xcopy /Y /Q /I "!QT6_PATH!\plugins\imageformats" "!DEPLOY_DIR!\plugins\imageformats\" >nul 2>&1
set SERVER_DIR=!DEPLOY_DIR!\server set SERVER_DIR=!DEPLOY_DIR!\server
if not exist "!SERVER_DIR!\CommonwealthOnline.Server.exe" ( if not exist "!SERVER_DIR!\CommonwealthOnline.Server.exe" (
echo ERROR: Self-contained C# server is not staged beside the Host GUI. echo ERROR: Self-contained C# server is not staged beside the Host GUI.
echo Run build.bat. CMake publishes the server during the Host GUI build. echo Run build.bat. CMake publishes the server during the Host GUI build.
exit /b 1 exit /b 1
) )
if exist "!SERVER_DIR!\*.py" ( set PROHIBITED_FOUND=0
echo ERROR: Python source found in staged server package. for /r "!SERVER_DIR!" %%F in (*.py *.pyw *.pyi *.pyc *.pyo *.whl *.egg requirements*.txt Pipfile Pipfile.lock pyproject.toml poetry.lock setup.py setup.cfg tox.ini) do (
exit /b 1 if exist "%%F" (
) echo ERROR: Prohibited legacy runtime artifact found in staged package: %%F
set PROHIBITED_FOUND=1
echo. )
echo Deployment complete: )
echo !DEPLOY_DIR!\CommonwealthOnlineHost.exe if "!PROHIBITED_FOUND!"=="1" exit /b 1
echo !SERVER_DIR!\CommonwealthOnline.Server.exe
echo. echo.
echo Copy the entire Release directory when distributing. Python and a separate .NET runtime are not required. echo Deployment complete:
exit /b 0 echo !DEPLOY_DIR!\CommonwealthOnlineHost.exe
echo !SERVER_DIR!\CommonwealthOnline.Server.exe
echo.
echo Copy the entire Release directory when distributing. The bundled server is self-contained.
exit /b 0