使用预配包自定义 Windows 10“开始”菜单和任务栏Customize Windows 10 Start and taskbar with provisioning packages

适用范围Applies to

  • Windows 10Windows 10

查找使用者信息?Looking for consumer information? 自定义“开始”菜单Customize the Start menu

在 Windows 10 专业版、Windows 10 企业版和 Windows 10 教育版版本 1703 中,可使用通过 Windows 配置设计器创建的预配包为用户部署自定义“开始”菜单和任务栏布局。In Windows 10 Pro, Windows 10 Enterprise, and Windows 10 Education, version 1703, you can use a provisioning package that you create with Windows Configuration Designer to deploy a customized Start and taskbar layout to users. 只需覆盖包含“开始”菜单和任务栏布局的 .xml 文件即可更新该布局,无需重置映像。No reimaging is required, and the Start and taskbar layout can be updated simply by overwriting the .xml file that contains the layout. 预配包可以应用于运行设备。The provisioning package can be applied to a running device. 这使你可以花费最少的管理开销来为不同部门或组织自定义“开始”菜单和任务栏布局。This enables you to customize Start and taskbar layouts for different departments or organizations, with minimal management overhead.

重要

如果使用预配包配置任务栏,则在每次重启 explorer.exe 进程时都会重新应用该配置。If you use a provisioning package to configure the taskbar, your configuration will be reapplied each time the explorer.exe process restarts. 如果配置固定了某个应用,而用户取消固定该应用,则用户更改将在下次应用配置时覆盖。If your configuration pins an app and the user unpins that app, the user's change will be overwritten the next time the configuration is applied. 若要应用任务栏配置,并允许用户做出可以保留的更改,请使用组策略以应用你的配置。To apply a taskbar configuration and allow users to make changes that will persist, apply your configuration by using Group Policy.

开始之前:请自定义并导出“开始”菜单布局(针对桌面版)。Before you begin: Customize and export Start layout for desktop editions.

“开始”菜单布局控件的工作原理How Start layout control works

三种功能支持“开始”菜单和任务栏布局控件:Three features enable Start and taskbar layout control:

  • Windows PowerShell 中的 Export-StartLayout cmdlet 采用 .xml 文件格式导出当前“开始”菜单布局的说明。The Export-StartLayout cmdlet in Windows PowerShell exports a description of the current Start layout in .xml file format.

    备注

    若要将“开始”菜单布局导入已装载的 Windows 映像,请使用 Import-StartLayout cmdlet。To import the layout of Start to a mounted Windows image, use the Import-StartLayout cmdlet.

  • 可以修改“开始”菜单 .xml 文件,以将 <CustomTaskbarLayoutCollection> 包括在内,或者仅为任务栏配置创建 .xml 文件。You can modify the Start .xml file to include <CustomTaskbarLayoutCollection> or create an .xml file just for the taskbar configuration.

  • 在 Windows 配置设计器中,你可以使用策略/开始/StartLayout 设置提供 .xml 文件的内容,该文件定义“开始”菜单和任务栏布局。In Windows Configuration Designer, you use the Policies/Start/StartLayout setting to provide the contents of the .xml file that defines the Start and taskbar layout.

准备“开始”菜单布局 XML 文件Prepare the Start layout XML file

Export-StartLayout cmdlet 生成 XML 文件。The Export-StartLayout cmdlet produces an XML file. 由于 Windows 配置设计器可生成包含配置设置的 customizations.xml 文件,因此,将“开始”菜单布局部分直接添加到 customizations.xml 文件,可能会导致 XML 文件嵌入 XML 文件。Because Windows Configuration Designer produces a customizations.xml file that contains the configuration settings, adding the Start layout section to the customizations.xml file directly would result in an XML file embedded in an XML file. 将“开始”菜单布局部分添加到 customizations.xml 文件之前,你必须将 layout.xml 中的标记字符替换为转义字符。Before you add the Start layout section to the customizations.xml file, you must replace the markup characters in your layout.xml with escape characters.

  1. 将 Layout.xml 的内容复制到用于转义字符的在线工具中。Copy the contents of layout.xml into an online tool that escapes characters.

  2. 在创建预配包的过程中,你将复制包含转义字符的文本,并将其粘贴在项目的 customizations.xml 文件中。During the procedure to create a provisioning package, you will copy the text with the escape characters and paste it in the customizations.xml file for your project.

创建包含自定义的“开始”屏幕布局的预配包Create a provisioning package that contains a customized Start layout

使用 Windows 配置设计器工具创建预配包。Use the Windows Configuration Designer tool to create a provisioning package. 了解如何安装 Windows 配置设计器。Learn how to install Windows Configuration Designer.

重要

