diff options
author | Rob Mensching <rob@firegiant.com> | 2021-04-22 17:06:54 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-04-29 16:36:06 -0700 |
commit | af10c45d7b3a44af0b461a557847fe03263dcc10 (patch) | |
tree | 6a5c1532304782c36ffe4200b38f3afb76789a43 /src/burn/engine/core.h | |
parent | 9c2aed97299fb96aeee3f1471ce40225437aaecf (diff) | |
download | wix-af10c45d7b3a44af0b461a557847fe03263dcc10.tar.gz wix-af10c45d7b3a44af0b461a557847fe03263dcc10.tar.bz2 wix-af10c45d7b3a44af0b461a557847fe03263dcc10.zip |
Move burn into burn
Diffstat (limited to 'src/burn/engine/core.h')
-rw-r--r-- | src/burn/engine/core.h | 218 |
1 files changed, 218 insertions, 0 deletions
diff --git a/src/burn/engine/core.h b/src/burn/engine/core.h new file mode 100644 index 00000000..e96440bb --- /dev/null +++ b/src/burn/engine/core.h | |||
@@ -0,0 +1,218 @@ | |||
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 | #if defined(__cplusplus) | ||
6 | extern "C" { | ||
7 | #endif | ||
8 | |||
9 | |||
10 | // constants | ||
11 | |||
12 | const LPCWSTR BURN_POLICY_REGISTRY_PATH = L"WiX\\Burn"; | ||
13 | |||
14 | const LPCWSTR BURN_COMMANDLINE_SWITCH_PARENT = L"parent"; | ||
15 | const LPCWSTR BURN_COMMANDLINE_SWITCH_PARENT_NONE = L"parent:none"; | ||
16 | const LPCWSTR BURN_COMMANDLINE_SWITCH_CLEAN_ROOM = L"burn.clean.room"; | ||
17 | const LPCWSTR BURN_COMMANDLINE_SWITCH_ELEVATED = L"burn.elevated"; | ||
18 | const LPCWSTR BURN_COMMANDLINE_SWITCH_EMBEDDED = L"burn.embedded"; | ||
19 | const LPCWSTR BURN_COMMANDLINE_SWITCH_RUNONCE = L"burn.runonce"; | ||
20 | const LPCWSTR BURN_COMMANDLINE_SWITCH_LOG_APPEND = L"burn.log.append"; | ||
21 | const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_DETECT = L"burn.related.detect"; | ||
22 | const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_UPGRADE = L"burn.related.upgrade"; | ||
23 | const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_ADDON = L"burn.related.addon"; | ||
24 | const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_PATCH = L"burn.related.patch"; | ||
25 | const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_UPDATE = L"burn.related.update"; | ||
26 | const LPCWSTR BURN_COMMANDLINE_SWITCH_PASSTHROUGH = L"burn.passthrough"; | ||
27 | const LPCWSTR BURN_COMMANDLINE_SWITCH_DISABLE_UNELEVATE = L"burn.disable.unelevate"; | ||
28 | const LPCWSTR BURN_COMMANDLINE_SWITCH_IGNOREDEPENDENCIES = L"burn.ignoredependencies"; | ||
29 | const LPCWSTR BURN_COMMANDLINE_SWITCH_ANCESTORS = L"burn.ancestors"; | ||
30 | const LPCWSTR BURN_COMMANDLINE_SWITCH_FILEHANDLE_ATTACHED = L"burn.filehandle.attached"; | ||
31 | const LPCWSTR BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF = L"burn.filehandle.self"; | ||
32 | const LPCWSTR BURN_COMMANDLINE_SWITCH_PREFIX = L"burn."; | ||
33 | |||
34 | const LPCWSTR BURN_BUNDLE_LAYOUT_DIRECTORY = L"WixBundleLayoutDirectory"; | ||
35 | const LPCWSTR BURN_BUNDLE_ACTION = L"WixBundleAction"; | ||
36 | const LPCWSTR BURN_BUNDLE_ACTIVE_PARENT = L"WixBundleActiveParent"; | ||
37 | const LPCWSTR BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER = L"WixBundleExecutePackageCacheFolder"; | ||
38 | const LPCWSTR BURN_BUNDLE_EXECUTE_PACKAGE_ACTION = L"WixBundleExecutePackageAction"; | ||
39 | const LPCWSTR BURN_BUNDLE_FORCED_RESTART_PACKAGE = L"WixBundleForcedRestartPackage"; | ||
40 | const LPCWSTR BURN_BUNDLE_INSTALLED = L"WixBundleInstalled"; | ||
41 | const LPCWSTR BURN_BUNDLE_ELEVATED = L"WixBundleElevated"; | ||
42 | const LPCWSTR BURN_BUNDLE_PROVIDER_KEY = L"WixBundleProviderKey"; | ||
43 | const LPCWSTR BURN_BUNDLE_MANUFACTURER = L"WixBundleManufacturer"; | ||
44 | const LPCWSTR BURN_BUNDLE_SOURCE_PROCESS_PATH = L"WixBundleSourceProcessPath"; | ||
45 | const LPCWSTR BURN_BUNDLE_SOURCE_PROCESS_FOLDER = L"WixBundleSourceProcessFolder"; | ||
46 | const LPCWSTR BURN_BUNDLE_TAG = L"WixBundleTag"; | ||
47 | const LPCWSTR BURN_BUNDLE_UILEVEL = L"WixBundleUILevel"; | ||
48 | const LPCWSTR BURN_BUNDLE_VERSION = L"WixBundleVersion"; | ||
49 | const LPCWSTR BURN_REBOOT_PENDING = L"RebootPending"; | ||
50 | |||
51 | // The following constants must stay in sync with src\wix\Binder.cs | ||
52 | const LPCWSTR BURN_BUNDLE_NAME = L"WixBundleName"; | ||
53 | const LPCWSTR BURN_BUNDLE_ORIGINAL_SOURCE = L"WixBundleOriginalSource"; | ||
54 | const LPCWSTR BURN_BUNDLE_ORIGINAL_SOURCE_FOLDER = L"WixBundleOriginalSourceFolder"; | ||
55 | const LPCWSTR BURN_BUNDLE_LAST_USED_SOURCE = L"WixBundleLastUsedSource"; | ||
56 | |||
57 | |||
58 | // enums | ||
59 | |||
60 | enum BURN_MODE | ||
61 | { | ||
62 | BURN_MODE_UNTRUSTED, | ||
63 | BURN_MODE_NORMAL, | ||
64 | BURN_MODE_ELEVATED, | ||
65 | BURN_MODE_EMBEDDED, | ||
66 | BURN_MODE_RUNONCE, | ||
67 | }; | ||
68 | |||
69 | enum BURN_AU_PAUSE_ACTION | ||
70 | { | ||
71 | BURN_AU_PAUSE_ACTION_NONE, | ||
72 | BURN_AU_PAUSE_ACTION_IFELEVATED, | ||
73 | BURN_AU_PAUSE_ACTION_IFELEVATED_NORESUME, | ||
74 | }; | ||
75 | |||
76 | |||
77 | // structs | ||
78 | |||
79 | typedef struct _BURN_ENGINE_STATE | ||
80 | { | ||
81 | // UX flow control | ||
82 | BOOL fDetected; | ||
83 | BOOL fPlanned; | ||
84 | BOOL fQuit; | ||
85 | //BOOL fSuspend; // Is TRUE when UX made Suspend() call on core. | ||
86 | //BOOL fForcedReboot; // Is TRUE when UX made Reboot() call on core. | ||
87 | //BOOL fCancelled; // Is TRUE when UX return cancel on UX OnXXX() methods. | ||
88 | //BOOL fReboot; // Is TRUE when UX confirms OnRestartRequried(). | ||
89 | BOOL fRestart; // Set TRUE when UX returns IDRESTART during Apply(). | ||
90 | |||
91 | // engine data | ||
92 | BOOTSTRAPPER_COMMAND command; | ||
93 | BURN_SECTION section; | ||
94 | BURN_VARIABLES variables; | ||
95 | BURN_CONDITION condition; | ||
96 | BURN_SEARCHES searches; | ||
97 | BURN_USER_EXPERIENCE userExperience; | ||
98 | BURN_REGISTRATION registration; | ||
99 | BURN_CONTAINERS containers; | ||
100 | BURN_PAYLOADS payloads; | ||
101 | BURN_PACKAGES packages; | ||
102 | BURN_UPDATE update; | ||
103 | BURN_APPROVED_EXES approvedExes; | ||
104 | BURN_EXTENSIONS extensions; | ||
105 | |||
106 | HWND hMessageWindow; | ||
107 | HANDLE hMessageWindowThread; | ||
108 | |||
109 | BOOL fDisableRollback; | ||
110 | BOOL fDisableSystemRestore; | ||
111 | BOOL fParallelCacheAndExecute; | ||
112 | |||
113 | BURN_LOGGING log; | ||
114 | |||
115 | BURN_PAYLOAD_GROUP layoutPayloads; | ||
116 | |||
117 | BURN_PLAN plan; | ||
118 | |||
119 | BURN_MODE mode; | ||
120 | BURN_AU_PAUSE_ACTION automaticUpdates; | ||
121 | |||
122 | DWORD dwElevatedLoggingTlsId; | ||
123 | |||
124 | LPWSTR sczBundleEngineWorkingPath; | ||
125 | BURN_PIPE_CONNECTION companionConnection; | ||
126 | BURN_PIPE_CONNECTION embeddedConnection; | ||
127 | |||
128 | BURN_RESUME_MODE resumeMode; | ||
129 | BOOL fDisableUnelevate; | ||
130 | |||
131 | LPWSTR sczIgnoreDependencies; | ||
132 | |||
133 | int argc; | ||
134 | LPWSTR* argv; | ||
135 | } BURN_ENGINE_STATE; | ||
136 | |||
137 | |||
138 | // function declarations | ||
139 | |||
140 | HRESULT CoreInitialize( | ||
141 | __in BURN_ENGINE_STATE* pEngineState | ||
142 | ); | ||
143 | HRESULT CoreInitializeConstants( | ||
144 | __in BURN_ENGINE_STATE* pEngineState | ||
145 | ); | ||
146 | HRESULT CoreSerializeEngineState( | ||
147 | __in BURN_ENGINE_STATE* pEngineState, | ||
148 | __inout BYTE** ppbBuffer, | ||
149 | __inout SIZE_T* piBuffer | ||
150 | ); | ||
151 | HRESULT CoreQueryRegistration( | ||
152 | __in BURN_ENGINE_STATE* pEngineState | ||
153 | ); | ||
154 | //HRESULT CoreDeserializeEngineState( | ||
155 | // __in BURN_ENGINE_STATE* pEngineState, | ||
156 | // __in_bcount(cbBuffer) BYTE* pbBuffer, | ||
157 | // __in SIZE_T cbBuffer | ||
158 | // ); | ||
159 | HRESULT CoreDetect( | ||
160 | __in BURN_ENGINE_STATE* pEngineState, | ||
161 | __in_opt HWND hwndParent | ||
162 | ); | ||
163 | HRESULT CorePlan( | ||
164 | __in BURN_ENGINE_STATE* pEngineState, | ||
165 | __in BOOTSTRAPPER_ACTION action | ||
166 | ); | ||
167 | HRESULT CoreElevate( | ||
168 | __in BURN_ENGINE_STATE* pEngineState, | ||
169 | __in_opt HWND hwndParent | ||
170 | ); | ||
171 | HRESULT CoreApply( | ||
172 | __in BURN_ENGINE_STATE* pEngineState, | ||
173 | __in_opt HWND hwndParent | ||
174 | ); | ||
175 | HRESULT CoreLaunchApprovedExe( | ||
176 | __in BURN_ENGINE_STATE* pEngineState, | ||
177 | __in BURN_LAUNCH_APPROVED_EXE* pLaunchApprovedExe | ||
178 | ); | ||
179 | HRESULT CoreQuit( | ||
180 | __in BURN_ENGINE_STATE* pEngineState, | ||
181 | __in int nExitCode | ||
182 | ); | ||
183 | HRESULT CoreSaveEngineState( | ||
184 | __in BURN_ENGINE_STATE* pEngineState | ||
185 | ); | ||
186 | LPCWSTR CoreRelationTypeToCommandLineString( | ||
187 | __in BOOTSTRAPPER_RELATION_TYPE relationType | ||
188 | ); | ||
189 | HRESULT CoreRecreateCommandLine( | ||
190 | __deref_inout_z LPWSTR* psczCommandLine, | ||
191 | __in BOOTSTRAPPER_ACTION action, | ||
192 | __in BOOTSTRAPPER_DISPLAY display, | ||
193 | __in BOOTSTRAPPER_RESTART restart, | ||
194 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | ||
195 | __in BOOL fPassthrough, | ||
196 | __in_z_opt LPCWSTR wzActiveParent, | ||
197 | __in_z_opt LPCWSTR wzAncestors, | ||
198 | __in_z_opt LPCWSTR wzAppendLogPath, | ||
199 | __in_z_opt LPCWSTR wzAdditionalCommandLineArguments | ||
200 | ); | ||
201 | HRESULT CoreAppendFileHandleAttachedToCommandLine( | ||
202 | __in HANDLE hFileWithAttachedContainer, | ||
203 | __out HANDLE* phExecutableFile, | ||
204 | __deref_inout_z LPWSTR* psczCommandLine | ||
205 | ); | ||
206 | HRESULT CoreAppendFileHandleSelfToCommandLine( | ||
207 | __in LPCWSTR wzExecutablePath, | ||
208 | __out HANDLE* phExecutableFile, | ||
209 | __deref_inout_z LPWSTR* psczCommandLine, | ||
210 | __deref_inout_z_opt LPWSTR* psczObfuscatedCommandLine | ||
211 | ); | ||
212 | void CoreCleanup( | ||
213 | __in BURN_ENGINE_STATE* pEngineState | ||
214 | ); | ||
215 | |||
216 | #if defined(__cplusplus) | ||
217 | } | ||
218 | #endif | ||