aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/approvedexe.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-06-24 12:28:27 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-06-27 11:14:21 -0500
commiteb53852d7ae6838e54525eb57df1d8ce8a722f9b (patch)
tree7fa05bd6df1bce2e20d87c5fbacc1c658dc000aa /src/burn/engine/approvedexe.cpp
parent6ee12a64cb75097a238e60d4fd0ea542e8312214 (diff)
downloadwix-eb53852d7ae6838e54525eb57df1d8ce8a722f9b.tar.gz
wix-eb53852d7ae6838e54525eb57df1d8ce8a722f9b.tar.bz2
wix-eb53852d7ae6838e54525eb57df1d8ce8a722f9b.zip
Add longPathAware to Burn manifest to support long paths.
Fixes 3455
Diffstat (limited to 'src/burn/engine/approvedexe.cpp')
-rw-r--r--src/burn/engine/approvedexe.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/burn/engine/approvedexe.cpp b/src/burn/engine/approvedexe.cpp
index 2a96868e..d8bd956b 100644
--- a/src/burn/engine/approvedexe.cpp
+++ b/src/burn/engine/approvedexe.cpp
@@ -148,6 +148,7 @@ extern "C" HRESULT ApprovedExesLaunch(
148 LPWSTR sczCommand = NULL; 148 LPWSTR sczCommand = NULL;
149 LPWSTR sczCommandObfuscated = NULL; 149 LPWSTR sczCommandObfuscated = NULL;
150 LPWSTR sczExecutableDirectory = NULL; 150 LPWSTR sczExecutableDirectory = NULL;
151 size_t cchExecutableDirectory = 0;
151 STARTUPINFOW si = { }; 152 STARTUPINFOW si = { };
152 PROCESS_INFORMATION pi = { }; 153 PROCESS_INFORMATION pi = { };
153 154
@@ -177,9 +178,17 @@ extern "C" HRESULT ApprovedExesLaunch(
177 // Try to get the directory of the executable so we can set the current directory of the process to help those executables 178 // Try to get the directory of the executable so we can set the current directory of the process to help those executables
178 // that expect stuff to be relative to them. Best effort only. 179 // that expect stuff to be relative to them. Best effort only.
179 hr = PathGetDirectory(pLaunchApprovedExe->sczExecutablePath, &sczExecutableDirectory); 180 hr = PathGetDirectory(pLaunchApprovedExe->sczExecutablePath, &sczExecutableDirectory);
181 if (SUCCEEDED(hr))
182 {
183 // CreateProcessW has undocumented MAX_PATH restriction for lpCurrentDirectory even when long path support is enabled.
184 hr = ::StringCchLengthW(sczExecutableDirectory, MAX_PATH - 1, &cchExecutableDirectory);
185 }
186
180 if (FAILED(hr)) 187 if (FAILED(hr))
181 { 188 {
182 ReleaseNullStr(sczExecutableDirectory); 189 ReleaseNullStr(sczExecutableDirectory);
190
191 hr = S_OK;
183 } 192 }
184 193
185 LogId(REPORT_STANDARD, MSG_LAUNCHING_APPROVED_EXE, pLaunchApprovedExe->sczExecutablePath, sczCommandObfuscated); 194 LogId(REPORT_STANDARD, MSG_LAUNCHING_APPROVED_EXE, pLaunchApprovedExe->sczExecutablePath, sczCommandObfuscated);