Powertoys: OS detection code has flaw in it

Created on 20 May 2020  路  19Comments  路  Source: microsoft/PowerToys

Environment

Windows build number: Version 10.0.17763.1217
PowerToys version: 0.18
PowerToy module for which you are reporting the bug (if applicable): PowerLauncher.exe and PowerToysSettings.exe

Steps to reproduce

Run the program. Or open Settings.

Expected behavior

Application runs.

Actual behavior

PowerLauncher or PowerToysSettings has stopped working. Log details:

Launcher Application Log: Application: PowerLauncher.exe
CoreCLR Version: 4.700.20.20201
.NET Core Version: 3.1.4
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeLoadException: Could not find Windows Runtime type 'Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication'.
at PowerLauncher.App.Main()

Launcher EventData: Application: PowerLauncher.exe CoreCLR Version: 4.700.20.20201 .NET Core Version: 3.1.4 Description: The process was terminated due to an unhandled exception. Exception Info: System.TypeLoadException: Could not find Windows Runtime type 'Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication'. at PowerLauncher.App.Main()

Settings Application Log Data:
Faulting application name: PowerToysSettings.exe, version: 0.18.0.0, time stamp: 0x5ec2d148
Faulting module name: EdgeManager.dll, version: 11.0.17763.1217, time stamp: 0x2082218a
Exception code: 0xc0000409
Fault offset: 0x0000000000067ff2
Faulting process id: 0x1d80
Faulting application start time: 0x01d62ead2370442a
Faulting application path: C:Program FilesPowerToysPowerToysSettings.exe
Faulting module path: C:WindowsSystem32EdgeManager.dll
Report Id: b8f755fa-b776-456a-a8e0-582d6909b2c4

Area-Runner Hot Fix Issue-Bug

Most helpful comment

@traeblain @pleonex
if for you it's acceptable to install an unsigned msi, I've prepared a private build with a possible fix.
Since we haven't been able to reproduce the problem, I can't be sure that the fix will work.
You can install this private build on top of the existing one, you don't need to manually uninstall it first.
In any case, if you decide to uninstall manually, use Windows 10 Settings -> Apps -> Apps & features and not the legacy control panel because it doesn't work.
Thank you.

PowerToysSetup-0.18.1-x64.zip

All 19 comments

Hi @traeblain
the installer should have installed the .NET Core 3.1 Desktop Runtime, you can fix it installing it from this direct link https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-desktop-3.1.4-windows-x64-installer
Thank you.

Installed that, Core SDK, both x64 and x86 in hopes of addressing the issue and neither have addressed the issue. Here's all I have installed since the issue occurred hoping one would work:

  • dotnet-runtime-3.1.4-win-x86.exe
  • windowsdesktop-runtime-3.1.4-win-x86.exe
  • dotnet-runtime-3.1.4-win-x64.exe
  • windowsdesktop-runtime-3.1.4-win-x64.exe
  • dotnet-sdk-3.1.300-win-x64.exe

Restart, everything and still get the error.

@enricogior, the OS detect code has to have a flaw in it.

His OS doesn't have the xaml island work. He is on 1809, not 1903

Windows build number: Version 10.0.17763.1217

Same issue here. I am running Windows 10 LTSC 2019 (version 1809, build 17763.1217). I have .NET Core 3.1 SDK installed.

some how we're hitting a scenario the OS detection code should have caught. this needs to be a hotfix item.

@traeblain @pleonex
do you mind running a simple test tool to try to figure out why we fail to detect the correct Windows 10 version on you machines?
Expand the attached zip folder and double click the executable, it will print out on the screen some data. It will also write the same data to a text file WinVerTestTool_Log.txt.
Copy the data from the screen or upload the log file (whatever is more convenient for you).
Thanks.

WinVerTestTool.zip

IsApiContractPresent: 0
VerifyVersionInfo: 0
Registry: 0
kernel32.dll: 0
RtlGetVersion: 0

Hope it helps.

@traeblain
thanks, the result shows that all the different methods used worked as expected, strange that it doesn't work when executed in PowerToys.

Thanks for helping!

@traeblain @pleonex
if for you it's acceptable to install an unsigned msi, I've prepared a private build with a possible fix.
Since we haven't been able to reproduce the problem, I can't be sure that the fix will work.
You can install this private build on top of the existing one, you don't need to manually uninstall it first.
In any case, if you decide to uninstall manually, use Windows 10 Settings -> Apps -> Apps & features and not the legacy control panel because it doesn't work.
Thank you.

PowerToysSetup-0.18.1-x64.zip

Almost there. Not getting the PowerLauncher Error, so it appears it's detected the OS properly now as I cannot use Run and Keyboard Manager due to the need for 1903.

But Settings is still issuing a "Stopped Working" error with the following details in the Event Log:

Faulting application name: PowerToysSettings.exe, version: 0.18.1.0, time stamp: 0x5ec6d3d1
Faulting module name: EdgeManager.dll, version: 11.0.17763.1217, time stamp: 0x2082218a
Exception code: 0xc0000409
Fault offset: 0x0000000000067ff2
Faulting process id: 0x5754
Faulting application start time: 0x01d62faacb45221f
Faulting application path: C:\Program Files\PowerToys\PowerToysSettings.exe
Faulting module path: C:\Windows\System32\EdgeManager.dll
Report Id: 9eab574f-a29f-42e9-b2bc-f8d44f46cb27
Faulting package full name: 
Faulting package-relative application ID:

which means we're not launchign the correct settings app

@traeblain thanks for testing it.

We are launching the correct Settings app, we fail to create the WebView control because C:\Windows\System32\EdgeManager.dll crashes.

Same results from WinVerTool and with the new installer. This is the stacktrace from EdgeManager:
image

PS: not sure if related but I do have Microsoft Edge Beta (83.0.478.37) working without issue.

@pleonex
it seems a buffer overrun in the EdgeManager module, if that is caused by an invalid argument passed by PowerToys is hard to say.

3579 is part of the work here

PowerToys needs 1803, but PowerLauncher needs 1903? Confusing!
If PowerToys is installed on 1809, it should not install the tools which aren't running on this platform. Not?

@ThiloL the new settings and PT Run have a dependency in the OS we can't get around. Once WinUI 3 Desktop is ready for us to onboard, this dependency will go away.

When we started work, schedules aligned but then later they didn't.

We did a fix, haven't gotten any more reports. We'll revisit if this starts happening again

Was this page helpful?
0 / 5 - 0 ratings