diff options
Diffstat (limited to 'src/engine/core.h')
-rw-r--r-- | src/engine/core.h | 211 |
1 files changed, 211 insertions, 0 deletions
diff --git a/src/engine/core.h b/src/engine/core.h new file mode 100644 index 00000000..6a6da2b1 --- /dev/null +++ b/src/engine/core.h | |||
@@ -0,0 +1,211 @@ | |||
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 | |||
50 | // The following constants must stay in sync with src\wix\Binder.cs | ||
51 | const LPCWSTR BURN_BUNDLE_NAME = L"WixBundleName"; | ||
52 | const LPCWSTR BURN_BUNDLE_ORIGINAL_SOURCE = L"WixBundleOriginalSource"; | ||
53 | const LPCWSTR BURN_BUNDLE_ORIGINAL_SOURCE_FOLDER = L"WixBundleOriginalSourceFolder"; | ||
54 | const LPCWSTR BURN_BUNDLE_LAST_USED_SOURCE = L"WixBundleLastUsedSource"; | ||
55 | |||
56 | |||
57 | // enums | ||
58 | |||
59 | enum BURN_MODE | ||
60 | { | ||
61 | BURN_MODE_UNTRUSTED, | ||
62 | BURN_MODE_NORMAL, | ||
63 | BURN_MODE_ELEVATED, | ||
64 | BURN_MODE_EMBEDDED, | ||
65 | BURN_MODE_RUNONCE, | ||
66 | }; | ||
67 | |||
68 | enum BURN_AU_PAUSE_ACTION | ||
69 | { | ||
70 | BURN_AU_PAUSE_ACTION_NONE, | ||
71 | BURN_AU_PAUSE_ACTION_IFELEVATED, | ||
72 | BURN_AU_PAUSE_ACTION_IFELEVATED_NORESUME, | ||
73 | }; | ||
74 | |||
75 | |||
76 | // structs | ||
77 | |||
78 | typedef struct _BURN_ENGINE_STATE | ||
79 | { | ||
80 | // synchronization | ||
81 | CRITICAL_SECTION csActive; // Any call from the UX that reads or alters the engine state | ||
82 | // needs to be syncronized through this critical section. | ||
83 | // Note: The engine must never do a UX callback while in this critical section. | ||
84 | |||
85 | // UX flow control | ||
86 | //BOOL fSuspend; // Is TRUE when UX made Suspend() call on core. | ||
87 | //BOOL fForcedReboot; // Is TRUE when UX made Reboot() call on core. | ||
88 | //BOOL fCancelled; // Is TRUE when UX return cancel on UX OnXXX() methods. | ||
89 | //BOOL fReboot; // Is TRUE when UX confirms OnRestartRequried(). | ||
90 | BOOL fRestart; // Set TRUE when UX returns IDRESTART during Apply(). | ||
91 | |||
92 | // engine data | ||
93 | BOOTSTRAPPER_COMMAND command; | ||
94 | BURN_SECTION section; | ||
95 | BURN_VARIABLES variables; | ||
96 | BURN_CONDITION condition; | ||
97 | BURN_SEARCHES searches; | ||
98 | BURN_USER_EXPERIENCE userExperience; | ||
99 | BURN_REGISTRATION registration; | ||
100 | BURN_CONTAINERS containers; | ||
101 | BURN_CATALOGS catalogs; | ||
102 | BURN_PAYLOADS payloads; | ||
103 | BURN_PACKAGES packages; | ||
104 | BURN_UPDATE update; | ||
105 | BURN_APPROVED_EXES approvedExes; | ||
106 | |||
107 | HWND hMessageWindow; | ||
108 | HANDLE hMessageWindowThread; | ||
109 | |||
110 | BOOL fDisableRollback; | ||
111 | BOOL fDisableSystemRestore; | ||
112 | BOOL fParallelCacheAndExecute; | ||
113 | |||
114 | BURN_LOGGING log; | ||
115 | |||
116 | BURN_PLAN plan; | ||
117 | |||
118 | BURN_MODE mode; | ||
119 | BURN_AU_PAUSE_ACTION automaticUpdates; | ||
120 | |||
121 | DWORD dwElevatedLoggingTlsId; | ||
122 | |||
123 | LPWSTR sczBundleEngineWorkingPath; | ||
124 | BURN_PIPE_CONNECTION companionConnection; | ||
125 | BURN_PIPE_CONNECTION embeddedConnection; | ||
126 | |||
127 | BURN_RESUME_MODE resumeMode; | ||
128 | BOOL fDisableUnelevate; | ||
129 | |||
130 | LPWSTR sczIgnoreDependencies; | ||
131 | |||
132 | int argc; | ||
133 | LPWSTR* argv; | ||
134 | } BURN_ENGINE_STATE; | ||
135 | |||
136 | |||
137 | // function declarations | ||
138 | |||
139 | HRESULT CoreInitialize( | ||
140 | __in BURN_ENGINE_STATE* pEngineState | ||
141 | ); | ||
142 | HRESULT CoreSerializeEngineState( | ||
143 | __in BURN_ENGINE_STATE* pEngineState, | ||
144 | __inout BYTE** ppbBuffer, | ||
145 | __inout SIZE_T* piBuffer | ||
146 | ); | ||
147 | HRESULT CoreQueryRegistration( | ||
148 | __in BURN_ENGINE_STATE* pEngineState | ||
149 | ); | ||
150 | //HRESULT CoreDeserializeEngineState( | ||
151 | // __in BURN_ENGINE_STATE* pEngineState, | ||
152 | // __in_bcount(cbBuffer) BYTE* pbBuffer, | ||
153 | // __in SIZE_T cbBuffer | ||
154 | // ); | ||
155 | HRESULT CoreDetect( | ||
156 | __in BURN_ENGINE_STATE* pEngineState, | ||
157 | __in_opt HWND hwndParent | ||
158 | ); | ||
159 | HRESULT CorePlan( | ||
160 | __in BURN_ENGINE_STATE* pEngineState, | ||
161 | __in BOOTSTRAPPER_ACTION action | ||
162 | ); | ||
163 | HRESULT CoreElevate( | ||
164 | __in BURN_ENGINE_STATE* pEngineState, | ||
165 | __in_opt HWND hwndParent | ||
166 | ); | ||
167 | HRESULT CoreApply( | ||
168 | __in BURN_ENGINE_STATE* pEngineState, | ||
169 | __in_opt HWND hwndParent | ||
170 | ); | ||
171 | HRESULT CoreLaunchApprovedExe( | ||
172 | __in BURN_ENGINE_STATE* pEngineState, | ||
173 | __in BURN_LAUNCH_APPROVED_EXE* pLaunchApprovedExe | ||
174 | ); | ||
175 | HRESULT CoreQuit( | ||
176 | __in BURN_ENGINE_STATE* pEngineState, | ||
177 | __in int nExitCode | ||
178 | ); | ||
179 | HRESULT CoreSaveEngineState( | ||
180 | __in BURN_ENGINE_STATE* pEngineState | ||
181 | ); | ||
182 | LPCWSTR CoreRelationTypeToCommandLineString( | ||
183 | __in BOOTSTRAPPER_RELATION_TYPE relationType | ||
184 | ); | ||
185 | HRESULT CoreRecreateCommandLine( | ||
186 | __deref_inout_z LPWSTR* psczCommandLine, | ||
187 | __in BOOTSTRAPPER_ACTION action, | ||
188 | __in BOOTSTRAPPER_DISPLAY display, | ||
189 | __in BOOTSTRAPPER_RESTART restart, | ||
190 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | ||
191 | __in BOOL fPassthrough, | ||
192 | __in_z_opt LPCWSTR wzActiveParent, | ||
193 | __in_z_opt LPCWSTR wzAncestors, | ||
194 | __in_z_opt LPCWSTR wzAppendLogPath, | ||
195 | __in_z_opt LPCWSTR wzAdditionalCommandLineArguments | ||
196 | ); | ||
197 | HRESULT CoreAppendFileHandleAttachedToCommandLine( | ||
198 | __in HANDLE hFileWithAttachedContainer, | ||
199 | __out HANDLE* phExecutableFile, | ||
200 | __deref_inout_z LPWSTR* psczCommandLine | ||
201 | ); | ||
202 | HRESULT CoreAppendFileHandleSelfToCommandLine( | ||
203 | __in LPCWSTR wzExecutablePath, | ||
204 | __out HANDLE* phExecutableFile, | ||
205 | __deref_inout_z LPWSTR* psczCommandLine, | ||
206 | __deref_inout_z_opt LPWSTR* psczObfuscatedCommandLine | ||
207 | ); | ||
208 | |||
209 | #if defined(__cplusplus) | ||
210 | } | ||
211 | #endif | ||