Skip to content

Commit

Permalink
Add WPT directory to the path
Browse files Browse the repository at this point in the history
When Windows Performance Toolkit has been installed by UIforETW for the
first time it will not be in the path. This doesn't affect UIforETW
because it runs xperf.exe with a fully specified path. However this does
affect some of the Python scripts which UIforETW runs. Adding the WPT10
directory to the path avoids this first-run problem.

See issue #106 for details.
  • Loading branch information
randomascii committed May 15, 2019
1 parent 9113481 commit 92efb38
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UIforETW/UIforETWDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,14 @@ BOOL CUIforETWDlg::OnInitDialog()
gpuViewPath_ = wpt10Dir_ + L"gpuview\\gpuview.exe";
wpa10Path_ = wpt10Dir_ + L"wpa.exe";

// When WPT has just been installed it will not be in the path, which means
// that Python scripts which rely on xperf.exe being in the path will fail.
// This adds the WPT10 directory to the path. We could just do this when WPT
// has been freshly installed but this seems cleaner.
auto path = GetEnvironmentVariableString(L"path");
path += L';' + wpt10Dir_;
SetEnvironmentVariable(L"path", path.c_str());

// The Media Experience Analyzer is a 64-bit installer, so we look for it in
// ProgramFiles.
wchar_t* progFilesDir = nullptr;
Expand Down

0 comments on commit 92efb38

Please sign in to comment.