Tuesday, May 24, 2016

Windows 10 Apps from Windows Store Will Not Start

So Microsoft has taken away the old calculator, and given us a new one that runs on the new WinRT side of the house. As a result, when applications from Windows Store would not run, I was out of a calculator.

In Windows event log, I saw this:


Then I followed the message here to "Microsoft-Windows-TWinUI/Operational". It really did not give anything more:


I tried uninstalling it. Nothing happened after I selected "Uninstall" from the popup menu.  Microsoft has a site that can perform diagnostics, so I tried it:

http://windows.microsoft.com/en-us/windows-10/run-the-troubleshooter-for-windows-apps

It did nothing.

So I am on my own. I started a power shell window in admin mode, and ran "Get-AppxPackage *calc*":

Now I know that the full package name for the calculator is "Microsoft.WindowsCalculator_10.1601.49020.0_x64__8wekyb3d8bbwe". I tried "Remove-AppxPackage Microsoft.WindowsCalculator_10.1601.49020.0_x64__8wekyb3d8bbwe". That gave me a bunch of errors and refused to proceed. So I tried to directly re-install it by running "Add-AppxPackage -register "C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1601.4902
0.0_x64__8wekyb3d8bbwe\AppxManifest.xml" -DisableDevelopmentMode". This is what I got:


Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF6, Package could not be registered. (Exception from
HRESULT: 0x80073CF6)
NOTE: For additional information, look for [ActivityId] 5ef603bf-b483-0008-6b97-f65e83b4d101 in the Event Log or use
the command line Get-AppxLog -ActivityID 5ef603bf-b483-0008-6b97-f65e83b4d101
At line:1 char:1
+ Add-AppxPackage -register "C:\Program Files\WindowsApps\Microsoft.Win ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Program File...ppxManifest.xml:String) [Add-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand


I then ran "Get-AppxLog -ActivityID 5ef603bf-b483-0008-6b97-f65e83b4d101" as suggested in the error message. Finally I was getting some useful information:

Windows cannot find the resource package manifest in the bundle file:
C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1601.49020.0_neutral
_split.scale-150_8wekyb3d8bbwe\AppxManifest.xml.
Windows cannot find the resource package manifest in the bundle file:
C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1601.49020.0_neutral
_split.language-zh-hans_8wekyb3d8bbwe\AppxManifest.xml.
error 0x80070002: Reading manifest from location: C:\ProgramData\Microsoft\Windo
ws\AppRepository\Microsoft.WindowsCalculator_10.1601.49020.0_neutral_split.langu
age-zh-hans_8wekyb3d8bbwe.xml failed with error: The system cannot find the
file specified.


Apparently if you have your screen scaled above 100% because of a 4K display, or if you are using a different language add-on, this is what you could get sometimes: broken Windows Store applications.

So I temporarily changed owners of these folders to my user account to gain full access, and then put the "TrustedInstaller" back as the owner. To find the "TrustedInstaller" you need to enter "NT SERVICE\TrustedInstaller" while the location is set to your computer, not an Active Directory.

For the "scale 150" file, I just made a copy of the "scale 100" file and renamed it to what the installer was complaining about. There was another app that had a "zh-hans" file, so I made a copy of that and renamed it using the calculator's full package name.

Then I ran "Add-AppxPackage -register "C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1601.4902
0.0_x64__8wekyb3d8bbwe\AppxManifest.xml" -DisableDevelopmentMode". This time, it worked. Now I have my calculator back.

I also had the same problems with Microsoft Solitaire Collection. I used the same fix, and that is now working also.

Update: on a different laptop running Windows 10, I got the same error on the Windows 10 Store application itself. The Windows 10 Store app shows a blank icon on the task bar. It is as if there is no application icon in that spot. When I clicked on it, The Store windows comes up briefly and then just disappears. "Sfc /scannow" etc. did nothing. Troubleshooting tools did nothing. The same steps showed that it was missing a scale 125 file and one for the language "zh-hans" as well. So Again I copied the scale 100 files to 125, and copied the default language folder to the missing "zh-hans" folder name. Now the icon is back, and the Store application launches fine.

Apparently this is a problem that has been plaguing Microsoft for quite some time. Even in the Windows 8 days a couple of years ago it had the same problems: http://programount.blogspot.com/2014/08/fix-windows-81-cannot-launch-pc.html. Even with the causes known for so long, they still cannot manage to fix it.