49 lines
1.5 KiB
Batchfile
49 lines
1.5 KiB
Batchfile
@echo off
|
|
setlocal
|
|
|
|
REM Windows packaging tool directories (system environment variables):
|
|
REM QT_PATH=D:\Qt\5.15.2
|
|
REM ISCC_PATH=C:\Program Files\Inno Setup 7
|
|
|
|
set PRJ_PATH=%~dp0
|
|
set PRJ_PATH=%PRJ_PATH:~0,-1%
|
|
|
|
set "VERSION_HEADER=%PRJ_PATH%\..\App\BeltTearing\BeltTearingApp\Version.h"
|
|
if not exist "%VERSION_HEADER%" (
|
|
echo ERROR: Version header not found: "%VERSION_HEADER%"
|
|
exit /b 1
|
|
)
|
|
|
|
for /f "tokens=3" %%V in ('findstr /B /C:"#define BELT_TEARING_APP_VERSION_STRING" "%VERSION_HEADER%"') do set "APP_VERSION=%%~V"
|
|
for /f "tokens=3" %%V in ('findstr /B /C:"#define BELT_TEARING_APP_VERSION_BUILD" "%VERSION_HEADER%"') do set "APP_VERSION_BUILD=%%~V"
|
|
|
|
if not defined APP_VERSION (
|
|
echo ERROR: BELT_TEARING_APP_VERSION_STRING not found in "%VERSION_HEADER%"
|
|
exit /b 1
|
|
)
|
|
if not defined APP_VERSION_BUILD (
|
|
echo ERROR: BELT_TEARING_APP_VERSION_BUILD not found in "%VERSION_HEADER%"
|
|
exit /b 1
|
|
)
|
|
|
|
set "MY_APP_VERSION=%APP_VERSION%.%APP_VERSION_BUILD%"
|
|
echo Packaging BeltTearingApp version %MY_APP_VERSION%
|
|
|
|
if not exist "%PRJ_PATH%\buildwin\BeltTearingApp" mkdir "%PRJ_PATH%\buildwin\BeltTearingApp"
|
|
|
|
cd /d "%PRJ_PATH%\buildwin\BeltTearingApp"
|
|
|
|
powershell -Command "Remove-Item * -Recurse -Force"
|
|
|
|
copy "..\..\build\App\BeltTearing\BeltTearingApp\release\BeltTearingApp.exe" .\
|
|
|
|
"%QT_PATH%\msvc2019_64\bin\windeployqt.exe" "BeltTearingApp.exe"
|
|
|
|
cd ..\..
|
|
|
|
"%ISCC_PATH%\ISCC.exe" "/DMyAppVersion=%MY_APP_VERSION%" "BeltTearingApp.iss"
|
|
|
|
echo "finish"
|
|
|
|
endlocal
|