diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-12-15 20:03:48 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-12-15 20:06:52 -0600 |
commit | b20a77911c6a2b096f021639e0daadae7430091c (patch) | |
tree | 1df3027e71821ad80e21bd30bdf0c1f538bf869c | |
parent | 8701b06765803d1af0672df7cff533662990a82e (diff) | |
download | wix-b20a77911c6a2b096f021639e0daadae7430091c.tar.gz wix-b20a77911c6a2b096f021639e0daadae7430091c.tar.bz2 wix-b20a77911c6a2b096f021639e0daadae7430091c.zip |
WIXFEAT:6195 - Don't change current directory for ExePackage.
-rw-r--r-- | src/engine/exeengine.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/engine/exeengine.cpp b/src/engine/exeengine.cpp index 8d6cd7fd..d3ec7676 100644 --- a/src/engine/exeengine.cpp +++ b/src/engine/exeengine.cpp | |||
@@ -377,8 +377,6 @@ extern "C" HRESULT ExeEngineExecutePackage( | |||
377 | ) | 377 | ) |
378 | { | 378 | { |
379 | HRESULT hr = S_OK; | 379 | HRESULT hr = S_OK; |
380 | WCHAR wzCurrentDirectory[MAX_PATH] = { }; | ||
381 | BOOL fChangedCurrentDirectory = FALSE; | ||
382 | int nResult = IDNOACTION; | 380 | int nResult = IDNOACTION; |
383 | LPCWSTR wzArguments = NULL; | 381 | LPCWSTR wzArguments = NULL; |
384 | LPWSTR sczArguments = NULL; | 382 | LPWSTR sczArguments = NULL; |
@@ -535,13 +533,8 @@ extern "C" HRESULT ExeEngineExecutePackage( | |||
535 | { | 533 | { |
536 | // Make the cache location of the executable the current directory to help those executables | 534 | // Make the cache location of the executable the current directory to help those executables |
537 | // that expect stuff to be relative to them. | 535 | // that expect stuff to be relative to them. |
538 | if (::GetCurrentDirectoryW(countof(wzCurrentDirectory), wzCurrentDirectory)) | 536 | si.cb = sizeof(si); |
539 | { | 537 | if (!::CreateProcessW(sczExecutablePath, sczCommand, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, sczCachedDirectory, &si, &pi)) |
540 | fChangedCurrentDirectory = ::SetCurrentDirectoryW(sczCachedDirectory); | ||
541 | } | ||
542 | |||
543 | si.cb = sizeof(si); // TODO: hookup the stdin/stdout/stderr pipes for logging purposes? | ||
544 | if (!::CreateProcessW(sczExecutablePath, sczCommand, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) | ||
545 | { | 538 | { |
546 | ExitWithLastError(hr, "Failed to CreateProcess on path: %ls", sczExecutablePath); | 539 | ExitWithLastError(hr, "Failed to CreateProcess on path: %ls", sczExecutablePath); |
547 | } | 540 | } |
@@ -573,11 +566,6 @@ extern "C" HRESULT ExeEngineExecutePackage( | |||
573 | ExitOnRootFailure(hr, "Process returned error: 0x%x", dwExitCode); | 566 | ExitOnRootFailure(hr, "Process returned error: 0x%x", dwExitCode); |
574 | 567 | ||
575 | LExit: | 568 | LExit: |
576 | if (fChangedCurrentDirectory) | ||
577 | { | ||
578 | ::SetCurrentDirectoryW(wzCurrentDirectory); | ||
579 | } | ||
580 | |||
581 | StrSecureZeroFreeString(sczArguments); | 569 | StrSecureZeroFreeString(sczArguments); |
582 | StrSecureZeroFreeString(sczArgumentsFormatted); | 570 | StrSecureZeroFreeString(sczArgumentsFormatted); |
583 | ReleaseStr(sczArgumentsObfuscated); | 571 | ReleaseStr(sczArgumentsObfuscated); |