aboutsummaryrefslogtreecommitdiff
path: root/src/engine/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/core.h')
-rw-r--r--src/engine/core.h211
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)
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";
49
50// The following constants must stay in sync with src\wix\Binder.cs
51const LPCWSTR BURN_BUNDLE_NAME = L"WixBundleName";
52const LPCWSTR BURN_BUNDLE_ORIGINAL_SOURCE = L"WixBundleOriginalSource";
53const LPCWSTR BURN_BUNDLE_ORIGINAL_SOURCE_FOLDER = L"WixBundleOriginalSourceFolder";
54const LPCWSTR BURN_BUNDLE_LAST_USED_SOURCE = L"WixBundleLastUsedSource";
55
56
57// enums
58
59enum 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
68enum 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
78typedef 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
139HRESULT CoreInitialize(
140 __in BURN_ENGINE_STATE* pEngineState
141 );
142HRESULT CoreSerializeEngineState(
143 __in BURN_ENGINE_STATE* pEngineState,
144 __inout BYTE** ppbBuffer,
145 __inout SIZE_T* piBuffer
146 );
147HRESULT 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// );
155HRESULT CoreDetect(
156 __in BURN_ENGINE_STATE* pEngineState,
157 __in_opt HWND hwndParent
158 );
159HRESULT CorePlan(
160 __in BURN_ENGINE_STATE* pEngineState,
161 __in BOOTSTRAPPER_ACTION action
162 );
163HRESULT CoreElevate(
164 __in BURN_ENGINE_STATE* pEngineState,
165 __in_opt HWND hwndParent
166 );
167HRESULT CoreApply(
168 __in BURN_ENGINE_STATE* pEngineState,
169 __in_opt HWND hwndParent
170 );
171HRESULT CoreLaunchApprovedExe(
172 __in BURN_ENGINE_STATE* pEngineState,
173 __in BURN_LAUNCH_APPROVED_EXE* pLaunchApprovedExe
174 );
175HRESULT CoreQuit(
176 __in BURN_ENGINE_STATE* pEngineState,
177 __in int nExitCode
178 );
179HRESULT CoreSaveEngineState(
180 __in BURN_ENGINE_STATE* pEngineState
181 );
182LPCWSTR CoreRelationTypeToCommandLineString(
183 __in BOOTSTRAPPER_RELATION_TYPE relationType
184 );
185HRESULT 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 );
197HRESULT CoreAppendFileHandleAttachedToCommandLine(
198 __in HANDLE hFileWithAttachedContainer,
199 __out HANDLE* phExecutableFile,
200 __deref_inout_z LPWSTR* psczCommandLine
201 );
202HRESULT 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