2016-09-06 15:31:41 -04:00
@ echo off
setlocal
: : Initialize environment
call " %~dp0 ..\env.bat "
if errorlevel 1 goto error_env
call " %EnvPath% \env.bat "
if errorlevel 1 goto error_env
2018-05-07 00:42:52 -04:00
: : Initialize environment
2018-06-17 11:51:58 -04:00
call " %~dp0 env.bat " release
2018-05-07 00:42:52 -04:00
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
2016-09-06 15:31:41 -04:00
: : Check external libraries
2018-05-07 00:42:52 -04:00
if not exist " %BuildLibsPath% \libs " %cecho% error " Please build external libraries first. " & exit /B 1
2016-09-06 15:31:41 -04:00
: : Check gcc version of external libraries
2018-05-07 00:42:52 -04:00
if not exist " %BuildLibsPath% \libs\gcc-version " %cecho% error " Cannot get gcc version of external libraries. " & exit /B 1
set /P LibsGCCVersion = < " %BuildLibsPath% \libs\gcc-version "
if " %LibsGCCVersion% " NEQ " %GCCVersion% " %cecho% error " Please use correct version of external libraries. (gcc %GCCVersion% ^ < ^ > libs %LibsGCCVersion% ). " & exit /B 1
2016-09-06 15:31:41 -04:00
: : Build defines for script
set NSIS_PARAM =
set NSIS_PARAM = %NSIS_PARAM% /DRELEASEDIR=" %RsBuildPath% "
set NSIS_PARAM = %NSIS_PARAM% /DQTDIR=" %QtPath% \.. "
set NSIS_PARAM = %NSIS_PARAM% /DMINGWDIR=" %MinGWPath% \.. "
set NSIS_PARAM = %NSIS_PARAM% /DOUTDIR=" %RsPackPath% "
set NSIS_PARAM = %NSIS_PARAM% /DINSTALLERADD=" %RsArchiveAdd% "
2018-06-17 11:51:58 -04:00
set NSIS_PARAM = %NSIS_PARAM% /DEXTERNAL_LIB_DIR=" %BuildLibsPath% \libs "
2020-07-30 20:25:12 -04:00
set NSIS_PARAM = %NSIS_PARAM% /DARCHITECTURE=" %GCCArchitecture% "
2016-09-06 15:31:41 -04:00
2018-10-13 07:19:22 -04:00
: : Get compiled version
call " %ToolsPath% \get-rs-version.bat " " %RsBuildPath% \retroshare-gui\src\ %RsBuildConfig% \retroshare.exe " RsVersion
if errorlevel 1 %cecho% error " Version not found. " & exit /B 1
if " %RsVersion.Extra% " == " " %cecho% error " Extra number not found " .& exit /B 1
set NSIS_PARAM = %NSIS_PARAM% /DREVISION=%RsVersion.Extra%
2016-09-06 15:31:41 -04:00
set QtMainVersion = %QtVersion:~0,1%
: : Create installer
" %EnvMakeNSISExe% " %NSIS_PARAM% " %SourcePath% \build_scripts\Windows\installer\retroshare-Qt %QtMainVersion% .nsi "
exit /B %ERRORLEVEL%
: error_env
echo Failed to initialize environment.
endlocal
exit /B 1