Windows 安装程序方案和最佳实践Windows Setup Scenarios and Best Practices

Windows 安装程序安装 Windows 操作系统。Windows Setup installs the Windows operating system. Windows 安装程序使用称为基于映像的安装的技术 (IBS) ,它提供了一个统一的过程,所有客户都可在其中安装 Windows。Windows Setup uses a technology called Image-based Setup (IBS) that provides a single, unified process with which all customers can install Windows. IBS 执行 Windows 的干净安装和升级,并在客户端和服务器安装中使用。IBS performs clean installations and upgrades of Windows and is used in both client and server installations. 还可以通过使用 "安装应答文件设置" 在安装过程中自定义 Windows Windows 安装程序。Windows Setup also enables you to customize Windows during installation by using Setup answer file settings.

本主题内容:In this topic:

常见使用方案Common Usage Scenarios

常见安装方案包括执行清理安装、升级和无人参与安装。Common installation scenarios include performing clean installations, upgrades, and unattended installations.

自定义安装Custom Installations

Windows 安装程序的最常见方案是执行自定义安装。The most common scenario for Windows Setup is performing a custom installation. 在此方案中,你将 Windows 安装到没有操作系统的计算机上,或者安装了以前版本的 Windows。In this scenario, you install Windows onto a computer that does not have an operating system, or has a previous version of Windows. 此方案包含以下阶段:This scenario consists of the following stages:

  1. 从 Windows 产品 DVD 或网络共享运行 Setup.exe。Run Setup.exe from your Windows product DVD or network share.

  2. 选择 " 自定义 安装类型"。Select the Custom installation type.

  3. 如果要从 Windows 的以前安装进行安装,Windows 安装程序会创建一个本地启动目录,并将所有必需的 Windows 安装程序文件复制到此目录中。If you are installing from a previous installation of Windows, Windows Setup creates a local boot directory and copies all of the required Windows Setup files to this directory.

  4. Windows 安装程序重新启动、安装和配置 Windows 组件,并且在安装完成后,启动 "欢迎使用 Windows"。Windows Setup reboots, installs and configures Windows components, and, after installation is complete, launches Windows Welcome.

自定义安装不会从以前安装的 Windows 版本中迁移任何设置或首选项。Custom installations do not migrate any settings or preferences from previously installed versions of Windows. 以前的 Windows 版本中的文件将复制到 \ Windows 旧目录。Files from previous Windows versions are copied to a \Windows.old directory. Windows 安装中的所有数据,包括用户、程序文件和 Windows 目录均保存到此目录中。All data from the Windows installation including the Users, Program Files, and Windows directories are saved to this directory.

更新Upgrades

Windows 安装程序还可以从受支持的操作系统执行升级。Windows Setup can also perform upgrades from a supported operating system.

此方案包括以下阶段:This scenario includes the following stages:

  1. 在先前版本的 Windows 上运行 Setup.exe。Run Setup.exe on the previous version of Windows.

  2. 选择 " 升级 " 安装类型。Select the Upgrade installation type. Windows 安装程序升级该系统并在安装过程中保护您的文件、设置和首选项。Windows Setup upgrades the system and protects your files, settings, and preferences during the installation process.

  3. Windows 安装程序重新启动并还原受保护的文件、设置和首选项。Windows Setup reboots and restores your protected files, settings, and preferences. 然后,Windows 安装程序启动“欢迎使用 Windows”。Windows Setup then launches Windows Welcome.

备注Notes

  • 升级用于将单台计算机升级到 Windows 10。Upgrades are used to upgrade a single computer to Windows 10.
  • 升级支持将用户数据迁移到新系统。Upgrades support migrating user data to a new system.
  • 升级支持 Windows 映像的以下自定义。Upgrades support the following customizations of the Windows image. 这并不是 Windows 安装程序支持策略的更改,而是说明:This is not a change in Windows Setup support policy but instead a clarification:
    • 应用累积 (质量) 更新Applying a cumulative (quality) update
    • 将更新应用于完成功能更新所需的服务堆栈 (参阅 维护堆栈更新 以了解详细信息) Applying updates to the servicing stack necessary to complete the feature update (see Servicing stack updates for more information)
    • 将更新应用到安装程序用于功能更新的 Setup.exe 二进制文件或其他文件Applying updates to Setup.exe binaries or other files that Setup uses for feature updates
    • 将用于 Windows 恢复环境的 "安全操作系统" (SafeOS) 的更新Appling updates for the "safe operating system" (SafeOS) that is used for the Windows recovery environment
    • 添加或删除语言Adding or removing languages
    • 按需添加或删除功能Adding or removing Features on Demand

为清楚起见,Windows 安装程序不支持升级到已通过添加/删除/更改应用程序、设置或驱动程序自定义的 Windows 映像。For clarity, Windows Setup does not support upgrades to a Windows image that has been customized by adding / removing / changing applications, settings nor drivers.

自动安装Automated Installations

利用自动安装,你可以自定义 Windows 安装并不再需要用户与 Windows 安装程序进行交互。Automated installations enable you to customize a Windows installation and remove the need for a user to interact with Windows Setup. 通过使用 Windows 系统映像管理器 (Windows SIM) 或组件平台接口 (CPI) Api,你可以创建一个或多个自定义 Windows 安装,然后将其部署到许多不同的硬件配置。By using Windows System Image Manager (Windows SIM) or the Component Platform Interface (CPI) APIs, you can create one or more customized Windows installations that can then be deployed across many different hardware configurations.

自动安装(也称为无人参与安装)方案包括以下阶段:The automated installation, also called an unattended installation, scenario includes the following stages:

  1. 使用 Windows SIM 或 CPI Api 创建无人参与的安装答案文件,通常称为 Unattend.xml。Use Windows SIM or the CPI APIs to create an unattended installation answer file, typically called Unattend.xml. 此应答文件包含你在 Windows 映像中配置的所有设置。This answer file contains all of the settings that you configure in the Windows image. 有关详细信息,请参阅 Windows 系统映像管理器操作指南主题。For more information, see Windows System Image Manager How-to Topics.

  2. 在 Windows PE、以前版本的 Windows 或其他预安装环境中,使用应答文件的显式路径运行 Setup.exe。From Windows PE, a previous version of Windows, or another preinstallation environment, run Setup.exe with the explicit path to the answer file. 如果不包含答案文件的路径,则 Setup.exe 会在几个特定位置搜索有效的答案文件。If you do not include the path to the answer file, Setup.exe searches for a valid answer file in several specific locations. 有关详细信息,请参阅 Windows 安装程序命令行选项For more information, see Windows Setup Command-Line Options.

  3. 然后 Windows 安装程序安装操作系统,并配置答案文件中列出的所有设置。Windows Setup then installs the operating system and configures all settings listed in the answer file. 还可以在 Windows 安装程序过程中安装其他应用程序、设备驱动程序和更新。Additional applications, device drivers, and updates can also be installed during Windows Setup. 操作系统安装完成后,安装程序会启动“欢迎使用 Windows”。After the operating system is installed, Setup launches Windows Welcome.

Windows 安装程序最佳实践 Windows Setup Best Practices

以下部分介绍使用 Windows 安装程序的一些最佳实践。The following section describes some of the best practices to use with Windows Setup.

  • 验证是否有足够的空间用于 Windows 安装程序临时文件。Verify that there is sufficient space for Windows Setup temporary files. 如果从以前版本的 Windows 中运行安装程序,请验证磁盘上是否有足够的空间来临时 Windows 安装程序文件。If you run setup from a previous version of Windows, verify that there is sufficient space on the disk for temporary Windows Setup files. 所需的空间可能有所不同,但最大为 500 mb (MB) 。The space that is required may vary, but it can be up to 500 megabytes (MB).

  • 将先前安装的 Windows 移至 Windows.old 文件夹中。Previous Windows installations are moved to a Windows.old folder. 最佳做法是在升级之前备份数据。As a best practice, you should back up your data before you upgrade. 如果你在以前的 Windows 安装上安装 Windows,则所有以前的 Windows 文件和目录都将移动到 Windows .old 文件夹,包括用户、程序文件和 Windows 目录的内容。If you install Windows over a previous Windows installation, all previous Windows files and directories are moved to a Windows.old folder, including the contents of the Users, Program Files, and Windows directories. Windows 安装完成后,可以访问 Windows.old 文件夹中的数据。You can access your data in the Windows.old folder after Windows Setup completes. 如果其他文件夹不在用户、程序文件或 Windows 目录中,则不会移动这些文件夹。If you have additional folders not in the Users, Program Files, or Windows directories, those folders are not moved. 例如,如果你有一个名为 C:个 \ 驱动程序的文件夹,该文件夹将不会移动到 Windows .old 文件夹中。For example, if you have a folder that is named C:\Drivers, that folder will not be moved to the Windows.old folder.

  • 查看 Windows 安装程序日志文件。Review the Windows Setup log files. 如果在 Windows 安装程序过程中遇到问题,请查看% WINDIR% panther 中的日志文件 \ 。If you experience problems during Windows Setup, review the log files in %WINDIR%\panther. 你将能够通过查看安装日志文件来识别和解决许多问题。You will be able to identify and troubleshoot many issues by reviewing the installation log files. 有关详细信息,请参阅 部署疑难解答和日志文件 以及 Windows 安装程序日志文件和事件日志For more information, see Deployment Troubleshooting and Log Files and Windows Setup Log Files and Event Logs.

