21 lines
489 B
Batchfile
21 lines
489 B
Batchfile
@echo off
|
|
cd /d %~dp0
|
|
::读取版本配置文件
|
|
set configVersion=version.txt
|
|
for /f "tokens=1,2,3 delims=." %%a IN (%configVersion%) Do (
|
|
set tag1=%%a
|
|
set tag2=%%b
|
|
set tag3=%%c
|
|
)
|
|
set oldVersion=%tag1%.%tag2%.%tag3%
|
|
|
|
::替换
|
|
set d=%date: =0%
|
|
set t=%time: =0%
|
|
|
|
set productname=%oldVersion%.%d:~2,2%%d:~5,2%%d:~8,2%%t:~0,2%%t:~3,2%%t:~6,2%
|
|
echo %productname%
|
|
echo [assembly:System.Reflection.AssemblyFileVersion("%productname%")]> VersionInfo.cs
|
|
echo %productname%> versiontemp.txt
|
|
|