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 .old 目錄。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\setupact.log 中的記錄檔 \ 。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 模式總覽Audit Mode Overview

Windows 安裝程式設定階段Windows Setup Configuration Passes

Windows 安裝程式支援的平台和跨平台部署Windows Setup Supported Platforms and Cross-Platform Deployments