mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-01 02:36:23 -04:00
Windows build environment
- Use date of last git commit instead of current date for filename - Added download of Tor installation - Added section Tor to installer
This commit is contained in:
parent
38bdbdfdca
commit
d38e7d2e70
18 changed files with 135 additions and 36 deletions
|
@ -21,6 +21,12 @@ if not exist "%BuildLibsPath%\libs\gcc-version" %cecho% error "Cannot get gcc ve
|
|||
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
|
||||
|
||||
:: Get date
|
||||
call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate
|
||||
if errorlevel 1 %cecho% error "Could not get date."& goto error
|
||||
|
||||
if "%RsDate%"=="" %cecho% error "Could not get date."& goto error
|
||||
|
||||
:: Build defines for script
|
||||
set NSIS_PARAM=
|
||||
|
||||
|
@ -31,6 +37,9 @@ set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%RsPackPath%"
|
|||
set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%"
|
||||
set NSIS_PARAM=%NSIS_PARAM% /DEXTERNAL_LIB_DIR="%BuildLibsPath%\libs"
|
||||
set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%GCCArchitecture%"
|
||||
set NSIS_PARAM=%NSIS_PARAM% /DDATE="%RsDate%"
|
||||
|
||||
if exist "%EnvTorPath%\Tor\tor.exe" set NSIS_PARAM=%NSIS_PARAM% /DTORDIR="%EnvTorPath%\Tor"
|
||||
|
||||
:: Get compiled version
|
||||
call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
|
||||
|
|
|
@ -17,16 +17,8 @@ set GitPath=
|
|||
call "%ToolsPath%\find-in-path.bat" GitPath git.exe
|
||||
if "%GitPath%"=="" echo Git executable not found in PATH.& exit /B 1
|
||||
|
||||
:: Get compiled revision
|
||||
set GetRsVersion=%SourcePath%\build_scripts\Windows\tools\get-rs-version.bat
|
||||
if not exist "%GetRsVersion%" (
|
||||
echo File not found
|
||||
echo %GetRsVersion%
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
:: Get compiled version
|
||||
call "%GetRsVersion%" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
|
||||
call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
|
||||
if errorlevel 1 %cecho% error "Version not found."& goto error
|
||||
|
||||
if "%RsVersion.Major%"=="" %cecho% error "Major version not found."& goto error
|
||||
|
@ -36,13 +28,11 @@ if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& goto error
|
|||
|
||||
set RsVersion=%RsVersion.Major%.%RsVersion.Minor%.%RsVersion.Mini%
|
||||
|
||||
:: Check WMIC is available
|
||||
wmic.exe alias /? >nul 2>&1 || echo WMIC is not available.&& exit /B 1
|
||||
:: Get date
|
||||
call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate
|
||||
if errorlevel 1 %cecho% error "Could not get date."& goto error
|
||||
|
||||
:: Use WMIC to retrieve date in format YYYYMMDD
|
||||
set RsDate=
|
||||
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%%I
|
||||
set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2%
|
||||
if "%RsDate%"=="" %cecho% error "Could not get date."& goto error
|
||||
|
||||
:: Get last revision
|
||||
set RsLastRefFile=%BuildPath%\Qt-%QtVersion%-%GCCArchitecture%%RsType%-%RsBuildConfig%-LastRef.txt
|
||||
|
|
|
@ -29,16 +29,8 @@ if exist "%RsDeployPath%" rmdir /S /Q "%RsDeployPath%"
|
|||
:: Check compilation
|
||||
if not exist "%RsBuildPath%\Makefile" echo Project is not compiled.& goto error
|
||||
|
||||
:: Get compiled revision
|
||||
set GetRsVersion=%SourcePath%\build_scripts\Windows\tools\get-rs-version.bat
|
||||
if not exist "%GetRsVersion%" (
|
||||
%cecho% error "File not found"
|
||||
echo %GetRsVersion%
|
||||
goto error
|
||||
)
|
||||
|
||||
:: Get compiled version
|
||||
call "%GetRsVersion%" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
|
||||
call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
|
||||
if errorlevel 1 %cecho% error "Version not found."& goto error
|
||||
|
||||
if "%RsVersion.Major%"=="" %cecho% error "Major version not found."& goto error
|
||||
|
@ -48,18 +40,17 @@ if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& goto error
|
|||
|
||||
set RsVersion=%RsVersion.Major%.%RsVersion.Minor%.%RsVersion.Mini%
|
||||
|
||||
:: Check WMIC is available
|
||||
wmic.exe alias /? >nul 2>&1 || echo WMIC is not available.&& goto error
|
||||
:: Get date
|
||||
call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate
|
||||
if errorlevel 1 %cecho% error "Could not get date."& goto error
|
||||
|
||||
:: Use WMIC to retrieve date in format YYYYMMDD
|
||||
set RsDate=
|
||||
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%%I
|
||||
set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2%
|
||||
if "%RsDate%"=="" %cecho% error "Could not get date."& goto error
|
||||
|
||||
rem Tor
|
||||
if "%ParamTor%"=="1" (
|
||||
:: Check for tor executable
|
||||
if not exist "%EnvDownloadPath%\tor\Tor\tor.exe" (
|
||||
%cecho% error "Tor binary not found. Please download Tor Expert Bundle from\nhttps://www.torproject.org/download/download.html.en\nand unpack to\n%EnvDownloadPath:\=\\%\\tor"
|
||||
if not exist "%EnvTorPath%\Tor\tor.exe" (
|
||||
%cecho% error "Tor binary not found. Please download Tor Expert Bundle from\nhttps://www.torproject.org/download/download.html.en\nand unpack to\n%EnvTorPath:\=\\%"
|
||||
goto error
|
||||
)
|
||||
)
|
||||
|
@ -176,7 +167,7 @@ if exist "%SourcePath%\libresapi\src\webui" (
|
|||
|
||||
if "%ParamTor%"=="1" (
|
||||
echo copy tor
|
||||
echo n | copy /-y "%EnvDownloadPath%\tor\Tor\*.*" "%RsDeployPath%" %Quite%
|
||||
echo n | copy /-y "%EnvTorPath%\*.*" "%RsDeployPath%" %Quite%
|
||||
)
|
||||
|
||||
rem pack files
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue