diff options
Diffstat (limited to 'src/engine/exeengine.cpp')
| -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); |
