aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc/wiutil.h')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/wiutil.h402
1 files changed, 402 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h b/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h
new file mode 100644
index 00000000..9c2de209
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h
@@ -0,0 +1,402 @@
1#pragma once
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
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9// constants
10
11#define IDNOACTION 0
12#define WIU_MB_OKIGNORECANCELRETRY 0xE
13
14#define MAX_DARWIN_KEY 73
15#define MAX_DARWIN_COLUMN 255
16
17#define WIU_LOG_DEFAULT INSTALLLOGMODE_FATALEXIT | INSTALLLOGMODE_ERROR | INSTALLLOGMODE_WARNING | \
18 INSTALLLOGMODE_USER | INSTALLLOGMODE_INFO | INSTALLLOGMODE_RESOLVESOURCE | \
19 INSTALLLOGMODE_OUTOFDISKSPACE | INSTALLLOGMODE_ACTIONSTART | \
20 INSTALLLOGMODE_ACTIONDATA | INSTALLLOGMODE_COMMONDATA | INSTALLLOGMODE_PROPERTYDUMP
21
22#define ReleaseMsi(h) if (h) { ::MsiCloseHandle(h); }
23#define ReleaseNullMsi(h) if (h) { ::MsiCloseHandle(h); h = NULL; }
24
25
26typedef enum WIU_RESTART
27{
28 WIU_RESTART_NONE,
29 WIU_RESTART_REQUIRED,
30 WIU_RESTART_INITIATED,
31} WIU_RESTART;
32
33typedef enum WIU_MSI_EXECUTE_MESSAGE_TYPE
34{
35 WIU_MSI_EXECUTE_MESSAGE_NONE,
36 WIU_MSI_EXECUTE_MESSAGE_PROGRESS,
37 WIU_MSI_EXECUTE_MESSAGE_ERROR,
38 WIU_MSI_EXECUTE_MESSAGE_MSI_MESSAGE,
39 WIU_MSI_EXECUTE_MESSAGE_MSI_FILES_IN_USE,
40} WIU_MSI_EXECUTE_MESSAGE_TYPE;
41
42
43// structures
44
45typedef struct _WIU_MSI_EXECUTE_MESSAGE
46{
47 WIU_MSI_EXECUTE_MESSAGE_TYPE type;
48 DWORD dwAllowedResults;
49
50 DWORD cData;
51 LPCWSTR* rgwzData;
52
53 INT nResultRecommendation; // recommended return result for this message based on analysis of real world installs.
54
55 union
56 {
57 struct
58 {
59 DWORD dwPercentage;
60 } progress;
61 struct
62 {
63 DWORD dwErrorCode;
64 LPCWSTR wzMessage;
65 } error;
66 struct
67 {
68 INSTALLMESSAGE mt;
69 LPCWSTR wzMessage;
70 } msiMessage;
71 struct
72 {
73 DWORD cFiles;
74 LPCWSTR* rgwzFiles;
75 } msiFilesInUse;
76 };
77} WIU_MSI_EXECUTE_MESSAGE;
78
79typedef struct _WIU_MSI_PROGRESS
80{
81 DWORD dwTotal;
82 DWORD dwCompleted;
83 DWORD dwStep;
84 BOOL fMoveForward;
85 BOOL fEnableActionData;
86 BOOL fScriptInProgress;
87} WIU_MSI_PROGRESS;
88
89
90typedef int (*PFN_MSIEXECUTEMESSAGEHANDLER)(
91 __in WIU_MSI_EXECUTE_MESSAGE* pMessage,
92 __in_opt LPVOID pvContext
93 );
94
95typedef struct _WIU_MSI_EXECUTE_CONTEXT
96{
97 BOOL fRollback;
98 PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler;
99 LPVOID pvContext;
100 WIU_MSI_PROGRESS rgMsiProgress[64];
101 DWORD dwCurrentProgressIndex;
102
103 INSTALLUILEVEL previousInstallUILevel;
104 HWND hwndPreviousParentWindow;
105 INSTALLUI_HANDLERW pfnPreviousExternalUI;
106 INSTALLUI_HANDLER_RECORD pfnPreviousExternalUIRecord;
107
108 BOOL fSetPreviousExternalUIRecord;
109 BOOL fSetPreviousExternalUI;
110} WIU_MSI_EXECUTE_CONTEXT;
111
112
113// typedefs
114typedef UINT (WINAPI *PFN_MSIENABLELOGW)(
115 __in DWORD dwLogMode,
116 __in_z LPCWSTR szLogFile,
117 __in DWORD dwLogAttributes
118 );
119typedef UINT (WINAPI *PFN_MSIGETPRODUCTINFOW)(
120 __in LPCWSTR szProductCode,
121 __in LPCWSTR szProperty,
122 __out_ecount_opt(*pcchValue) LPWSTR szValue,
123 __inout LPDWORD pcchValue
124 );
125typedef INSTALLSTATE (WINAPI *PFN_MSIGETCOMPONENTPATHW)(
126 __in LPCWSTR szProduct,
127 __in LPCWSTR szComponent,
128 __out_ecount_opt(*pcchBuf) LPWSTR lpPathBuf,
129 __inout_opt LPDWORD pcchBuf
130 );
131typedef INSTALLSTATE (WINAPI *PFN_MSILOCATECOMPONENTW)(
132 __in LPCWSTR szComponent,
133 __out_ecount_opt(*pcchBuf) LPWSTR lpPathBuf,
134 __inout_opt LPDWORD pcchBuf
135 );
136typedef UINT (WINAPI *PFN_MSIGETPRODUCTINFOEXW)(
137 __in LPCWSTR szProductCode,
138 __in_opt LPCWSTR szUserSid,
139 __in MSIINSTALLCONTEXT dwContext,
140 __in LPCWSTR szProperty,
141 __out_ecount_opt(*pcchValue) LPWSTR szValue,
142 __inout_opt LPDWORD pcchValue
143 );
144typedef INSTALLSTATE (WINAPI *PFN_MSIQUERYFEATURESTATEW)(
145 __in LPCWSTR szProduct,
146 __in LPCWSTR szFeature
147 );
148typedef UINT (WINAPI *PFN_MSIGETPATCHINFOEXW)(
149 __in_z LPCWSTR wzPatchCode,
150 __in_z LPCWSTR wzProductCode,
151 __in_z_opt LPCWSTR wzUserSid,
152 __in MSIINSTALLCONTEXT dwContext,
153 __in_z LPCWSTR wzProperty,
154 __out_opt LPWSTR wzValue,
155 __inout DWORD* pcchValue
156 );
157typedef UINT (WINAPI *PFN_MSIDETERMINEPATCHSEQUENCEW)(
158 __in_z LPCWSTR wzProductCode,
159 __in_z_opt LPCWSTR wzUserSid,
160 __in MSIINSTALLCONTEXT context,
161 __in DWORD cPatchInfo,
162 __in PMSIPATCHSEQUENCEINFOW pPatchInfo
163 );
164typedef UINT (WINAPI *PFN_MSIDETERMINEAPPLICABLEPATCHESW)(
165 __in_z LPCWSTR wzProductPackagePath,
166 __in DWORD cPatchInfo,
167 __in PMSIPATCHSEQUENCEINFOW pPatchInfo
168 );
169typedef UINT (WINAPI *PFN_MSIINSTALLPRODUCTW)(
170 __in LPCWSTR szPackagePath,
171 __in_opt LPCWSTR szCommandLine
172 );
173typedef UINT (WINAPI *PFN_MSICONFIGUREPRODUCTEXW)(
174 __in LPCWSTR szProduct,
175 __in int iInstallLevel,
176 __in INSTALLSTATE eInstallState,
177 __in_opt LPCWSTR szCommandLine
178 );
179typedef UINT (WINAPI *PFN_MSIREMOVEPATCHESW)(
180 __in_z LPCWSTR wzPatchList,
181 __in_z LPCWSTR wzProductCode,
182 __in INSTALLTYPE eUninstallType,
183 __in_z_opt LPCWSTR szPropertyList
184 );
185typedef INSTALLUILEVEL (WINAPI *PFN_MSISETINTERNALUI)(
186 __in INSTALLUILEVEL dwUILevel,
187 __inout_opt HWND *phWnd
188 );
189typedef UINT (WINAPI *PFN_MSISETEXTERNALUIRECORD)(
190 __in_opt INSTALLUI_HANDLER_RECORD puiHandler,
191 __in DWORD dwMessageFilter,
192 __in_opt LPVOID pvContext,
193 __out_opt PINSTALLUI_HANDLER_RECORD ppuiPrevHandler
194 );
195typedef INSTALLUI_HANDLERW (WINAPI *PFN_MSISETEXTERNALUIW)(
196 __in_opt INSTALLUI_HANDLERW puiHandler,
197 __in DWORD dwMessageFilter,
198 __in_opt LPVOID pvContext
199 );
200typedef UINT (WINAPI *PFN_MSIENUMPRODUCTSW)(
201 __in DWORD iProductIndex,
202 __out_ecount(MAX_GUID_CHARS + 1) LPWSTR lpProductBuf
203 );
204typedef UINT (WINAPI *PFN_MSIENUMPRODUCTSEXW)(
205 __in_z_opt LPCWSTR wzProductCode,
206 __in_z_opt LPCWSTR wzUserSid,
207 __in DWORD dwContext,
208 __in DWORD dwIndex,
209 __out_opt WCHAR wzInstalledProductCode[39],
210 __out_opt MSIINSTALLCONTEXT *pdwInstalledContext,
211 __out_opt LPWSTR wzSid,
212 __inout_opt LPDWORD pcchSid
213 );
214
215typedef UINT (WINAPI *PFN_MSIENUMRELATEDPRODUCTSW)(
216 __in LPCWSTR lpUpgradeCode,
217 __reserved DWORD dwReserved,
218 __in DWORD iProductIndex,
219 __out_ecount(MAX_GUID_CHARS + 1) LPWSTR lpProductBuf
220 );
221typedef UINT (WINAPI *PFN_MSISOURCELISTADDSOURCEEXW)(
222 __in LPCWSTR szProductCodeOrPatchCode,
223 __in_opt LPCWSTR szUserSid,
224 __in MSIINSTALLCONTEXT dwContext,
225 __in DWORD dwOptions,
226 __in LPCWSTR szSource,
227 __in_opt DWORD dwIndex
228 );
229typedef UINT(WINAPI* PFN_MSIBEGINTRANSACTIONW)(
230 __in LPCWSTR szName,
231 __in DWORD dwTransactionAttributes,
232 __out MSIHANDLE* phTransactionHandle,
233 __out HANDLE* phChangeOfOwnerEvent
234 );
235typedef UINT(WINAPI* PFN_MSIENDTRANSACTION)(
236 __in DWORD dwTransactionState
237 );
238
239
240HRESULT DAPI WiuInitialize(
241 );
242void DAPI WiuUninitialize(
243 );
244void DAPI WiuFunctionOverride(
245 __in_opt PFN_MSIENABLELOGW pfnMsiEnableLogW,
246 __in_opt PFN_MSIGETCOMPONENTPATHW pfnMsiGetComponentPathW,
247 __in_opt PFN_MSILOCATECOMPONENTW pfnMsiLocateComponentW,
248 __in_opt PFN_MSIQUERYFEATURESTATEW pfnMsiQueryFeatureStateW,
249 __in_opt PFN_MSIGETPRODUCTINFOW pfnMsiGetProductInfoW,
250 __in_opt PFN_MSIGETPRODUCTINFOEXW pfnMsiGetProductInfoExW,
251 __in_opt PFN_MSIINSTALLPRODUCTW pfnMsiInstallProductW,
252 __in_opt PFN_MSICONFIGUREPRODUCTEXW pfnMsiConfigureProductExW,
253 __in_opt PFN_MSISETINTERNALUI pfnMsiSetInternalUI,
254 __in_opt PFN_MSISETEXTERNALUIW pfnMsiSetExternalUIW,
255 __in_opt PFN_MSIENUMRELATEDPRODUCTSW pfnMsiEnumRelatedProductsW,
256 __in_opt PFN_MSISETEXTERNALUIRECORD pfnMsiSetExternalUIRecord,
257 __in_opt PFN_MSISOURCELISTADDSOURCEEXW pfnMsiSourceListAddSourceExW
258 );
259HRESULT DAPI WiuGetComponentPath(
260 __in_z LPCWSTR wzProductCode,
261 __in_z LPCWSTR wzComponentId,
262 __out INSTALLSTATE* pInstallState,
263 __out_z LPWSTR* psczValue
264 );
265HRESULT DAPI WiuLocateComponent(
266 __in_z LPCWSTR wzComponentId,
267 __out INSTALLSTATE* pInstallState,
268 __out_z LPWSTR* psczValue
269 );
270HRESULT DAPI WiuQueryFeatureState(
271 __in_z LPCWSTR wzProduct,
272 __in_z LPCWSTR wzFeature,
273 __out INSTALLSTATE* pInstallState
274 );
275HRESULT DAPI WiuGetProductInfo(
276 __in_z LPCWSTR wzProductCode,
277 __in_z LPCWSTR wzProperty,
278 __out LPWSTR* psczValue
279 );
280HRESULT DAPI WiuGetProductInfoEx(
281 __in_z LPCWSTR wzProductCode,
282 __in_z_opt LPCWSTR wzUserSid,
283 __in MSIINSTALLCONTEXT dwContext,
284 __in_z LPCWSTR wzProperty,
285 __out LPWSTR* psczValue
286 );
287HRESULT DAPI WiuGetProductProperty(
288 __in MSIHANDLE hProduct,
289 __in_z LPCWSTR wzProperty,
290 __out LPWSTR* psczValue
291 );
292HRESULT DAPI WiuGetPatchInfoEx(
293 __in_z LPCWSTR wzPatchCode,
294 __in_z LPCWSTR wzProductCode,
295 __in_z_opt LPCWSTR wzUserSid,
296 __in MSIINSTALLCONTEXT dwContext,
297 __in_z LPCWSTR wzProperty,
298 __out LPWSTR* psczValue
299 );
300HRESULT DAPI WiuDeterminePatchSequence(
301 __in_z LPCWSTR wzProductCode,
302 __in_z_opt LPCWSTR wzUserSid,
303 __in MSIINSTALLCONTEXT context,
304 __in PMSIPATCHSEQUENCEINFOW pPatchInfo,
305 __in DWORD cPatchInfo
306 );
307HRESULT DAPI WiuDetermineApplicablePatches(
308 __in_z LPCWSTR wzProductPackagePath,
309 __in PMSIPATCHSEQUENCEINFOW pPatchInfo,
310 __in DWORD cPatchInfo
311 );
312HRESULT DAPI WiuEnumProducts(
313 __in DWORD iProductIndex,
314 __out_ecount(MAX_GUID_CHARS + 1) LPWSTR wzProductCode
315 );
316HRESULT DAPI WiuEnumProductsEx(
317 __in_z_opt LPCWSTR wzProductCode,
318 __in_z_opt LPCWSTR wzUserSid,
319 __in DWORD dwContext,
320 __in DWORD dwIndex,
321 __out_opt WCHAR wzInstalledProductCode[39],
322 __out_opt MSIINSTALLCONTEXT *pdwInstalledContext,
323 __out_opt LPWSTR wzSid,
324 __inout_opt LPDWORD pcchSid
325 );
326HRESULT DAPI WiuEnumRelatedProducts(
327 __in_z LPCWSTR wzUpgradeCode,
328 __in DWORD iProductIndex,
329 __out_ecount(MAX_GUID_CHARS + 1) LPWSTR wzProductCode
330 );
331HRESULT DAPI WiuEnumRelatedProductCodes(
332 __in_z LPCWSTR wzUpgradeCode,
333 __deref_out_ecount_opt(*pcRelatedProducts) LPWSTR** prgsczProductCodes,
334 __out DWORD* pcRelatedProducts,
335 __in BOOL fReturnHighestVersionOnly
336 );
337HRESULT DAPI WiuEnableLog(
338 __in DWORD dwLogMode,
339 __in_z LPCWSTR wzLogFile,
340 __in DWORD dwLogAttributes
341 );
342HRESULT DAPI WiuInitializeInternalUI(
343 __in INSTALLUILEVEL internalUILevel,
344 __in_opt HWND hwndParent,
345 __in WIU_MSI_EXECUTE_CONTEXT* pExecuteContext
346 );
347HRESULT DAPI WiuInitializeExternalUI(
348 __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler,
349 __in INSTALLUILEVEL internalUILevel,
350 __in_opt HWND hwndParent,
351 __in LPVOID pvContext,
352 __in BOOL fRollback,
353 __in WIU_MSI_EXECUTE_CONTEXT* pExecuteContext
354 );
355void DAPI WiuUninitializeExternalUI(
356 __in WIU_MSI_EXECUTE_CONTEXT* pExecuteContext
357 );
358HRESULT DAPI WiuConfigureProductEx(
359 __in_z LPCWSTR wzProduct,
360 __in int iInstallLevel,
361 __in INSTALLSTATE eInstallState,
362 __in_z LPCWSTR wzCommandLine,
363 __out WIU_RESTART* pRestart
364 );
365HRESULT DAPI WiuInstallProduct(
366 __in_z LPCWSTR wzPackagPath,
367 __in_z LPCWSTR wzCommandLine,
368 __out WIU_RESTART* pRestart
369 );
370HRESULT DAPI WiuRemovePatches(
371 __in_z LPCWSTR wzPatchList,
372 __in_z LPCWSTR wzProductCode,
373 __in_z LPCWSTR wzPropertyList,
374 __out WIU_RESTART* pRestart
375 );
376HRESULT DAPI WiuSourceListAddSourceEx(
377 __in_z LPCWSTR wzProductCodeOrPatchCode,
378 __in_z_opt LPCWSTR wzUserSid,
379 __in MSIINSTALLCONTEXT dwContext,
380 __in DWORD dwCode,
381 __in_z LPCWSTR wzSource,
382 __in_opt DWORD dwIndex
383 );
384HRESULT DAPI WiuBeginTransaction(
385 __in_z LPCWSTR szName,
386 __in DWORD dwTransactionAttributes,
387 __out MSIHANDLE* phTransactionHandle,
388 __out HANDLE* phChangeOfOwnerEvent,
389 __in DWORD dwLogMode,
390 __in_z LPCWSTR szLogPath
391 );
392HRESULT DAPI WiuEndTransaction(
393 __in DWORD dwTransactionState,
394 __in DWORD dwLogMode,
395 __in_z LPCWSTR szLogPath
396 );
397BOOL DAPI WiuIsMsiTransactionSupported(
398 );
399
400#ifdef __cplusplus
401}
402#endif