mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-30 18:06:18 -05:00
617ed25a19
- Removed commandline switch "version" - Added MinGit for determining version information during compile process - Added sigcheck to determine version of the executable
38 lines
802 B
Batchfile
38 lines
802 B
Batchfile
:: Usage:
|
|
:: call get-rs-version.bat Executable Variable
|
|
::
|
|
:: Variable.Major
|
|
:: Variable.Minor
|
|
:: Variable.Mini
|
|
:: Variable.Extra
|
|
|
|
setlocal
|
|
|
|
set Executable=%~1
|
|
set Variable=%~2
|
|
if "%Variable%"=="" (
|
|
echo.
|
|
echo Parameter error.
|
|
exit /B 1
|
|
)
|
|
|
|
if not exist "%Executable%" (
|
|
echo.
|
|
echo File %Executable% doesn't exist.
|
|
exit /B1
|
|
)
|
|
|
|
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%.Major=%VersionMajor%& set %Variable%.Minor=%VersionMinor%& set %Variable%.Mini=%VersionMini%& set %Variable%.Extra=%VersionExtra%&
|
|
exit /B 0 |