定制并封装Win7ISO文件(自动应答)


由于Win7系统已经在停止了维护,加上目前能下载到的系统一般是SP1版本,由于版本老旧安装后存在大量补丁需要更新,这就是大大的浪费了时间。

本文记录了通过使用离线和在线的方式来定制Win7的系统文件。

离线方式:

1.通过使用系统自带dism命令的/image选项,指定winodws的wim映像文件离线定制

2.使用第三方工具:MSMG_ToolKit/NTLite/Win7SP1x64UpdatesBatchSolution

在线方式:

1.通过使用系统自带dism命令的/online选项,对运行的系统手动安装补丁文件,然后将系统进行重新封装为WIM文件。

2.使用系统自动更新或者下载对应离线补丁包集合进行补丁更新,然后将系统进行重新封装为WIM文件。

一:离线方式定制Win7X64专业版WIM文件:

1.首先下载SP1版本的Win7原版ISO文件(或在非SP1版系统上打上KB976932的SP1补丁升级到SP1)。

2.下载 KB3020369(April 2015 Servicing Stack Update)和 KB3125574 (April 2016 Convenience Update Rollup)

3.提取Win7SP1的ISO中的install.wim文件。

4.使用以下命令将下载补丁离线打到install.wim文件中。

提取补丁文件中的CAB文件
expand -f:*Windows*.cab C:\files\Window7MediaRefresh\*.msu C:\files\Window7MediaRefresh\CABs

查看install.wim中的windows版本信息
DISM /get-imageinfo /imagefile:c:\test\images\install.wim

挂载install.wim中的win7专业版
Dism /Mount-Image /ImageFile:C:\test\images\install.wim /Name:"Windows 7 专业版" /MountDir:C:\test\offline

离线打补丁
Dism /Image:C:\test\offline /Add-Package /PackagePath:C:\files\Window7MediaRefresh\CABs\Windows6.1-KB3020369-x64.cab

查看已打补丁
Dism /Image:C:\test\offline /Get-Packages

卸载并保存更改到install.wim
Dism /Unmount-Image /MountDir:C:\test\offline /Commit

5.替换新的install.wim文件到Win7SP1的ISO中,现在使用此ISO文件安装系统,在系统中使用"Dism /Online /Get-Packages"或"控制面板-已安装的更新"中查看安装的补丁。

离线方式集成IE11到WIN7安装镜像中:

IE11预支持补丁KB2670838:http://www.microsoft.com/zh-cn/download/details.aspx?id=36805
微软官方IE11离线安装包:http://download.microsoft.com/download/5/6/F/56FD6253-CB53-4E38-94C6-74367DA2AB34/IE11-Windows6.1-x64-zh-cn.exe

1.提取IE11浏览器离线安装包文件:IE11.exe /x:. 

2.提取Windows 7 SP1安装镜像iso中的INSTALL.WIM映像文件

3.查看映像中win7版本信息:
dism /get-wiminfo /wimfile:d:\win7\install.wim

4.挂载映像中win7专业版文件:
dism /mount-wim /wimfile:d:\win7\install.wim /name:"Windows 7 Professional”/mountdir:d:\win7\wim

5.将KB2670838(预支持补丁)更新程序脱机添加到wim中:
dism /image:d:\win7\wim /add-package /packagepath:d:\win7\Windows6.1-KB2670838-x64.msu

6.将IE-Win7.cab和ielangpack-zh-CN.CAB脱机添加到wim中:
dism /image:d:\win7\wim /add-package /packagepath:d:\IE11\IE-Win7.CAB /packagepath:d:\IE11\ielangpack-zh-CN.CAB

7.将IE-Hyphenation-en.MSU(系统环境组件)和IE-Spelling-en.MSU(拼写功能组件)、添加到wim中:
dism /image:d:\win7\wim /add-package /packagepath:d:\IE11\IE-Hyphenation-en.MSU /packagepath:d:\IE11\IE-Spelling-en.MSU

8.卸载并保存更改:
dism /unmount-wim /mountdir:d:\win7\wim /commit

二:在线方式定制Win7X64专业版WIM文件

1.使用原版SP1镜像安装系统。

