无人值守安装IIS 6.0原理与脚本实现
核心执行命令如下:
Sysocmgr.exe /i:sysoc.inf /u:c:\iis.txt
其中 c:\iis.txt 文件用于指定需要安装的 IIS 具体组件清单。
[Components]
iis_common = ON
iis_www = ON
iis_asp = ON
iis_inetmgr = ON
aspnet= ON
除了 IIS 相关模块外,该列表还涵盖系统中所有可安装的组件选项:
Mplay Rec Vol fullscreenconsole fax wms_admin_mmc wms_svrtyplib wbem dtc com complusnetwork iis_common:CommonFiles - 安装需要 IIS 程序文件 iis_inetmgr:Internet 信息服务管理单元: MMC 中安装 IIS 管理界面 netfx iis_www:万维网服务 wms_admin_asp wms_server wms_isapi rootautoupdate autoupdate licenseserver certsrv_client certsrv_server authman cluster ieaccess iehardenadmin iehardenuser msmq_core msmq_localstorage msmq_adintegrated msmq_mqdsservice msmq_triggersservice msmq_httpsupport msmq_routingsupport bitsserverextensionsmanager:安装 BITS 管理扩展中 Microsoft 管理控制台 (MMC) bitsserverextensionsisapi:安装 IIS ISAPI 以允许上载后台智能传输服务 (BITS) sakit_web iis_asp iis_internetdataconnector iis_serversideincludes iis_webdav tswebclient:远程桌面 Web 连接 iis_ftp:FTP 服务 iis_smtp:简单邮件传输协议 (SMTP) 服务 iis_nntp:网络新闻传输协议 (NNTP) 服务 inetprint:Internet 打印 fp_extensions:FrontPage2002ServerExtensions appsrv_console dtcnetwork aspnet Asp.Net oeaccess mswordpad calc charmap clipbook deskpaper mousepoint paint templates imegen chat hypertrm accessopt rstorage indexsrv_system uddiweb uddidatabase uddiadmin terminalserver wbemmsi snmp wbemsnmp netmontools netcmak netcps wins dns dhcpserver simptcp ias netcis macprint macsrv lpdsvc reminst pop3service pop3admin display ntcomponents WMPOCM k scw computeserver netrqs storageserver
注意事项: Windows 系统在安装过程中会默认查找服务器最初安装该系统时所使用的媒体源。如果从 CD 启动,安装程序会提示用户插入 Windows 安装光盘。若希望运行无人值守安装并使用存储在本地或网络共享中的安装介质,必须修改注册表中的以下子项以指定正确的源路径: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup 需要更改 ServicePackSourcePath 和 SourcePath 两个子项的值,将其指向合适的网络共享或本地路径。确保该路径下包含 i386 文件夹。
以下是一个完整的 IIS 安装批处理文件 IISSetup.bat 的执行流程: 第一步:更改 Windows 安装文件的位置指向 第二步:生成无人值守安装所需的选项配置文件 第三步:调用安装程序开始执行安装任务
echo "更改windows安装文件的路径"
echo Windows Registry Editor Version 5.00 > c:\setupreg.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup] >> c:\setupreg.reg
echo "ServicePackSourcePath"="D:\\Win2003\\" >> c:\Win2003setupPath.reg
echo "SourcePath"="D:\\Win2003\\" >> c:\Win2003setupPath.reg
regedit /S c:\Win2003setupPath.reg
del c:\Win2003setupPath.reg
echo "生成IIS无人值守安装选项文件"
echo [Components] > c:\iis.txt
echo iis_common = ON >> c:\iis.txt
echo iis_www = ON >> c:\iis.txt
echo iis_asp = ON >> c:\iis.txt
echo iis_inetmgr = ON >> c:\iis.txt
echo aspnet= ON >> c:\iis.txt
Sysocmgr.exe /i:sysoc.inf /u:c:\iis.txt
del c:\iis.txt
echo IIS安装完毕
pause
至此,关于无人值守安装 IIS 6.0 的原理分析已介绍完毕。如需了解更多 IIS 相关内容,请搜索本站历史文章或继续阅读后续系列文章。感谢大家的支持!