mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-30 09:56:14 -05:00
94ec83fcdb
Moved header file with version information to retroshare/rsversion.h. Added version information to Windows executable. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7845 b45a01b8-16f6-495d-af2f-9b41ad6348cc
59 lines
1.3 KiB
Batchfile
59 lines
1.3 KiB
Batchfile
@echo off
|
|
|
|
setlocal
|
|
|
|
:: Modify variable when makensis.exe doesn't exist in PATH
|
|
set NSIS_EXE=makensis.exe
|
|
|
|
:: Needed environment variables
|
|
set SourceDir=%~dp0..\..
|
|
::set ReleaseDir=
|
|
::set QtDir=
|
|
::set MinGWDir=
|
|
|
|
:: Optional environment variables
|
|
::set OutDir=
|
|
|
|
:: Build defines for script
|
|
set NSIS_PARAM=
|
|
|
|
if "%SourceDir%" NEQ "" set NSIS_PARAM=%NSIS_PARAM% /DSOURCEDIR="%SourceDir%"
|
|
if "%ReleaseDir%" NEQ "" set NSIS_PARAM=%NSIS_PARAM% /DRELEASEDIR="%ReleaseDir%"
|
|
if "%QtDir%" NEQ "" set NSIS_PARAM=%NSIS_PARAM% /DQTDIR="%QtDir%"
|
|
if "%MinGWDir%" NEQ "" set NSIS_PARAM=%NSIS_PARAM% /DMINGWDIR="%MinGWDir%"
|
|
if "%OutDir%" NEQ "" set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%OutDir%"
|
|
|
|
:: Scan version from source
|
|
set BuildAdd=
|
|
set VersionFile="%SourceDir%\libretroshare\src\retroshare\rsversion.h"
|
|
|
|
if not exist "%VersionFile%" (
|
|
echo.
|
|
echo Version file doesn't exist.
|
|
echo %VersionFile%
|
|
goto :exit
|
|
)
|
|
|
|
for /F "usebackq tokens=1,2,3" %%A in (%VersionFile%) do (
|
|
if "%%A"=="#define" (
|
|
if "%%B"=="RS_BUILD_NUMBER_ADD" (
|
|
set BuildAdd=%%~C
|
|
)
|
|
)
|
|
)
|
|
|
|
if "%BuildAdd%"=="" (
|
|
echo.
|
|
echo Version not found in
|
|
echo %VersionFile%
|
|
goto :exit
|
|
)
|
|
|
|
set NSIS_PARAM=%NSIS_PARAM% /DBUILDADD=%BuildAdd%
|
|
|
|
:: Create installer
|
|
"%NSIS_EXE%" %NSIS_PARAM% "%~dp0retroshare.nsi"
|
|
|
|
:exit
|
|
endlocal
|