From eb53852d7ae6838e54525eb57df1d8ce8a722f9b Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 24 Jun 2022 12:28:27 -0500 Subject: Add longPathAware to Burn manifest to support long paths. Fixes 3455 --- src/libs/dutil/WixToolset.DUtil/logutil.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/libs/dutil/WixToolset.DUtil/logutil.cpp') diff --git a/src/libs/dutil/WixToolset.DUtil/logutil.cpp b/src/libs/dutil/WixToolset.DUtil/logutil.cpp index 88a90d8c..3a130b4e 100644 --- a/src/libs/dutil/WixToolset.DUtil/logutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/logutil.cpp @@ -684,9 +684,10 @@ LExit: extern "C" HRESULT DAPI LogHeader() { HRESULT hr = S_OK; - WCHAR wzComputerName[MAX_PATH]; + WCHAR wzComputerName[MAX_COMPUTERNAME_LENGTH + 1] = { }; DWORD cchComputerName = countof(wzComputerName); - WCHAR wzPath[MAX_PATH]; + LPWSTR sczPath = NULL; + LPCWSTR wzPath = NULL; DWORD dwMajorVersion = 0; DWORD dwMinorVersion = 0; LPCSTR szLevel = LOGUTIL_UNKNOWN; @@ -695,12 +696,19 @@ extern "C" HRESULT DAPI LogHeader() // // get the interesting data // - if (!::GetModuleFileNameW(NULL, wzPath, countof(wzPath))) + + hr = PathForCurrentProcess(&sczPath, NULL); + if (FAILED(hr)) + { + wzPath = L""; + } + else { - memset(wzPath, 0, sizeof(wzPath)); + wzPath = sczPath; + + hr = FileVersion(wzPath, &dwMajorVersion, &dwMinorVersion); } - hr = FileVersion(wzPath, &dwMajorVersion, &dwMinorVersion); if (FAILED(hr)) { dwMajorVersion = 0; @@ -743,6 +751,7 @@ extern "C" HRESULT DAPI LogHeader() hr = S_OK; ReleaseStr(sczCurrentDateTime); + ReleaseStr(sczPath); return hr; } -- cgit v1.2.3-55-g6feb