diff options
Diffstat (limited to 'src/burn/engine')
-rw-r--r-- | src/burn/engine/engine.vcxproj | 32 | ||||
-rw-r--r-- | src/burn/engine/manifest.cpp | 50 | ||||
-rw-r--r-- | src/burn/engine/precomp.h | 1 |
3 files changed, 74 insertions, 9 deletions
diff --git a/src/burn/engine/engine.vcxproj b/src/burn/engine/engine.vcxproj index 5c4860f1..b5cfcb45 100644 --- a/src/burn/engine/engine.vcxproj +++ b/src/burn/engine/engine.vcxproj | |||
@@ -35,13 +35,14 @@ | |||
35 | <TargetName>engine</TargetName> | 35 | <TargetName>engine</TargetName> |
36 | <CharacterSet>Unicode</CharacterSet> | 36 | <CharacterSet>Unicode</CharacterSet> |
37 | <Description>Native component of WixToolset.Burn</Description> | 37 | <Description>Native component of WixToolset.Burn</Description> |
38 | <CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets> | ||
38 | </PropertyGroup> | 39 | </PropertyGroup> |
39 | 40 | ||
40 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | 41 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
41 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | 42 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
42 | 43 | ||
43 | <PropertyGroup> | 44 | <PropertyGroup> |
44 | <ProjectAdditionalIncludeDirectories>..\..\api\burn\WixToolset.BootstrapperCore.Native\inc;$(ProjectAdditionalIncludeDirectories)</ProjectAdditionalIncludeDirectories> | 45 | <ProjectAdditionalIncludeDirectories>..\..\api\burn\WixToolset.BootstrapperCore.Native\inc;$(BurnGeneratedHeaderDirectory);$(ProjectAdditionalIncludeDirectories)</ProjectAdditionalIncludeDirectories> |
45 | </PropertyGroup> | 46 | </PropertyGroup> |
46 | 47 | ||
47 | <ImportGroup Label="ExtensionSettings"> | 48 | <ImportGroup Label="ExtensionSettings"> |
@@ -144,14 +145,15 @@ | |||
144 | <ClInclude Include="variant.h" /> | 145 | <ClInclude Include="variant.h" /> |
145 | </ItemGroup> | 146 | </ItemGroup> |
146 | 147 | ||
147 | <ItemGroup> | 148 | <ItemDefinitionGroup> |
148 | <CustomBuild Include="engine.mc"> | 149 | <CustomBuildStep> |
149 | <Message>Compiling message file...</Message> | 150 | <Message>Compiling message file...</Message> |
150 | <Command>mc.exe -h "$(IntDir)." -r "$(IntDir)." -A -c -z engine.messages "$(InputDir)engine.mc" | 151 | <Command>mc.exe -h "$(IntDir)." -r "$(IntDir)." -A -c -z engine.messages "$(InputDir)engine.mc" |
151 | rc.exe -fo "$(OutDir)engine.res" "$(IntDir)engine.messages.rc"</Command> | 152 | rc.exe -fo "$(OutDir)engine.res" "$(IntDir)engine.messages.rc"</Command> |
153 | <Inputs>$(InputDir)engine.mc</Inputs> | ||
152 | <Outputs>$(IntDir)engine.messages.h;$(IntDir)engine.messages.rc</Outputs> | 154 | <Outputs>$(IntDir)engine.messages.h;$(IntDir)engine.messages.rc</Outputs> |
153 | </CustomBuild> | 155 | </CustomBuildStep> |
154 | </ItemGroup> | 156 | </ItemDefinitionGroup> |
155 | 157 | ||
156 | <Target Name="SetWixVersion" DependsOnTargets="__SetPropertiesFromGit" BeforeTargets="ClCompile"> | 158 | <Target Name="SetWixVersion" DependsOnTargets="__SetPropertiesFromGit" BeforeTargets="ClCompile"> |
157 | <PropertyGroup> | 159 | <PropertyGroup> |
@@ -160,14 +162,26 @@ rc.exe -fo "$(OutDir)engine.res" "$(IntDir)engine.messages.rc"</Command> | |||
160 | <rup>$(GitBaseVersionPatch)</rup> | 162 | <rup>$(GitBaseVersionPatch)</rup> |
161 | <rpr>$(GitCommits)</rpr> | 163 | <rpr>$(GitCommits)</rpr> |
162 | <szVerMajorMinorBuild>$(rmj).$(rmm).$(rup).$(rpr)</szVerMajorMinorBuild> | 164 | <szVerMajorMinorBuild>$(rmj).$(rmm).$(rup).$(rpr)</szVerMajorMinorBuild> |
163 | <wixver>rmj=$(rmj);rmm=$(rmm);rup=$(rup);rpr=$(rpr);szVerMajorMinorBuild="$(szVerMajorMinorBuild)"</wixver> | ||
164 | </PropertyGroup> | 165 | </PropertyGroup> |
165 | 166 | ||
166 | <ItemGroup> | 167 | <ItemGroup> |
167 | <ClCompile> | 168 | <BurnVersionLines Include=" |
168 | <PreprocessorDefinitions>$(wixver);%(PreprocessorDefinitions)</PreprocessorDefinitions> | 169 | // <auto-generated/> |
169 | </ClCompile> | 170 | #ifndef _VERSION_FILE_H_ |
171 | #define _VERSION_FILE_H_ | ||
172 | |||
173 | #define szVerMajorMinorBuild "$(szVerMajorMinorBuild)" | ||
174 | #define wzVerMajorMinorBuild L"$(szVerMajorMinorBuild)" | ||
175 | #define rmj $(rmj) | ||
176 | #define rmm $(rmm) | ||
177 | #define rup $(rup) | ||
178 | #define rpr $(rpr) | ||
179 | |||
180 | #endif | ||
181 | "/> | ||
170 | </ItemGroup> | 182 | </ItemGroup> |
183 | |||
184 | <WriteLinesToFile Overwrite="true" File="$(BurnGeneratedHeaderDirectory)engine.version.h" Lines="@(BurnVersionLines)" /> | ||
171 | </Target> | 185 | </Target> |
172 | 186 | ||
173 | <ItemGroup> | 187 | <ItemGroup> |
diff --git a/src/burn/engine/manifest.cpp b/src/burn/engine/manifest.cpp index 7e16de13..0cd10dbb 100644 --- a/src/burn/engine/manifest.cpp +++ b/src/burn/engine/manifest.cpp | |||
@@ -7,6 +7,11 @@ static HRESULT ParseFromXml( | |||
7 | __in IXMLDOMDocument* pixdDocument, | 7 | __in IXMLDOMDocument* pixdDocument, |
8 | __in BURN_ENGINE_STATE* pEngineState | 8 | __in BURN_ENGINE_STATE* pEngineState |
9 | ); | 9 | ); |
10 | #if DEBUG | ||
11 | static void ValidateHarvestingAttributes( | ||
12 | __in IXMLDOMDocument* pixdDocument | ||
13 | ); | ||
14 | #endif | ||
10 | 15 | ||
11 | // function definitions | 16 | // function definitions |
12 | 17 | ||
@@ -43,6 +48,10 @@ extern "C" HRESULT ManifestLoadXmlFromBuffer( | |||
43 | hr = XmlLoadDocumentFromBuffer(pbBuffer, cbBuffer, &pixdDocument); | 48 | hr = XmlLoadDocumentFromBuffer(pbBuffer, cbBuffer, &pixdDocument); |
44 | ExitOnFailure(hr, "Failed to load manifest as XML document."); | 49 | ExitOnFailure(hr, "Failed to load manifest as XML document."); |
45 | 50 | ||
51 | #if DEBUG | ||
52 | ValidateHarvestingAttributes(pixdDocument); | ||
53 | #endif | ||
54 | |||
46 | hr = ParseFromXml(pixdDocument, pEngineState); | 55 | hr = ParseFromXml(pixdDocument, pEngineState); |
47 | 56 | ||
48 | LExit: | 57 | LExit: |
@@ -162,3 +171,44 @@ LExit: | |||
162 | ReleaseObject(pixeBundle); | 171 | ReleaseObject(pixeBundle); |
163 | return hr; | 172 | return hr; |
164 | } | 173 | } |
174 | |||
175 | #if DEBUG | ||
176 | static void ValidateHarvestingAttributes( | ||
177 | __in IXMLDOMDocument* pixdDocument | ||
178 | ) | ||
179 | { | ||
180 | HRESULT hr = S_OK; | ||
181 | IXMLDOMElement* pixeBundle = NULL; | ||
182 | LPWSTR sczEngineVersion = NULL; | ||
183 | DWORD dwProtocolVersion = 0; | ||
184 | BOOL fWin64 = FALSE; | ||
185 | |||
186 | hr = pixdDocument->get_documentElement(&pixeBundle); | ||
187 | ExitOnFailure(hr, "Failed to get document element."); | ||
188 | |||
189 | hr = XmlGetAttributeEx(pixeBundle, L"EngineVersion", &sczEngineVersion); | ||
190 | ExitOnRequiredXmlQueryFailure(hr, "Failed to get BurnManifest/@EngineVersion attribute."); | ||
191 | |||
192 | hr = XmlGetAttributeUInt32(pixeBundle, L"ProtocolVersion", &dwProtocolVersion); | ||
193 | ExitOnRequiredXmlQueryFailure(hr, "Failed to get BurnManifest/@ProtocolVersion attribute."); | ||
194 | |||
195 | hr = XmlGetYesNoAttribute(pixeBundle, L"Win64", &fWin64); | ||
196 | ExitOnRequiredXmlQueryFailure(hr, "Failed to get BurnManifest/@Win64 attribute."); | ||
197 | |||
198 | Assert(CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczEngineVersion, -1, wzVerMajorMinorBuild, -1)); | ||
199 | |||
200 | Assert(BURN_PROTOCOL_VERSION == dwProtocolVersion); | ||
201 | |||
202 | #if !defined(_WIN64) | ||
203 | Assert(!fWin64); | ||
204 | #else | ||
205 | Assert(fWin64); | ||
206 | #endif | ||
207 | |||
208 | LExit: | ||
209 | AssertSz(SUCCEEDED(hr), "Failed to get harvesting attributes."); | ||
210 | |||
211 | ReleaseStr(sczEngineVersion); | ||
212 | ReleaseObject(pixeBundle); | ||
213 | } | ||
214 | #endif | ||
diff --git a/src/burn/engine/precomp.h b/src/burn/engine/precomp.h index c83c1e74..19a6d48b 100644 --- a/src/burn/engine/precomp.h +++ b/src/burn/engine/precomp.h | |||
@@ -103,4 +103,5 @@ | |||
103 | #include "EngineForApplication.h" | 103 | #include "EngineForApplication.h" |
104 | #include "EngineForExtension.h" | 104 | #include "EngineForExtension.h" |
105 | #include "engine.messages.h" | 105 | #include "engine.messages.h" |
106 | #include "engine.version.h" | ||
106 | #include "engine.h" | 107 | #include "engine.h" |