Use ntldd instead of depends.exe

Check all exe and dll for dependencies
Deploy cmark.dll
This commit is contained in:
hunbernd 2020-05-23 16:53:59 +02:00
parent f5306fd549
commit c05f5e8329
4 changed files with 16 additions and 54 deletions

View File

@ -17,6 +17,9 @@ call "%~dp0env.bat" %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
:: Install ntldd
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-ntldd-git"
:: Remove deploy path
if exist "%RsDeployPath%" rmdir /S /Q "%RsDeployPath%"
@ -100,16 +103,13 @@ echo copy binaries
copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\RetroShare*.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite%
echo copy extensions
for /D %%D in ("%RsBuildPath%\plugins\*") do (
call :copy_extension "%%D" "%RsDeployPath%\Data\%Extensions%"
call :copy_dependencies "%RsDeployPath%\Data\%Extensions%\%%~nxD.dll" "%RsDeployPath%"
)
echo copy dependencies
call :copy_dependencies "%RsDeployPath%\retroshare.exe" "%RsDeployPath%"
echo copy Qt DLL's
copy "%RsMinGWPath%\bin\Qt%QtMainVersion1%Svg%QtMainVersion2%.dll" "%RsDeployPath%" %Quite%
@ -128,7 +128,9 @@ if exist "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" (
copy "%QtSharePath%\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite%
del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite%
for %%D in ("%RsDeployPath%\imageformats\*.dll") do (
echo copy dependencies
for /R "%RsDeployPath%" %%D in (*.dll, *.exe) do (
call :copy_dependencies "%%D" "%RsDeployPath%"
)
@ -207,14 +209,11 @@ if exist "%~1\%RsBuildConfig%\%~n1.dll" (
goto :EOF
:copy_dependencies
set CopyDependenciesCopiedSomething=0
for /F "usebackq" %%A in (`%ToolsPath%\depends.bat list %1`) do (
for /F "usebackq" %%A in (`%ToolsPath%\depends.bat %1`) do (
if not exist "%~2\%%A" (
if exist "%RsMinGWPath%\bin\%%A" (
set CopyDependenciesCopiedSomething=1
copy "%RsMinGWPath%\bin\%%A" %2 %Quite%
)
)
)
if "%CopyDependenciesCopiedSomething%"=="1" goto copy_dependencies
goto :EOF

View File

@ -9,7 +9,6 @@ set EnvDownloadPath=%EnvRootPath%\download
set EnvWgetExe=%EnvToolsPath%\wget.exe
set EnvSevenZipExe=%EnvToolsPath%\7z.exe
set EnvDependsExe=%EnvToolsPath%\depends.exe
set EnvCEchoExe=%EnvToolsPath%\cecho.exe
set cecho=call "%ToolsPath%\cecho.bat"

View File

@ -8,8 +8,6 @@ set SevenZipUrl=https://sourceforge.net/projects/sevenzip/files/7-Zip/18.05/7z18
set SevenZipInstall=7z1805.msi
set WgetUrl=https://eternallybored.org/misc/wget/1.19.4/32/wget.exe
set WgetInstall=wget.exe
set DependsUrl=http://www.dependencywalker.com/depends22_x86.zip
set DependsInstall=depends22_x86.zip
set SigcheckInstall=Sigcheck.zip
set SigcheckUrl=https://download.sysinternals.com/files/%SigcheckInstall%
@ -56,22 +54,6 @@ if not exist "%EnvToolsPath%\cecho.exe" (
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
)
if not exist "%EnvToolsPath%\depends.exe" (
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
mkdir "%EnvTempPath%"
%cecho% info "Download Dependency Walker installation"
if not exist "%EnvDownloadPath%\%DependsInstall%" call "%ToolsPath%\winhttpjs.bat" %DependsUrl% -saveTo "%EnvDownloadPath%\%DependsInstall%"
if not exist "%EnvDownloadPath%\%DependsInstall%" %cecho% error "Cannot download Dependendy Walker installation" & goto error
%cecho% info "Unpack Dependency Walker"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%DependsInstall%"
copy "%EnvTempPath%\*" "%EnvToolsPath%"
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
)
if not exist "%EnvToolsPath%\sigcheck.exe" (
%cecho% info "Download Sigcheck installation"

View File

@ -1,40 +1,22 @@
:: Usage:
:: call depends.bat [list^|missing] file
:: call depends.bat file
if "%2"=="" (
echo Usage: %~nx0 [list^|missing] File
if "%1"=="" (
echo Usage: %~nx0 File
exit /B 1
)
setlocal
pushd %~dp1
if not exist "%EnvDependsExe%" echo depends.exe not found in %EnvToolsPath%.& exit /B 1
%EnvMSYS2Cmd% "ntldd --recursive $0 | cut -f1 -d"=" | awk '{$1=$1};1'" %~nx1 > %~sdp0depends.tmp
set CutPath=
call "%ToolsPath%\find-in-path.bat" CutPath cut.exe
if "%CutPath%"=="" echo cut.exe not found in PATH.& exit /B 1
start /wait "" "%EnvDependsExe%" /c /oc:"%~dp0depends.tmp" %2
if "%1"=="missing" (
cut.exe --delimiter=, --fields=1,2 "%~dp0depends.tmp" >"%~dp0depends1.tmp"
for /F "tokens=1,2 delims=," %%A in (%~sdp0depends1.tmp) do (
if "%%A"=="?" (
echo %%~B
)
)
)
if "%1"=="list" (
cut.exe --delimiter=, --fields=2 "%~dp0depends.tmp" >"%~dp0depends1.tmp"
for /F "tokens=1 delims=," %%A in (%~sdp0depends1.tmp) do (
if "%%A" NEQ "Module" (
for /F %%A in (%~sdp0depends.tmp) do (
echo %%~A
)
)
)
if exist "%~dp0depends.tmp" del /Q "%~dp0depends.tmp"
if exist "%~dp0depends1.tmp" del /Q "%~dp0depends1.tmp"
popd
endlocal
exit /B 0