From 453bec104676c7dd808a20eaf30db9c918bed1e7 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 24 Jun 2020 09:20:15 +1000 Subject: Update to latest dutil. --- src/engine/engine.vcxproj | 4 ++-- src/engine/packages.config | 2 +- src/engine/precomp.h | 6 ++++-- src/engine/registration.cpp | 2 +- src/stub/WixToolset.Burn.nuspec | 3 +-- src/stub/packages.config | 2 +- src/stub/precomp.h | 1 + src/stub/stub.cpp | 30 ++++++++++++++++++++++++++++++ src/stub/stub.vcxproj | 8 ++++---- 9 files changed, 45 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/engine/engine.vcxproj b/src/engine/engine.vcxproj index 80b67b7d..2fe68c2a 100644 --- a/src/engine/engine.vcxproj +++ b/src/engine/engine.vcxproj @@ -3,7 +3,7 @@ - + @@ -167,7 +167,7 @@ rc.exe -fo "$(OutDir)engine.res" "$(IntDir)engine.messages.rc" This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + diff --git a/src/engine/packages.config b/src/engine/packages.config index 251df9d0..52ccddb4 100644 --- a/src/engine/packages.config +++ b/src/engine/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/src/engine/precomp.h b/src/engine/precomp.h index 7aa7dafa..04dfa50e 100644 --- a/src/engine/precomp.h +++ b/src/engine/precomp.h @@ -2,8 +2,6 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -#define ExitTrace LogErrorString - #include #include #include @@ -26,6 +24,10 @@ #include #include +#include + +#define DUTIL_SOURCE_DEFAULT DUTIL_SOURCE_EXTERNAL + #include #include #include diff --git a/src/engine/registration.cpp b/src/engine/registration.cpp index 93c990f5..bbde92b3 100644 --- a/src/engine/registration.cpp +++ b/src/engine/registration.cpp @@ -893,7 +893,7 @@ extern "C" HRESULT RegistrationSessionEnd( if (FAILED(hr)) { - ExitTrace(hr, "Failed to write volatile reboot required registry key."); + ExitTraceSource(DUTIL_SOURCE_DEFAULT, hr, "Failed to write volatile reboot required registry key."); hr = S_OK; } } diff --git a/src/stub/WixToolset.Burn.nuspec b/src/stub/WixToolset.Burn.nuspec index e71f64e4..35392523 100644 --- a/src/stub/WixToolset.Burn.nuspec +++ b/src/stub/WixToolset.Burn.nuspec @@ -5,8 +5,7 @@ $version$ $authors$ $authors$ - - https://licenses.nuget.org/MS-RL + MS-RL https://github.com/wixtoolset/burn false $description$ diff --git a/src/stub/packages.config b/src/stub/packages.config index e8115bfa..38ce9597 100644 --- a/src/stub/packages.config +++ b/src/stub/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/stub/precomp.h b/src/stub/precomp.h index 387d4f0f..c8301a0f 100644 --- a/src/stub/precomp.h +++ b/src/stub/precomp.h @@ -9,5 +9,6 @@ #include #include #include +#include #include "engine.h" diff --git a/src/stub/stub.cpp b/src/stub/stub.cpp index 2f09eede..d3ace1f3 100644 --- a/src/stub/stub.cpp +++ b/src/stub/stub.cpp @@ -3,6 +3,16 @@ #include "precomp.h" +static void CALLBACK BurnTraceError( + __in_z LPCSTR szFile, + __in int iLine, + __in REPORT_LEVEL rl, + __in UINT source, + __in HRESULT hrError, + __in_z __format_string LPCSTR szFormat, + __in va_list args + ); + int WINAPI wWinMain( __in HINSTANCE hInstance, __in_opt HINSTANCE /* hPrevInstance */, @@ -30,6 +40,8 @@ int WINAPI wWinMain( L"feclient.dll", // unsafely loaded by DecryptFile(). }; + DutilInitialize(&BurnTraceError); + // Best effort attempt to get our file handle as soon as possible. hr = PathForCurrentProcess(&sczPath, NULL); if (SUCCEEDED(hr)) @@ -60,5 +72,23 @@ LExit: ReleaseFileHandle(hEngineFile); ReleaseStr(sczPath); + DutilUninitialize(); + return FAILED(hr) ? (int)hr : (int)dwExitCode; } + +static void CALLBACK BurnTraceError( + __in_z LPCSTR /*szFile*/, + __in int /*iLine*/, + __in REPORT_LEVEL /*rl*/, + __in UINT source, + __in HRESULT hrError, + __in_z __format_string LPCSTR szFormat, + __in va_list args + ) +{ + if (DUTIL_SOURCE_DEFAULT == source) + { + LogErrorStringArgs(hrError, szFormat, args); + } +} diff --git a/src/stub/stub.vcxproj b/src/stub/stub.vcxproj index ce43e0e6..a3db2044 100644 --- a/src/stub/stub.vcxproj +++ b/src/stub/stub.vcxproj @@ -2,7 +2,7 @@ - + @@ -28,7 +28,7 @@ Application Windows burn - v141 + v142 Unicode Native component of WixToolset.Burn @@ -85,7 +85,7 @@ - + @@ -94,6 +94,6 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}. - + -- cgit v1.2.3-55-g6feb