Quando tento remover aplicativos provisionados de uma imagem offline do Windows 8.1, a maioria dos aplicativos que desejo remover não causa problemas, mas a tentativa de remover o Microsoft.Office.OneNote causa um erro.
O seguinte código do PowerShell demonstra o problema. O sistema operacional é o Windows PE 5.0. (Por que WinPE? Meu objetivo é remover alguns aplicativos provisionados durante uma sequência de tarefas do System Center Configuration Manager 2012 R2 antes que a nova instalação seja inicializada pela primeira vez.) A imagem offline é Windows 8.1 com atualizações até 30 de abril de 2015 e está localizado na raiz da unidade G:.
PS > Get-AppxProvisionedPackage -Path G:\
...
[lines omitted]
...
DisplayName : Microsoft.Office.OneNote
Version : 2014.215.704.4136
Architecture : neutral
ResourceId : ~
PackageName : Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe
...
[lines omitted]
...
DisplayName : Microsoft.ZuneMusic
Version : 2014.228.1317.652
Architecture : neutral
ResourceId : ~
PackageName : Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe
...
PS > Remove-AppxProvisionedPackage -Path G:\ -PackageName Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe
Path : G:\
Online : False
Restart Needed : False
PS > Remove-AppxProvisionedPackage -Path G:\ -PackageName Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage : The system cannot find the file specified.
At line:1 char:1
+ Remove-AppxProvisionedPackage -Path G:\ -PackageName Microsoft.Office.OneNote_20 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand
Aqui estão trechos do arquivo % SystemRoot% \ Logs \ DISM \ dism.log .
Remoção de Microsoft.ZuneMusic:
2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Enter DismRemoveProvisionedAppxPackageInternal - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Input parameters: Session: 2, PackageName: Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Input parameters: Session: 2, PackageName: Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Initialized default cancel event - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Successfully enqueued command object - CCommandThread::EnqueueCommandObject
2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1068 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop
2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1068 Successfully dequeued command object - CCommandThread::DequeueCommandObject
2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Getting Provider AppxManager - CDISMProviderStore::GetProvider
2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Provider has not previously been encountered. Attempting to initialize the provider. - CDISMProviderStore::Internal_GetProvider
2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Loading Provider from location X:\windows\TEMP\D173D978-C7E2-4153-88D4-A35376D8C923\AppxProvider.dll - CDISMProviderStore::Internal_GetProvider
2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Connecting to the provider located at X:\windows\TEMP\D173D978-C7E2-4153-88D4-A35376D8C923\AppxProvider.dll. - CDISMProviderStore::Internal_LoadProvider
2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Encountered a servicing provider, performing additional servicing initializations. - CDISMProviderStore::Internal_LoadProvider
2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1068 Calling RemoveAllUserAppx with package full name = Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe - CRemoveAppxCommandObject::InternalExecute
2015-06-08 14:43:29, Info DISM DISM Appx Provider: PID=1848 TID=1440 Writing temporary provision file: X:\windows\TEMP\appxStage-{77DB0339-427B-481D-BC0D-88B930DBA99A}\AppxProvisioning.xml. - CDismContext::FinalizeChanges
2015-06-08 14:43:30, Info DISM DISM Appx Provider: PID=1848 TID=1440 Taking ownership of G:\ProgramData\Microsoft\Windows. - CDismContext::FinalizeChanges
2015-06-08 14:43:30, Info DISM DISM Appx Provider: PID=1848 TID=1440 Copying from X:\windows\TEMP\appxStage-{77DB0339-427B-481D-BC0D-88B930DBA99A}\AppxProvisioning.xml to G:\ProgramData\Microsoft\Windows\AppxProvisioning.xml. - CDismContext::FinalizeChanges
2015-06-08 14:43:30, Info DISM API: PID=1444 TID=1068 Successfully removed package - CRemoveAppxCommandObject::InternalExecute
2015-06-08 14:43:30, Info DISM API: PID=1444 TID=1636 Leave DismRemoveProvisionedAppxPackageInternal - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:43:30, Info DISM API: PID=1444 TID=1636 Enter DismCloseSessionInternal - DismCloseSessionInternal
Remoção do Microsoft.Office.OneNote (com linhas de erro em negrito):
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Enter DismRemoveProvisionedAppxPackageInternal - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Input parameters: Session: 2, PackageName: Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Input parameters: Session: 2, PackageName: Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Initialized default cancel event - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Successfully enqueued command object - CCommandThread::EnqueueCommandObject
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=876 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=876 Successfully dequeued command object - CCommandThread::DequeueCommandObject
2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Getting Provider AppxManager - CDISMProviderStore::GetProvider
2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Provider has not previously been encountered. Attempting to initialize the provider. - CDISMProviderStore::Internal_GetProvider
2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Loading Provider from location X:\windows\TEMP\D613CBD7-929A-4C48-92DE-589E048B20EC\AppxProvider.dll - CDISMProviderStore::Internal_GetProvider
2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Connecting to the provider located at X:\windows\TEMP\D613CBD7-929A-4C48-92DE-589E048B20EC\AppxProvider.dll. - CDISMProviderStore::Internal_LoadProvider
2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Encountered a servicing provider, performing additional servicing initializations. - CDISMProviderStore::Internal_LoadProvider
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=876 Calling RemoveAllUserAppx with package full name = Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe - CRemoveAppxCommandObject::InternalExecute
2015-06-08 14:57:06, Error DISM DISM Appx Provider: PID=2020 TID=848 Failed to get staged packages for package 'Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe'. - CPackageAdapter::CreateForRemove(hr:0x80070002)
2015-06-08 14:57:06, Error DISM DISM Appx Provider: PID=2020 TID=848 Failed while initializing package adapter for package 'Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe' - CAppxManager::RemoveAllUserAppx(hr:0x80070002)
2015-06-08 14:57:06, Error DISM API: PID=1444 TID=876 Failed to remove package - CRemoveAppxCommandObject::InternalExecute(hr:0x80070002)
2015-06-08 14:57:06, Error DISM API: PID=1444 TID=876 InternalExecute failed - CBaseCommandObject::Execute(hr:0x80070002)
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Leave DismRemoveProvisionedAppxPackageInternal - DismRemoveProvisionedAppxPackageInternal
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Enter DismGetLastErrorMessageInternal - DismGetLastErrorMessageInternal
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Exit DismGetLastErrorMessageInternal - DismGetLastErrorMessageInternal
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Enter DismDeleteInternal - DismDeleteInternal
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Leave DismDeleteInternal - DismDeleteInternal
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Enter DismCloseSessionInternal - DismCloseSessionInternal
O erro retornado de Remove-AppxProvisionedPackage é "O sistema não pode encontrar o arquivo especificado." Qual arquivo?
A mensagem de erro mais detalhada do log do DISM é "Falha ao obter pacotes preparados para o pacote 'Microsoft.Office.OneNote_2014.215.704.4136_neutral_ ~ _8wekyb3d8bbwe'." O que isso significa?
Embora eu tenha encontrado um artigo no blog descrevendo a terminologia de aplicativos do Windows 8 / 8.1 que pode sugerir o problema - algo sobre uma versão em estágio do aplicativo - minhas buscas por ajuda sobre esses erros específicos foram infrutíferas. Como posso encontrar as causas desses erros?.