使用应用预配电脑Provision PCs with apps

适用于Applies to

  • Windows 10Windows10

在 Windows 10 版本 1703 中,你可以在设置的程序包中安装多个通用 Windows 平台 (UWP) 应用 (Windows) 桌面应用程序和 Windows 桌面应用程序。In Windows 10, version 1703, you can install multiple Universal Windows Platform (UWP) apps and Windows desktop applications (Win32) in a provisioning package. 本主题介绍了 Windows 配置设计器中用于安装应用的各种设置。This topic explains the various settings in Windows Configuration Designer for app install.

在 Windows 配置设计器向导中添加应用时,系统会根据你选择的应用显示相应设置。When you add an app in a Windows Configuration Designer wizard, the appropriate settings are displayed based on the app that you select. 有关使用 Windows 配置设计器中的高级编辑器添加应用的说明,请参阅使用高级编辑器添加应用For instructions on adding an app using the advanced editor in Windows Configuration Designer, see Add an app using advanced editor.

重要

如果计划使用 Intune 管理你的设备,我们建议使用 Intune 安装适用于企业版 2016 应用 (Access、Excel、OneDrive for Business、OneNote、Outlook、PowerPoint、Publisher、Skype for Business、Word、Project Desktop Client 和 Visio Pro for Microsoft 365 企业) 版应用。If you plan to use Intune to manage your devices, we recommend using Intune to install Microsoft 365 Apps for enterprise 2016 apps (Access, Excel, OneDrive for Business, OneNote, Outlook, PowerPoint, Publisher, Skype for Business, Word, Project Desktop Client, and Visio Pro for Microsoft 365 Apps for enterprise). 使用预配包安装的应用不能使用 Intune 管理或修改。Apps that are installed using a provisioning package cannot be managed or modified using Intune. 了解如何使用 Microsoft Intune 分配 Microsoft 365 企业版应用。Learn how to assign Microsoft 365 Apps for enterprise 2016 apps using Microsoft Intune.

UWP 应用的设置Settings for UWP apps

  • 许可证路径:指定许可文件(如果应用来自 Microsoft Store)。License Path: Specify the license file if it is an app from the Microsoft Store. 如果你拥有该应用的证书,那么这是可选项。This is optional if you have a certificate for the app.

  • 包系列名称:如果你未指定许可证,则指定包系列名称。Package family name: Specify the package family name if you don’t specify a license. 在指定许可证后,将会自动填充此字段。This field will be auto-populated after you specify a license.

  • 必需的 appx 依赖关系:指定安装应用所需的 appx 依赖关系包Required appx dependencies: Specify the appx dependency packages that are required for the installation of the app

Windows 桌面应用程序的设置Settings for Windows desktop applications

MSI 安装程序MSI installer

备注

可在此处找到有关于脱机选项 Msiexec.exe 的详细信息You can find more information about command-line options for Msiexec.exe here.

  • 命令行参数:(可选)附加其他命令参数。Command line arguments: Optionally, append additional command arguments. 为你附加无提示标志。The silent flag is appended for you. 示例:PROPERTY=VALUEExample: PROPERTY=VALUE

  • 失败后继续安装:(可选)指定你是否要继续安装其他应用(如果此应用无法安装)Continue installations after failure: Optionally, specify if you want to continue installing additional apps if this app fails to install

  • 需要重新启动:(可选)指定你是否要在成功安装此应用后进行重启Restart required: Optionally, specify if you want to initiate a reboot after a successful install of this app

  • 必需的 win32 应用依赖关系:(可选)指定安装应用所需的其他文件。Required win32 app dependencies: Optionally, specify additional files that are required for the installation of the app. 对于具有多个文件依赖关系或目录结构的安装程序,请创建资源的 cab 文件For installers that have multiple file dependencies or have directory structures, create a cab file of the assets. 安装脚本应包括 .cab 文件的扩展The installation script should include expansion of the .cab file.

