转换包含服务的安装程序Convert an installer that includes services

Windows 10 版本2004引入了对运行包含服务的 .MSIX 包的支持。Windows 10, version 2004, introduces support for running an MSIX package that includes services. 可以使用 .MSIX 打包工具获取现有的服务安装程序,并将其转换为 .MSIX。You can use the MSIX Packaging Tool to take an existing installer with services and convert it to MSIX. 此支持由2020年1月版 .Msix 打包工具 (1.2019.1220.0) 提供。This support is as of the January 2020 release of the MSIX Packaging Tool(1.2019.1220.0). 将打包的 .MSIX 与服务一起使用后,将需要管理员权限才能在计算机上安装。Once you have a packaged MSIX with a service, it will require admin privileges to install on a machine.

InstructionsInstructions

若要转换包含服务的安装程序,请使用 .MSIX 打包工具,就像使用任何 应用程序包一样。To convert an installer that includes services, use the MSIX Packaging Tool as you would with any application package. 选择包含服务的安装程序,您将在创建 .MSIX 包的最后一步之前看到 " 服务 报表" 页。Select an installer that has services, and you will see the Services report page before the final step to create your MSIX package.

" 服务 报表" 页将列出在转换过程中检测到的服务。The Services report page lists services that were detected in your installer during conversion. 的表中将显示具有所需的所有信息并支持的服务。Services that have all the information they need and are supported will be shown in the Included table. 排除的表中将显示需要其他信息、需要修复或不受支持的服务。Services that need additional information, need a fix, or aren’t supported will be shown in the Excluded table.

若要修复服务或查看有关服务的其他数据,请双击表中的服务条目以查看弹出窗口,其中包含有关服务的详细信息。To fix a service or see additional data about the service, double-click the service entry in the table to view a pop-up with more information about the service. 如果需要,可以编辑此信息。You can edit some of this information if you need to.

  • 项名称: 服务的名称。Key name: The name of the service. 这是不可编辑的。This is not editable.
  • 说明: 服务项的说明。Description: The description of the service entry.
  • 显示名称: 服务的显示名称。Display name: The display name of the service.
  • 映像路径: 服务可执行文件的位置。Image path: Location of the service executable. 这是不可编辑的。This is not editable.
  • 启动帐户: 服务的启动帐户。Start account: The start account for the service.
  • 启动类型: 服务的启动类型。Startup type: Type of startup for the service. 支持 自动手动禁用Supports Automatic, Manual, and Disabled.
  • 参数: 要在服务启动时运行的参数。Arguments: Arguments to be run when the service starts.
  • 依赖项: 服务的依赖关系。Dependencies: Dependencies for the service.

修复了某个服务后,可以将其移动到 包含 的表中,或者,如果不希望在最终包中使用它,也可以选择将它保留在 排除 的表中。After a service has been fixed, you can move it to the Included table or you can choose to leave it in the Excluded table if you don’t want it in your final package. 然后,可以继续执行最后一个步骤来创建 .MSIX 包。Then, you can continue to the final step to create your MSIX package.

已知的限制Known limitations

服务可执行文件路径 (也称为图像路径) 当前不可编辑。The services executable path (also called the image path) is currently not editable. 若要解决与路径有关的任何问题,必须在转换安装程序之前手动编辑服务可执行文件路径。To fix any issues with your path, you must manually edit your service executable path before converting your installer. 或者,在转换后,可以使用 .MSIX 打包工具中的 包编辑器 手动编辑清单。Alternatively, after conversion you can edit the manifest manually using the Package Editor in the MSIX Packaging Tool.

服务报表当前在 包编辑器中不可用。The Services report is currently not available in the Package Editor. 你必须手动编辑清单以更改 .MSIX 包中包含的服务。You must manually edit the manifest to make changes to the services included in your MSIX package.

目前,我们不支持在包外具有依赖关系的服务。We currently do not support services with dependencies outside the package.

使用清单手动添加服务Add a service manually using your manifest

如果手动将服务添加到应用程序,则需要 将服务添加 到应用程序清单。If you are manually adding a service to your application, you will need to add a service to your app manifest. 这需要将 受限功能 添加到应用程序。This does require a restricted capability to add to your application.