报错概览

在日志文件setuperr.log中发现以下类似报错😅

2024-03-02 16:05:38, Error                 SYSPRP Package Microsoft.LanguageExperiencePackzh-CN_22621.41.188.0_neutral__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
2024-03-02 16:05:38, Error                 SYSPRP Failed to remove apps for the current user: 0x80073cf2.
2024-03-02 16:05:38, Error                 SYSPRP Exit code of RemoveAllApps thread was 0x3cf2.
2024-03-02 16:05:38, Error                 SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing 'SysprepGeneralizeValidate' from C:\Windows\System32\AppxSysprep.dll; dwRet = 0x3cf2
2024-03-02 16:05:38, Error                 SYSPRP SysprepSession::Validate: Error in validating actions from C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml; dwRet = 0x3cf2
2024-03-02 16:05:38, Error                 SYSPRP RunPlatformActions:Failed while validating Sysprep session actions; dwRet = 0x3cf2
2024-03-02 16:05:38, Error      [0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x3cf2
2024-03-02 16:05:38, Error      [0x0f00d8] SYSPRP WinMain:Hit failure while pre-validate sysprep generalize internal providers; hr = 0x80073cf2

错误分析

通过报错可以发现以下报错内容

SYSPRP Package Microsoft.LanguageExperiencePackzh-CN_22621.41.188.0_neutral__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.

意思是语言包无法正常封装进入系统,因为这个语言仅仅为一个用户安装了
而我们知道通过微软商城或者add-appxpackage命令安装的包都是仅仅为一个人安装了😣

问题解决

通过以下命令可以卸载一个语言包

remove-appxpackage -allusers -package "Microsoft.LanguageExperiencePackzh-CN_22621.41.188.0_neutral__8wekyb3d8bbwe"

然后通过DISM部署来为所有用户安装

DISM /Online /Add-ProvisionedAppxPackage /packagePath:"E:\Microsoft.LanguageExperiencePackzh-CN_22621.41.188.0_neutral__8wekyb3d8bbwe.Appx" /SkipLicense

错误修正成功