Files
Commonwealth-Online-Public/host-gui/deploy.bat
T
andrewandCursor 5d9d88806c Add Qt6 DLL deployment script and deployment guide
- Created deploy.bat to copy required Qt6 runtime DLLs
- Copies platforms, styles, and imageformats plugins
- Auto-detects Qt6 installation at common paths
- Creates portable application ready for distribution

- Added DEPLOYMENT.md comprehensive guide covering:
  - First-time setup (run deploy.bat)
  - Running the application
  - Distributing to other machines
  - Creating portable packages
  - Troubleshooting common issues
  - Performance notes

The application is now fully deployable:
1. Build with build.bat
2. Deploy DLLs with deploy.bat
3. Distribute entire Release folder to users

No Visual Studio or Qt installation needed on target machines!

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 21:20:50 +12:00

76 lines
2.2 KiB
Batchfile

@echo off
setlocal enabledelayedexpansion
echo.
echo ================================================================================
echo Commonwealth Online GUI - Qt6 DLL Deployment
echo ================================================================================
echo.
REM Find Qt6 installation
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.10.2\msvc2022_64\bin" set QT6_PATH=C:\Qt\6.10.2\msvc2022_64
if exist "C:\Qt\6.8.0\msvc2022_64\bin" set QT6_PATH=C:\Qt\6.8.0\msvc2022_64
if "!QT6_PATH!"=="" (
echo ERROR: Could not find Qt6 installation.
echo Please ensure Qt6 is installed to one of these paths:
echo - C:\Qt\6.11.1\msvc2022_64
echo - C:\Qt\6.10.2\msvc2022_64
echo - C:\Qt\6.8.0\msvc2022_64
pause
exit /b 1
)
echo Found Qt6 at: !QT6_PATH!
echo.
echo Deploying Qt6 DLLs to release directory...
echo.
set DEPLOY_DIR=%cd%\build\bin\Release
REM Required DLLs
set DLLs=^
Qt6Core.dll ^
Qt6Gui.dll ^
Qt6Widgets.dll ^
Qt6Network.dll ^
Qt6Concurrent.dll ^
Qt6DBus.dll ^
Qt6Xml.dll
REM Copy DLLs
for %%D in (%DLLs%) do (
if exist "!QT6_PATH!\bin\%%D" (
echo Copying %%D...
copy /Y "!QT6_PATH!\bin\%%D" "!DEPLOY_DIR!\%%D" >nul
) else (
echo WARNING: %%D not found (may not be required)
)
)
REM Copy plugins directory
if not exist "!DEPLOY_DIR!\plugins" mkdir "!DEPLOY_DIR!\plugins"
echo Copying Qt plugins...
xcopy /Y /Q "!QT6_PATH!\plugins\platforms" "!DEPLOY_DIR!\plugins\platforms\"
xcopy /Y /Q "!QT6_PATH!\plugins\styles" "!DEPLOY_DIR!\plugins\styles\" 2>nul
xcopy /Y /Q "!QT6_PATH!\plugins\imageformats" "!DEPLOY_DIR!\plugins\imageformats\" 2>nul
echo.
echo ================================================================================
echo Deployment Complete!
echo ================================================================================
echo.
echo Executable is now ready to run:
echo !DEPLOY_DIR!\CommonwealthOnlineHost.exe
echo.
echo You can now:
echo 1. Double-click CommonwealthOnlineHost.exe to run
echo 2. Or copy the entire Release folder to another machine
echo 3. Include all DLLs and plugins folder when distributing
echo.
pause