生成预配包时,可能会在项目文件和预配包 (.ppkg) 文件中包含敏感信息。When you build a provisioning package, you may include sensitive information in the project files and in the provisioning package (.ppkg) file. 尽管你可以选择加密 .ppkg 文件,但项目文件不会加密。Although you have the option to encrypt the .ppkg file, project files are not encrypted. 应将项目文件存储在安全位置,并在不再需要它们时删除项目文件。You should store the project files in a secure location and delete the project files when they are no longer needed.

  1. 打开 Windows 配置设计器(默认情况下为 %systemdrive%\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Imaging and Configuration Designer\x86\ICD.exe)。Open Windows Configuration Designer (by default, %systemdrive%\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Imaging and Configuration Designer\x86\ICD.exe).

  2. 选择高级预配Choose Advanced provisioning.

  3. 为项目命名,然后单击下一步Name your project, and click Next.

  4. 选择所有 Windows 桌面版,然后单击下一步Choose All Windows desktop editions and click Next.

  5. 新建项目上,单击完成On New project, click Finish. 此时将打开你的程序包的工作区。The workspace for your package opens.

  6. 展开运行时设置 > 策略 > 开始,然后单击 StartLayoutExpand Runtime settings > Policies > Start, and click StartLayout.

    提示

    如果开始未列出,请检查你在第 4 步中选择的设置类型。If Start is not listed, check the type of settings you selected in step 4. 你必须使用所有 Windows 桌面版的设置创建项目。You must create the project using settings for All Windows desktop editions.

  7. 输入 layout.xmlEnter layout.xml. 此值会在 customizations.xml 文件中创建占位符,你将使用该占位符替换后面步骤中的 layout.xml 文件内容。This value creates a placeholder in the customizations.xml file that you will replace with the contents of the layout.xml file in a later step.

  8. 保存项目并关闭 Windows 配置设计器。Save your project and close Windows Configuration Designer.

  9. 在文件资源管理器中,打开项目的目录。In File Explorer, open the project's directory. (默认位置是 C:\Users\user name\Documents\Windows Imaging and Configuration Designer (WICD)\project name(The default location is C:\Users\user name\Documents\Windows Imaging and Configuration Designer (WICD)\project name)

  10. 在文本编辑器中打开 customizations.xml 文件。Open the customizations.xml file in a text editor. <自定义项> 部分如下所示:The <Customizations> section will look like this:

    包含要替换突出显示内容的占位符文本的自定义项文件

  11. 标记字符替换为转义字符的情况下,将 layout.xml 替换为 layout.xml 文件中的文本。Replace layout.xml with the text from the layout.xml file, with markup characters replaced with escape characters.

  12. 保存并关闭 customizations.xml 文件。Save and close the customizations.xml file.

  13. 打开 Windows 配置设计器,并打开你的项目。Open Windows Configuration Designer and open your project.

  14. 文件菜单上,选择保存On the File menu, select Save.

  15. 在“导出”**** 菜单上,选择“设置包”****。On the Export menu, select Provisioning package.

  16. 所有者更改为 IT 管理员,这会将此预配包的优先级设置为高于应用于来自其他源的设备的预配包,然后选择下一步Change Owner to IT Admin, which will set the precedence of this provisioning package higher than provisioning packages applied to this device from other sources, and then select Next.

  17. 可选。Optional. 设置程序包安全性窗口中,你可以选择对程序包进行加密并启用程序包签名。In the Provisioning package security window, you can choose to encrypt the package and enable package signing.

    • 启用程序包加密 - 如果你选择此选项,将在屏幕上显示自动生成的密码。Enable package encryption - If you select this option, an auto-generated password will be shown on the screen.

    • 启用程序包签名 - 如果你选择此选项,则必须选择一个有效的证书,用于对程序包进行签名。Enable package signing - If you select this option, you must select a valid certificate to use for signing the package. 你可以通过单击 浏览 并选择要用于对程序包进行签名的证书指定相关证书。You can specify the certificate by clicking Browse and choosing the certificate you want to use to sign the package.

  18. 单击下一步指定你希望预配包在生成后所处的输出位置。Click Next to specify the output location where you want the provisioning package to go when it's built. 默认情况下,Windows 映像和配置设计器 (ICD) 使用项目文件夹作为输出位置。By default, Windows Imaging and Configuration Designer (ICD) uses the project folder as the output location.

    或者,你还可以单击浏览更改默认输出位置。Optionally, you can click Browse to change the default output location.

  19. 单击“下一步”****。Click Next.

  20. 单击构建开始构建程序包。Click Build to start building the package. 无需花费太长时间即可构建设置包。The provisioning package doesn't take long to build. 项目信息会显示在构建页面中,并且进度栏会指示构建状态。The project information is displayed in the build page and the progress bar indicates the build status.

    如果你需要取消构建,请单击“取消” ****。If you need to cancel the build, click Cancel. 这将取消当前的构建过程、关闭向导,并使你返回到“自定义页面” ****。This cancels the current build process, closes the wizard, and takes you back to the Customizations Page.

  21. 如果构建失败,则显示一条包含项目文件夹链接的错误消息。If your build fails, an error message will show up that includes a link to the project folder. 你可以扫描日志以确定导致错误的原因。You can scan the logs to determine what caused the error. 解决问题后,请尝试重新构建程序包。Once you fix the issue, try building the package again.

    如果构建成功,将显示设置包的名称、输出目录和项目目录。If your build is successful, the name of the provisioning package, output directory, and project directory will be shown.

    • 如果要进行选择,你可以重新构建设置包并选择不同的输出程序包路径。If you choose, you can build the provisioning package again and pick a different path for the output package. 若要执行此操作,请单击“返回”**** 更改输出程序包名称和路径,然后单击“下一步”**** 启动另一次构建。To do this, click Back to change the output package name and path, and then click Next to start another build.
    • 如果你已完成,请单击完成关闭向导,并返回到自定义页面If you are done, click Finish to close the wizard and go back to the Customizations Page.
  22. 将预配包复制到目标设备。Copy the provisioning package to the target device.

  23. 双击 ppkg 文件并允许安装。Double-click the ppkg file and allow it to install.