可执行文件或其他安装程序Exe or other installer

  • 命令行参数:在命令行参数后附加无提示标志(必需)。Command line arguments: Append the command line arguments with a silent flag (required). (可选)附加其他标志Optionally, append additional flags

  • 返回代码:指定成功及成功并重启的返回代码(默认情况下分别为 0 和 3010)。任何未列出的返回代码将解释为失败。Return Codes: Specify the return codes for success and success with restart (0 and 3010 by default respectively) Any return code that is not listed will be interpreted as failure. 文本框用空格分隔。The text boxes are space delimited.

  • 失败后继续安装:(可选)指定你是否要继续安装其他应用(如果此应用无法安装)Continue installations after failure: Optionally, specify if you want to continue installing additional apps if this app fails to install

  • 需要重新启动:(可选)指定你是否要在成功安装此应用后进行重启Restart required: Optionally, specify if you want to initiate a reboot after a successful install of this app

  • 必需的 win32 应用依赖关系:(可选)指定安装应用所需的其他文件。Required win32 app dependencies: Optionally, specify additional files that are required for the installation of the app. 对于具有多个文件依赖关系或目录结构的安装程序,请创建资源的 cab 文件For installers that have multiple file dependencies or have directory structures, create a cab file of the assets. 安装脚本应包括 .cab 文件的扩展The installation script should include expansion of the .cab file.

在 Windows 配置设计器中使用高级编辑器添加 Windows 桌面应用程序Add a Windows desktop application using advanced editor in Windows Configuration Designer

  1. 可用自定义项窗格中,依次转到运行时设置 > ProvisioningCommands > PrimaryContext > CommandIn the Available customizations pane, go to Runtime settings > ProvisioningCommands > PrimaryContext > Command.

  2. 输入第一个应用的名称,然后单击添加Enter a name for the first app, and then click Add.

    输入第一个应用的名称

  3. 针对相应的安装程序类型配置设置。Configure the settings for the appropriate installer type.

    输入第一个应用的设置

将通用应用添加到程序包Add a universal app to your package

可在预配包中分发的通用应用可以是你的组织开发的业务线 (LOB) 应用、通过脱机许可获取的适用于企业的 Microsoft Store 应用或第三方应用。Universal apps that you can distribute in the provisioning package can be line-of-business (LOB) apps developed by your organization, Microsoft Store for Business apps that you acquire with offline licensing, or third-party apps. 此过程将假设你要从适用于企业的 Microsoft Store 分发应用。This procedure will assume you are distributing apps from the Microsoft Store for Business. 对于其他应用,请从应用开发人员处获取必要的信息(如程序包系列名称)。For other apps, obtain the necessary information (such as the package family name) from the app developer.

  1. 可用自定义窗格中,依次转到运行时设置 > UniversalAppInstallIn the Available customizations pane, go to Runtime settings > UniversalAppInstall.

  2. 对于 DeviceContextApp,为应用指定 PackageFamilyNameFor DeviceContextApp, specify the PackageFamilyName for the app. 在适用于企业的 Microsoft Store 中,程序包系列名称在下载页面的程序包详细信息部分中列出。In Microsoft Store for Business, the package family name is listed in the Package details section of the download page.

    脱机应用包的详细信息

  3. 对于 ApplicationFile,单击浏览以查找并选择目标应用(*.appx 或 *.appxbundle)。For ApplicationFile, click Browse to find and select the target app (either an *.appx or *.appxbundle).

  4. 对于 DependencyAppxFiles,单击浏览以为应用查找并添加任何依赖项。For DependencyAppxFiles, click Browse to find and add any dependencies for the app. 在适用于企业的 Microsoft Store 中,应用的任何依赖项都在下载页面的所需框架部分中列出。In Microsoft Store for Business, any dependencies for the app are listed in the Required frameworks section of the download page.

    脱机应用包的所需框架

  5. 对于 DeviceContextAppLicense,输入 LicenseProductIDFor DeviceContextAppLicense, enter the LicenseProductID.

    • 在适用于企业的 Microsoft Store 的应用下载页面中,为该应用生成未编码的许可证。In Microsoft Store for Business, generate the unencoded license for the app on the app's download page.

      为脱机应用生成许可证

    • 打开许可证文件并搜索 LicenseID= 以获取 GUID,在 LicenseProductID 字段中输入 GUID 并单击添加Open the license file and search for LicenseID= to get the GUID, enter the GUID in the LicenseProductID field and click Add.

  6. 可用自定义窗格中,单击刚刚添加的 LicenseProductIdIn the Available customizations pane, click the LicenseProductId that you just added.

  7. 对于 LicenseInstall,请单击浏览,导航到重命名为 <file name>.ms-windows-store-license 的许可证文件,然后选择此许可证文件。For LicenseInstall, click Browse, navigate to the license file that you renamed <file name>.ms-windows-store-license, and select the license file.

了解有关从适用于企业的 Microsoft Store 分配脱机应用的详细信息。Learn more about distributing offline apps from the Microsoft Store for Business.

备注

删除预配包时,不会删除设备上下文在该预配包中安装的任何应用。Removing a provisioning package will not remove any apps installed by device context in that provisioning package.

将证书添加到程序包Add a certificate to your package

  1. 可用自定义窗格中,转到运行时设置 > 证书 > ClientCertificatesIn the Available customizations pane, go to Runtime settings > Certificates > ClientCertificates.

  2. 输入 CertificateName,然后单击添加Enter a CertificateName and then click Add.

  3. 输入 CertificatePasswordEnter the CertificatePassword.

  4. 对于 CertificatePath,浏览并选择要使用的证书。For CertificatePath, browse and select the certificate to be used.

  5. ExportCertificate 设置为 FalseSet ExportCertificate to False.

  6. 对于 KeyLocation,选择仅软件For KeyLocation, select Software only.

将其他设置添加到程序包Add other settings to your package

有关你可以在预配包中自定义的设置的详细信息,请参阅 Windows 预配设置参考For details about the settings you can customize in provisioning packages, see Windows Provisioning settings reference.

生成程序包Build your package

  1. 完成预配包的配置后,在文件菜单上单击保存When you are done configuring the provisioning package, on the File menu, click Save.

  2. 阅读项目文件可能包含敏感信息的警告,然后单击确定Read the warning that project files may contain sensitive information, and click OK.

    重要提示 生成预配包时,可能会在项目文件中和预配包 (.ppkg) 文件中包含敏感信息。Important 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.

  3. 导出菜单中,单击预配包On the Export menu, click Provisioning package.

  4. 所有者更改为 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.

  5. 程序包版本设置一个值。Set a value for Package Version.

    提示

    你可以对现有的程序包进行更改,并更改版本号以更新之前应用的程序包。You can make changes to existing packages and change the version number to update previously applied packages.

  6. 可选。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 Select... and choosing the certificate you want to use to sign the package.

      重要提示Important
      建议将受信任的预配证书包含在预配包中。We recommend that you include a trusted provisioning certificate in your provisioning package. 当程序包应用于设备时,该证书将添加到系统存储,然后便可以静默方式应用通过该证书签名的任意程序包。When the package is applied to a device, the certificate is added to the system store and any package signed with that certificate thereafter can be applied silently.

  7. 单击下一步,指定在生成预配包后想要放置的输出位置。Click Next to specify the output location where you want the provisioning package to go once it's built. 默认情况下,Windows ICD 会使用项目文件夹作为输出位置。By default, Windows ICD uses the project folder as the output location.

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

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

  9. 单击构建开始构建程序包。Click Build to start building the package. 项目信息会显示在构建页面中,并且进度栏会指示构建状态。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.

  10. 如果构建失败,则显示一条包含项目文件夹链接的错误消息。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.

  11. 选择“输出位置”**** 链接以转到该程序包所在的位置。Select the output location link to go to the location of the package. 你可以通过以下方法之一将该 .ppkg 提供给其他用户:You can provide that .ppkg to others through any of the following methods:

    • 共享的网络文件夹Shared network folder

    • SharePoint 站点SharePoint site

    • 可移动媒体 (USB/SD)Removable media (USB/SD)

    • 电子邮件Email

    • USB Tether(仅限移动版)USB tether (mobile only)

    • NFC(仅限移动版)NFC (mobile only)

下一步如何应用预配包Next step: How to apply a provisioning package

了解详细信息Learn more

相关主题Related topics