2.使用系统自带Winodws update升级系统到最新版本。

  如有离线补丁,也可以使用dism命令进行安装:
  dism /online /add-package /packagepath:d:\xxxxx.cab    #进行离线补丁安装
  Dism /Online /Get-Packages    #查看已经安装补丁

3.使用软媒大师Dism++,等软件进行系统优化和个性化设置。

4.可以配置常用软件预先安装到系统内,也可以下载好软件包/驱动包再系统封装后自动进行安装。

5.使用系统总裁封装工具IT天空封装工具进行系统封装,封装完成后关机(下一步完成前不能开机)。

6.使用PE启动系统,进行系统备份,并备份格式为WIM,备份完成的WIM文件就是封装后的系统。

7.替换原版ISO文件中的install.WIM文件为上一步生成的WIM文件,即完成了系统ISO的定制。

三:制作无人值守安装

使用windows AIK 工具生成XML文件,重命名为autounattend.xml,并添加到ISO文件的根目录中。

AIX
AIX2

autounattend.xml 模板

1.启用Administrator用户并设置密码为空。

2.自动将整个磁盘划分为C盘并格式化NTFS格式。

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <servicing></servicing>
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SetupUILanguage>
                <UILanguage>zh-CN</UILanguage>
            </SetupUILanguage>
            <InputLocale>zh-CN</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <UserLocale>zh-CN</UserLocale>
        </component>
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserData>
                <AcceptEula>true</AcceptEula>
                <ProductKey>
                    <Key>HYF8J-CVRMY-CM74G-RPHKF-PW487</Key>
                </ProductKey>
            </UserData>
            <ImageInstall>
                <OSImage>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/image/index</Key>
                            <Value>1</Value>
                        </MetaData>
                    </InstallFrom>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                </OSImage>
            </ImageInstall>
            <DiskConfiguration>
                <Disk wcm:action="add">
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Type>Primary</Type>
                            <Extend>true</Extend>
                        </CreatePartition>
                    </CreatePartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Active>true</Active>
                            <Extend>false</Extend>
                            <Format>NTFS</Format>
                            <Letter>C</Letter>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                        </ModifyPartition>
                    </ModifyPartitions>
                </Disk>
            </DiskConfiguration>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
                            <PlainText>false</PlainText>
                        </Password>
                        <DisplayName>Administartor</DisplayName>
                        <Group>Administrators</Group>
                        <Name>Administrator</Name>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <OOBE>
                <NetworkLocation>Work</NetworkLocation>
                <ProtectYourPC>3</ProtectYourPC>
            </OOBE>
            <TimeZone>China Standard Time</TimeZone>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ComputerName>*</ComputerName>
            <CopyProfile>true</CopyProfile>
        </component>
        <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Path>cmd /c net user Administrator /active:yes</Path>
                    <Description>EnableAdmin</Description>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:d:/beavan/os/windows/windows_7_professional_with_sp1_x64/sources/install.wim#Windows 7 PROFESSIONAL" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

附录A:Win7中不建议安装的更新列表(建议隐藏)

◎ KB971033 : Windows正版验证补丁。
◎ KB4493132 : 升级至 Windows 10 的兼容性更新,弹出生命周期终止(EOL)通知。
◎ KB3021917 : 参与 Windows 客户体验改善计划 (CEIP),将检测结果发送回 Microsoft。
◎ KB3068708 : 参与 Windows 客户体验改善计划 (CEIP),将检测结果发送回 Microsoft。
◎ KB3080149 : 参与 Windows 客户体验改善计划 (CEIP),将检测结果发送回 Microsoft。
◎ KB3150513 : 收集用户的信息,同时和升级到Windows10系统有关。
◎ KB4524752 : Windows 7 SP1 停止支持通知,仅适用于专业版。

附录B:Windows 7 default product keys

◎ Windows 7 Ultimate – D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV
◎ Windows 7 Professional – HYF8J-CVRMY-CM74G-RPHKF-PW487
◎ Windows 7 Home Premium – RHPQ2-RMFJH-74XYM-BH4JX-XM76F
◎ Windows 7 Home Basic – YGFVB-QTFXQ-3H233-PTWTJ-YRYRV
◎ Windows 7 Starter – 7Q28W-FT9PC-CMMYT-WHMY2-89M6G


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM