google / UIforETW

User interface for recording and managing ETW traces
https://randomascii.wordpress.com/2015/04/14/uiforetw-windows-performance-made-easier/
Apache License 2.0
1.55k stars 201 forks source link

UIforETW needs to be able find WPT in non-default install locations #118

Closed randomascii closed 2 years ago

randomascii commented 6 years ago

Some developers install WPT on drives other than C:. UIforETW either needs a way for the user to specify the location or it needs to automatically find the install location, perhaps by searching the PATH environment variable?

mwinterb commented 6 years ago

HKLM\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v8.1 and HKLM\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 both have InstallationFolder values. They point to the directories that contain the Windows Performance Toolkit directory (including for one of my coworkers that encountered this issue).

However, there's another tool that may install WPT, right? That's not the SDK or the extracted MSI's? I would need to check if that tool does the same installation.

What is your preferred behavior if the registry locations don't exist? Fallback to the current "assume in Program Files"?

randomascii commented 6 years ago

I'm not aware of a way to install WPT other than the SDK or the redist MSIs, although there could be such a thing. Falling back to the current behavior is probably fine if the registry keys don't exist or if xperf.exe can't be found.

I think there is also a problem on first-use of UIforETW where if it installs WPT and then tries to launch it then xperf.exe may not be found because it is added to the path too late. I have not seen this for a while. It resolves on relaunch of UIforETW.

randomascii commented 5 years ago

Is this still an issue? Can I close this?

eugeneia commented 4 years ago

FWIW I still had this issue even when setting the registry key and ended up using an NTFS junction to get it to work.

rickbrew commented 4 years ago

I'm not aware of a way to install WPT other than the SDK or the redist MSIs

You can also install it from the Microsoft Store, but I'm not sure if it's been maintained: https://www.microsoft.com/en-us/p/windows-performance-analyzer/9n0w1b2bxgnz?activetab=pivot:overviewtab

Detecting the app can be accomplished with something like GetPackagesByPackageFamily, and launching the app can be done with IApplicationActivationManager::ActivateApplication. Powershell's Get-AppxPackage is also useful for stumbling around and exploring this area.

randomascii commented 4 years ago

@eugeneia - can you debug why the fixes didn't work? It would be nice to understand what went wrong so that we can fix the code.

Off-topic, but I inquired about the Microsoft store version. It is currently behind the SDK version but should be catching up soon, and then it might move ahead. Having an option to detect and use it would be nice.

trueqbit commented 3 years ago

See my comment for the reason it doesn't work.

randomascii commented 3 years ago

Would someone like to create a PR for the issues raised in the previous comment? I don't have a setup to test this easily so I'm not sure when I'll get around to it.

trueqbit commented 3 years ago

FYI I compiled UIforETW and walked through this with a debugger, so this is verified. Also, looking at wine's implementation gives even more confidence :)

randomascii commented 2 years ago

I think this is fixed now - path support allows fixing quite easily. Reopen if there are still issues.