From 1fb8dc635834c5b9f24b898a291734d7bd136ad4 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 19 Apr 2021 18:27:49 -0500 Subject: Replace OnResolveSource with OnCacheAcquireResolving. #3640 --- src/Samples/bafunctions/bafunctions.vcxproj | 8 +-- src/Samples/bafunctions/packages.config | 4 +- src/dnchost/dnchost.vcxproj | 8 +-- src/dnchost/packages.config | 4 +- src/mbahost/mbahost.vcxproj | 8 +-- src/mbahost/packages.config | 4 +- .../examples/TestEngine/Example.TestEngine.vcxproj | 8 +-- src/test/examples/TestEngine/packages.config | 4 +- .../WixStandardBootstrapperApplication.cpp | 81 ++++++++++------------ src/wixstdba/packages.config | 4 +- src/wixstdba/wixstdba.vcxproj | 8 +-- 11 files changed, 67 insertions(+), 74 deletions(-) (limited to 'src') diff --git a/src/Samples/bafunctions/bafunctions.vcxproj b/src/Samples/bafunctions/bafunctions.vcxproj index 559cfea6..69914bab 100644 --- a/src/Samples/bafunctions/bafunctions.vcxproj +++ b/src/Samples/bafunctions/bafunctions.vcxproj @@ -2,8 +2,8 @@ - - + + @@ -73,8 +73,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/Samples/bafunctions/packages.config b/src/Samples/bafunctions/packages.config index 4d2086b2..be5b9f7f 100644 --- a/src/Samples/bafunctions/packages.config +++ b/src/Samples/bafunctions/packages.config @@ -1,7 +1,7 @@  - - + + \ No newline at end of file diff --git a/src/dnchost/dnchost.vcxproj b/src/dnchost/dnchost.vcxproj index 9acf5627..51a12d8d 100644 --- a/src/dnchost/dnchost.vcxproj +++ b/src/dnchost/dnchost.vcxproj @@ -4,8 +4,8 @@ - - + + @@ -99,8 +99,8 @@ - - + + \ No newline at end of file diff --git a/src/dnchost/packages.config b/src/dnchost/packages.config index af4b54a2..3767d555 100644 --- a/src/dnchost/packages.config +++ b/src/dnchost/packages.config @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/src/mbahost/mbahost.vcxproj b/src/mbahost/mbahost.vcxproj index 771307ec..b016159c 100644 --- a/src/mbahost/mbahost.vcxproj +++ b/src/mbahost/mbahost.vcxproj @@ -5,8 +5,8 @@ - - + + @@ -99,8 +99,8 @@ - - + + \ No newline at end of file diff --git a/src/mbahost/packages.config b/src/mbahost/packages.config index cf236703..ebb9d908 100644 --- a/src/mbahost/packages.config +++ b/src/mbahost/packages.config @@ -4,7 +4,7 @@ - - + + \ No newline at end of file diff --git a/src/test/examples/TestEngine/Example.TestEngine.vcxproj b/src/test/examples/TestEngine/Example.TestEngine.vcxproj index a4645666..e93cacac 100644 --- a/src/test/examples/TestEngine/Example.TestEngine.vcxproj +++ b/src/test/examples/TestEngine/Example.TestEngine.vcxproj @@ -1,8 +1,8 @@ - - + + @@ -76,8 +76,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/test/examples/TestEngine/packages.config b/src/test/examples/TestEngine/packages.config index 4d2086b2..be5b9f7f 100644 --- a/src/test/examples/TestEngine/packages.config +++ b/src/test/examples/TestEngine/packages.config @@ -1,7 +1,7 @@  - - + + \ No newline at end of file diff --git a/src/wixstdba/WixStandardBootstrapperApplication.cpp b/src/wixstdba/WixStandardBootstrapperApplication.cpp index 8b4b89a1..23fded79 100644 --- a/src/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/wixstdba/WixStandardBootstrapperApplication.cpp @@ -945,55 +945,48 @@ public: // IBootstrapperApplication } - virtual STDMETHODIMP OnResolveSource( - __in_z LPCWSTR wzPackageOrContainerId, + virtual STDMETHODIMP OnCacheAcquireResolving( + __in_z_opt LPCWSTR wzPackageOrContainerId, __in_z_opt LPCWSTR wzPayloadId, - __in_z LPCWSTR wzLocalSource, - __in_z_opt LPCWSTR wzDownloadSource, - __in BOOTSTRAPPER_RESOLVESOURCE_ACTION /*recommendation*/, - __inout BOOTSTRAPPER_RESOLVESOURCE_ACTION* pAction, + __in_z LPCWSTR* rgSearchPaths, + __in DWORD /*cSearchPaths*/, + __in BOOL /*fFoundLocal*/, + __in DWORD dwRecommendedSearchPath, + __in_z_opt LPCWSTR /*wzDownloadUrl*/, + __in_z_opt LPCWSTR /*wzPayloadContainerId*/, + __in BOOTSTRAPPER_CACHE_RESOLVE_OPERATION /*recommendation*/, + __inout DWORD* /*pdwChosenSearchPath*/, + __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* pAction, __inout BOOL* pfCancel ) { HRESULT hr = S_OK; - if (BOOTSTRAPPER_DISPLAY_FULL == m_command.display) + if (BOOTSTRAPPER_CACHE_RESOLVE_NONE == *pAction && BOOTSTRAPPER_DISPLAY_FULL == m_command.display) // prompt to change the source location. { - if (wzDownloadSource) - { - *pAction = BOOTSTRAPPER_RESOLVESOURCE_ACTION_DOWNLOAD; - } - else // prompt to change the source location. - { - OPENFILENAMEW ofn = { }; - WCHAR wzFile[MAX_PATH] = { }; + OPENFILENAMEW ofn = { }; + WCHAR wzFile[MAX_PATH] = { }; - ::StringCchCopyW(wzFile, countof(wzFile), wzLocalSource); + ::StringCchCopyW(wzFile, countof(wzFile), rgSearchPaths[dwRecommendedSearchPath]); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = m_hWnd; - ofn.lpstrFile = wzFile; - ofn.nMaxFile = countof(wzFile); - ofn.lpstrFilter = L"All Files\0*.*\0"; - ofn.nFilterIndex = 1; - ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; - ofn.lpstrTitle = m_pTheme->sczCaption; + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = m_hWnd; + ofn.lpstrFile = wzFile; + ofn.nMaxFile = countof(wzFile); + ofn.lpstrFilter = L"All Files\0*.*\0"; + ofn.nFilterIndex = 1; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + ofn.lpstrTitle = m_pTheme->sczCaption; - if (::GetOpenFileNameW(&ofn)) - { - hr = m_pEngine->SetLocalSource(wzPackageOrContainerId, wzPayloadId, ofn.lpstrFile); - *pAction = BOOTSTRAPPER_RESOLVESOURCE_ACTION_RETRY; - } - else - { - *pfCancel = TRUE; - } + if (::GetOpenFileNameW(&ofn)) + { + hr = m_pEngine->SetLocalSource(wzPackageOrContainerId, wzPayloadId, ofn.lpstrFile); + *pAction = BOOTSTRAPPER_CACHE_RESOLVE_RETRY; + } + else + { + *pfCancel = TRUE; } - } - else if (wzDownloadSource) - { - // If doing a non-interactive install and download source is available, let's try downloading the package silently - *pAction = BOOTSTRAPPER_RESOLVESOURCE_ACTION_DOWNLOAD; } // else there's nothing more we can do in non-interactive mode @@ -1196,8 +1189,8 @@ public: // IBootstrapperApplication case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS: OnCacheAcquireProgressFallback(reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); break; - case BOOTSTRAPPER_APPLICATION_MESSAGE_ONRESOLVESOURCE: - OnResolveSourceFallback(reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); + case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRERESOLVING: + OnCacheAcquireResolvingFallback(reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); break; case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE: OnCacheAcquireCompleteFallback(reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); @@ -1570,12 +1563,12 @@ private: // privates m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext); } - void OnResolveSourceFallback( - __in BA_ONRESOLVESOURCE_ARGS* pArgs, - __inout BA_ONRESOLVESOURCE_RESULTS* pResults + void OnCacheAcquireResolvingFallback( + __in BA_ONCACHEACQUIRERESOLVING_ARGS* pArgs, + __inout BA_ONCACHEACQUIRERESOLVING_RESULTS* pResults ) { - m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONRESOLVESOURCE, pArgs, pResults, m_pvBAFunctionsProcContext); + m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRERESOLVING, pArgs, pResults, m_pvBAFunctionsProcContext); } void OnCacheAcquireCompleteFallback( diff --git a/src/wixstdba/packages.config b/src/wixstdba/packages.config index cf236703..ebb9d908 100644 --- a/src/wixstdba/packages.config +++ b/src/wixstdba/packages.config @@ -4,7 +4,7 @@ - - + + \ No newline at end of file diff --git a/src/wixstdba/wixstdba.vcxproj b/src/wixstdba/wixstdba.vcxproj index e484da0c..6d7d61a2 100644 --- a/src/wixstdba/wixstdba.vcxproj +++ b/src/wixstdba/wixstdba.vcxproj @@ -5,8 +5,8 @@ - - + + @@ -94,8 +94,8 @@ rc.exe -fo "$(OutDir)wixstdba.res" "$(IntDir)wixstdba.messages.rc" - - + + \ No newline at end of file -- cgit v1.2.3-55-g6feb