Skip to content

Commit

Permalink
Install WPT prerequisites as well
Browse files Browse the repository at this point in the history
WPTx64 (DesktopEditions)-x86_en-us.msi is the WPT installer, but it
doesn't fully install unless WPTx64 (OnecoreUAP)-x86_en-us.msi is
installed first. So let's do that. This changes the packaging and
the installation process.
  • Loading branch information
randomascii committed Nov 10, 2021
1 parent ae4a6d4 commit 9882261
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
25 changes: 18 additions & 7 deletions UIforETW/UIforETWDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,14 +452,25 @@ BOOL CUIforETWDlg::OnInitDialog()
// Install 64-bit WPT 10 if needed and if available.
if (xperfVersion < preferredXperfVersion)
{
const std::wstring installPath10 = CanonicalizePath(GetExeDir() + L"..\\third_party\\wpt10\\WPTx64 (DesktopEditions)-x86_en-us.msi");
if (PathFileExists(installPath10.c_str()))
const std::wstring installPath10[] =
{
ChildProcess child(msiExecPath);
std::wstring args = L" /i \"" + installPath10 + L"\"";
child.Run(true, L"msiexec.exe" + args);
const DWORD installResult10 = child.GetExitCode();
if (!installResult10)
CanonicalizePath(GetExeDir() + L"..\\third_party\\wpt10\\WPTx64 (OnecoreUAP)-x86_en-us.msi"),
CanonicalizePath(GetExeDir() + L"..\\third_party\\wpt10\\WPTx64 (DesktopEditions)-x86_en-us.msi"),
};
if (PathFileExists(installPath10[0].c_str()) && PathFileExists(installPath10[1].c_str()))
{
bool success = true;
DWORD installResult10 = 0;
for (const auto& installPath : installPath10)
{
ChildProcess child(msiExecPath);
std::wstring args = L" /i \"" + installPath + L"\"";
child.Run(true, L"msiexec.exe" + args);
installResult10 = child.GetExitCode();
if (installResult10)
success = false;
}
if (success)
{
xperfVersion = GetFileVersion(GetXperfPath());
outputPrintf(L"WPT version %llu.%llu.%llu.%llu was installed.\n",
Expand Down
11 changes: 8 additions & 3 deletions package_etw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ mkdir %destdir%\lib
mkdir %destdir%\third_party
mkdir %symboldir%

set wptredistmsi=Windows Performance Toolkit\Redistributables\WPTx64 (DesktopEditions)-x86_en-us.msi
@rem Prerequisite for the WPT installer
set wptredistmsi1=Windows Performance Toolkit\Redistributables\WPTx64 (OnecoreUAP)-x86_en-us.msi
@rem The WPT installer
set wptredistmsi2=Windows Performance Toolkit\Redistributables\WPTx64 (DesktopEditions)-x86_en-us.msi

set wpt10=c:\Program Files (x86)\Windows Kits\10\
if not exist "%wpt10%%wptredistmsi%" goto nowpt10
if not exist "%wpt10%%wptredistmsi1%" goto nowpt10
if not exist "%wpt10%%wptredistmsi2%" goto nowpt10
mkdir %destdir%\third_party\wpt10
xcopy "%wpt10%%wptredistmsi%" %destdir%\third_party\wpt10
xcopy "%wpt10%%wptredistmsi1%" %destdir%\third_party\wpt10
xcopy "%wpt10%%wptredistmsi2%" %destdir%\third_party\wpt10
@if errorlevel 1 goto copyfailure
xcopy "%wpt10%Licenses\10.0.22000.0\sdk_license.rtf" %destdir%\third_party\wpt10
@if errorlevel 1 goto copyfailure
Expand Down

0 comments on commit 9882261

Please sign in to comment.