ver | find "5.1." > NUL && goto win_xp
ver | find "6.0." > NUL && goto vista
ver | find "6.1." > NUL && goto win7
ver | find "6.2." > NUL && goto win8
:win_xp
set INS45="WindowsXP-KB942288-v3-x86.exe"
IF not EXIST %INS45% (
echo 正在安装 Windows Installer4.5...
wget -c http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsXP-KB942288-v3-x86.exe
)
%INS45% /quiet /norestart /nobackup /passive
IF NOT EXIST "%WINDIR%\Microsoft.NET\Framework\v2.*" (
set net20 = "NetFx20SP2_x86.exe"
set hnet = "http://download.microsoft.com/download/c/6/e/c6e88215-0178-4c6c-b5f3-158ff77b1f38/NetFx20SP2_x86.exe"
IF NOT EXIST "NetFx20SP2_x86.exe" (
echo 正在下载 .net20...
wget -c http://download.microsoft.com/download/c/6/e/c6e88215-0178-4c6c-b5f3-158ff77b1f38/NetFx20SP2_x86.exe
)
echo 正在安装 .net20...
NetFx20SP2_x86.exe /quiet norestart
)
goto STARTSETUP
:win7
:STARTSETUP
set SQL2005="SQLEXPR_CHS.EXE"
IF NOT EXIST %SQL2005% (
echo 正在下载 .sqlexpr2005...
wget -c http://download.microsoft.com/download/0/9/0/09020fab-d2c3-4a8c-b9e0-db53a7a30ae8/SQLEXPR_CHS.EXE
)
echo 正在安装 SQLserver 2005 Express...
SQLEXPR_CHS.EXE /qb INSTANCENAME="MSSQLSERVER" ADDLOCAL=All SECURITYMODE=SQL SAPWD="1221wx" INSTALLSQLDIR="D:\MSSQL" INSTALLSQLDATADIR="D:\MSSQL\DATA" SQLAUTOSTART=1 DISABLENETWORKPROTOCOLS=0
echo 环境已经全部安装完成.点击安装软件.
setup.exe