Fixed build script for Windows installer

This commit is contained in:
thunder2 2015-08-04 19:02:13 +02:00
parent 789df68582
commit 43db562c2a
3 changed files with 58 additions and 17 deletions

View File

@ -0,0 +1,43 @@
@:: Usage:
@:: call GetRsVersion.bat Define Variable
@setlocal
@echo off
set Define=%~1
if "%Define%"=="" (
echo.
echo Parameter error
endlocal
exit /B1
)
set Variable=%~2
if "%Variable%"=="" (
echo.
echo Parameter error
endlocal
exit /B1
)
set Result=
set VersionFile="%~dp0..\..\libretroshare\src\retroshare\rsversion.h"
if not exist "%VersionFile%" (
echo.
echo Version file doesn't exist.
echo %VersionFile%
endlocal
exit /B1
)
for /F "usebackq tokens=1,2,3" %%A in (%VersionFile%) do (
if "%%A"=="#define" (
if "%%B"=="%Define%" (
set Result=%%~C
)
)
)
endlocal & set %Variable%=%Result%
exit /B 0

View File

@ -24,32 +24,27 @@ 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 Revision=
set BuildAdd=
set VersionFile="%SourceDir%\libretroshare\src\retroshare\rsversion.h"
call "%~dp0GetRsVersion.bat" RS_REVISION_STRING Revision
if errorlevel 1 goto exit
call "%~dp0GetRsVersion.bat" RS_BUILD_NUMBER_ADD BuildAdd
if errorlevel 1 goto exit
if not exist "%VersionFile%" (
if "%Revision%"=="" (
echo.
echo Version file doesn't exist.
echo Version not found in
echo %VersionFile%
goto :exit
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
goto exit
)
set NSIS_PARAM=%NSIS_PARAM% /DBUILDADD=%BuildAdd%
set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%Revision% /DBUILDADD=%BuildAdd%
:: Create installer
"%NSIS_EXE%" %NSIS_PARAM% "%~dp0retroshare.nsi"

View File

@ -42,7 +42,7 @@
!GetDllVersion "${RELEASEDIR}\retroshare-gui\src\release\RetroShare.exe" VERSION_
!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}${BUILDADD}
!define REVISION ${VERSION_4}
;!define REVISION ${VERSION_4}
# Check version
!ifndef REVISION
@ -53,6 +53,9 @@
!error "REVISION is not defined"
!endif
# Date
!define /date Date "%Y%m%d"
# Application name and version
!define APPNAME "RetroShare"
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
@ -68,7 +71,7 @@
# Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "${OUTDIR_}RetroShare_${VERSION}_${REVISION}_setup.exe"
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-setup.exe"
BrandingText "${APPNAMEANDVERSION}"
RequestExecutionlevel highest
# Use compression