Set the ZIP version automatically.

This commit is contained in:
XhmikosR 2014-08-10 09:53:38 +03:00
parent 9859ec422f
commit 9429fae4fc

View File

@ -1,8 +1,6 @@
@ECHO OFF
SETLOCAL
SET "VERSION=3.4.1"
CD /D %~dp0
rem Check for the help switches
@ -55,6 +53,7 @@ IF /I "%BUILDTYPE%" == "Clean" GOTO END
CALL :SubDetectSevenzipPath
IF DEFINED SEVENZIP_PATH IF EXIST "%SEVENZIP_PATH%" (
CALL :SubGetVersion
CALL :SubZipFile
)
@ -138,6 +137,16 @@ ENDLOCAL
EXIT /B
:SubGetVersion
FOR /F delims^=^"^ tokens^=2 %%A IN ('FINDSTR /R /C:"AssemblyVersion" "src\Properties\AssemblyInfo.cs.template"') DO (
rem 3.4.1.[REVNO]
SET "VERSION=%%A"
)
rem 3.4.1: 0 from the left and -8 chars from the right
SET "VERSION=%VERSION:~0,-8%"
EXIT /B
:SubDetectSevenzipPath
FOR %%G IN (7z.exe) DO (SET "SEVENZIP_PATH=%%~$PATH:G")
IF EXIST "%SEVENZIP_PATH%" (SET "SEVENZIP=%SEVENZIP_PATH%" & EXIT /B)