aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/approvedexe.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-05-02 16:07:18 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-05-11 19:11:19 -0500
commit5cb01b477d85920662112d63b5a44b75c03762a9 (patch)
treefaa0e320981e7328debd861aa90980bce7411cf9 /src/burn/engine/approvedexe.cpp
parent71e689fe5179ca253d878480ba34e2e76a540eab (diff)
downloadwix-5cb01b477d85920662112d63b5a44b75c03762a9.tar.gz
wix-5cb01b477d85920662112d63b5a44b75c03762a9.tar.bz2
wix-5cb01b477d85920662112d63b5a44b75c03762a9.zip
Allow launching approved exes from the original package cache.
Diffstat (limited to 'src/burn/engine/approvedexe.cpp')
-rw-r--r--src/burn/engine/approvedexe.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/burn/engine/approvedexe.cpp b/src/burn/engine/approvedexe.cpp
index 55518519..e3d51a47 100644
--- a/src/burn/engine/approvedexe.cpp
+++ b/src/burn/engine/approvedexe.cpp
@@ -217,6 +217,7 @@ extern "C" HRESULT ApprovedExesVerifySecureLocation(
217{ 217{
218 HRESULT hr = S_OK; 218 HRESULT hr = S_OK;
219 LPWSTR scz = NULL; 219 LPWSTR scz = NULL;
220 LPWSTR sczSecondary = NULL;
220 221
221 const LPCWSTR vrgSecureFolderVariables[] = { 222 const LPCWSTR vrgSecureFolderVariables[] = {
222 L"ProgramFiles64Folder", 223 L"ProgramFiles64Folder",
@@ -243,10 +244,20 @@ extern "C" HRESULT ApprovedExesVerifySecureLocation(
243 } 244 }
244 245
245 // The problem with using a Variable for the root package cache folder is that it might not have been secured yet. 246 // The problem with using a Variable for the root package cache folder is that it might not have been secured yet.
246 // Getting it through CacheGetRootCompletedPath makes sure it has been secured. 247 // Getting it through CacheGetPerMachineRootCompletedPath makes sure it has been secured.
247 hr = CacheGetRootCompletedPath(TRUE, TRUE, &scz); 248 hr = CacheGetPerMachineRootCompletedPath(&scz, &sczSecondary);
248 ExitOnFailure(hr, "Failed to get the root package cache folder."); 249 ExitOnFailure(hr, "Failed to get the root package cache folder.");
249 250
251 // If the package cache is redirected, hr is S_FALSE.
252 if (S_FALSE == hr)
253 {
254 hr = PathDirectoryContainsPath(sczSecondary, pLaunchApprovedExe->sczExecutablePath);
255 if (S_OK == hr)
256 {
257 ExitFunction();
258 }
259 }
260
250 hr = PathDirectoryContainsPath(scz, pLaunchApprovedExe->sczExecutablePath); 261 hr = PathDirectoryContainsPath(scz, pLaunchApprovedExe->sczExecutablePath);
251 if (S_OK == hr) 262 if (S_OK == hr)
252 { 263 {
@@ -257,6 +268,7 @@ extern "C" HRESULT ApprovedExesVerifySecureLocation(
257 268
258LExit: 269LExit:
259 ReleaseStr(scz); 270 ReleaseStr(scz);
271 ReleaseStr(sczSecondary);
260 272
261 return hr; 273 return hr;
262} 274}