diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-04-19 17:32:32 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-04-19 23:23:39 -0500 |
commit | 62b32cd6f21292c73dae8d5cfcd3a1cb13a1fd7d (patch) | |
tree | 428818dcb1ab7f1f79b236db7c67e82a6ea0774d /src/balutil | |
parent | 1a898496aae8189efb966abd9445e6200fdea0b7 (diff) | |
download | wix-62b32cd6f21292c73dae8d5cfcd3a1cb13a1fd7d.tar.gz wix-62b32cd6f21292c73dae8d5cfcd3a1cb13a1fd7d.tar.bz2 wix-62b32cd6f21292c73dae8d5cfcd3a1cb13a1fd7d.zip |
Replace OnResolveSource with OnCacheAcquireResolving.
Update balretry to have a separate type for container vs payload.
#3640
Diffstat (limited to 'src/balutil')
-rw-r--r-- | src/balutil/balretry.cpp | 223 | ||||
-rw-r--r-- | src/balutil/balutil.vcxproj | 8 | ||||
-rw-r--r-- | src/balutil/inc/BAFunctions.h | 2 | ||||
-rw-r--r-- | src/balutil/inc/BalBaseBAFunctions.h | 23 | ||||
-rw-r--r-- | src/balutil/inc/BalBaseBAFunctionsProc.h | 2 | ||||
-rw-r--r-- | src/balutil/inc/BalBaseBootstrapperApplication.h | 36 | ||||
-rw-r--r-- | src/balutil/inc/BalBaseBootstrapperApplicationProc.h | 16 | ||||
-rw-r--r-- | src/balutil/inc/IBootstrapperApplication.h | 50 | ||||
-rw-r--r-- | src/balutil/inc/balretry.h | 37 | ||||
-rw-r--r-- | src/balutil/packages.config | 4 |
10 files changed, 252 insertions, 149 deletions
diff --git a/src/balutil/balretry.cpp b/src/balutil/balretry.cpp index d95d86b2..9d8abd6d 100644 --- a/src/balutil/balretry.cpp +++ b/src/balutil/balretry.cpp | |||
@@ -2,23 +2,33 @@ | |||
2 | 2 | ||
3 | #include "precomp.h" | 3 | #include "precomp.h" |
4 | 4 | ||
5 | typedef enum BALRETRY_TYPE | ||
6 | { | ||
7 | BALRETRY_TYPE_CACHE_CONTAINER, | ||
8 | BALRETRY_TYPE_CACHE_PAYLOAD, | ||
9 | BALRETRY_TYPE_EXECUTE, | ||
10 | } BALRETRY_TYPE; | ||
11 | |||
5 | struct BALRETRY_INFO | 12 | struct BALRETRY_INFO |
6 | { | 13 | { |
7 | LPWSTR sczId; // package or container id. | 14 | LPWSTR sczId; |
8 | LPWSTR sczPayloadId; // optional payload id. | ||
9 | DWORD cRetries; | 15 | DWORD cRetries; |
10 | DWORD dwLastError; | 16 | DWORD dwLastError; |
11 | }; | 17 | }; |
12 | 18 | ||
13 | static DWORD vdwMaxRetries = 0; | 19 | static DWORD vdwMaxRetries = 0; |
14 | static DWORD vdwTimeout = 0; | 20 | static DWORD vdwTimeout = 0; |
15 | static BALRETRY_INFO vrgRetryInfo[2]; | 21 | static BALRETRY_INFO vrgRetryInfo[3]; |
16 | 22 | ||
17 | // prototypes | 23 | // prototypes |
18 | static BOOL IsActiveRetryEntry( | 24 | static BOOL IsActiveRetryEntry( |
19 | __in BALRETRY_TYPE type, | 25 | __in BALRETRY_TYPE type, |
20 | __in_z LPCWSTR wzPackageId, | 26 | __in_z LPCWSTR sczId |
21 | __in_z_opt LPCWSTR wzPayloadId | 27 | ); |
28 | |||
29 | static HRESULT StartActiveRetryEntry( | ||
30 | __in BALRETRY_TYPE type, | ||
31 | __in_z LPCWSTR sczId | ||
22 | ); | 32 | ); |
23 | 33 | ||
24 | 34 | ||
@@ -39,7 +49,6 @@ DAPI_(void) BalRetryUninitialize() | |||
39 | for (DWORD i = 0; i < countof(vrgRetryInfo); ++i) | 49 | for (DWORD i = 0; i < countof(vrgRetryInfo); ++i) |
40 | { | 50 | { |
41 | ReleaseStr(vrgRetryInfo[i].sczId); | 51 | ReleaseStr(vrgRetryInfo[i].sczId); |
42 | ReleaseStr(vrgRetryInfo[i].sczPayloadId); | ||
43 | memset(vrgRetryInfo + i, 0, sizeof(BALRETRY_INFO)); | 52 | memset(vrgRetryInfo + i, 0, sizeof(BALRETRY_INFO)); |
44 | } | 53 | } |
45 | 54 | ||
@@ -48,34 +57,32 @@ DAPI_(void) BalRetryUninitialize() | |||
48 | } | 57 | } |
49 | 58 | ||
50 | 59 | ||
51 | DAPI_(void) BalRetryStartPackage( | 60 | DAPI_(void) BalRetryStartContainerOrPayload( |
52 | __in BALRETRY_TYPE type, | 61 | __in_z_opt LPCWSTR wzContainerOrPackageId, |
53 | __in_z_opt LPCWSTR wzPackageId, | ||
54 | __in_z_opt LPCWSTR wzPayloadId | 62 | __in_z_opt LPCWSTR wzPayloadId |
55 | ) | 63 | ) |
56 | { | 64 | { |
57 | if (!wzPackageId || !*wzPackageId) | 65 | if (!wzContainerOrPackageId && !wzPayloadId) |
58 | { | 66 | { |
59 | ReleaseNullStr(vrgRetryInfo[type].sczId); | 67 | ReleaseNullStr(vrgRetryInfo[BALRETRY_TYPE_CACHE_CONTAINER].sczId); |
60 | ReleaseNullStr(vrgRetryInfo[type].sczPayloadId); | 68 | ReleaseNullStr(vrgRetryInfo[BALRETRY_TYPE_CACHE_PAYLOAD].sczId); |
61 | } | 69 | } |
62 | else if (IsActiveRetryEntry(type, wzPackageId, wzPayloadId)) | 70 | else if (wzPayloadId) |
63 | { | 71 | { |
64 | ++vrgRetryInfo[type].cRetries; | 72 | StartActiveRetryEntry(BALRETRY_TYPE_CACHE_PAYLOAD, wzPayloadId); |
65 | ::Sleep(vdwTimeout); | ||
66 | } | 73 | } |
67 | else | 74 | else |
68 | { | 75 | { |
69 | StrAllocString(&vrgRetryInfo[type].sczId, wzPackageId, 0); | 76 | StartActiveRetryEntry(BALRETRY_TYPE_CACHE_CONTAINER, wzContainerOrPackageId); |
70 | if (wzPayloadId) | ||
71 | { | ||
72 | StrAllocString(&vrgRetryInfo[type].sczPayloadId, wzPayloadId, 0); | ||
73 | } | ||
74 | |||
75 | vrgRetryInfo[type].cRetries = 0; | ||
76 | } | 77 | } |
78 | } | ||
77 | 79 | ||
78 | vrgRetryInfo[type].dwLastError = ERROR_SUCCESS; | 80 | |
81 | DAPI_(void) BalRetryStartPackage( | ||
82 | __in_z LPCWSTR wzPackageId | ||
83 | ) | ||
84 | { | ||
85 | StartActiveRetryEntry(BALRETRY_TYPE_EXECUTE, wzPackageId); | ||
79 | } | 86 | } |
80 | 87 | ||
81 | 88 | ||
@@ -84,87 +91,112 @@ DAPI_(void) BalRetryErrorOccurred( | |||
84 | __in DWORD dwError | 91 | __in DWORD dwError |
85 | ) | 92 | ) |
86 | { | 93 | { |
87 | if (IsActiveRetryEntry(BALRETRY_TYPE_CACHE, wzPackageId, NULL)) | 94 | if (IsActiveRetryEntry(BALRETRY_TYPE_EXECUTE, wzPackageId)) |
88 | { | 95 | { |
89 | vrgRetryInfo[BALRETRY_TYPE_CACHE].dwLastError = dwError; | 96 | vrgRetryInfo[BALRETRY_TYPE_EXECUTE].dwLastError = dwError; |
90 | } | 97 | } |
91 | else if (IsActiveRetryEntry(BALRETRY_TYPE_EXECUTE, wzPackageId, NULL)) | 98 | } |
99 | |||
100 | |||
101 | DAPI_(HRESULT) BalRetryEndContainerOrPayload( | ||
102 | __in_z_opt LPCWSTR wzContainerOrPackageId, | ||
103 | __in_z_opt LPCWSTR wzPayloadId, | ||
104 | __in HRESULT hrError, | ||
105 | __inout BOOL* pfRetry | ||
106 | ) | ||
107 | { | ||
108 | HRESULT hr = S_OK; | ||
109 | BALRETRY_TYPE type = BALRETRY_TYPE_CACHE_PAYLOAD; | ||
110 | LPCWSTR wzId = NULL; | ||
111 | |||
112 | if (!wzContainerOrPackageId && !wzPayloadId) | ||
92 | { | 113 | { |
93 | vrgRetryInfo[BALRETRY_TYPE_EXECUTE].dwLastError = dwError; | 114 | ReleaseNullStr(vrgRetryInfo[BALRETRY_TYPE_CACHE_CONTAINER].sczId); |
115 | ReleaseNullStr(vrgRetryInfo[BALRETRY_TYPE_CACHE_PAYLOAD].sczId); | ||
116 | ExitFunction(); | ||
117 | } | ||
118 | else if (wzPayloadId) | ||
119 | { | ||
120 | type = BALRETRY_TYPE_CACHE_PAYLOAD; | ||
121 | wzId = wzPayloadId; | ||
122 | } | ||
123 | else | ||
124 | { | ||
125 | type = BALRETRY_TYPE_CACHE_CONTAINER; | ||
126 | wzId = wzContainerOrPackageId; | ||
94 | } | 127 | } |
128 | |||
129 | if (FAILED(hrError) && vrgRetryInfo[type].cRetries < vdwMaxRetries && IsActiveRetryEntry(type, wzId)) | ||
130 | { | ||
131 | // Retry on all errors except the following. | ||
132 | if (HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT) != hrError && | ||
133 | BG_E_NETWORK_DISCONNECTED != hrError && | ||
134 | HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) != hrError && | ||
135 | HRESULT_FROM_WIN32(ERROR_INTERNET_NAME_NOT_RESOLVED) != hrError) | ||
136 | { | ||
137 | *pfRetry = TRUE; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | LExit: | ||
142 | return hr; | ||
95 | } | 143 | } |
96 | 144 | ||
97 | 145 | ||
98 | DAPI_(HRESULT) BalRetryEndPackage( | 146 | DAPI_(HRESULT) BalRetryEndPackage( |
99 | __in BALRETRY_TYPE type, | 147 | __in_z LPCWSTR wzPackageId, |
100 | __in_z_opt LPCWSTR wzPackageId, | ||
101 | __in_z_opt LPCWSTR wzPayloadId, | ||
102 | __in HRESULT hrError, | 148 | __in HRESULT hrError, |
103 | __inout BOOL* pfRetry | 149 | __inout BOOL* pfRetry |
104 | ) | 150 | ) |
105 | { | 151 | { |
106 | HRESULT hr = S_OK; | 152 | HRESULT hr = S_OK; |
153 | BALRETRY_TYPE type = BALRETRY_TYPE_EXECUTE; | ||
107 | 154 | ||
108 | if (!wzPackageId || !*wzPackageId) | 155 | if (!wzPackageId || !*wzPackageId) |
109 | { | 156 | { |
110 | ReleaseNullStr(vrgRetryInfo[type].sczId); | 157 | ReleaseNullStr(vrgRetryInfo[type].sczId); |
111 | ReleaseNullStr(vrgRetryInfo[type].sczPayloadId); | ||
112 | } | 158 | } |
113 | else if (FAILED(hrError) && vrgRetryInfo[type].cRetries < vdwMaxRetries && IsActiveRetryEntry(type, wzPackageId, wzPayloadId)) | 159 | else if (FAILED(hrError) && vrgRetryInfo[type].cRetries < vdwMaxRetries && IsActiveRetryEntry(type, wzPackageId)) |
114 | { | 160 | { |
115 | if (BALRETRY_TYPE_CACHE == type) | 161 | // If the service is out of whack, just try again. |
162 | if (HRESULT_FROM_WIN32(ERROR_INSTALL_SERVICE_FAILURE) == hrError) | ||
116 | { | 163 | { |
117 | // Retry on all errors except the following. | 164 | *pfRetry = TRUE; |
118 | if (HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT) != hrError && | ||
119 | BG_E_NETWORK_DISCONNECTED != hrError && | ||
120 | HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) != hrError && | ||
121 | HRESULT_FROM_WIN32(ERROR_INTERNET_NAME_NOT_RESOLVED) != hrError) | ||
122 | { | ||
123 | *pfRetry = TRUE; | ||
124 | } | ||
125 | } | 165 | } |
126 | else if (BALRETRY_TYPE_EXECUTE == type) | 166 | else if (HRESULT_FROM_WIN32(ERROR_INSTALL_FAILURE) == hrError) |
127 | { | 167 | { |
128 | // If the service is out of whack, just try again. | 168 | DWORD dwError = vrgRetryInfo[type].dwLastError; |
129 | if (HRESULT_FROM_WIN32(ERROR_INSTALL_SERVICE_FAILURE) == hrError) | 169 | |
130 | { | 170 | // If we failed with one of these specific error codes, then retry since |
131 | *pfRetry = TRUE; | 171 | // we've seen these have a high success of succeeding on retry. |
132 | } | 172 | if (1303 == dwError || |
133 | else if (HRESULT_FROM_WIN32(ERROR_INSTALL_FAILURE) == hrError) | 173 | 1304 == dwError || |
134 | { | 174 | 1306 == dwError || |
135 | DWORD dwError = vrgRetryInfo[type].dwLastError; | 175 | 1307 == dwError || |
136 | 176 | 1309 == dwError || | |
137 | // If we failed with one of these specific error codes, then retry since | 177 | 1310 == dwError || |
138 | // we've seen these have a high success of succeeding on retry. | 178 | 1311 == dwError || |
139 | if (1303 == dwError || | 179 | 1312 == dwError || |
140 | 1304 == dwError || | 180 | 1316 == dwError || |
141 | 1306 == dwError || | 181 | 1317 == dwError || |
142 | 1307 == dwError || | 182 | 1321 == dwError || |
143 | 1309 == dwError || | 183 | 1335 == dwError || |
144 | 1310 == dwError || | 184 | 1402 == dwError || |
145 | 1311 == dwError || | 185 | 1406 == dwError || |
146 | 1312 == dwError || | 186 | 1606 == dwError || |
147 | 1316 == dwError || | 187 | 1706 == dwError || |
148 | 1317 == dwError || | 188 | 1719 == dwError || |
149 | 1321 == dwError || | 189 | 1723 == dwError || |
150 | 1335 == dwError || | 190 | 1923 == dwError || |
151 | 1402 == dwError || | 191 | 1931 == dwError) |
152 | 1406 == dwError || | ||
153 | 1606 == dwError || | ||
154 | 1706 == dwError || | ||
155 | 1719 == dwError || | ||
156 | 1723 == dwError || | ||
157 | 1923 == dwError || | ||
158 | 1931 == dwError) | ||
159 | { | ||
160 | *pfRetry = TRUE; | ||
161 | } | ||
162 | } | ||
163 | else if (HRESULT_FROM_WIN32(ERROR_INSTALL_ALREADY_RUNNING) == hrError) | ||
164 | { | 192 | { |
165 | *pfRetry = TRUE; | 193 | *pfRetry = TRUE; |
166 | } | 194 | } |
167 | } | 195 | } |
196 | else if (HRESULT_FROM_WIN32(ERROR_INSTALL_ALREADY_RUNNING) == hrError) | ||
197 | { | ||
198 | *pfRetry = TRUE; | ||
199 | } | ||
168 | } | 200 | } |
169 | 201 | ||
170 | return hr; | 202 | return hr; |
@@ -175,17 +207,40 @@ DAPI_(HRESULT) BalRetryEndPackage( | |||
175 | 207 | ||
176 | static BOOL IsActiveRetryEntry( | 208 | static BOOL IsActiveRetryEntry( |
177 | __in BALRETRY_TYPE type, | 209 | __in BALRETRY_TYPE type, |
178 | __in_z LPCWSTR wzPackageId, | 210 | __in_z LPCWSTR sczId |
179 | __in_z_opt LPCWSTR wzPayloadId | ||
180 | ) | 211 | ) |
181 | { | 212 | { |
182 | BOOL fActive = FALSE; | 213 | BOOL fActive = FALSE; |
183 | 214 | ||
184 | fActive = vrgRetryInfo[type].sczId && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzPackageId, -1, vrgRetryInfo[type].sczId, -1); | 215 | fActive = vrgRetryInfo[type].sczId && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, sczId, -1, vrgRetryInfo[type].sczId, -1); |
185 | if (fActive && wzPayloadId) // if a payload id was provided ensure it matches. | 216 | |
217 | return fActive; | ||
218 | } | ||
219 | |||
220 | static HRESULT StartActiveRetryEntry( | ||
221 | __in BALRETRY_TYPE type, | ||
222 | __in_z LPCWSTR sczId | ||
223 | ) | ||
224 | { | ||
225 | HRESULT hr = S_OK; | ||
226 | |||
227 | if (!sczId || !*sczId) | ||
186 | { | 228 | { |
187 | fActive = vrgRetryInfo[type].sczPayloadId && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzPayloadId, -1, vrgRetryInfo[type].sczPayloadId, -1); | 229 | ReleaseNullStr(vrgRetryInfo[type].sczId); |
188 | } | 230 | } |
231 | else if (IsActiveRetryEntry(type, sczId)) | ||
232 | { | ||
233 | ++vrgRetryInfo[type].cRetries; | ||
234 | ::Sleep(vdwTimeout); | ||
235 | } | ||
236 | else | ||
237 | { | ||
238 | hr = StrAllocString(&vrgRetryInfo[type].sczId, sczId, 0); | ||
189 | 239 | ||
190 | return fActive; | 240 | vrgRetryInfo[type].cRetries = 0; |
241 | } | ||
242 | |||
243 | vrgRetryInfo[type].dwLastError = ERROR_SUCCESS; | ||
244 | |||
245 | return hr; | ||
191 | } | 246 | } |
diff --git a/src/balutil/balutil.vcxproj b/src/balutil/balutil.vcxproj index 6d31f9ba..a47e994f 100644 --- a/src/balutil/balutil.vcxproj +++ b/src/balutil/balutil.vcxproj | |||
@@ -2,8 +2,8 @@ | |||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
3 | 3 | ||
4 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 4 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
5 | <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')" /> | 5 | <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')" /> |
6 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.64\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.64\build\WixToolset.DUtil.props')" /> | 6 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.70\build\WixToolset.DUtil.props')" /> |
7 | 7 | ||
8 | <ItemGroup Label="ProjectConfigurations"> | 8 | <ItemGroup Label="ProjectConfigurations"> |
9 | <ProjectConfiguration Include="Debug|ARM64"> | 9 | <ProjectConfiguration Include="Debug|ARM64"> |
@@ -98,8 +98,8 @@ | |||
98 | <PropertyGroup> | 98 | <PropertyGroup> |
99 | <ErrorText>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}.</ErrorText> | 99 | <ErrorText>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}.</ErrorText> |
100 | </PropertyGroup> | 100 | </PropertyGroup> |
101 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.64\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.64\build\WixToolset.DUtil.props'))" /> | 101 | <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'))" /> |
102 | <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'))" /> | 102 | <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'))" /> |
103 | <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'))" /> | 103 | <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'))" /> |
104 | </Target> | 104 | </Target> |
105 | </Project> \ No newline at end of file | 105 | </Project> \ No newline at end of file |
diff --git a/src/balutil/inc/BAFunctions.h b/src/balutil/inc/BAFunctions.h index 66852efa..07f7a750 100644 --- a/src/balutil/inc/BAFunctions.h +++ b/src/balutil/inc/BAFunctions.h | |||
@@ -42,7 +42,7 @@ enum BA_FUNCTIONS_MESSAGE | |||
42 | BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGEBEGIN, | 42 | BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGEBEGIN, |
43 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREBEGIN, | 43 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREBEGIN, |
44 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS, | 44 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS, |
45 | BA_FUNCTIONS_MESSAGE_ONRESOLVESOURCE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONRESOLVESOURCE, | 45 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRERESOLVING = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRERESOLVING, |
46 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE, | 46 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE, |
47 | BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYBEGIN, | 47 | BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYBEGIN, |
48 | BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYCOMPLETE, | 48 | BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYCOMPLETE, |
diff --git a/src/balutil/inc/BalBaseBAFunctions.h b/src/balutil/inc/BalBaseBAFunctions.h index 0164269c..ca727f49 100644 --- a/src/balutil/inc/BalBaseBAFunctions.h +++ b/src/balutil/inc/BalBaseBAFunctions.h | |||
@@ -90,6 +90,7 @@ public: // IBootstrapperApplication | |||
90 | } | 90 | } |
91 | 91 | ||
92 | virtual STDMETHODIMP OnDetectBegin( | 92 | virtual STDMETHODIMP OnDetectBegin( |
93 | __in BOOL /*fCached*/, | ||
93 | __in BOOL /*fInstalled*/, | 94 | __in BOOL /*fInstalled*/, |
94 | __in DWORD /*cPackages*/, | 95 | __in DWORD /*cPackages*/, |
95 | __inout BOOL* /*pfCancel*/ | 96 | __inout BOOL* /*pfCancel*/ |
@@ -385,8 +386,11 @@ public: // IBootstrapperApplication | |||
385 | virtual STDMETHODIMP OnCacheAcquireBegin( | 386 | virtual STDMETHODIMP OnCacheAcquireBegin( |
386 | __in_z LPCWSTR /*wzPackageOrContainerId*/, | 387 | __in_z LPCWSTR /*wzPackageOrContainerId*/, |
387 | __in_z_opt LPCWSTR /*wzPayloadId*/, | 388 | __in_z_opt LPCWSTR /*wzPayloadId*/, |
388 | __in BOOTSTRAPPER_CACHE_OPERATION /*operation*/, | ||
389 | __in_z LPCWSTR /*wzSource*/, | 389 | __in_z LPCWSTR /*wzSource*/, |
390 | __in_z_opt LPCWSTR /*wzDownloadUrl*/, | ||
391 | __in_z_opt LPCWSTR /*wzPayloadContainerId*/, | ||
392 | __in BOOTSTRAPPER_CACHE_OPERATION /*recommendation*/, | ||
393 | __inout BOOTSTRAPPER_CACHE_OPERATION* /*pAction*/, | ||
390 | __inout BOOL* /*pfCancel*/ | 394 | __inout BOOL* /*pfCancel*/ |
391 | ) | 395 | ) |
392 | { | 396 | { |
@@ -405,13 +409,18 @@ public: // IBootstrapperApplication | |||
405 | return S_OK; | 409 | return S_OK; |
406 | } | 410 | } |
407 | 411 | ||
408 | virtual STDMETHODIMP OnResolveSource( | 412 | virtual STDMETHODIMP OnCacheAcquireResolving( |
409 | __in_z LPCWSTR /*wzPackageOrContainerId*/, | 413 | __in_z_opt LPCWSTR /*wzPackageOrContainerId*/, |
410 | __in_z_opt LPCWSTR /*wzPayloadId*/, | 414 | __in_z_opt LPCWSTR /*wzPayloadId*/, |
411 | __in_z LPCWSTR /*wzLocalSource*/, | 415 | __in_z LPCWSTR* /*rgSearchPaths*/, |
412 | __in_z_opt LPCWSTR /*wzDownloadSource*/, | 416 | __in DWORD /*cSearchPaths*/, |
413 | __in BOOTSTRAPPER_RESOLVESOURCE_ACTION /*recommendation*/, | 417 | __in BOOL /*fFoundLocal*/, |
414 | __inout BOOTSTRAPPER_RESOLVESOURCE_ACTION* /*pAction*/, | 418 | __in DWORD /*dwRecommendedSearchPath*/, |
419 | __in_z_opt LPCWSTR /*wzDownloadUrl*/, | ||
420 | __in_z_opt LPCWSTR /*wzPayloadContainerId*/, | ||
421 | __in BOOTSTRAPPER_CACHE_RESOLVE_OPERATION /*recommendation*/, | ||
422 | __inout DWORD* /*pdwChosenSearchPath*/, | ||
423 | __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* /*pAction*/, | ||
415 | __inout BOOL* /*pfCancel*/ | 424 | __inout BOOL* /*pfCancel*/ |
416 | ) | 425 | ) |
417 | { | 426 | { |
diff --git a/src/balutil/inc/BalBaseBAFunctionsProc.h b/src/balutil/inc/BalBaseBAFunctionsProc.h index e1de800a..7e89fe83 100644 --- a/src/balutil/inc/BalBaseBAFunctionsProc.h +++ b/src/balutil/inc/BalBaseBAFunctionsProc.h | |||
@@ -77,7 +77,7 @@ static HRESULT WINAPI BalBaseBAFunctionsProc( | |||
77 | case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN: | 77 | case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN: |
78 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN: | 78 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN: |
79 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS: | 79 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS: |
80 | case BA_FUNCTIONS_MESSAGE_ONRESOLVESOURCE: | 80 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRERESOLVING: |
81 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE: | 81 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE: |
82 | case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN: | 82 | case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN: |
83 | case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE: | 83 | case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE: |
diff --git a/src/balutil/inc/BalBaseBootstrapperApplication.h b/src/balutil/inc/BalBaseBootstrapperApplication.h index c9211e0f..3d3e4ffa 100644 --- a/src/balutil/inc/BalBaseBootstrapperApplication.h +++ b/src/balutil/inc/BalBaseBootstrapperApplication.h | |||
@@ -87,6 +87,7 @@ public: // IBootstrapperApplication | |||
87 | } | 87 | } |
88 | 88 | ||
89 | virtual STDMETHODIMP OnDetectBegin( | 89 | virtual STDMETHODIMP OnDetectBegin( |
90 | __in BOOL /*fCached*/, | ||
90 | __in BOOL /*fInstalled*/, | 91 | __in BOOL /*fInstalled*/, |
91 | __in DWORD /*cPackages*/, | 92 | __in DWORD /*cPackages*/, |
92 | __inout BOOL* pfCancel | 93 | __inout BOOL* pfCancel |
@@ -442,14 +443,17 @@ public: // IBootstrapperApplication | |||
442 | } | 443 | } |
443 | 444 | ||
444 | virtual STDMETHODIMP OnCacheAcquireBegin( | 445 | virtual STDMETHODIMP OnCacheAcquireBegin( |
445 | __in_z LPCWSTR wzPackageOrContainerId, | 446 | __in_z_opt LPCWSTR wzPackageOrContainerId, |
446 | __in_z_opt LPCWSTR wzPayloadId, | 447 | __in_z_opt LPCWSTR wzPayloadId, |
447 | __in BOOTSTRAPPER_CACHE_OPERATION /*operation*/, | ||
448 | __in_z LPCWSTR /*wzSource*/, | 448 | __in_z LPCWSTR /*wzSource*/, |
449 | __in_z_opt LPCWSTR /*wzDownloadUrl*/, | ||
450 | __in_z_opt LPCWSTR /*wzPayloadContainerId*/, | ||
451 | __in BOOTSTRAPPER_CACHE_OPERATION /*recommendation*/, | ||
452 | __inout BOOTSTRAPPER_CACHE_OPERATION* /*pAction*/, | ||
449 | __inout BOOL* pfCancel | 453 | __inout BOOL* pfCancel |
450 | ) | 454 | ) |
451 | { | 455 | { |
452 | BalRetryStartPackage(BALRETRY_TYPE_CACHE, wzPackageOrContainerId, wzPayloadId); | 456 | BalRetryStartContainerOrPayload(wzPackageOrContainerId, wzPayloadId); |
453 | *pfCancel |= CheckCanceled(); | 457 | *pfCancel |= CheckCanceled(); |
454 | return S_OK; | 458 | return S_OK; |
455 | } | 459 | } |
@@ -488,13 +492,18 @@ public: // IBootstrapperApplication | |||
488 | return hr; | 492 | return hr; |
489 | } | 493 | } |
490 | 494 | ||
491 | virtual STDMETHODIMP OnResolveSource( | 495 | virtual STDMETHODIMP OnCacheAcquireResolving( |
492 | __in_z LPCWSTR /*wzPackageOrContainerId*/, | 496 | __in_z_opt LPCWSTR /*wzPackageOrContainerId*/, |
493 | __in_z_opt LPCWSTR /*wzPayloadId*/, | 497 | __in_z_opt LPCWSTR /*wzPayloadId*/, |
494 | __in_z LPCWSTR /*wzLocalSource*/, | 498 | __in_z LPCWSTR* /*rgSearchPaths*/, |
495 | __in_z_opt LPCWSTR /*wzDownloadSource*/, | 499 | __in DWORD /*cSearchPaths*/, |
496 | __in BOOTSTRAPPER_RESOLVESOURCE_ACTION /*recommendation*/, | 500 | __in BOOL /*fFoundLocal*/, |
497 | __inout BOOTSTRAPPER_RESOLVESOURCE_ACTION* /*pAction*/, | 501 | __in DWORD /*dwRecommendedSearchPath*/, |
502 | __in_z_opt LPCWSTR /*wzDownloadUrl*/, | ||
503 | __in_z_opt LPCWSTR /*wzPayloadContainerId*/, | ||
504 | __in BOOTSTRAPPER_CACHE_RESOLVE_OPERATION /*recommendation*/, | ||
505 | __inout DWORD* /*pdwChosenSearchPath*/, | ||
506 | __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* /*pAction*/, | ||
498 | __inout BOOL* pfCancel | 507 | __inout BOOL* pfCancel |
499 | ) | 508 | ) |
500 | { | 509 | { |
@@ -518,7 +527,7 @@ public: // IBootstrapperApplication | |||
518 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); | 527 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); |
519 | } | 528 | } |
520 | 529 | ||
521 | hr = BalRetryEndPackage(BALRETRY_TYPE_CACHE, wzPackageOrContainerId, wzPayloadId, hrStatus, &fRetry); | 530 | hr = BalRetryEndContainerOrPayload(wzPackageOrContainerId, wzPayloadId, hrStatus, &fRetry); |
522 | ExitOnFailure(hr, "BalRetryEndPackage for cache failed"); | 531 | ExitOnFailure(hr, "BalRetryEndPackage for cache failed"); |
523 | 532 | ||
524 | if (fRetry) | 533 | if (fRetry) |
@@ -599,7 +608,7 @@ public: // IBootstrapperApplication | |||
599 | // Only track retry on execution (not rollback). | 608 | // Only track retry on execution (not rollback). |
600 | if (fExecute) | 609 | if (fExecute) |
601 | { | 610 | { |
602 | BalRetryStartPackage(BALRETRY_TYPE_EXECUTE, wzPackageId, NULL); | 611 | BalRetryStartPackage(wzPackageId); |
603 | } | 612 | } |
604 | 613 | ||
605 | m_fRollingBack = !fExecute; | 614 | m_fRollingBack = !fExecute; |
@@ -700,7 +709,7 @@ public: // IBootstrapperApplication | |||
700 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); | 709 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); |
701 | } | 710 | } |
702 | 711 | ||
703 | hr = BalRetryEndPackage(BALRETRY_TYPE_EXECUTE, wzPackageId, NULL, hrStatus, &fRetry); | 712 | hr = BalRetryEndPackage(wzPackageId, hrStatus, &fRetry); |
704 | ExitOnFailure(hr, "BalRetryEndPackage for execute failed"); | 713 | ExitOnFailure(hr, "BalRetryEndPackage for execute failed"); |
705 | 714 | ||
706 | if (fRetry) | 715 | if (fRetry) |
@@ -951,6 +960,9 @@ protected: | |||
951 | m_fApplying = FALSE; | 960 | m_fApplying = FALSE; |
952 | m_fRollingBack = FALSE; | 961 | m_fRollingBack = FALSE; |
953 | 962 | ||
963 | m_dwProgressPercentage = 0; | ||
964 | m_dwOverallProgressPercentage = 0; | ||
965 | |||
954 | BalRetryInitialize(dwRetryCount, dwRetryTimeout); | 966 | BalRetryInitialize(dwRetryCount, dwRetryTimeout); |
955 | } | 967 | } |
956 | 968 | ||
diff --git a/src/balutil/inc/BalBaseBootstrapperApplicationProc.h b/src/balutil/inc/BalBaseBootstrapperApplicationProc.h index d8a6590b..42ffeb79 100644 --- a/src/balutil/inc/BalBaseBootstrapperApplicationProc.h +++ b/src/balutil/inc/BalBaseBootstrapperApplicationProc.h | |||
@@ -15,7 +15,7 @@ static HRESULT BalBaseBAProcOnDetectBegin( | |||
15 | __inout BA_ONDETECTBEGIN_RESULTS* pResults | 15 | __inout BA_ONDETECTBEGIN_RESULTS* pResults |
16 | ) | 16 | ) |
17 | { | 17 | { |
18 | return pBA->OnDetectBegin(pArgs->fInstalled, pArgs->cPackages, &pResults->fCancel); | 18 | return pBA->OnDetectBegin(pArgs->fCached, pArgs->fInstalled, pArgs->cPackages, &pResults->fCancel); |
19 | } | 19 | } |
20 | 20 | ||
21 | static HRESULT BalBaseBAProcOnDetectComplete( | 21 | static HRESULT BalBaseBAProcOnDetectComplete( |
@@ -303,7 +303,7 @@ static HRESULT BalBaseBAProcOnCacheAcquireBegin( | |||
303 | __inout BA_ONCACHEACQUIREBEGIN_RESULTS* pResults | 303 | __inout BA_ONCACHEACQUIREBEGIN_RESULTS* pResults |
304 | ) | 304 | ) |
305 | { | 305 | { |
306 | return pBA->OnCacheAcquireBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->operation, pArgs->wzSource, &pResults->fCancel); | 306 | return pBA->OnCacheAcquireBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->wzSource, pArgs->wzDownloadUrl, pArgs->wzPayloadContainerId, pArgs->recommendation, &pResults->action, &pResults->fCancel); |
307 | } | 307 | } |
308 | 308 | ||
309 | static HRESULT BalBaseBAProcOnCacheAcquireProgress( | 309 | static HRESULT BalBaseBAProcOnCacheAcquireProgress( |
@@ -315,13 +315,13 @@ static HRESULT BalBaseBAProcOnCacheAcquireProgress( | |||
315 | return pBA->OnCacheAcquireProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel); | 315 | return pBA->OnCacheAcquireProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel); |
316 | } | 316 | } |
317 | 317 | ||
318 | static HRESULT BalBaseBAProcOnResolveSource( | 318 | static HRESULT BalBaseBAProcOnCacheAcquireResolving( |
319 | __in IBootstrapperApplication* pBA, | 319 | __in IBootstrapperApplication* pBA, |
320 | __in BA_ONRESOLVESOURCE_ARGS* pArgs, | 320 | __in BA_ONCACHEACQUIRERESOLVING_ARGS* pArgs, |
321 | __inout BA_ONRESOLVESOURCE_RESULTS* pResults | 321 | __inout BA_ONCACHEACQUIRERESOLVING_RESULTS* pResults |
322 | ) | 322 | ) |
323 | { | 323 | { |
324 | return pBA->OnResolveSource(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->wzLocalSource, pArgs->wzDownloadSource, pArgs->recommendation, &pResults->action, &pResults->fCancel); | 324 | return pBA->OnCacheAcquireResolving(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->rgSearchPaths, pArgs->cSearchPaths, pArgs->fFoundLocal, pArgs->dwRecommendedSearchPath, pArgs->wzDownloadUrl, pArgs->wzPayloadContainerId, pArgs->recommendation, &pResults->dwChosenSearchPath, &pResults->action, &pResults->fCancel); |
325 | } | 325 | } |
326 | 326 | ||
327 | static HRESULT BalBaseBAProcOnCacheAcquireComplete( | 327 | static HRESULT BalBaseBAProcOnCacheAcquireComplete( |
@@ -713,8 +713,8 @@ static HRESULT WINAPI BalBaseBootstrapperApplicationProc( | |||
713 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS: | 713 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS: |
714 | hr = BalBaseBAProcOnCacheAcquireProgress(pBA, reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_RESULTS*>(pvResults)); | 714 | hr = BalBaseBAProcOnCacheAcquireProgress(pBA, reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_RESULTS*>(pvResults)); |
715 | break; | 715 | break; |
716 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONRESOLVESOURCE: | 716 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRERESOLVING: |
717 | hr = BalBaseBAProcOnResolveSource(pBA, reinterpret_cast<BA_ONRESOLVESOURCE_ARGS*>(pvArgs), reinterpret_cast<BA_ONRESOLVESOURCE_RESULTS*>(pvResults)); | 717 | hr = BalBaseBAProcOnCacheAcquireResolving(pBA, reinterpret_cast<BA_ONCACHEACQUIRERESOLVING_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRERESOLVING_RESULTS*>(pvResults)); |
718 | break; | 718 | break; |
719 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE: | 719 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE: |
720 | hr = BalBaseBAProcOnCacheAcquireComplete(pBA, reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_RESULTS*>(pvResults)); | 720 | hr = BalBaseBAProcOnCacheAcquireComplete(pBA, reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_RESULTS*>(pvResults)); |
diff --git a/src/balutil/inc/IBootstrapperApplication.h b/src/balutil/inc/IBootstrapperApplication.h index ed70d8fe..8fcdd318 100644 --- a/src/balutil/inc/IBootstrapperApplication.h +++ b/src/balutil/inc/IBootstrapperApplication.h | |||
@@ -21,6 +21,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
21 | 21 | ||
22 | // OnDetectBegin - called when the engine begins detection. | 22 | // OnDetectBegin - called when the engine begins detection. |
23 | STDMETHOD(OnDetectBegin)( | 23 | STDMETHOD(OnDetectBegin)( |
24 | __in BOOL fCached, | ||
24 | __in BOOL fInstalled, | 25 | __in BOOL fInstalled, |
25 | __in DWORD cPackages, | 26 | __in DWORD cPackages, |
26 | __inout BOOL* pfCancel | 27 | __inout BOOL* pfCancel |
@@ -279,14 +280,20 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
279 | __inout BOOL* pfCancel | 280 | __inout BOOL* pfCancel |
280 | ) = 0; | 281 | ) = 0; |
281 | 282 | ||
282 | // OnCacheAcquireBegin - called when the engine begins copying or | 283 | // OnCacheAcquireBegin - called when the engine begins acquiring a payload or container. |
283 | // downloading a payload to the working folder. | 284 | // |
285 | // Notes: | ||
286 | // It is expected the BA may call IBootstrapperEngine::SetLocalSource() or IBootstrapperEngine::SetDownloadSource() | ||
287 | // to update the source location before returning. | ||
284 | // | 288 | // |
285 | STDMETHOD(OnCacheAcquireBegin)( | 289 | STDMETHOD(OnCacheAcquireBegin)( |
286 | __in_z_opt LPCWSTR wzPackageOrContainerId, | 290 | __in_z_opt LPCWSTR wzPackageOrContainerId, |
287 | __in_z_opt LPCWSTR wzPayloadId, | 291 | __in_z_opt LPCWSTR wzPayloadId, |
288 | __in BOOTSTRAPPER_CACHE_OPERATION operation, | ||
289 | __in_z LPCWSTR wzSource, | 292 | __in_z LPCWSTR wzSource, |
293 | __in_z_opt LPCWSTR wzDownloadUrl, | ||
294 | __in_z_opt LPCWSTR wzPayloadContainerId, | ||
295 | __in BOOTSTRAPPER_CACHE_OPERATION recommendation, | ||
296 | __inout BOOTSTRAPPER_CACHE_OPERATION* pAction, | ||
290 | __inout BOOL* pfCancel | 297 | __inout BOOL* pfCancel |
291 | ) = 0; | 298 | ) = 0; |
292 | 299 | ||
@@ -302,27 +309,38 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
302 | __inout BOOL* pfCancel | 309 | __inout BOOL* pfCancel |
303 | ) = 0; | 310 | ) = 0; |
304 | 311 | ||
305 | // OnResolveSource - called when a payload or container cannot be found locally. | 312 | // OnCacheAcquireResolving - called to allow the BA to override the acquisition action for the payload or container. |
306 | // | 313 | // |
307 | // Parameters: | 314 | // Parameters: |
315 | // wzPackageOrContainerId will be NULL when resolving a layout-only payload. | ||
308 | // wzPayloadId will be NULL when resolving a container. | 316 | // wzPayloadId will be NULL when resolving a container. |
309 | // wzDownloadSource will be NULL if the container or payload does not provide a DownloadURL. | 317 | // wzDownloadUrl will be NULL if the container or payload does not provide a DownloadURL. |
318 | // wzPayloadContainerId will not be NULL if acquiring a payload that is in a container. | ||
310 | // | 319 | // |
311 | // Notes: | 320 | // rgSearchPaths are the search paths used for source resolution. |
312 | // It is expected the BA may call IBootstrapperEngine::SetLocalSource() or IBootstrapperEngine::SetDownloadSource() | 321 | // fFoundLocal is TRUE when dwRecommendedSearchPath indicates that the file was found. |
313 | // to update the source location before returning BOOTSTRAPPER_RESOLVESOURCE_ACTION_RETRY or BOOTSTRAPPER_RESOLVESOURCE_ACTION_DOWNLOAD. | 322 | // dwRecommendedSearchPath is the index into rgSearchPaths for the recommended local file. |
314 | STDMETHOD(OnResolveSource)( | 323 | // |
315 | __in_z LPCWSTR wzPackageOrContainerId, | 324 | STDMETHOD(OnCacheAcquireResolving)( |
325 | __in_z_opt LPCWSTR wzPackageOrContainerId, | ||
316 | __in_z_opt LPCWSTR wzPayloadId, | 326 | __in_z_opt LPCWSTR wzPayloadId, |
317 | __in_z LPCWSTR wzLocalSource, | 327 | __in_z LPCWSTR* rgSearchPaths, |
318 | __in_z_opt LPCWSTR wzDownloadSource, | 328 | __in DWORD cSearchPaths, |
319 | __in BOOTSTRAPPER_RESOLVESOURCE_ACTION recommendation, | 329 | __in BOOL fFoundLocal, |
320 | __inout BOOTSTRAPPER_RESOLVESOURCE_ACTION* pAction, | 330 | __in DWORD dwRecommendedSearchPath, |
331 | __in_z_opt LPCWSTR wzDownloadUrl, | ||
332 | __in_z_opt LPCWSTR wzPayloadContainerId, | ||
333 | __in BOOTSTRAPPER_CACHE_RESOLVE_OPERATION recommendation, | ||
334 | __inout DWORD* pdwChosenSearchPath, | ||
335 | __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* pAction, | ||
321 | __inout BOOL* pfCancel | 336 | __inout BOOL* pfCancel |
322 | ) = 0; | 337 | ) = 0; |
323 | 338 | ||
324 | // OnCacheAcquireComplete - called after the engine copied or downloaded | 339 | // OnCacheAcquireComplete - called after the engine acquired the payload or container. |
325 | // a payload to the working folder. | 340 | // |
341 | // Notes: | ||
342 | // It is expected the BA may call IBootstrapperEngine::SetLocalSource() or IBootstrapperEngine::SetDownloadSource() | ||
343 | // to update the source location before returning BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION_RETRY. | ||
326 | // | 344 | // |
327 | STDMETHOD(OnCacheAcquireComplete)( | 345 | STDMETHOD(OnCacheAcquireComplete)( |
328 | __in_z_opt LPCWSTR wzPackageOrContainerId, | 346 | __in_z_opt LPCWSTR wzPackageOrContainerId, |
diff --git a/src/balutil/inc/balretry.h b/src/balutil/inc/balretry.h index 040ab4ae..35282a7e 100644 --- a/src/balutil/inc/balretry.h +++ b/src/balutil/inc/balretry.h | |||
@@ -6,12 +6,6 @@ | |||
6 | extern "C" { | 6 | extern "C" { |
7 | #endif | 7 | #endif |
8 | 8 | ||
9 | typedef enum BALRETRY_TYPE | ||
10 | { | ||
11 | BALRETRY_TYPE_CACHE, | ||
12 | BALRETRY_TYPE_EXECUTE, | ||
13 | } BALRETRY_TYPE; | ||
14 | |||
15 | /******************************************************************* | 9 | /******************************************************************* |
16 | BalRetryInitialize - initialize the retry count and timeout between | 10 | BalRetryInitialize - initialize the retry count and timeout between |
17 | retries (in milliseconds). | 11 | retries (in milliseconds). |
@@ -33,9 +27,7 @@ DAPI_(void) BalRetryUninitialize(); | |||
33 | wait the specified timeout. | 27 | wait the specified timeout. |
34 | ********************************************************************/ | 28 | ********************************************************************/ |
35 | DAPI_(void) BalRetryStartPackage( | 29 | DAPI_(void) BalRetryStartPackage( |
36 | __in BALRETRY_TYPE type, | 30 | __in_z LPCWSTR wzPackageId |
37 | __in_z_opt LPCWSTR wzPackageId, | ||
38 | __in_z_opt LPCWSTR wzPayloadId | ||
39 | ); | 31 | ); |
40 | 32 | ||
41 | /******************************************************************* | 33 | /******************************************************************* |
@@ -43,17 +35,34 @@ DAPI_(void) BalRetryStartPackage( | |||
43 | to consider. | 35 | to consider. |
44 | ********************************************************************/ | 36 | ********************************************************************/ |
45 | DAPI_(void) BalRetryErrorOccurred( | 37 | DAPI_(void) BalRetryErrorOccurred( |
46 | __in_z_opt LPCWSTR wzPackageId, | 38 | __in_z LPCWSTR wzPackageId, |
47 | __in DWORD dwError | 39 | __in DWORD dwError |
48 | ); | 40 | ); |
49 | 41 | ||
50 | /******************************************************************* | 42 | /******************************************************************* |
51 | BalRetryEndPackage - returns IDRETRY is a retry is recommended or | 43 | BalRetryEndPackage - returns TRUE if a retry is recommended. |
52 | IDNOACTION if a retry is not recommended. | ||
53 | ********************************************************************/ | 44 | ********************************************************************/ |
54 | DAPI_(HRESULT) BalRetryEndPackage( | 45 | DAPI_(HRESULT) BalRetryEndPackage( |
55 | __in BALRETRY_TYPE type, | 46 | __in_z LPCWSTR wzPackageId, |
56 | __in_z_opt LPCWSTR wzPackageId, | 47 | __in HRESULT hrError, |
48 | __inout BOOL* pfRetry | ||
49 | ); | ||
50 | |||
51 | /******************************************************************* | ||
52 | BalRetryStartContainerOrPayload - call when a container or payload | ||
53 | begins to be acquired. If the target is being retried, | ||
54 | the function will wait the specified timeout. | ||
55 | ********************************************************************/ | ||
56 | DAPI_(void) BalRetryStartContainerOrPayload( | ||
57 | __in_z_opt LPCWSTR wzContainerOrPackageId, | ||
58 | __in_z_opt LPCWSTR wzPayloadId | ||
59 | ); | ||
60 | |||
61 | /******************************************************************* | ||
62 | BalRetryEndContainerOrPayload - returns TRUE if a retry is recommended. | ||
63 | ********************************************************************/ | ||
64 | DAPI_(HRESULT) BalRetryEndContainerOrPayload( | ||
65 | __in_z_opt LPCWSTR wzContainerOrPackageId, | ||
57 | __in_z_opt LPCWSTR wzPayloadId, | 66 | __in_z_opt LPCWSTR wzPayloadId, |
58 | __in HRESULT hrError, | 67 | __in HRESULT hrError, |
59 | __inout BOOL* pfRetry | 68 | __inout BOOL* pfRetry |
diff --git a/src/balutil/packages.config b/src/balutil/packages.config index 0a0e5748..de70fed1 100644 --- a/src/balutil/packages.config +++ b/src/balutil/packages.config | |||
@@ -1,6 +1,6 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <packages> | 2 | <packages> |
3 | <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" /> | 3 | <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" /> |
4 | <package id="WixToolset.BootstrapperCore.Native" version="4.0.110" targetFramework="native" /> | 4 | <package id="WixToolset.BootstrapperCore.Native" version="4.0.132" targetFramework="native" /> |
5 | <package id="WixToolset.DUtil" version="4.0.64" targetFramework="native" /> | 5 | <package id="WixToolset.DUtil" version="4.0.70" targetFramework="native" /> |
6 | </packages> \ No newline at end of file | 6 | </packages> \ No newline at end of file |