Project, you want to create an ASP. NET project installation file, because the project relies on the. 3.5 SP1, it is necessary to detect if the environment meets the requirements in order to install the program
MOM found the detection scheme: each. NET version corresponding to the installation of the MSBuild.exe, can be run through the DOS command msbuild.exe-version view output version
(Reference: http://blog.csdn.net/yapingxin/article/details/7320129)
The following is a project in which the build installer is used to detect the. NET Framework 3.5 SP1 commands,
@echo Offset Netver=0Set Netverstr=3.5ifExist%windir%\microsoft.net\framework\v3.5\msbuild.exe (%windir%\microsoft.net\framework\v3.5\msbuild.exe-version >Tmpver.txt for/F"skip=3 tokens=1,2,3,4 delims=."%%iinch(Tmpver.txt) Do(Set Netver=%%K Set Netverstr=%%i.%%j.%%k.%%l) del tmpver.txt) REM expression 3.5Minimum version number of SP1:3.5.30729.1if%netver% GEQ30729 ( Echo. NET Framework Version number%netverstr%EchoEnvironmental compliance requirements, installation procedures ...) Else(EchoPlease install the. Net Framework First3.5SP1) Pause