aboutsummaryrefslogtreecommitdiff
path: root/src/wixstdba/WixStandardBootstrapperApplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixstdba/WixStandardBootstrapperApplication.cpp')
-rw-r--r--src/wixstdba/WixStandardBootstrapperApplication.cpp81
1 files changed, 37 insertions, 44 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(