Windows store installation error

Introduction:

A few days ago I was facing a strange behavor on my Laptop; I was unable to open the windows’ calculator. It appears briefly and the disapears quickly. And I was so busy to tackle this problem, till yesterday when I took the Bull by the horns.

The solution:

For those looking forward, go to step 5.

  1. I took a trace with Procmon and I found this:

Calculator

It seems something was broken; the Calculator was unable to load some DLLs from “C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1608.2213.0_x64__8wekyb3d8bbwe\” location.

2. I’ve done some Internet research and the suggestions tend to the reinstallation of the calculator using the Windows store App; unfortunaly, even the Windows store App was do not work properly 😦

3. To Re-install the Windows store application, I’ve used this powershell command:

Get-AppXPackage *WindowsStore* -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}

and guess what! I’ve got the following error:

powershellerror80070002
I got here two errors code: 0x80073CF9 and 0x80070002.

4. To have the corresponding error message use the following command:

winrm helpmsg ERROR_CODE
winrmhelpmsg
The last error message informs us that the setup failed beacause of a missing file. And if we read carrefuly the full error message we are prompted to use the following command to get more details;

Get-AppxLog -ActivityID 9535eb18-6e56-0000-8304-3695566ed201

The result is a log of the setup process and at the end we get this information:

Opening the registry key Software\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\\S-1-5-21-705754729-2888756721-3051348587-1047 fails with the following error message 0x80070002

So what is S-1-5-21-705754729-2888756721-3051348587-1047 ?

It’s a user SID (Security Identifier). So I’ve a user SID missing in the registry! but what user this SID relates to?

The following command gives me the answer: wmic useraccount get sid,name

wmic_sid

The SID in question is not on my system. It seems that is a SID of a domain’s user that was not properly deleted after the computer unjoigned from the domain.

5. At this point, two options are available:

  • Install the Windows store for the current user only with this powershell command: Get-AppXPackage *WindowsStore*| Foreach {Add-AppxPackage -DisableDevelopmentMode -Register   “$($_.InstallLocation)\AppXManifest.xml”}
    (Without -Allusers parameters)
  • Add the missing registry key and run the powershell setup command for all computer’s users.

I’ve shoosed the seconde one to be able to install Windows store for all users’ acounts, and after that I was able to install the Calculator from the Windows Store.