main
h 232 lines 6.74 KB
Raw
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_REGISTRATION_REGISTRY_UNINSTALL_KEY = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
13 const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH = L"BundleCachePath";
14 const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_ADDON_CODE = L"BundleAddonCode";
15 const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_DETECT_CODE = L"BundleDetectCode";
16 const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_PATCH_CODE = L"BundlePatchCode";
17 const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_UPGRADE_CODE = L"BundleUpgradeCode";
18 const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_DISPLAY_NAME = L"DisplayName";
19 const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION = L"BundleVersion";
20 const LPCWSTR BURN_REGISTRATION_REGISTRY_ENGINE_VERSION = L"EngineVersion";
21 const LPCWSTR BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION = L"EngineProtocolVersion";
22 const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY = L"BundleProviderKey";
23 const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_TAG = L"BundleTag";
24
25 const LPCWSTR REGISTRY_BUNDLE_INSTALLED = L"Installed";
26
27 enum BURN_RESUME_MODE
28 {
29 BURN_RESUME_MODE_NONE,
30 BURN_RESUME_MODE_ACTIVE,
31 BURN_RESUME_MODE_SUSPEND,
32 BURN_RESUME_MODE_ARP,
33 BURN_RESUME_MODE_REBOOT_PENDING,
34 };
35
36 enum BURN_REGISTRATION_MODIFY_TYPE
37 {
38 BURN_REGISTRATION_MODIFY_ENABLED,
39 BURN_REGISTRATION_MODIFY_DISABLE,
40 BURN_REGISTRATION_MODIFY_DISABLE_BUTTON,
41 };
42
43
44 // structs
45
46 typedef struct _BURN_UPDATE_REGISTRATION
47 {
48 BOOL fRegisterUpdate;
49 LPWSTR sczManufacturer;
50 LPWSTR sczDepartment;
51 LPWSTR sczProductFamily;
52 LPWSTR sczName;
53 LPWSTR sczClassification;
54 } BURN_UPDATE_REGISTRATION;
55
56 typedef struct _BURN_RELATED_BUNDLE
57 {
58 BOOTSTRAPPER_RELATION_TYPE detectRelationType;
59 BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE defaultPlanRelationType;
60 BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE planRelationType;
61 BOOL fForwardCompatible;
62
63 VERUTIL_VERSION* pVersion;
64 LPWSTR sczTag;
65 BOOL fPlannable;
66
67 BURN_PACKAGE package;
68
69 BOOTSTRAPPER_REQUEST_STATE defaultRequestedRestore;
70 BOOTSTRAPPER_REQUEST_STATE requestedRestore;
71 BOOTSTRAPPER_ACTION_STATE restore;
72 } BURN_RELATED_BUNDLE;
73
74 typedef struct _BURN_RELATED_BUNDLES
75 {
76 BURN_RELATED_BUNDLE* rgRelatedBundles;
77 DWORD cRelatedBundles;
78 BURN_RELATED_BUNDLE** rgpPlanSortedRelatedBundles;
79 } BURN_RELATED_BUNDLES;
80
81 typedef struct _BURN_SOFTWARE_TAG
82 {
83 LPWSTR sczFilename;
84 LPWSTR sczRegid;
85 LPWSTR sczPath;
86 LPSTR sczTag;
87 } BURN_SOFTWARE_TAG;
88
89 typedef struct _BURN_SOFTWARE_TAGS
90 {
91 BURN_SOFTWARE_TAG* rgSoftwareTags;
92 DWORD cSoftwareTags;
93 } BURN_SOFTWARE_TAGS;
94
95 typedef struct _BURN_REGISTRATION
96 {
97 BOOL fPerMachine;
98 BOOL fForceSystemComponent;
99 BOOL fDisableResume;
100 BOOL fCached;
101 BOOTSTRAPPER_REGISTRATION_TYPE detectedRegistrationType;
102 LPWSTR sczId;
103 LPWSTR sczTag;
104
105 LPWSTR *rgsczDetectCodes;
106 DWORD cDetectCodes;
107
108 LPWSTR *rgsczUpgradeCodes;
109 DWORD cUpgradeCodes;
110
111 LPWSTR *rgsczAddonCodes;
112 DWORD cAddonCodes;
113
114 LPWSTR *rgsczPatchCodes;
115 DWORD cPatchCodes;
116
117 VERUTIL_VERSION* pVersion;
118 LPWSTR sczProviderKey;
119 LPWSTR sczExecutableName;
120
121 // paths
122 HKEY hkRoot;
123 LPWSTR sczRegistrationKey;
124 LPWSTR sczCacheExecutablePath;
125 LPWSTR sczResumeCommandLine;
126 LPWSTR sczStateFile;
127
128 // ARP registration
129 LPWSTR sczDisplayName;
130 LPWSTR sczInProgressDisplayName;
131 LPWSTR sczDisplayVersion;
132 LPWSTR sczPublisher;
133 LPWSTR sczHelpLink;
134 LPWSTR sczHelpTelephone;
135 LPWSTR sczAboutUrl;
136 LPWSTR sczUpdateUrl;
137 LPWSTR sczParentDisplayName;
138 LPWSTR sczComments;
139 //LPWSTR sczReadme; // TODO: this would be a file path
140 LPWSTR sczContact;
141 //DWORD64 qwEstimatedSize; // TODO: size should come from disk cost calculation
142 BURN_REGISTRATION_MODIFY_TYPE modify;
143 BOOL fNoRemove;
144
145 BURN_SOFTWARE_TAGS softwareTags;
146
147 // Update registration
148 BURN_UPDATE_REGISTRATION update;
149
150 BURN_RELATED_BUNDLES relatedBundles; // Only valid after detect.
151 DEPENDENCY* rgDependents; // Only valid after detect.
152 UINT cDependents; // Only valid after detect.
153 BOOL fSelfRegisteredAsDependent; // Only valid after detect.
154 BOOL fParentRegisteredAsDependent; // Only valid after detect.
155 BOOL fForwardCompatibleBundleExists; // Only valid after detect.
156 BOOL fEligibleForCleanup; // Only valid after detect.
157
158 BOOL fDetectedForeignProviderKeyBundleId;
159 LPWSTR sczDetectedProviderKeyBundleId;
160 LPWSTR sczBundlePackageAncestors;
161 } BURN_REGISTRATION;
162
163
164 // functions
165
166 HRESULT RegistrationParseFromXml(
167 __in BURN_REGISTRATION* pRegistration,
168 __in BURN_CACHE* pCache,
169 __in IXMLDOMNode* pixnBundle
170 );
171 void RegistrationUninitialize(
172 __in BURN_REGISTRATION* pRegistration
173 );
174 HRESULT RegistrationSetVariables(
175 __in BURN_REGISTRATION* pRegistration,
176 __in BURN_VARIABLES* pVariables
177 );
178 HRESULT RegistrationSetDynamicVariables(
179 __in BURN_REGISTRATION* pRegistration,
180 __in BURN_VARIABLES* pVariables
181 );
182 HRESULT RegistrationDetectInstalled(
183 __in BURN_REGISTRATION* pRegistration
184 );
185 HRESULT RegistrationDetectResumeType(
186 __in BURN_REGISTRATION* pRegistration,
187 __out BOOTSTRAPPER_RESUME_TYPE* pResumeType
188 );
189 HRESULT RegistrationDetectRelatedBundles(
190 __in BURN_REGISTRATION* pRegistration
191 );
192 HRESULT RegistrationPlanInitialize(
193 __in BURN_REGISTRATION* pRegistration
194 );
195 HRESULT RegistrationSessionBegin(
196 __in_z LPCWSTR wzEngineWorkingPath,
197 __in BURN_REGISTRATION* pRegistration,
198 __in BURN_CACHE* pCache,
199 __in BURN_VARIABLES* pVariables,
200 __in DWORD dwRegistrationOptions,
201 __in DWORD64 qwEstimatedSize,
202 __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType
203 );
204 HRESULT RegistrationSessionEnd(
205 __in BURN_REGISTRATION* pRegistration,
206 __in BURN_CACHE* pCache,
207 __in BURN_VARIABLES* pVariables,
208 __in BURN_PACKAGES* pPackages,
209 __in BURN_RESUME_MODE resumeMode,
210 __in BOOTSTRAPPER_APPLY_RESTART restart,
211 __in DWORD64 qwEstimatedSize,
212 __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType
213 );
214 HRESULT RegistrationSaveState(
215 __in BURN_REGISTRATION* pRegistration,
216 __in_bcount_opt(cbBuffer) BYTE* pbBuffer,
217 __in_opt SIZE_T cbBuffer
218 );
219 HRESULT RegistrationLoadState(
220 __in BURN_REGISTRATION* pRegistration,
221 __out_bcount(*pcbBuffer) BYTE** ppbBuffer,
222 __out SIZE_T* pcbBuffer
223 );
224 HRESULT RegistrationGetResumeCommandLine(
225 __in const BURN_REGISTRATION* pRegistration,
226 __deref_out_z LPWSTR* psczResumeCommandLine
227 );
228
229
230 #if defined(__cplusplus)
231 }
232 #endif