mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
Modified Windows Build Environment
- Removed commandline switch "version" - Added MinGit for determining version information during compile process - Added sigcheck to determine version of the executable
This commit is contained in:
parent
c7563f1efd
commit
617ed25a19
43 changed files with 2731 additions and 2725 deletions
|
@ -1,27 +1,27 @@
|
|||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
call "%EnvPath%\env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
%cecho% info "Build libraries"
|
||||
call "%~dp0build-libs\build-libs.bat"
|
||||
if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Build %SourceName%"
|
||||
call "%~dp0build\build.bat" release tor version autologin plugins
|
||||
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Pack %SourceName%"
|
||||
call "%~dp0build\pack.bat" release tor
|
||||
if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
call "%EnvPath%\env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
%cecho% info "Build libraries"
|
||||
call "%~dp0build-libs\build-libs.bat"
|
||||
if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Build %SourceName%"
|
||||
call "%~dp0build\build.bat" release tor autologin plugins
|
||||
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Pack %SourceName%"
|
||||
call "%~dp0build\pack.bat" release tor
|
||||
if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
call "%EnvPath%\env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
%cecho% info "Build libraries"
|
||||
call "%~dp0build-libs\build-libs.bat"
|
||||
if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Build %SourceName%"
|
||||
call "%~dp0build\build.bat" release version autologin plugins
|
||||
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Pack %SourceName%"
|
||||
call "%~dp0build\pack.bat" release
|
||||
if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Build installer"
|
||||
call "%~dp0build\build-installer.bat"
|
||||
if errorlevel 1 %cecho% error "Failed to build installer." & exit /B %ERRORLEVEL%
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
call "%EnvPath%\env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
%cecho% info "Build libraries"
|
||||
call "%~dp0build-libs\build-libs.bat"
|
||||
if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Build %SourceName%"
|
||||
call "%~dp0build\build.bat" release autologin plugins
|
||||
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Pack %SourceName%"
|
||||
call "%~dp0build\pack.bat" release
|
||||
if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Build installer"
|
||||
call "%~dp0build\build-installer.bat"
|
||||
if errorlevel 1 %cecho% error "Failed to build installer." & exit /B %ERRORLEVEL%
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
||||
|
|
|
@ -31,15 +31,13 @@ set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%RsPackPath%"
|
|||
set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%"
|
||||
set NSIS_PARAM=%NSIS_PARAM% /DEXTERNAL_LIB_DIR="%BuildLibsPath%\libs"
|
||||
|
||||
:: Scan version from source
|
||||
set RsRevision=
|
||||
set RsBuildAdd=
|
||||
call "%ToolsPath%\get-rs-version.bat" RS_REVISION_STRING RsRevision
|
||||
if "%RsRevision%"=="" echo Revision not found.& exit /B 1
|
||||
call "%ToolsPath%\get-rs-version.bat" RS_BUILD_NUMBER_ADD RsBuildAdd
|
||||
if errorlevel 1 exit /B 1
|
||||
:: 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
|
||||
|
||||
set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%RsRevision% /DBUILDADD=%RsBuildAdd%
|
||||
if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& exit /B 1
|
||||
|
||||
set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%RsVersion.Extra%
|
||||
|
||||
set QtMainVersion=%QtVersion:~0,1%
|
||||
|
||||
|
|
|
@ -22,13 +22,12 @@ 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
|
||||
|
||||
:: Check git executable
|
||||
if "%ParamVersion%"=="0" goto found_git
|
||||
set GitPath=
|
||||
call "%ToolsPath%\find-in-path.bat" GitPath git.exe
|
||||
if "%GitPath%" NEQ "" goto found_git
|
||||
choice /M "Git not found in PATH. Version information cannot be calculated. Do you want to proceed?"
|
||||
if %errorlevel%==2 exit /B 1
|
||||
:found_git
|
||||
if "%GitPath%"=="" (
|
||||
%cecho% error "Git not found in PATH. Version information cannot be determined."
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo === Version
|
||||
|
@ -75,7 +74,7 @@ popd
|
|||
|
||||
title %COMSPEC%
|
||||
|
||||
if errorlevel 1 echo.& echo Build failed& echo.
|
||||
if errorlevel 1 %cecho% error "\nBuild failed\n"
|
||||
exit /B %ERRORLEVEL%
|
||||
|
||||
:error_env
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
:: Process commandline parameter
|
||||
set ParamRelease=0
|
||||
set ParamDebug=0
|
||||
set ParamVersion=0
|
||||
set ParamAutologin=0
|
||||
set ParamPlugins=0
|
||||
set ParamTor=0
|
||||
|
@ -13,8 +12,6 @@ if "%~1" NEQ "" (
|
|||
set ParamRelease=1
|
||||
) else if "%%~a"=="debug" (
|
||||
set ParamDebug=1
|
||||
) else if "%%~a"=="version" (
|
||||
set ParamVersion=1
|
||||
) else if "%%~a"=="autologin" (
|
||||
set ParamAutologin=1
|
||||
) else if "%%~a"=="plugins" (
|
||||
|
@ -95,7 +92,6 @@ echo Mandatory parameter
|
|||
echo release^|debug Build release or debug version
|
||||
echo.
|
||||
echo Optional parameter (need clean when changed)
|
||||
echo version Create version information from git
|
||||
echo autologin Build with autologin
|
||||
echo plugins Build plugins
|
||||
echo.
|
||||
|
|
|
@ -32,27 +32,21 @@ 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%" (
|
||||
echo File not found
|
||||
%cecho% error "File not found"
|
||||
echo %GetRsVersion%
|
||||
goto error
|
||||
)
|
||||
|
||||
call "%GetRsVersion%" RS_REVISION_STRING RsRevision
|
||||
if "%RsRevision%"=="" echo Revision not found.& goto error
|
||||
|
||||
:: Get compiled version
|
||||
call "%GetRsVersion%" RS_MAJOR_VERSION RsMajorVersion
|
||||
if "%RsMajorVersion%"=="" echo Major version not found.& goto error
|
||||
call "%GetRsVersion%" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
|
||||
if errorlevel 1 %cecho% error "Version not found."& goto error
|
||||
|
||||
call "%GetRsVersion%" RS_MINOR_VERSION RsMinorVersion
|
||||
if "%RsMinorVersion%"=="" echo Minor version not found.& goto error
|
||||
if "%RsVersion.Major%"=="" %cecho% error "Major version not found."& goto error
|
||||
if "%RsVersion.Minor%"=="" %cecho% error "Minor version not found."& goto error
|
||||
if "%RsVersion.Mini%"=="" %cecho% error "Mini number not found".& goto error
|
||||
if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& goto error
|
||||
|
||||
call "%GetRsVersion%" RS_BUILD_NUMBER RsBuildNumber
|
||||
if "%RsBuildNumber%"=="" echo Build number not found.& goto error
|
||||
|
||||
call "%GetRsVersion%" RS_BUILD_NUMBER_ADD RsBuildNumberAdd
|
||||
|
||||
set RsVersion=%RsMajorVersion%.%RsMinorVersion%.%RsBuildNumber%%RsBuildNumberAdd%
|
||||
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
|
||||
|
@ -65,10 +59,7 @@ 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" (
|
||||
echo Tor binary not found. Please download Tor Expert Bundle from
|
||||
echo https://www.torproject.org/download/download.html.en
|
||||
echo and unpack to
|
||||
echo %EnvDownloadPath%\tor
|
||||
%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
|
||||
)
|
||||
)
|
||||
|
@ -83,9 +74,9 @@ if "%QtMainVersion%"=="4" set QtMainVersion2=4
|
|||
if "%QtMainVersion%"=="5" set QtMainVersion1=5
|
||||
|
||||
if "%RsBuildConfig%" NEQ "release" (
|
||||
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
|
||||
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
|
||||
) else (
|
||||
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsType%%RsArchiveAdd%.7z
|
||||
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%%RsType%%RsArchiveAdd%.7z
|
||||
)
|
||||
|
||||
if exist "%Archive%" del /Q "%Archive%"
|
||||
|
@ -98,7 +89,7 @@ title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files]
|
|||
set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc
|
||||
set Extensions=
|
||||
for /f %%e in ('type "%ExtensionsFile%" ^| "%EnvSedExe%" -n "s/^.*\/\(extensions[^/]*\)\/.*$/\1/p" ^| "%EnvSedExe%" -n "1,1p"') do set Extensions=%%e
|
||||
if "%Extensions%"=="" echo Folder for extensions not found in %ExtensionsFile%& goto error
|
||||
if "%Extensions%"=="" %cecho% error "Folder for extensions not found in %ExtensionsFile%"& goto error
|
||||
|
||||
:: Copy files
|
||||
mkdir "%RsDeployPath%\Data\%Extensions%"
|
||||
|
|
44
build_scripts/Windows/env/env-msys.bat
vendored
44
build_scripts/Windows/env/env-msys.bat
vendored
|
@ -1,22 +1,22 @@
|
|||
:: Usage:
|
||||
:: call env-msys.bat [reinstall|clean]
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
set EnvMSYSPath=%EnvRootPath%\msys
|
||||
|
||||
call "%~dp0tools\prepare-msys.bat" %1
|
||||
if errorlevel 1 exit /B %ERRORLEVEL%
|
||||
|
||||
set EnvMSYSSH=%EnvMSYSPath%\msys\1.0\bin\sh.exe
|
||||
if not exist "%EnvMSYSSH%" if errorlevel 1 goto error_env
|
||||
|
||||
set EnvMSYSCmd="%EnvMSYSSH%" --login -i -c
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
||||
:: Usage:
|
||||
:: call env-msys.bat [reinstall|clean]
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
set EnvMSYSPath=%EnvRootPath%\msys
|
||||
|
||||
call "%~dp0tools\prepare-msys.bat" %1
|
||||
if errorlevel 1 exit /B %ERRORLEVEL%
|
||||
|
||||
set EnvMSYSSH=%EnvMSYSPath%\msys\1.0\bin\sh.exe
|
||||
if not exist "%EnvMSYSSH%" if errorlevel 1 goto error_env
|
||||
|
||||
set EnvMSYSCmd="%EnvMSYSSH%" --login -i -c
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
||||
|
|
46
build_scripts/Windows/env/env-qt.bat
vendored
46
build_scripts/Windows/env/env-qt.bat
vendored
|
@ -1,23 +1,23 @@
|
|||
:: Usage:
|
||||
:: call env-qt4.bat version [reinstall|clean]
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
set EnvQtBasePath=%EnvRootPath%\qt
|
||||
|
||||
:: Create folders
|
||||
if not exist "%EnvQtBasePath%" mkdir "%EnvQtBasePath%"
|
||||
|
||||
call "%~dp0tools\prepare-qt.bat" %1 %2
|
||||
if errorlevel 1 exit /B %ERRORLEVEL%
|
||||
|
||||
if "%MinGWDir%" NEQ "" set PATH=%MinGWDir%\bin;%PATH%
|
||||
if "%QtDir%" NEQ "" set PATH=%QtDir%\bin;%PATH%
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
||||
:: Usage:
|
||||
:: call env-qt4.bat version [reinstall|clean]
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
set EnvQtBasePath=%EnvRootPath%\qt
|
||||
|
||||
:: Create folders
|
||||
if not exist "%EnvQtBasePath%" mkdir "%EnvQtBasePath%"
|
||||
|
||||
call "%~dp0tools\prepare-qt.bat" %1 %2
|
||||
if errorlevel 1 exit /B %ERRORLEVEL%
|
||||
|
||||
if "%MinGWDir%" NEQ "" set PATH=%MinGWDir%\bin;%PATH%
|
||||
if "%QtDir%" NEQ "" set PATH=%QtDir%\bin;%PATH%
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
||||
|
|
8
build_scripts/Windows/env/env.bat
vendored
8
build_scripts/Windows/env/env.bat
vendored
|
@ -24,7 +24,13 @@ if not exist "%EnvToolsPath%" mkdir "%EnvToolsPath%"
|
|||
if not exist "%EnvDownloadPath%" mkdir "%EnvDownloadPath%"
|
||||
|
||||
call "%~dp0tools\prepare-tools.bat"
|
||||
exit /B %ERRORLEVEL%
|
||||
if errorlevel 1 exit /B %ERRORLEVEL%
|
||||
|
||||
:: Add MinGit to PATH
|
||||
set PATH=%EnvToolsPath%\MinGit\cmd;%PATH%
|
||||
set HOME=%EnvToolsPath%\MinGit\home
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
|
|
408
build_scripts/Windows/env/tools/prepare-qt.bat
vendored
408
build_scripts/Windows/env/tools/prepare-qt.bat
vendored
|
@ -1,204 +1,204 @@
|
|||
:: Usage:
|
||||
:: call prepare-qt.bat version [reinstall|clean]
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
if "%EnvQtBasePath%"=="" exit /B 1
|
||||
if not exist "%EnvRootPath%"=="" exit /B 1
|
||||
|
||||
set EnvQtVersion=%~1
|
||||
if "%EnvQtVersion%"=="" (
|
||||
%cecho% error "Please specify Qt version"
|
||||
goto error
|
||||
)
|
||||
|
||||
for /f "tokens=1,2 delims=." %%A in ("%EnvQtVersion%") do set EnvQtMainVersion=%%A& set EnvQtBaseVersion=%%A.%%B
|
||||
set EnvQtPath=%EnvQtBasePath%\%EnvQtVersion%
|
||||
|
||||
if "%~2"=="clean" (
|
||||
%cecho% info "Clean Qt %EnvQtVersion%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvQtPath%"
|
||||
goto exit
|
||||
)
|
||||
|
||||
set CheckQmakeExe=
|
||||
if "%EnvQtMainVersion%"=="4" (
|
||||
set CheckQmakeExe=%EnvQtPath%\Qt\bin\qmake.exe
|
||||
) else (
|
||||
if "%EnvQtMainVersion%" GEQ "5" (
|
||||
call :get_mingw_version EnvQtMinGWVersion "%EnvQtPath%\%EnvQtBaseVersion%"
|
||||
if "!EnvQtMinGWVersion!" NEQ "" (
|
||||
set CheckQmakeExe=%EnvQtPath%\%EnvQtBaseVersion%\!EnvQtMinGWVersion!\bin\qmake.exe
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if "%CheckQmakeExe%" NEQ "" (
|
||||
if exist "%CheckQmakeExe%" (
|
||||
if "%~2"=="reinstall" (
|
||||
choice /M "Found existing Qt %EnvQtVersion% version. Do you want to proceed?"
|
||||
if !ERRORLEVEL!==2 goto exit
|
||||
) else (
|
||||
goto exit
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
set QtInstall=qt-opensource-windows-x86-mingw-%EnvQtVersion%.exe
|
||||
set QtInstallWildcard=qt-opensource-windows-x86-mingw*-%EnvQtVersion%.exe
|
||||
set QtUrl=http://download.qt.io/official_releases/qt/%EnvQtBaseVersion%/%EnvQtVersion%
|
||||
|
||||
%cecho% info "Remove previous Qt %EnvQtVersion% version"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvQtPath%"
|
||||
|
||||
%cecho% info "Download Qt installation files"
|
||||
if not exist "%EnvDownloadPath%\%QtInstall%" (
|
||||
call "%ToolsPath%\download-file-wildcard.bat" "%QtUrl%" "%QtInstallWildcard%" "%EnvDownloadPath%" QtInstallDownload
|
||||
if "!QtInstallDownload!"=="" %cecho% error "Cannot download Qt %EnvQtVersion%" & goto error
|
||||
ren "%EnvDownloadPath%\!QtInstallDownload!" "%QtInstall%"
|
||||
)
|
||||
if not exist "%EnvDownloadPath%\%QtInstall%" %cecho% error "Cannot download Qt %EnvQtVersion%" & goto error
|
||||
|
||||
mkdir "%EnvQtPath%"
|
||||
|
||||
if "%EnvQtMainVersion%"=="4" (
|
||||
rem Qt 4
|
||||
goto install_qt4
|
||||
)
|
||||
if "%EnvQtMainVersion%" GEQ "5" (
|
||||
rem Qt >= 5
|
||||
goto install_qt5
|
||||
)
|
||||
|
||||
%cecho% error "Unknown Qt version %EnvQtVersion%"
|
||||
|
||||
:error
|
||||
endlocal & set QtDir=& set MinGWDir=
|
||||
exit /B 1
|
||||
|
||||
:exit
|
||||
set QtDir=
|
||||
set MinGWDir=
|
||||
|
||||
if "%EnvQtMainVersion%"=="4" (
|
||||
rem Qt 4
|
||||
set QtDir=%EnvQtBasePath%\%EnvQtVersion%\Qt
|
||||
set MinGWDir=%EnvQtBasePath%\%EnvQtVersion%\mingw32
|
||||
) else (
|
||||
if "%EnvQtMainVersion%" GEQ "5" (
|
||||
call :get_mingw_version EnvQtToolsMinGWVersion "%EnvQtPath%\Tools"
|
||||
|
||||
set QtDir=%EnvQtPath%\%EnvQtBaseVersion%\!EnvQtMinGWVersion!
|
||||
set MinGWDir=%EnvQtPath%\Tools\!EnvQtToolsMinGWVersion!
|
||||
)
|
||||
)
|
||||
|
||||
endlocal & set QtDir=%QtDir%& set MinGWDir=%MinGWDir%
|
||||
exit /B 0
|
||||
|
||||
:get_mingw_version
|
||||
setlocal enabledelayedexpansion
|
||||
set Variable=%~1
|
||||
set Result=
|
||||
|
||||
for /D %%A in (%~2\*) do set Name=%%~nA& if "!Name:~0,5!"=="mingw" set Result=!Name!
|
||||
endlocal & set %Variable%=%Result%
|
||||
goto :EOF
|
||||
|
||||
:replace
|
||||
set InFile=%~1
|
||||
set InFileName=%~nx1
|
||||
set OutFile=%~1.tmp
|
||||
set SearchText=%~2
|
||||
set ReplaceText=%~3
|
||||
|
||||
if exist "%OutFile%" del /Q "%OutFile%"
|
||||
|
||||
for /f "tokens=1* delims=]" %%A in ('find /n /v ""^<%InFile%') do (
|
||||
set string=%%B
|
||||
|
||||
if "!string!"=="" (
|
||||
echo.>>%OutFile%
|
||||
) else (
|
||||
set modified=!string:%SearchText%=%ReplaceText%!
|
||||
echo !modified!>> %OutFile%
|
||||
)
|
||||
)
|
||||
del "%InFile%"
|
||||
rename "%OutFile%" "%InFileName%"
|
||||
goto :EOF
|
||||
|
||||
:install_qt4
|
||||
set MinGWInstall=i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z
|
||||
set MinGWUrl=http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/4.8.2/threads-posix/dwarf/%MinGWInstall%/download
|
||||
|
||||
%cecho% info "Download MinGW installation files"
|
||||
if not exist "%EnvDownloadPath%\%MinGWInstall%" call "%ToolsPath%\download-file.bat" "%MinGWUrl%" "%EnvDownloadPath%\%MinGWInstall%"
|
||||
if not exist "%EnvDownloadPath%\%MinGWInstall%" %cecho% error "Cannot download MinGW" & goto error
|
||||
|
||||
%cecho% info "Unpack Qt %EnvQtVersion%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%QtInstall%" $_14_
|
||||
move "%EnvTempPath%\$_14_" "%EnvQtPath%\Qt"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
%cecho% info "Unpack MinGW"
|
||||
"%EnvSevenZipExe%" x -o"%EnvQtPath%" "%EnvDownloadPath%\%MinGWInstall%"
|
||||
|
||||
echo Prepare Qt %EnvQtVersion%
|
||||
echo [Paths]>"%EnvQtPath%\Qt\bin\qt.conf"
|
||||
echo Prefix=..>>"%EnvQtPath%\Qt\bin\qt.conf"
|
||||
|
||||
goto exit
|
||||
|
||||
:install_qt5
|
||||
set EnvQtInstallerFrameworkVersion=2.0.3
|
||||
|
||||
set QtInstallerFrameworkInstall=QtInstallerFramework-%EnvQtInstallerFrameworkVersion%-win-x86.exe
|
||||
set QtInstallerFrameworkUrl=http://download.qt.io/official_releases/qt-installer-framework/%EnvQtInstallerFrameworkVersion%/QtInstallerFramework-win-x86.exe
|
||||
|
||||
%cecho% info "Download QtInstallerFramework installation files"
|
||||
if not exist "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" call "%ToolsPath%\download-file.bat" "%QtInstallerFrameworkUrl%" "%EnvDownloadPath%\%QtInstallerFrameworkInstall%"
|
||||
if not exist "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" %cecho% error "Cannot download Qt Installer Framework %EnvQtInstallerFrameworkVersion%" & goto error
|
||||
|
||||
%cecho% info "Unpack Qt Installer Framework"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" bin\devtool.exe
|
||||
move "%EnvTempPath%\bin\devtool.exe" "%EnvQtPath%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
%cecho% info "Unpack Qt %EnvQtVersion%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
"%EnvQtPath%\devtool.exe" "%EnvDownloadPath%\%QtInstall%" --dump "%EnvTempPath%"
|
||||
|
||||
pushd "%EnvTempPath%"
|
||||
del /S *vcredist*.7z
|
||||
del /S *qtcreator*.7z
|
||||
del /S *1installer-changelog.7z
|
||||
for /R %%F in (*.7z) do "%EnvSevenZipExe%" x -y -o"%EnvQtPath%" "%%F"
|
||||
popd
|
||||
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
call :get_mingw_version EnvQtMinGWVersion "%EnvQtPath%\%EnvQtBaseVersion%"
|
||||
|
||||
%cecho% info "Prepare Qt %EnvQtVersion%"
|
||||
echo [Paths]>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
echo Documentation=../../Docs/Qt-%EnvQtBaseVersion%>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
echo Examples=../../Examples/Qt-%EnvQtBaseVersion%>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
echo Prefix=..>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
|
||||
call :replace "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\mkspecs\qconfig.pri" "Enterprise" "OpenSource"
|
||||
|
||||
for /R "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\lib" %%A in (*.pc) do (
|
||||
call :replace "%%A" "c:/Users/qt/work/install" "%EnvQtPath:\=\\%\%EnvQtBaseVersion%\\%EnvQtMinGWVersion%"
|
||||
call :replace "%%A" "c:\Users\qt\work\install" "%EnvQtPath:\=/%\%EnvQtBaseVersion%/%EnvQtMinGWVersion%"
|
||||
)
|
||||
for /R "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\lib" %%A in (*.prl) do (
|
||||
call :replace "%%A" "c:/Users/qt/work/install" "%EnvQtPath:\=\\%\%EnvQtBaseVersion%\\%EnvQtMinGWVersion%"
|
||||
call :replace "%%A" "c:\Users\qt\work\install" "%EnvQtPath:\=/%\%EnvQtBaseVersion%/%EnvQtMinGWVersion%"
|
||||
)
|
||||
goto exit
|
||||
:: Usage:
|
||||
:: call prepare-qt.bat version [reinstall|clean]
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
if "%EnvQtBasePath%"=="" exit /B 1
|
||||
if not exist "%EnvRootPath%"=="" exit /B 1
|
||||
|
||||
set EnvQtVersion=%~1
|
||||
if "%EnvQtVersion%"=="" (
|
||||
%cecho% error "Please specify Qt version"
|
||||
goto error
|
||||
)
|
||||
|
||||
for /f "tokens=1,2 delims=." %%A in ("%EnvQtVersion%") do set EnvQtMainVersion=%%A& set EnvQtBaseVersion=%%A.%%B
|
||||
set EnvQtPath=%EnvQtBasePath%\%EnvQtVersion%
|
||||
|
||||
if "%~2"=="clean" (
|
||||
%cecho% info "Clean Qt %EnvQtVersion%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvQtPath%"
|
||||
goto exit
|
||||
)
|
||||
|
||||
set CheckQmakeExe=
|
||||
if "%EnvQtMainVersion%"=="4" (
|
||||
set CheckQmakeExe=%EnvQtPath%\Qt\bin\qmake.exe
|
||||
) else (
|
||||
if "%EnvQtMainVersion%" GEQ "5" (
|
||||
call :get_mingw_version EnvQtMinGWVersion "%EnvQtPath%\%EnvQtBaseVersion%"
|
||||
if "!EnvQtMinGWVersion!" NEQ "" (
|
||||
set CheckQmakeExe=%EnvQtPath%\%EnvQtBaseVersion%\!EnvQtMinGWVersion!\bin\qmake.exe
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if "%CheckQmakeExe%" NEQ "" (
|
||||
if exist "%CheckQmakeExe%" (
|
||||
if "%~2"=="reinstall" (
|
||||
choice /M "Found existing Qt %EnvQtVersion% version. Do you want to proceed?"
|
||||
if !ERRORLEVEL!==2 goto exit
|
||||
) else (
|
||||
goto exit
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
set QtInstall=qt-opensource-windows-x86-mingw-%EnvQtVersion%.exe
|
||||
set QtInstallWildcard=qt-opensource-windows-x86-mingw*-%EnvQtVersion%.exe
|
||||
set QtUrl=http://download.qt.io/official_releases/qt/%EnvQtBaseVersion%/%EnvQtVersion%
|
||||
|
||||
%cecho% info "Remove previous Qt %EnvQtVersion% version"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvQtPath%"
|
||||
|
||||
%cecho% info "Download Qt installation files"
|
||||
if not exist "%EnvDownloadPath%\%QtInstall%" (
|
||||
call "%ToolsPath%\download-file-wildcard.bat" "%QtUrl%" "%QtInstallWildcard%" "%EnvDownloadPath%" QtInstallDownload
|
||||
if "!QtInstallDownload!"=="" %cecho% error "Cannot download Qt %EnvQtVersion%" & goto error
|
||||
ren "%EnvDownloadPath%\!QtInstallDownload!" "%QtInstall%"
|
||||
)
|
||||
if not exist "%EnvDownloadPath%\%QtInstall%" %cecho% error "Cannot download Qt %EnvQtVersion%" & goto error
|
||||
|
||||
mkdir "%EnvQtPath%"
|
||||
|
||||
if "%EnvQtMainVersion%"=="4" (
|
||||
rem Qt 4
|
||||
goto install_qt4
|
||||
)
|
||||
if "%EnvQtMainVersion%" GEQ "5" (
|
||||
rem Qt >= 5
|
||||
goto install_qt5
|
||||
)
|
||||
|
||||
%cecho% error "Unknown Qt version %EnvQtVersion%"
|
||||
|
||||
:error
|
||||
endlocal & set QtDir=& set MinGWDir=
|
||||
exit /B 1
|
||||
|
||||
:exit
|
||||
set QtDir=
|
||||
set MinGWDir=
|
||||
|
||||
if "%EnvQtMainVersion%"=="4" (
|
||||
rem Qt 4
|
||||
set QtDir=%EnvQtBasePath%\%EnvQtVersion%\Qt
|
||||
set MinGWDir=%EnvQtBasePath%\%EnvQtVersion%\mingw32
|
||||
) else (
|
||||
if "%EnvQtMainVersion%" GEQ "5" (
|
||||
call :get_mingw_version EnvQtToolsMinGWVersion "%EnvQtPath%\Tools"
|
||||
|
||||
set QtDir=%EnvQtPath%\%EnvQtBaseVersion%\!EnvQtMinGWVersion!
|
||||
set MinGWDir=%EnvQtPath%\Tools\!EnvQtToolsMinGWVersion!
|
||||
)
|
||||
)
|
||||
|
||||
endlocal & set QtDir=%QtDir%& set MinGWDir=%MinGWDir%
|
||||
exit /B 0
|
||||
|
||||
:get_mingw_version
|
||||
setlocal enabledelayedexpansion
|
||||
set Variable=%~1
|
||||
set Result=
|
||||
|
||||
for /D %%A in (%~2\*) do set Name=%%~nA& if "!Name:~0,5!"=="mingw" set Result=!Name!
|
||||
endlocal & set %Variable%=%Result%
|
||||
goto :EOF
|
||||
|
||||
:replace
|
||||
set InFile=%~1
|
||||
set InFileName=%~nx1
|
||||
set OutFile=%~1.tmp
|
||||
set SearchText=%~2
|
||||
set ReplaceText=%~3
|
||||
|
||||
if exist "%OutFile%" del /Q "%OutFile%"
|
||||
|
||||
for /f "tokens=1* delims=]" %%A in ('find /n /v ""^<%InFile%') do (
|
||||
set string=%%B
|
||||
|
||||
if "!string!"=="" (
|
||||
echo.>>%OutFile%
|
||||
) else (
|
||||
set modified=!string:%SearchText%=%ReplaceText%!
|
||||
echo !modified!>> %OutFile%
|
||||
)
|
||||
)
|
||||
del "%InFile%"
|
||||
rename "%OutFile%" "%InFileName%"
|
||||
goto :EOF
|
||||
|
||||
:install_qt4
|
||||
set MinGWInstall=i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z
|
||||
set MinGWUrl=http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/4.8.2/threads-posix/dwarf/%MinGWInstall%/download
|
||||
|
||||
%cecho% info "Download MinGW installation files"
|
||||
if not exist "%EnvDownloadPath%\%MinGWInstall%" call "%ToolsPath%\download-file.bat" "%MinGWUrl%" "%EnvDownloadPath%\%MinGWInstall%"
|
||||
if not exist "%EnvDownloadPath%\%MinGWInstall%" %cecho% error "Cannot download MinGW" & goto error
|
||||
|
||||
%cecho% info "Unpack Qt %EnvQtVersion%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%QtInstall%" $_14_
|
||||
move "%EnvTempPath%\$_14_" "%EnvQtPath%\Qt"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
%cecho% info "Unpack MinGW"
|
||||
"%EnvSevenZipExe%" x -o"%EnvQtPath%" "%EnvDownloadPath%\%MinGWInstall%"
|
||||
|
||||
echo Prepare Qt %EnvQtVersion%
|
||||
echo [Paths]>"%EnvQtPath%\Qt\bin\qt.conf"
|
||||
echo Prefix=..>>"%EnvQtPath%\Qt\bin\qt.conf"
|
||||
|
||||
goto exit
|
||||
|
||||
:install_qt5
|
||||
set EnvQtInstallerFrameworkVersion=2.0.3
|
||||
|
||||
set QtInstallerFrameworkInstall=QtInstallerFramework-%EnvQtInstallerFrameworkVersion%-win-x86.exe
|
||||
set QtInstallerFrameworkUrl=http://download.qt.io/official_releases/qt-installer-framework/%EnvQtInstallerFrameworkVersion%/QtInstallerFramework-win-x86.exe
|
||||
|
||||
%cecho% info "Download QtInstallerFramework installation files"
|
||||
if not exist "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" call "%ToolsPath%\download-file.bat" "%QtInstallerFrameworkUrl%" "%EnvDownloadPath%\%QtInstallerFrameworkInstall%"
|
||||
if not exist "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" %cecho% error "Cannot download Qt Installer Framework %EnvQtInstallerFrameworkVersion%" & goto error
|
||||
|
||||
%cecho% info "Unpack Qt Installer Framework"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" bin\devtool.exe
|
||||
move "%EnvTempPath%\bin\devtool.exe" "%EnvQtPath%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
%cecho% info "Unpack Qt %EnvQtVersion%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
"%EnvQtPath%\devtool.exe" "%EnvDownloadPath%\%QtInstall%" --dump "%EnvTempPath%"
|
||||
|
||||
pushd "%EnvTempPath%"
|
||||
del /S *vcredist*.7z
|
||||
del /S *qtcreator*.7z
|
||||
del /S *1installer-changelog.7z
|
||||
for /R %%F in (*.7z) do "%EnvSevenZipExe%" x -y -o"%EnvQtPath%" "%%F"
|
||||
popd
|
||||
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
call :get_mingw_version EnvQtMinGWVersion "%EnvQtPath%\%EnvQtBaseVersion%"
|
||||
|
||||
%cecho% info "Prepare Qt %EnvQtVersion%"
|
||||
echo [Paths]>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
echo Documentation=../../Docs/Qt-%EnvQtBaseVersion%>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
echo Examples=../../Examples/Qt-%EnvQtBaseVersion%>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
echo Prefix=..>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
|
||||
call :replace "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\mkspecs\qconfig.pri" "Enterprise" "OpenSource"
|
||||
|
||||
for /R "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\lib" %%A in (*.pc) do (
|
||||
call :replace "%%A" "c:/Users/qt/work/install" "%EnvQtPath:\=\\%\%EnvQtBaseVersion%\\%EnvQtMinGWVersion%"
|
||||
call :replace "%%A" "c:\Users\qt\work\install" "%EnvQtPath:\=/%\%EnvQtBaseVersion%/%EnvQtMinGWVersion%"
|
||||
)
|
||||
for /R "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\lib" %%A in (*.prl) do (
|
||||
call :replace "%%A" "c:/Users/qt/work/install" "%EnvQtPath:\=\\%\%EnvQtBaseVersion%\\%EnvQtMinGWVersion%"
|
||||
call :replace "%%A" "c:\Users\qt\work\install" "%EnvQtPath:\=/%\%EnvQtBaseVersion%/%EnvQtMinGWVersion%"
|
||||
)
|
||||
goto exit
|
||||
|
|
|
@ -19,6 +19,11 @@ set UnixToolsInstall=UnxUpdates.zip
|
|||
set NSISUrl=http://prdownloads.sourceforge.net/nsis/nsis-3.0-setup.exe?download
|
||||
set NSISInstall=nsis-3.0-setup.exe
|
||||
set NSISInstallPath=%EnvToolsPath%\NSIS
|
||||
set MinGitInstall=MinGit-2.19.1-32-bit.zip
|
||||
set MinGitUrl=https://github.com/git-for-windows/git/releases/download/v2.19.1.windows.1/%MinGitInstall%
|
||||
set MinGitInstallPath=%EnvToolsPath%\MinGit
|
||||
set SigcheckInstall=Sigcheck.zip
|
||||
set SigcheckUrl=https://download.sysinternals.com/files/%SigcheckInstall%
|
||||
|
||||
if not exist "%EnvToolsPath%\wget.exe" (
|
||||
echo Download Wget installation
|
||||
|
@ -143,7 +148,7 @@ if not exist "%EnvToolsPath%\sed.exe" (
|
|||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
)
|
||||
|
||||
if not exist "%EnvToolsPath%\NSIS\nsis.exe" (
|
||||
if not exist "%NSISInstallPath%\nsis.exe" (
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
|
@ -160,6 +165,26 @@ if not exist "%EnvToolsPath%\NSIS\nsis.exe" (
|
|||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
)
|
||||
|
||||
if not exist "%MinGitInstallPath%\cmd\git.exe" (
|
||||
%cecho% info "Download MinGit installation"
|
||||
|
||||
if not exist "%EnvDownloadPath%\%MinGitInstall%" call "%ToolsPath%\download-file.bat" "%MinGitUrl%" "%EnvDownloadPath%\%MinGitInstall%"
|
||||
if not exist "%EnvDownloadPath%\%MinGitInstall%" %cecho% error "Cannot download MinGit installation" & goto error
|
||||
|
||||
%cecho% info "Unpack MinGit"
|
||||
"%EnvSevenZipExe%" x -o"%MinGitInstallPath%" "%EnvDownloadPath%\%MinGitInstall%"
|
||||
)
|
||||
|
||||
if not exist "%EnvToolsPath%\sigcheck.exe" (
|
||||
%cecho% info "Download Sigcheck installation"
|
||||
|
||||
if not exist "%EnvDownloadPath%\%SigcheckInstall%" call "%ToolsPath%\download-file.bat" "%SigcheckUrl%" "%EnvDownloadPath%\%SigcheckInstall%"
|
||||
if not exist "%EnvDownloadPath%\%SigcheckInstall%" %cecho% error "Cannot download Sigcheck installation" & goto error
|
||||
|
||||
%cecho% info "Unpack Sigcheck"
|
||||
"%EnvSevenZipExe%" x -o"%EnvToolsPath%" "%EnvDownloadPath%\%SigcheckInstall%" sigcheck.exe
|
||||
)
|
||||
|
||||
:exit
|
||||
endlocal
|
||||
exit /B 0
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
!include ifexist.nsh
|
||||
|
||||
# Needed defines
|
||||
;!define BUILDADD ""
|
||||
;!define REVISION ""
|
||||
;!define RELEASEDIR ""
|
||||
;!define QTDIR ""
|
||||
;!define MINGWDIR ""
|
||||
|
@ -13,10 +13,6 @@
|
|||
;!define OUTDIR ""
|
||||
|
||||
# Check needed defines
|
||||
!ifndef BUILDADD
|
||||
!error "BUILDADD is not defined"
|
||||
!endif
|
||||
|
||||
!ifndef RELEASEDIR
|
||||
!error "RELEASEDIR is not defined"
|
||||
!endif
|
||||
|
@ -44,7 +40,7 @@
|
|||
|
||||
# Get version from executable
|
||||
!GetDllVersion "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" VERSION_
|
||||
!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}${BUILDADD}
|
||||
!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}
|
||||
;!define REVISION ${VERSION_4}
|
||||
|
||||
# Get version of Qt
|
||||
|
@ -56,10 +52,6 @@
|
|||
!error "REVISION is not defined"
|
||||
!endif
|
||||
|
||||
!ifndef REVISION
|
||||
!error "REVISION is not defined"
|
||||
!endif
|
||||
|
||||
# Date
|
||||
!define /date Date "%Y%m%d"
|
||||
|
||||
|
@ -254,7 +246,7 @@ ${!defineifexist} PLUGIN_VOIP_EXISTS "${RELEASEDIR}\plugins\VOIP\release\VOIP.dl
|
|||
File "${RELEASEDIR}\plugins\FeedReader\release\FeedReader.dll"
|
||||
SectionEnd
|
||||
!endif
|
||||
|
||||
|
||||
!ifdef PLUGIN_VOIP_EXISTS
|
||||
Section $(Section_Plugin_VOIP) Section_Plugin_VOIP
|
||||
SetOutPath "$DataDir\extensions6"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
!include ifexist.nsh
|
||||
|
||||
# Needed defines
|
||||
;!define BUILDADD ""
|
||||
;!define REVISION ""
|
||||
;!define RELEASEDIR ""
|
||||
;!define QTDIR ""
|
||||
;!define MINGWDIR ""
|
||||
|
@ -13,10 +13,6 @@
|
|||
;!define OUTDIR ""
|
||||
|
||||
# Check needed defines
|
||||
!ifndef BUILDADD
|
||||
!error "BUILDADD is not defined"
|
||||
!endif
|
||||
|
||||
!ifndef RELEASEDIR
|
||||
!error "RELEASEDIR is not defined"
|
||||
!endif
|
||||
|
@ -44,7 +40,7 @@
|
|||
|
||||
# Get version from executable
|
||||
!GetDllVersion "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" VERSION_
|
||||
!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}${BUILDADD}
|
||||
!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}
|
||||
;!define REVISION ${VERSION_4}
|
||||
|
||||
# Get version of Qt
|
||||
|
@ -56,10 +52,6 @@
|
|||
!error "REVISION is not defined"
|
||||
!endif
|
||||
|
||||
!ifndef REVISION
|
||||
!error "REVISION is not defined"
|
||||
!endif
|
||||
|
||||
# Date
|
||||
!define /date Date "%Y%m%d"
|
||||
|
||||
|
@ -276,7 +268,7 @@ ${!defineifexist} PLUGIN_VOIP_EXISTS "${RELEASEDIR}\plugins\VOIP\release\VOIP.dl
|
|||
File "${RELEASEDIR}\plugins\FeedReader\release\FeedReader.dll"
|
||||
SectionEnd
|
||||
!endif
|
||||
|
||||
|
||||
!ifdef PLUGIN_VOIP_EXISTS
|
||||
Section $(Section_Plugin_VOIP) Section_Plugin_VOIP
|
||||
SetOutPath "$DataDir\extensions6"
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
:: Usage:
|
||||
:: call qt-cmd.bat <Qt version> [command]
|
||||
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
set QtVersion=%~1
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
call "%EnvPath%\env-qt.bat" %QtVersion%
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
if "%~2"=="" (
|
||||
"%ComSpec%"
|
||||
) else (
|
||||
"%ComSpec%" /c %2 %3 %4 %5 %6 %7 %8 %9
|
||||
)
|
||||
|
||||
exit /B %ERRORLEVEL%
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
endlocal
|
||||
exit /B 1
|
||||
:: Usage:
|
||||
:: call qt-cmd.bat <Qt version> [command]
|
||||
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
set QtVersion=%~1
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
call "%EnvPath%\env-qt.bat" %QtVersion%
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
if "%~2"=="" (
|
||||
"%ComSpec%"
|
||||
) else (
|
||||
"%ComSpec%" /c %2 %3 %4 %5 %6 %7 %8 %9
|
||||
)
|
||||
|
||||
exit /B %ERRORLEVEL%
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
endlocal
|
||||
exit /B 1
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
:: Usage:
|
||||
:: call download-file-wildcard.bat url file-wildcard download-path variable
|
||||
|
||||
if "%~4"=="" (
|
||||
echo.
|
||||
echo Parameter error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
if "%EnvTempPath%"=="" (
|
||||
echo.
|
||||
echo Environment error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
setlocal
|
||||
|
||||
set Url=%~1
|
||||
set FileWildcard=%~2
|
||||
set DownloadPath=%~3
|
||||
set Var=%~4
|
||||
set File=
|
||||
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
"%EnvWgetExe%" --recursive --continue --no-directories --no-parent -A "%FileWildcard%" --directory-prefix="%EnvTempPath%" "%Url%"
|
||||
|
||||
if errorlevel 1 (
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
endlocal & set %Var%=
|
||||
exit /B %ERRORLEVEL%
|
||||
)
|
||||
|
||||
for %%A in (%EnvTempPath%\%FileWildcard%) do set File=%%~nxA
|
||||
if "%File%"=="" (
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
endlocal & set %Var%=
|
||||
exit /B %ERRORLEVEL%
|
||||
)
|
||||
|
||||
move "%EnvTempPath%\%File%" "%DownloadPath%"
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
endlocal & set %Var%=%File%
|
||||
exit /B 0
|
||||
:: Usage:
|
||||
:: call download-file-wildcard.bat url file-wildcard download-path variable
|
||||
|
||||
if "%~4"=="" (
|
||||
echo.
|
||||
echo Parameter error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
if "%EnvTempPath%"=="" (
|
||||
echo.
|
||||
echo Environment error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
setlocal
|
||||
|
||||
set Url=%~1
|
||||
set FileWildcard=%~2
|
||||
set DownloadPath=%~3
|
||||
set Var=%~4
|
||||
set File=
|
||||
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
"%EnvWgetExe%" --recursive --continue --no-directories --no-parent -A "%FileWildcard%" --directory-prefix="%EnvTempPath%" "%Url%"
|
||||
|
||||
if errorlevel 1 (
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
endlocal & set %Var%=
|
||||
exit /B %ERRORLEVEL%
|
||||
)
|
||||
|
||||
for %%A in (%EnvTempPath%\%FileWildcard%) do set File=%%~nxA
|
||||
if "%File%"=="" (
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
endlocal & set %Var%=
|
||||
exit /B %ERRORLEVEL%
|
||||
)
|
||||
|
||||
move "%EnvTempPath%\%File%" "%DownloadPath%"
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
endlocal & set %Var%=%File%
|
||||
exit /B 0
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
:: Usage:
|
||||
:: call download-file.bat url file
|
||||
|
||||
if "%~2"=="" (
|
||||
echo.
|
||||
echo Parameter error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
::"%EnvCurlExe%" -L -k "%~1" -o "%~2"
|
||||
"%EnvWgetExe%" --no-check-certificate --continue "%~1" --output-document="%~2"
|
||||
|
||||
exit /B %ERRORLEVEL%
|
||||
:: Usage:
|
||||
:: call download-file.bat url file
|
||||
|
||||
if "%~2"=="" (
|
||||
echo.
|
||||
echo Parameter error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
::"%EnvCurlExe%" -L -k "%~1" -o "%~2"
|
||||
"%EnvWgetExe%" --no-check-certificate --continue "%~1" --output-document="%~2"
|
||||
|
||||
exit /B %ERRORLEVEL%
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
:: Usage:
|
||||
:: call get-rs-version.bat Define Variable
|
||||
:: call get-rs-version.bat Executable Variable
|
||||
::
|
||||
:: Variable.Major
|
||||
:: Variable.Minor
|
||||
:: Variable.Mini
|
||||
:: Variable.Extra
|
||||
|
||||
setlocal
|
||||
|
||||
set Define=%~1
|
||||
set Executable=%~1
|
||||
set Variable=%~2
|
||||
if "%Variable%"=="" (
|
||||
echo.
|
||||
|
@ -11,23 +16,23 @@ if "%Variable%"=="" (
|
|||
exit /B 1
|
||||
)
|
||||
|
||||
set Result=
|
||||
set VersionFile="%~dp0..\..\..\libretroshare\src\retroshare\rsversion.h"
|
||||
|
||||
if not exist "%VersionFile%" (
|
||||
if not exist "%Executable%" (
|
||||
echo.
|
||||
echo Version file doesn't exist.
|
||||
echo %VersionFile%
|
||||
echo File %Executable% doesn't exist.
|
||||
exit /B1
|
||||
)
|
||||
|
||||
for /F "usebackq tokens=1,2,3" %%A in (%VersionFile%) do (
|
||||
if "%%A"=="#define" (
|
||||
if "%%B"=="%Define%" (
|
||||
set Result=%%~C
|
||||
)
|
||||
)
|
||||
set VersionMajor=
|
||||
set VersionMinor=
|
||||
set VersionMini=
|
||||
set VersionExtra=
|
||||
|
||||
for /F "tokens=1,2,3,* delims=.-" %%A in ('%EnvToolsPath%\sigcheck.exe -nobanner -n %Executable%') do (
|
||||
set VersionMajor=%%A
|
||||
set VersionMinor=%%B
|
||||
set VersionMini=%%C
|
||||
set VersionExtra=%%D
|
||||
)
|
||||
|
||||
endlocal & set %Variable%=%Result%
|
||||
endlocal & set %Variable%.Major=%VersionMajor%& set %Variable%.Minor=%VersionMinor%& set %Variable%.Mini=%VersionMini%& set %Variable%.Extra=%VersionExtra%&
|
||||
exit /B 0
|
|
@ -1,15 +1,15 @@
|
|||
:: Usage:
|
||||
:: call remove-dir.bat path
|
||||
|
||||
if "%~1"=="" (
|
||||
echo.
|
||||
echo Parameter error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
if exist %1 (
|
||||
del /s /f /q %1 >nul
|
||||
rmdir /s /q %1
|
||||
)
|
||||
|
||||
exit /B 0
|
||||
:: Usage:
|
||||
:: call remove-dir.bat path
|
||||
|
||||
if "%~1"=="" (
|
||||
echo.
|
||||
echo Parameter error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
if exist %1 (
|
||||
del /s /f /q %1 >nul
|
||||
rmdir /s /q %1
|
||||
)
|
||||
|
||||
exit /B 0
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue