aboutsummaryrefslogtreecommitdiff
path: root/src/ca/XmlFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ca/XmlFile.cpp')
-rw-r--r--src/ca/XmlFile.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/ca/XmlFile.cpp b/src/ca/XmlFile.cpp
index 95449126..71c9a390 100644
--- a/src/ca/XmlFile.cpp
+++ b/src/ca/XmlFile.cpp
@@ -464,9 +464,7 @@ LExit:
464 ReleaseStr(pwzCurrentFile); 464 ReleaseStr(pwzCurrentFile);
465 ReleaseStr(pwzCustomActionData); 465 ReleaseStr(pwzCustomActionData);
466 466
467 if (FAILED(hr)) 467 return WcaFinalize(FAILED(hr) ? ERROR_INSTALL_FAILURE : er);
468 er = ERROR_INSTALL_FAILURE;
469 return WcaFinalize(er);
470} 468}
471 469
472 470
@@ -483,7 +481,6 @@ extern "C" UINT __stdcall ExecXmlFile(
483 HRESULT hrOpenFailure = S_OK; 481 HRESULT hrOpenFailure = S_OK;
484 UINT er = ERROR_SUCCESS; 482 UINT er = ERROR_SUCCESS;
485 483
486 BOOL fIsWow64Process = FALSE;
487 BOOL fIsFSRedirectDisabled = FALSE; 484 BOOL fIsFSRedirectDisabled = FALSE;
488 BOOL fPreserveDate = FALSE; 485 BOOL fPreserveDate = FALSE;
489 486
@@ -533,10 +530,12 @@ extern "C" UINT __stdcall ExecXmlFile(
533 hr = WcaReadIntegerFromCaData(&pwz, (int*) &xa); 530 hr = WcaReadIntegerFromCaData(&pwz, (int*) &xa);
534 ExitOnFailure(hr, "failed to process CustomActionData"); 531 ExitOnFailure(hr, "failed to process CustomActionData");
535 532
533#ifndef _WIN64
536 // Initialize the Wow64 API - store the result in fWow64APIPresent 534 // Initialize the Wow64 API - store the result in fWow64APIPresent
537 // If it fails, this doesn't warrant an error yet, because we only need the Wow64 API in some cases 535 // If it fails, this doesn't warrant an error yet, because we only need the Wow64 API in some cases
538 WcaInitializeWow64(); 536 WcaInitializeWow64();
539 fIsWow64Process = WcaIsWow64Process(); 537 BOOL fIsWow64Process = WcaIsWow64Process();
538#endif
540 539
541 if (xaOpenFile != xa && xaOpenFilex64 != xa) 540 if (xaOpenFile != xa && xaOpenFilex64 != xa)
542 ExitOnFailure(hr = E_INVALIDARG, "invalid custom action data"); 541 ExitOnFailure(hr = E_INVALIDARG, "invalid custom action data");
@@ -558,6 +557,7 @@ extern "C" UINT __stdcall ExecXmlFile(
558 557
559 if (xaOpenFilex64 == xa) 558 if (xaOpenFilex64 == xa)
560 { 559 {
560#ifndef _WIN64
561 if (!fIsWow64Process) 561 if (!fIsWow64Process)
562 { 562 {
563 hr = E_NOTIMPL; 563 hr = E_NOTIMPL;
@@ -568,6 +568,7 @@ extern "C" UINT __stdcall ExecXmlFile(
568 ExitOnFailure(hr, "Custom action was told to act on a 64-bit component, but was unable to disable filesystem redirection through the Wow64 API."); 568 ExitOnFailure(hr, "Custom action was told to act on a 64-bit component, but was unable to disable filesystem redirection through the Wow64 API.");
569 569
570 fIsFSRedirectDisabled = TRUE; 570 fIsFSRedirectDisabled = TRUE;
571#endif
571 } 572 }
572 573
573 hr = XmlLoadDocumentFromFileEx(pwzFile, XML_LOAD_PRESERVE_WHITESPACE, &pixd); 574 hr = XmlLoadDocumentFromFileEx(pwzFile, XML_LOAD_PRESERVE_WHITESPACE, &pixd);
@@ -810,7 +811,9 @@ LExit:
810 fIsFSRedirectDisabled = FALSE; 811 fIsFSRedirectDisabled = FALSE;
811 WcaRevertWow64FSRedirection(); 812 WcaRevertWow64FSRedirection();
812 } 813 }
814#ifndef _WIN64
813 WcaFinalizeWow64(); 815 WcaFinalizeWow64();
816#endif
814 817
815 ReleaseStr(pwzCustomActionData); 818 ReleaseStr(pwzCustomActionData);
816 ReleaseStr(pwzData); 819 ReleaseStr(pwzData);
@@ -829,9 +832,7 @@ LExit:
829 832
830 XmlUninitialize(); 833 XmlUninitialize();
831 834
832 if (FAILED(hr)) 835 return WcaFinalize(FAILED(hr) ? ERROR_INSTALL_FAILURE : er);
833 er = ERROR_INSTALL_FAILURE;
834 return WcaFinalize(er);
835} 836}
836 837
837 838
@@ -882,6 +883,7 @@ extern "C" UINT __stdcall ExecXmlFileRollback(
882 hr = WcaReadStreamFromCaData(&pwz, &pbData, &cbData); 883 hr = WcaReadStreamFromCaData(&pwz, &pbData, &cbData);
883 ExitOnFailure(hr, "failed to read file contents from custom action data"); 884 ExitOnFailure(hr, "failed to read file contents from custom action data");
884 885
886#ifndef _WIN64
885 fIs64Bit = (BOOL)iIs64Bit; 887 fIs64Bit = (BOOL)iIs64Bit;
886 888
887 if (fIs64Bit) 889 if (fIs64Bit)
@@ -902,6 +904,7 @@ extern "C" UINT __stdcall ExecXmlFileRollback(
902 hr = WcaDisableWow64FSRedirection(); 904 hr = WcaDisableWow64FSRedirection();
903 ExitOnFailure(hr, "Custom action was told to rollback a 64-bit component, but was unable to Disable Filesystem Redirection through the Wow64 API."); 905 ExitOnFailure(hr, "Custom action was told to rollback a 64-bit component, but was unable to Disable Filesystem Redirection through the Wow64 API.");
904 } 906 }
907#endif
905 908
906 // Always preserve the modified date on rollback 909 // Always preserve the modified date on rollback
907 hr = FileGetTime(pwzFileName, NULL, NULL, &ft); 910 hr = FileGetTime(pwzFileName, NULL, NULL, &ft);
@@ -937,8 +940,6 @@ LExit:
937 940
938 ReleaseMem(pbData); 941 ReleaseMem(pbData);
939 942
940 if (FAILED(hr)) 943 return WcaFinalize(FAILED(hr) ? ERROR_INSTALL_FAILURE : er);
941 er = ERROR_INSTALL_FAILURE;
942 return WcaFinalize(er);
943} 944}
944 945