summaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/logutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/logutil.cpp')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/logutil.cpp19
1 files changed, 14 insertions, 5 deletions
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:
684extern "C" HRESULT DAPI LogHeader() 684extern "C" HRESULT DAPI LogHeader()
685{ 685{
686 HRESULT hr = S_OK; 686 HRESULT hr = S_OK;
687 WCHAR wzComputerName[MAX_PATH]; 687 WCHAR wzComputerName[MAX_COMPUTERNAME_LENGTH + 1] = { };
688 DWORD cchComputerName = countof(wzComputerName); 688 DWORD cchComputerName = countof(wzComputerName);
689 WCHAR wzPath[MAX_PATH]; 689 LPWSTR sczPath = NULL;
690 LPCWSTR wzPath = NULL;
690 DWORD dwMajorVersion = 0; 691 DWORD dwMajorVersion = 0;
691 DWORD dwMinorVersion = 0; 692 DWORD dwMinorVersion = 0;
692 LPCSTR szLevel = LOGUTIL_UNKNOWN; 693 LPCSTR szLevel = LOGUTIL_UNKNOWN;
@@ -695,12 +696,19 @@ extern "C" HRESULT DAPI LogHeader()
695 // 696 //
696 // get the interesting data 697 // get the interesting data
697 // 698 //
698 if (!::GetModuleFileNameW(NULL, wzPath, countof(wzPath))) 699
700 hr = PathForCurrentProcess(&sczPath, NULL);
701 if (FAILED(hr))
702 {
703 wzPath = L"";
704 }
705 else
699 { 706 {
700 memset(wzPath, 0, sizeof(wzPath)); 707 wzPath = sczPath;
708
709 hr = FileVersion(wzPath, &dwMajorVersion, &dwMinorVersion);
701 } 710 }
702 711
703 hr = FileVersion(wzPath, &dwMajorVersion, &dwMinorVersion);
704 if (FAILED(hr)) 712 if (FAILED(hr))
705 { 713 {
706 dwMajorVersion = 0; 714 dwMajorVersion = 0;
@@ -743,6 +751,7 @@ extern "C" HRESULT DAPI LogHeader()
743 hr = S_OK; 751 hr = S_OK;
744 752
745 ReleaseStr(sczCurrentDateTime); 753 ReleaseStr(sczCurrentDateTime);
754 ReleaseStr(sczPath);
746 755
747 return hr; 756 return hr;
748} 757}