Windows 安装程序限制 Windows Setup Limitations

以下部分介绍 Windows 安装程序的一些限制。The following sections describe some of the limitations of Windows Setup. 请在运行 Windows 安装程序之前查看此部分。Review this section before you run Windows Setup.

  • 启用 uefi 兼容模式以安装到基于 UEFI 的计算机Enable UEFI-compatibility mode to install to an UEFI-based computer. 在某些 UEFI 计算机上,无法在 BIOS 兼容模式下安装 Windows。On some UEFI computers, you cannot install Windows in BIOS-compatibility mode. 可能需要切换到 UEFI 兼容性模式。You may need to switch to UEFI-compatibility mode.

  • 应用程序可能需要一致的驱动器号。Applications might require a consistent drive letter. 如果将自定义应用程序安装到 Windows 映像,请将 Windows 安装到目标计算机上的相同驱动器号,因为某些应用程序需要一致的驱动器号。If you install custom applications to your Windows image, install Windows to the same drive letter on the destination computer, because some applications require a consistent drive letter. 如果系统的驱动器号与应用程序中指定的驱动器号不匹配,则卸载方案、提供服务方案和修复方案可能无法正常执行。Uninstallation, servicing, and repair scenarios might not function appropriately if the drive letter of the system does not match the drive letter specified in the application. 此限制适用于部署映像服务和管理 (DISM) 工具和 Windows 安装程序。This limitation applies to both the Deployment Image Servicing and Management (DISM) tool and Windows Setup.

  • 将多个映像部署到多个分区。Deploying multiple images to multiple partitions. 如果在多个分区上捕获和部署多个映像,则必须满足以下要求:If you capture and deploy multiple images on multiple partitions, the following requirements must be fulfilled:

    • 参考计算机和目标计算机上的分区结构、总线位置和磁盘数量必须相同。The partition structure, bus location, and number of disks must be identical on the reference and destination computers.

    • 分区类型(主要、扩展或逻辑)必须匹配。The partition types (primary, extended, or logical) must match. 引用计算机上的活动分区必须与目标计算机的活动分区相匹配。The active partition on the reference computer must match that of the destination computer.

  • 安装自定义 .wim 文件需要 .wim 文件中的一个描述值。Installing Custom .wim files requires a description value in the .wim file. 创建自定义 .wim 文件时,Windows 安装程序要求始终包含说明值。When you create a custom .wim file, Windows Setup requires that you always include a description value. 如果 .wim 文件不包含描述值,则可能无法正确安装映像。If a .wim file does not include a description value, the image may not install correctly. dism 命令与 /capture-image 选项一起使用时,可以提供说明值。You can provide a description value when you use the dism command with the /capture-image option. 如果安装的 .wim 文件没有说明值,请重新捕获该映像,并提供有效的描述值。If you install a .wim file that does not have a description value, recapture the image and provide a valid description value. 有关详细信息,请参阅 适用于 Windows 的 DISM 部署映像服务和管理技术参考For more information, see the DISM - Deployment Image Servicing and Management Technical Reference for Windows.

注意Note
对于 Windows 预安装环境 (Windows PE) ,启动文件的版本必须与计算机体系结构匹配。For Windows Preinstallation Environment (Windows PE), the version of boot files must match the computer architecture. X64 UEFI 计算机仅可使用 Windows PE x64 启动文件启动。An x64 UEFI computer can only boot by using Windows PE x64 boot files. X86 计算机只能使用 Windows PE x86 启动文件启动。An x86 computer can only boot by using Windows PE x86 boot files. 这不同于旧的 BIOS。This is different from legacy BIOS. 在旧的 BIOS 中,x64 计算机可以使用 x86 启动文件启动。In legacy BIOS, an x64 computer can boot by using x86 boot files.

相关主题Related topics

Windows 安装程序安装过程Windows Setup Installation Process

Windows 安装程序自动化概述Windows Setup Automation Overview

审核模式概述Audit Mode Overview

Windows Setup Configuration PassesWindows Setup Configuration Passes

Windows 安装程序支持的平台和跨平台部署Windows Setup Supported Platforms and Cross-Platform Deployments