Install tor if needed

This commit is contained in:
hunbernd 2020-06-07 00:39:01 +02:00
parent 03b4c69ae9
commit a2ebf0b715
2 changed files with 21 additions and 15 deletions

View File

@ -20,6 +20,11 @@ if errorlevel 1 goto error_env
if not "%ParamNoupdate%"=="1" (
:: Install ntldd
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-ntldd-git"
:: Install tor
if "%ParamTor%"=="1" (
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-tor"
)
)
:: Remove deploy path
@ -55,14 +60,6 @@ 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 "%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"
goto error
)
)
set QtMainVersion=%QtVersion:~0,1%
set QtSharePath=%RsMinGWPath%\share\qt%QtMainVersion%\
@ -124,7 +121,7 @@ if "%QtMainVersion%"=="5" (
)
if exist "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" (
echo Copy styles
echo copy styles
mkdir "%RsDeployPath%\styles" %Quite%
copy "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" "%RsDeployPath%\styles" %Quite%
)
@ -132,6 +129,12 @@ if exist "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" (
copy "%QtSharePath%\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite%
del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite%
if "%ParamTor%"=="1" (
echo copy tor
copy "%RsMinGWPath%\bin\tor.exe" "%RsDeployPath%" %Quite%
copy "%RsMinGWPath%\bin\tor-gencert.exe" "%RsDeployPath%" %Quite%
)
echo copy dependencies
for /R "%RsDeployPath%" %%D in (*.dll, *.exe) do (
call :copy_dependencies "%%D" "%RsDeployPath%"
@ -183,11 +186,6 @@ if "%ParamWebui%"=="1" (
)
)
if "%ParamTor%"=="1" (
echo copy tor
echo n | copy /-y "%EnvDownloadPath%\tor\Tor\*.*" "%RsDeployPath%" %Quite%
)
rem pack files
title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files]

View File

@ -50,6 +50,14 @@
# Date
!define /date Date "%Y%m%d"
# Detect tor
${!defineifexist} TOR_EXISTS "${DEPLOYDIR}\tor.exe"
!ifdef TOR_EXISTS
!define RSTYPE "-tor"
!else
!define RSTYPE ""
!endif
# Application name and version
!define APPNAME "RetroShare"
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
@ -64,7 +72,7 @@
# Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-${ARCHITECTURE}${INSTALLERADD}-setup.exe"
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-${ARCHITECTURE}${RSTYPE}${INSTALLERADD}-setup.exe"
BrandingText "${APPNAMEANDVERSION}"
RequestExecutionlevel highest
# Use compression