aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/core.h')
-rw-r--r--src/burn/engine/core.h218
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)
6extern "C" {
7#endif
8
9
10// constants
11
12const LPCWSTR BURN_POLICY_REGISTRY_PATH = L"WiX\\Burn";
13
14const LPCWSTR BURN_COMMANDLINE_SWITCH_PARENT = L"parent";
15const LPCWSTR BURN_COMMANDLINE_SWITCH_PARENT_NONE = L"parent:none";
16const LPCWSTR BURN_COMMANDLINE_SWITCH_CLEAN_ROOM = L"burn.clean.room";
17const LPCWSTR BURN_COMMANDLINE_SWITCH_ELEVATED = L"burn.elevated";
18const LPCWSTR BURN_COMMANDLINE_SWITCH_EMBEDDED = L"burn.embedded";
19const LPCWSTR BURN_COMMANDLINE_SWITCH_RUNONCE = L"burn.runonce";
20const LPCWSTR BURN_COMMANDLINE_SWITCH_LOG_APPEND = L"burn.log.append";
21const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_DETECT = L"burn.related.detect";
22const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_UPGRADE = L"burn.related.upgrade";
23const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_ADDON = L"burn.related.addon";
24const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_PATCH = L"burn.related.patch";
25const LPCWSTR BURN_COMMANDLINE_SWITCH_RELATED_UPDATE = L"burn.related.update";
26const LPCWSTR BURN_COMMANDLINE_SWITCH_PASSTHROUGH = L"burn.passthrough";
27const LPCWSTR BURN_COMMANDLINE_SWITCH_DISABLE_UNELEVATE = L"burn.disable.unelevate";
28const LPCWSTR BURN_COMMANDLINE_SWITCH_IGNOREDEPENDENCIES = L"burn.ignoredependencies";
29const LPCWSTR BURN_COMMANDLINE_SWITCH_ANCESTORS = L"burn.ancestors";
30const LPCWSTR BURN_COMMANDLINE_SWITCH_FILEHANDLE_ATTACHED = L"burn.filehandle.attached";
31const LPCWSTR BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF = L"burn.filehandle.self";
32const LPCWSTR BURN_COMMANDLINE_SWITCH_PREFIX = L"burn.";
33
34const LPCWSTR BURN_BUNDLE_LAYOUT_DIRECTORY = L"WixBundleLayoutDirectory";
35const LPCWSTR BURN_BUNDLE_ACTION = L"WixBundleAction";
36const LPCWSTR BURN_BUNDLE_ACTIVE_PARENT = L"WixBundleActiveParent";
37const LPCWSTR BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER = L"WixBundleExecutePackageCacheFolder";
38const LPCWSTR BURN_BUNDLE_EXECUTE_PACKAGE_ACTION = L"WixBundleExecutePackageAction";
39const LPCWSTR BURN_BUNDLE_FORCED_RESTART_PACKAGE = L"WixBundleForcedRestartPackage";
40const LPCWSTR BURN_BUNDLE_INSTALLED = L"WixBundleInstalled";
41const LPCWSTR BURN_BUNDLE_ELEVATED = L"WixBundleElevated";
42const LPCWSTR BURN_BUNDLE_PROVIDER_KEY = L"WixBundleProviderKey";
43const LPCWSTR BURN_BUNDLE_MANUFACTURER = L"WixBundleManufacturer";
44const LPCWSTR BURN_BUNDLE_SOURCE_PROCESS_PATH = L"WixBundleSourceProcessPath";
45const LPCWSTR BURN_BUNDLE_SOURCE_PROCESS_FOLDER = L"WixBundleSourceProcessFolder";
46const LPCWSTR BURN_BUNDLE_TAG = L"WixBundleTag";
47const LPCWSTR BURN_BUNDLE_UILEVEL = L"WixBundleUILevel";
48const LPCWSTR BURN_BUNDLE_VERSION = L"WixBundleVersion";
49const LPCWSTR BURN_REBOOT_PENDING = L"RebootPending";
50
51// The following constants must stay in sync with src\wix\Binder.cs
52const LPCWSTR BURN_BUNDLE_NAME = L"WixBundleName";
53const LPCWSTR BURN_BUNDLE_ORIGINAL_SOURCE = L"WixBundleOriginalSource";
54const LPCWSTR BURN_BUNDLE_ORIGINAL_SOURCE_FOLDER = L"WixBundleOriginalSourceFolder";
55const LPCWSTR BURN_BUNDLE_LAST_USED_SOURCE = L"WixBundleLastUsedSource";
56
57
58// enums
59
60enum 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
69enum 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
79typedef 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
140HRESULT CoreInitialize(
141 __in BURN_ENGINE_STATE* pEngineState
142 );
143HRESULT CoreInitializeConstants(
144 __in BURN_ENGINE_STATE* pEngineState
145 );
146HRESULT CoreSerializeEngineState(
147 __in BURN_ENGINE_STATE* pEngineState,
148 __inout BYTE** ppbBuffer,
149 __inout SIZE_T* piBuffer
150 );
151HRESULT 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// );
159HRESULT CoreDetect(
160 __in BURN_ENGINE_STATE* pEngineState,
161 __in_opt HWND hwndParent
162 );
163HRESULT CorePlan(
164 __in BURN_ENGINE_STATE* pEngineState,
165 __in BOOTSTRAPPER_ACTION action
166 );
167HRESULT CoreElevate(
168 __in BURN_ENGINE_STATE* pEngineState,
169 __in_opt HWND hwndParent
170 );
171HRESULT CoreApply(
172 __in BURN_ENGINE_STATE* pEngineState,
173 __in_opt HWND hwndParent
174 );
175HRESULT CoreLaunchApprovedExe(
176 __in BURN_ENGINE_STATE* pEngineState,
177 __in BURN_LAUNCH_APPROVED_EXE* pLaunchApprovedExe
178 );
179HRESULT CoreQuit(
180 __in BURN_ENGINE_STATE* pEngineState,
181 __in int nExitCode
182 );
183HRESULT CoreSaveEngineState(
184 __in BURN_ENGINE_STATE* pEngineState
185 );
186LPCWSTR CoreRelationTypeToCommandLineString(
187 __in BOOTSTRAPPER_RELATION_TYPE relationType
188 );
189HRESULT 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 );
201HRESULT CoreAppendFileHandleAttachedToCommandLine(
202 __in HANDLE hFileWithAttachedContainer,
203 __out HANDLE* phExecutableFile,
204 __deref_inout_z LPWSTR* psczCommandLine
205 );
206HRESULT CoreAppendFileHandleSelfToCommandLine(
207 __in LPCWSTR wzExecutablePath,
208 __out HANDLE* phExecutableFile,
209 __deref_inout_z LPWSTR* psczCommandLine,
210 __deref_inout_z_opt LPWSTR* psczObfuscatedCommandLine
211 );
212void CoreCleanup(
213 __in BURN_ENGINE_STATE* pEngineState
214 );
215
216#if defined(__cplusplus)
217}
218#endif