diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-04-19 18:27:49 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-04-20 00:04:12 -0500 |
commit | 1fb8dc635834c5b9f24b898a291734d7bd136ad4 (patch) | |
tree | a2d47cd653937fbfd9781b06bb2ee26e0c83ec40 /src/wixstdba | |
parent | 559dbc8dc9c1e3bfe03c0257c6e396cec87a9b6a (diff) | |
download | wix-1fb8dc635834c5b9f24b898a291734d7bd136ad4.tar.gz wix-1fb8dc635834c5b9f24b898a291734d7bd136ad4.tar.bz2 wix-1fb8dc635834c5b9f24b898a291734d7bd136ad4.zip |
Replace OnResolveSource with OnCacheAcquireResolving.
#3640
Diffstat (limited to 'src/wixstdba')
-rw-r--r-- | src/wixstdba/WixStandardBootstrapperApplication.cpp | 81 | ||||
-rw-r--r-- | src/wixstdba/packages.config | 4 | ||||
-rw-r--r-- | src/wixstdba/wixstdba.vcxproj | 8 |
3 files changed, 43 insertions, 50 deletions
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 | |||
945 | } | 945 | } |
946 | 946 | ||
947 | 947 | ||
948 | virtual STDMETHODIMP OnResolveSource( | 948 | virtual STDMETHODIMP OnCacheAcquireResolving( |
949 | __in_z LPCWSTR wzPackageOrContainerId, | 949 | __in_z_opt LPCWSTR wzPackageOrContainerId, |
950 | __in_z_opt LPCWSTR wzPayloadId, | 950 | __in_z_opt LPCWSTR wzPayloadId, |
951 | __in_z LPCWSTR wzLocalSource, | 951 | __in_z LPCWSTR* rgSearchPaths, |
952 | __in_z_opt LPCWSTR wzDownloadSource, | 952 | __in DWORD /*cSearchPaths*/, |
953 | __in BOOTSTRAPPER_RESOLVESOURCE_ACTION /*recommendation*/, | 953 | __in BOOL /*fFoundLocal*/, |
954 | __inout BOOTSTRAPPER_RESOLVESOURCE_ACTION* pAction, | 954 | __in DWORD dwRecommendedSearchPath, |
955 | __in_z_opt LPCWSTR /*wzDownloadUrl*/, | ||
956 | __in_z_opt LPCWSTR /*wzPayloadContainerId*/, | ||
957 | __in BOOTSTRAPPER_CACHE_RESOLVE_OPERATION /*recommendation*/, | ||
958 | __inout DWORD* /*pdwChosenSearchPath*/, | ||
959 | __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* pAction, | ||
955 | __inout BOOL* pfCancel | 960 | __inout BOOL* pfCancel |
956 | ) | 961 | ) |
957 | { | 962 | { |
958 | HRESULT hr = S_OK; | 963 | HRESULT hr = S_OK; |
959 | 964 | ||
960 | if (BOOTSTRAPPER_DISPLAY_FULL == m_command.display) | 965 | if (BOOTSTRAPPER_CACHE_RESOLVE_NONE == *pAction && BOOTSTRAPPER_DISPLAY_FULL == m_command.display) // prompt to change the source location. |
961 | { | 966 | { |
962 | if (wzDownloadSource) | 967 | OPENFILENAMEW ofn = { }; |
963 | { | 968 | WCHAR wzFile[MAX_PATH] = { }; |
964 | *pAction = BOOTSTRAPPER_RESOLVESOURCE_ACTION_DOWNLOAD; | ||
965 | } | ||
966 | else // prompt to change the source location. | ||
967 | { | ||
968 | OPENFILENAMEW ofn = { }; | ||
969 | WCHAR wzFile[MAX_PATH] = { }; | ||
970 | 969 | ||
971 | ::StringCchCopyW(wzFile, countof(wzFile), wzLocalSource); | 970 | ::StringCchCopyW(wzFile, countof(wzFile), rgSearchPaths[dwRecommendedSearchPath]); |
972 | 971 | ||
973 | ofn.lStructSize = sizeof(ofn); | 972 | ofn.lStructSize = sizeof(ofn); |
974 | ofn.hwndOwner = m_hWnd; | 973 | ofn.hwndOwner = m_hWnd; |
975 | ofn.lpstrFile = wzFile; | 974 | ofn.lpstrFile = wzFile; |
976 | ofn.nMaxFile = countof(wzFile); | 975 | ofn.nMaxFile = countof(wzFile); |
977 | ofn.lpstrFilter = L"All Files\0*.*\0"; | 976 | ofn.lpstrFilter = L"All Files\0*.*\0"; |
978 | ofn.nFilterIndex = 1; | 977 | ofn.nFilterIndex = 1; |
979 | ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; | 978 | ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; |
980 | ofn.lpstrTitle = m_pTheme->sczCaption; | 979 | ofn.lpstrTitle = m_pTheme->sczCaption; |
981 | 980 | ||
982 | if (::GetOpenFileNameW(&ofn)) | 981 | if (::GetOpenFileNameW(&ofn)) |
983 | { | 982 | { |
984 | hr = m_pEngine->SetLocalSource(wzPackageOrContainerId, wzPayloadId, ofn.lpstrFile); | 983 | hr = m_pEngine->SetLocalSource(wzPackageOrContainerId, wzPayloadId, ofn.lpstrFile); |
985 | *pAction = BOOTSTRAPPER_RESOLVESOURCE_ACTION_RETRY; | 984 | *pAction = BOOTSTRAPPER_CACHE_RESOLVE_RETRY; |
986 | } | 985 | } |
987 | else | 986 | else |
988 | { | 987 | { |
989 | *pfCancel = TRUE; | 988 | *pfCancel = TRUE; |
990 | } | ||
991 | } | 989 | } |
992 | } | ||
993 | else if (wzDownloadSource) | ||
994 | { | ||
995 | // If doing a non-interactive install and download source is available, let's try downloading the package silently | ||
996 | *pAction = BOOTSTRAPPER_RESOLVESOURCE_ACTION_DOWNLOAD; | ||
997 | } | 990 | } |
998 | // else there's nothing more we can do in non-interactive mode | 991 | // else there's nothing more we can do in non-interactive mode |
999 | 992 | ||
@@ -1196,8 +1189,8 @@ public: // IBootstrapperApplication | |||
1196 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS: | 1189 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS: |
1197 | OnCacheAcquireProgressFallback(reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_RESULTS*>(pvResults)); | 1190 | OnCacheAcquireProgressFallback(reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_RESULTS*>(pvResults)); |
1198 | break; | 1191 | break; |
1199 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONRESOLVESOURCE: | 1192 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRERESOLVING: |
1200 | OnResolveSourceFallback(reinterpret_cast<BA_ONRESOLVESOURCE_ARGS*>(pvArgs), reinterpret_cast<BA_ONRESOLVESOURCE_RESULTS*>(pvResults)); | 1193 | OnCacheAcquireResolvingFallback(reinterpret_cast<BA_ONCACHEACQUIRERESOLVING_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRERESOLVING_RESULTS*>(pvResults)); |
1201 | break; | 1194 | break; |
1202 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE: | 1195 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE: |
1203 | OnCacheAcquireCompleteFallback(reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_RESULTS*>(pvResults)); | 1196 | OnCacheAcquireCompleteFallback(reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_RESULTS*>(pvResults)); |
@@ -1570,12 +1563,12 @@ private: // privates | |||
1570 | m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext); | 1563 | m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext); |
1571 | } | 1564 | } |
1572 | 1565 | ||
1573 | void OnResolveSourceFallback( | 1566 | void OnCacheAcquireResolvingFallback( |
1574 | __in BA_ONRESOLVESOURCE_ARGS* pArgs, | 1567 | __in BA_ONCACHEACQUIRERESOLVING_ARGS* pArgs, |
1575 | __inout BA_ONRESOLVESOURCE_RESULTS* pResults | 1568 | __inout BA_ONCACHEACQUIRERESOLVING_RESULTS* pResults |
1576 | ) | 1569 | ) |
1577 | { | 1570 | { |
1578 | m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONRESOLVESOURCE, pArgs, pResults, m_pvBAFunctionsProcContext); | 1571 | m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRERESOLVING, pArgs, pResults, m_pvBAFunctionsProcContext); |
1579 | } | 1572 | } |
1580 | 1573 | ||
1581 | void OnCacheAcquireCompleteFallback( | 1574 | 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 @@ | |||
4 | <package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" /> | 4 | <package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" /> |
5 | <package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="native" developmentDependency="true" /> | 5 | <package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="native" developmentDependency="true" /> |
6 | <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" /> | 6 | <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" /> |
7 | <package id="WixToolset.BalUtil" version="4.0.55" targetFramework="native" /> | 7 | <package id="WixToolset.BalUtil" version="4.0.57" targetFramework="native" /> |
8 | <package id="WixToolset.BootstrapperCore.Native" version="4.0.110" targetFramework="native" /> | 8 | <package id="WixToolset.BootstrapperCore.Native" version="4.0.132" targetFramework="native" /> |
9 | <package id="WixToolset.DUtil" version="4.0.70" targetFramework="native" /> | 9 | <package id="WixToolset.DUtil" version="4.0.70" targetFramework="native" /> |
10 | </packages> \ No newline at end of file | 10 | </packages> \ 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 @@ | |||
5 | <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" /> | 5 | <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" /> |
6 | <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" /> | 6 | <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" /> |
7 | <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" /> | 7 | <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" /> |
8 | <Import Project="..\..\packages\WixToolset.BalUtil.4.0.55\build\WixToolset.BalUtil.props" Condition="Exists('..\..\packages\WixToolset.BalUtil.4.0.55\build\WixToolset.BalUtil.props')" /> | 8 | <Import Project="..\..\packages\WixToolset.BalUtil.4.0.57\build\WixToolset.BalUtil.props" Condition="Exists('..\..\packages\WixToolset.BalUtil.4.0.57\build\WixToolset.BalUtil.props')" /> |
9 | <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.110\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.110\build\WixToolset.BootstrapperCore.Native.props')" /> | 9 | <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.132\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.132\build\WixToolset.BootstrapperCore.Native.props')" /> |
10 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props')" /> | 10 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props')" /> |
11 | 11 | ||
12 | <ItemGroup Label="ProjectConfigurations"> | 12 | <ItemGroup Label="ProjectConfigurations"> |
@@ -94,8 +94,8 @@ rc.exe -fo "$(OutDir)wixstdba.res" "$(IntDir)wixstdba.messages.rc"</Command> | |||
94 | <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" /> | 94 | <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" /> |
95 | <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" /> | 95 | <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" /> |
96 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets'))" /> | 96 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets'))" /> |
97 | <Error Condition="!Exists('..\..\packages\WixToolset.BalUtil.4.0.55\build\WixToolset.BalUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BalUtil.4.0.55\build\WixToolset.BalUtil.props'))" /> | 97 | <Error Condition="!Exists('..\..\packages\WixToolset.BalUtil.4.0.57\build\WixToolset.BalUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BalUtil.4.0.57\build\WixToolset.BalUtil.props'))" /> |
98 | <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.110\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.110\build\WixToolset.BootstrapperCore.Native.props'))" /> | 98 | <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.132\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.132\build\WixToolset.BootstrapperCore.Native.props'))" /> |
99 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props'))" /> | 99 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props'))" /> |
100 | </Target> | 100 | </Target> |
101 | </Project> \ No newline at end of file | 101 | </Project> \ No newline at end of file |