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:
thunder2 2018-10-13 13:19:22 +02:00
parent c7563f1efd
commit 617ed25a19
43 changed files with 2731 additions and 2725 deletions

View File

@ -9,7 +9,7 @@ call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
%cecho% info "Build %SourceName%"
call "%~dp0build\build.bat" 32 release tor version autologin plugins
call "%~dp0build\build.bat" 32 release tor autologin plugins
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
%cecho% info "Pack %SourceName%"

View File

@ -9,7 +9,7 @@ call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
%cecho% info "Build %SourceName%"
call "%~dp0build\build.bat" 32 release version autologin plugins
call "%~dp0build\build.bat" 32 release autologin plugins
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
%cecho% info "Pack %SourceName%"

View File

@ -49,10 +49,8 @@ echo.
title Build - %SourceName%-%RsBuildConfig% [qmake]
set RS_QMAKE_CONFIG="CONFIG+=%RsBuildConfig%"
if "%ParamVersion%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=version_detail_bash_script"
if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_autologin"
if "%ParamPlugins%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=retroshare_plugins"
if "%ParamRetroTor%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=retrotor"
call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath
call "%ToolsPath%\msys2-path.bat" "%EnvMSYS2Path%" MSYS2EnvMSYS2Path

View File

@ -3,7 +3,6 @@ set Param32=0
set Param64=0
set ParamRelease=0
set ParamDebug=0
set ParamVersion=0
set ParamAutologin=0
set ParamPlugins=0
set ParamTor=0
@ -19,8 +18,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" (
@ -87,7 +84,6 @@ echo 32^|64 32-bit or 64-bit Version
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.

View File

@ -26,27 +26,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 "Revision 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
@ -59,10 +53,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
)
)
@ -78,9 +69,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%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
) else (
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%-msys2%RsType%%RsArchiveAdd%.7z
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-msys2%RsType%%RsArchiveAdd%.7z
)
if exist "%Archive%" del /Q "%Archive%"

View File

@ -10,6 +10,8 @@ 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%
if not exist "%EnvToolsPath%\wget.exe" (
echo Download Wget installation
@ -70,6 +72,16 @@ if not exist "%EnvToolsPath%\depends.exe" (
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
)
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

View File

@ -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

View File

@ -13,7 +13,7 @@ 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
call "%~dp0build\build.bat" release tor autologin plugins
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
%cecho% info "Pack %SourceName%"

View File

@ -13,7 +13,7 @@ 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
call "%~dp0build\build.bat" release autologin plugins
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
%cecho% info "Pack %SourceName%"

View File

@ -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%

View File

@ -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

View File

@ -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.

View File

@ -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%"

View File

@ -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.

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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