mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed build script for Windows installer
This commit is contained in:
parent
789df68582
commit
43db562c2a
43
build_scripts/Windows/GetRsVersion.bat
Normal file
43
build_scripts/Windows/GetRsVersion.bat
Normal 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
|
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user