diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp index 202c4d284..e1ea157e3 100644 --- a/src/burn/engine/logging.cpp +++ b/src/burn/engine/logging.cpp @@ -71,6 +71,7 @@ extern "C" HRESULT LoggingOpen( LPWSTR sczLoggingBaseFolder = NULL; LPWSTR sczPrefixFormatted = NULL; LPCWSTR wzPostfix = NULL; + LPWSTR sczProcessPath = NULL; switch (pInternalCommand->mode) { @@ -185,6 +186,15 @@ extern "C" HRESULT LoggingOpen( hr = GetNonSessionSpecificTempFolder(&sczLoggingBaseFolder); ExitOnFailure(hr, "Failed to get non-session specific TEMP folder."); } + + if (!wzPrefix || !*wzPrefix) + { + hr = PathForCurrentProcess(&sczProcessPath, NULL); + ExitOnFailure(hr, "Failed to get process full path."); + + hr = FileStripExtension(sczProcessPath, &wzPrefix); + ExitOnFailure(hr, "Failed to get file name from path."); + } hr = LogOpen(sczLoggingBaseFolder, wzPrefix, wzPostfix, pLog->sczExtension, FALSE, FALSE, &pLog->sczPath); if (FAILED(hr)) @@ -233,6 +243,7 @@ extern "C" HRESULT LoggingOpen( LExit: ReleaseStr(sczLoggingBaseFolder); + ReleaseStr(sczProcessPath); StrSecureZeroFreeString(sczPrefixFormatted); return hr;