您的部分或全部 Windows 10 应用程序是否无法正常运行?以前,我写了一篇关于如何解决缺少 Windows 应用商店应用程序的问题的(fix the problem of missing Windows Store apps)文章 ,最近我有一个客户向我购买了一台Windows 10机器,Windows应用程序似乎可以打开,但随后会立即关闭。
如果您遇到应用无法加载的问题,则可能是权限问题。商店(Store)应用程序无法启动的原因有很多,其中之一是某些Windows文件夹和注册表设置的权限已手动或通过组策略更改。
您可以通过检查这些文件夹和注册表设置的所有权限并确保它们都正确来解决此问题。在这篇文章中,我将引导您完成执行此操作的步骤,以便您可以让您的商店(Store)应用程序再次运行。
Windows 10 事件日志
您可以通过打开事件日志并检查事件日志中的事件 ID 5961(Event ID 5961)来确认这是否是问题的原因。您可以通过单击开始(Start)并输入事件日志来打开事件日志(event log)。
您将不得不导航到以下日志文件以查看此特定事件是否存在:
Applications and Services Logs\Microsoft\Windows\Apps\Microsoft-Windows-TWinUI/Operational
到达那里后,您会看到那里列出了一大堆事件,可能有数千个。您无法真正手动完成此操作,因此单击最右侧的“查找”(Find)按钮并输入 5961。它将搜索该日志,如果找到任何内容,它将突出显示该行。双击该行,您应该会看到如下信息:
Log Name: Microsoft-Windows-TWinUI/Operational
Source: Microsoft-Windows-Immersive-Shell
Event ID: 5961
Level: Error
Description:
Activation of the app for the Windows.Launch contract failed with error: The app didn't start.
如果该事件存在,您可以确定这是Windows中名为All Application Packages的新组的权限问题。什么是所有应用程序包(Application Packages)?嗯(Well),它类似于内置的管理员或用户组。所有应用程序包(Application Packages)包括安装在Windows 10中的任何商店应用程序。如果该组对某些文件夹和注册表设置没有权限,则会导致商店应用无法启动。
修复文件系统权限
首先,让我们修复文件系统权限。这基本上是检查三个文件夹的权限: Program Files、Windows和Users。
转到资源管理器并右键单击C:\Windows并单击安全(Security)选项卡。这是具有正确权限的外观。
如果这不是您对目录显示的权限,请单击右下角的“高级(Advanced)”按钮。在下一个对话框中,单击更改权限(Change Permissions)按钮。
然后,您要单击“添加(Add)”按钮。请注意,如果Add按钮显示为灰色,则可能意味着文件全部归TrustedInstaller所有。阅读我之前关于如何更改权限的帖子,以便您可以完全控制文件和文件夹(change permissions so that you can gain full control over the files and folders)。
在这里,您需要单击选择主体(Select a principal),然后在对象名称框中键入所有应用程序包。(all application packages)确保(Make)在单击确定之前也单击检查名称(Check Names)按钮。
确保Type设置为Allow并且Apply to( Applies to) is This folder, subfolders and files。在权限下,确保您已选中Read & execute、List folder contents和Read 。然后单击确定。
您将被带回主权限屏幕。在这里,您需要确保选中将所有子对象权限条目替换为此对象的可继承权限条目(Replace all child object permission entries with inheritable permission entries from this object)。
对Windows目录完成此操作后,您需要对 C:Users 和 C:Program Files 执行相同的操作。对于 C:Users,除了你给All Application Packages组Full Control之外,一切都是一样的。此外,如果您运行的是 64 位Windows,您也需要对 C:Program Files (x86) 执行此操作。
修复注册表权限
对于注册表项,通过转到开始(Start)并输入regedit 打开 regedit(regedit)。打开后,您需要检查HKEY_USERS的权限。右键单击(Right-click)HKEY_USERS并(HKEY_USERS)单击Permissions。
确保所有应用程序包(All Application Packages)都具有读取(Read)权限。
现在对HKEY_CLASSES_ROOT做同样的事情。接下来展开HKEY_LOCAL_MACHINE并检查HARDWARE、SAM、SOFTWARE和SYSTEM。
如果你现在还没有发疯,那么恭喜!我在整个过程中看到的主要问题是更改系统文件夹的权限,因为您必须克服TrustedInstaller才能更改权限。一半的时间从来没有正常工作,然后试图让一切恢复正常,这同样有风险。
您最好只重置Windows 10,但这需要您再次安装所有第三方应用程序。您可以通过转到“设置”(Settings),单击“更新和安全(Update & Security)” ,然后单击“恢复(Recovery)”来重置Windows 10。如果您尝试更改权限并遇到错误,请发表评论,我们会尽力提供帮助。享受!
Fix Windows 10 App Opens Then Closes
Are some or all of yoυr Windows 10 apps not working properly? Previouslу, I wrote an article on how to fix the problem of missing Windows Store apps and recently I had a client who bought a Windows 10 machine to me where the Windows apps would appear to open, but then would close immediately.
If you are having this issue where an app fails to load, then it’s probably a permissions issue. There are lots of reasons why Store apps fail to start and one of them is because the permissions for certain Windows folders and registry settings have been changed, either manually or by group policy.
You can fix this problem by checking all the permissions for these folders and registry settings and making sure they are all correct. In this post, I’ll walk you through the steps for doing this so you can get your Store apps running again.
Windows 10 Event Log
You can confirm whether this is the cause of the issue by opening the event log and checking for the Event ID 5961 in the event log. You can open the event log by clicking on Start and typing in event log.
You’re going to have to navigate to the following log file to see if this particular event exists or not:
Applications and Services Logs\Microsoft\Windows\Apps\Microsoft-Windows-TWinUI/Operational
Once there, you’ll see a whole bunch of events listed there, probably thousands. You can’t really manually go through this, so click on the Find button at the very right and type in 5961. It’ll search through that log and if it finds anything, it will highlight that row. Double-click on the row and you should see some information like below:
Log Name: Microsoft-Windows-TWinUI/Operational
Source: Microsoft-Windows-Immersive-Shell
Event ID: 5961
Level: Error
Description:
Activation of the app for the Windows.Launch contract failed with error: The app didn't start.
If the event exists, you can be pretty certain that it’s a permissions issue for a new group in Windows called All Application Packages. What is All Application Packages? Well, it’s similar to the built-in Administrators or Users groups. All Application Packages includes any store app that is installed in Windows 10. If this group doesn’t have permissions to certain folders and registry settings, it will cause store apps to fail launching.
Fix File System Permissions
First, let’s fix the file system permissions. This is basically checking the permissions on three folders: Program Files, Windows and Users.
Go to Explorer and right-click on C:\Windows and click on the Security tab. Here is what it should look like with the correct permissions.
If that is not what your permissions are showing for the directory, then click on the Advanced button at the bottom right. On the next dialog, click on the Change Permissions button.
You then want to click the Add button. Note that if the Add button is grayed out, it probably means the files are all owned by TrustedInstaller. Read my previous post on how to change permissions so that you can gain full control over the files and folders.
Here you need to click on Select a principal and then type in all application packages into the object name box. Make sure to click the Check Names button also before clicking OK.
Make sure the Type is set to Allow and Applies to is This folder, subfolders and files. Under permissions, make sure you have Read & execute, List folder contents and Read checked. Then click OK.
You’ll be brought back to the main permissions screen. Here you need to make sure to check the Replace all child object permission entries with inheritable permission entries from this object.
Once you have done this for the Windows directory, you need to do the same thing for C:\Users and C:\Program Files. For C:\Users, everything is the same except you give the All Application Packages group Full Control. Also, if you’re running 64-bit Windows, you’ll need to do this for C:\Program Files (x86) too.
Fixing Registry Permissions
For registry entries, open regedit by going to Start and typing in regedit. Once you have it opened, you need to check the permissions for HKEY_USERS. Right-click on HKEY_USERS and click on Permissions.
Make sure that All Application Packages has Read permission.
Now do the same thing for HKEY_CLASSES_ROOT. Next expand HKEY_LOCAL_MACHINE and do the check for HARDWARE, SAM, SOFTWARE and SYSTEM.
If you haven’t gone crazy by now, then congrats! The main issue that I saw with this whole process is changing the permissions on the system folders because you have to overcome TrustedInstaller in order to make changes to the permissions. Half the time that never works properly and then trying to get everything back to normal is just as risky.
You may be better off just resetting Windows 10, but it’ll require you to install all your third-party apps again. You can reset Windows 10 by going to Settings, click on Update & Security and then clicking on Recovery. If you’re trying to change permissions and running into errors, post a comment and we’ll try to help. Enjoy!