diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-04-13 18:16:55 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-04-14 12:15:52 -0700 |
| commit | d32f770ca05748df9e356444c7e617d5eeedb60c (patch) | |
| tree | 5a866f82950f9047aab6d7655ba538bcdbfb2535 /src/engine/externalengine.cpp | |
| parent | 6f7bb97daa1ae6bf2486b1c566c29e1b524b7548 (diff) | |
| download | wix-d32f770ca05748df9e356444c7e617d5eeedb60c.tar.gz wix-d32f770ca05748df9e356444c7e617d5eeedb60c.tar.bz2 wix-d32f770ca05748df9e356444c7e617d5eeedb60c.zip | |
Allow BA to update feed source
Fixes wixtoolset/issues#5568
Diffstat (limited to 'src/engine/externalengine.cpp')
| -rw-r--r-- | src/engine/externalengine.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/engine/externalengine.cpp b/src/engine/externalengine.cpp index d881544c..fffd96bf 100644 --- a/src/engine/externalengine.cpp +++ b/src/engine/externalengine.cpp | |||
| @@ -733,6 +733,38 @@ LExit: | |||
| 733 | return hr; | 733 | return hr; |
| 734 | } | 734 | } |
| 735 | 735 | ||
| 736 | HRESULT ExternalEngineSetUpdateSource( | ||
| 737 | __in BURN_ENGINE_STATE* pEngineState, | ||
| 738 | __in_z LPCWSTR wzUrl | ||
| 739 | ) | ||
| 740 | { | ||
| 741 | HRESULT hr = S_OK; | ||
| 742 | BOOL fLeaveCriticalSection = FALSE; | ||
| 743 | |||
| 744 | ::EnterCriticalSection(&pEngineState->userExperience.csEngineActive); | ||
| 745 | fLeaveCriticalSection = TRUE; | ||
| 746 | hr = UserExperienceEnsureEngineInactive(&pEngineState->userExperience); | ||
| 747 | ExitOnFailure(hr, "Engine is active, cannot change engine state."); | ||
| 748 | |||
| 749 | if (wzUrl && *wzUrl) | ||
| 750 | { | ||
| 751 | hr = StrAllocString(&pEngineState->update.sczUpdateSource, wzUrl, 0); | ||
| 752 | ExitOnFailure(hr, "Failed to set feed download URL."); | ||
| 753 | } | ||
| 754 | else // no URL provided means clear out the whole download source. | ||
| 755 | { | ||
| 756 | ReleaseNullStr(pEngineState->update.sczUpdateSource); | ||
| 757 | } | ||
| 758 | |||
| 759 | LExit: | ||
| 760 | if (fLeaveCriticalSection) | ||
| 761 | { | ||
| 762 | ::LeaveCriticalSection(&pEngineState->userExperience.csEngineActive); | ||
| 763 | } | ||
| 764 | |||
| 765 | return hr; | ||
| 766 | } | ||
| 767 | |||
| 736 | // TODO: callers need to provide the original size (at the time of first public release) of the struct instead of the current size. | 768 | // TODO: callers need to provide the original size (at the time of first public release) of the struct instead of the current size. |
| 737 | HRESULT WINAPI ExternalEngineValidateMessageParameter( | 769 | HRESULT WINAPI ExternalEngineValidateMessageParameter( |
| 738 | __in_opt const LPVOID pv, | 770 | __in_opt const LPVOID pv, |
