aboutsummaryrefslogtreecommitdiff
path: root/src/burn/stub
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-04-22 17:06:54 -0700
committerRob Mensching <rob@firegiant.com>2021-04-29 16:36:06 -0700
commitaf10c45d7b3a44af0b461a557847fe03263dcc10 (patch)
tree6a5c1532304782c36ffe4200b38f3afb76789a43 /src/burn/stub
parent9c2aed97299fb96aeee3f1471ce40225437aaecf (diff)
downloadwix-af10c45d7b3a44af0b461a557847fe03263dcc10.tar.gz
wix-af10c45d7b3a44af0b461a557847fe03263dcc10.tar.bz2
wix-af10c45d7b3a44af0b461a557847fe03263dcc10.zip
Move burn into burn
Diffstat (limited to 'src/burn/stub')
-rw-r--r--src/burn/stub/StubSection.cpp23
-rw-r--r--src/burn/stub/WixToolset.Burn.props13
-rw-r--r--src/burn/stub/packages.config8
-rw-r--r--src/burn/stub/precomp.cpp3
-rw-r--r--src/burn/stub/precomp.h17
-rw-r--r--src/burn/stub/stub.cpp106
-rw-r--r--src/burn/stub/stub.icobin0 -> 2238 bytes
-rw-r--r--src/burn/stub/stub.nuspec25
-rw-r--r--src/burn/stub/stub.rc3
-rw-r--r--src/burn/stub/stub.vcxproj120
10 files changed, 318 insertions, 0 deletions
diff --git a/src/burn/stub/StubSection.cpp b/src/burn/stub/StubSection.cpp
new file mode 100644
index 00000000..962bb3cf
--- /dev/null
+++ b/src/burn/stub/StubSection.cpp
@@ -0,0 +1,23 @@
1// 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.
2
3#include "precomp.h"
4
5#pragma section(".wixburn",read)
6
7// If these defaults ever change, be sure to update constants in burn\engine\section.cpp as well.
8#pragma data_seg(push, ".wixburn")
9static DWORD dwMagic = 0x00f14300;
10static DWORD dwVersion = 0x00000002;
11
12static GUID guidBundleId = { };
13
14static DWORD dwStubSize = 0;
15static DWORD dwOriginalChecksum = 0;
16static DWORD dwOriginalSignatureOffset = 0;
17static DWORD dwOriginalSignatureSize = 0;
18
19static DWORD dwContainerFormat = 1;
20static DWORD dwContainerCount = 0;
21static DWORD qwBootstrapperApplicationContainerSize = 0;
22static DWORD qwAttachedContainerSize = 0;
23#pragma data_seg(pop)
diff --git a/src/burn/stub/WixToolset.Burn.props b/src/burn/stub/WixToolset.Burn.props
new file mode 100644
index 00000000..38cd333e
--- /dev/null
+++ b/src/burn/stub/WixToolset.Burn.props
@@ -0,0 +1,13 @@
1<?xml version="1.0" encoding="utf-8"?>
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<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
5 <ItemGroup>
6 <BurnExes Include="$(MSBuildThisFileDirectory)..\tools\**\burn.exe" />
7 <None Include="@(BurnExes)">
8 <Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
9 <Visible>False</Visible>
10 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
11 </None>
12 </ItemGroup>
13</Project>
diff --git a/src/burn/stub/packages.config b/src/burn/stub/packages.config
new file mode 100644
index 00000000..a98c0c8e
--- /dev/null
+++ b/src/burn/stub/packages.config
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="native" developmentDependency="true" />
4 <package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" />
5 <package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="native" developmentDependency="true" />
6 <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" />
7 <package id="WixToolset.DUtil" version="4.0.72" targetFramework="native" />
8</packages> \ No newline at end of file
diff --git a/src/burn/stub/precomp.cpp b/src/burn/stub/precomp.cpp
new file mode 100644
index 00000000..37664a1c
--- /dev/null
+++ b/src/burn/stub/precomp.cpp
@@ -0,0 +1,3 @@
1// 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.
2
3#include "precomp.h"
diff --git a/src/burn/stub/precomp.h b/src/burn/stub/precomp.h
new file mode 100644
index 00000000..bb7ded9c
--- /dev/null
+++ b/src/burn/stub/precomp.h
@@ -0,0 +1,17 @@
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#include <windows.h>
6
7#include <dutilsources.h>
8#include <burnsources.h>
9
10#include <dutil.h>
11#include <apputil.h>
12#include <strutil.h>
13#include <fileutil.h>
14#include <pathutil.h>
15#include <logutil.h>
16
17#include "engine.h"
diff --git a/src/burn/stub/stub.cpp b/src/burn/stub/stub.cpp
new file mode 100644
index 00000000..0cb202e0
--- /dev/null
+++ b/src/burn/stub/stub.cpp
@@ -0,0 +1,106 @@
1// 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.
2
3#include "precomp.h"
4
5
6static void CALLBACK BurnTraceError(
7 __in_z LPCSTR szFile,
8 __in int iLine,
9 __in REPORT_LEVEL rl,
10 __in UINT source,
11 __in HRESULT hrError,
12 __in_z __format_string LPCSTR szFormat,
13 __in va_list args
14 );
15
16int WINAPI wWinMain(
17 __in HINSTANCE hInstance,
18 __in_opt HINSTANCE /* hPrevInstance */,
19 __in_z_opt LPWSTR lpCmdLine,
20 __in int nCmdShow
21 )
22{
23 HRESULT hr = S_OK;
24 DWORD dwExitCode = 0;
25 LPWSTR sczPath = NULL;
26 HANDLE hEngineFile = INVALID_HANDLE_VALUE;
27
28 LPCWSTR rgsczSafelyLoadSystemDlls[] =
29 {
30 L"cabinet.dll", // required by Burn.
31 L"msi.dll", // required by Burn.
32 L"version.dll", // required by Burn.
33 L"wininet.dll", // required by Burn.
34
35 L"comres.dll", // required by CLSIDFromProgID() when loading clbcatq.dll.
36 L"clbcatq.dll", // required by CLSIDFromProgID() when loading msxml?.dll.
37
38 L"msasn1.dll", // required by DecryptFile() when loading crypt32.dll.
39 L"crypt32.dll", // required by DecryptFile() when loading feclient.dll.
40 L"feclient.dll", // unsafely loaded by DecryptFile().
41 };
42
43 DutilInitialize(&BurnTraceError);
44
45 // Best effort attempt to get our file handle as soon as possible.
46 hr = PathForCurrentProcess(&sczPath, NULL);
47 if (SUCCEEDED(hr))
48 {
49 hEngineFile = ::CreateFileW(sczPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
50 }
51
52 // If the engine is in the clean room, we'll do the unsafe initialization
53 // because some systems in Windows (namely GDI+) will fail when run in
54 // a process that protects against DLL hijacking. Since we know the clean
55 // room is in a clean folder and not subject to DLL hijacking we won't
56 // make ourselves perfectly secure so that we can load BAs that still
57 // depend on those parts of Windows that are insecure to DLL hijacking.
58 if (EngineInCleanRoom(lpCmdLine))
59 {
60 AppInitializeUnsafe();
61 }
62 else
63 {
64 AppInitialize(rgsczSafelyLoadSystemDlls, countof(rgsczSafelyLoadSystemDlls));
65 }
66
67 // call run
68 hr = EngineRun(hInstance, hEngineFile, lpCmdLine, nCmdShow, &dwExitCode);
69 ExitOnFailure(hr, "Failed to run application.");
70
71LExit:
72 ReleaseFileHandle(hEngineFile);
73 ReleaseStr(sczPath);
74
75 DutilUninitialize();
76
77 return FAILED(hr) ? (int)hr : (int)dwExitCode;
78}
79
80static void CALLBACK BurnTraceError(
81 __in_z LPCSTR /*szFile*/,
82 __in int /*iLine*/,
83 __in REPORT_LEVEL /*rl*/,
84 __in UINT source,
85 __in HRESULT hrError,
86 __in_z __format_string LPCSTR szFormat,
87 __in va_list args
88 )
89{
90 BOOL fLog = FALSE;
91
92 switch (source)
93 {
94 case DUTIL_SOURCE_DEFAULT:
95 fLog = TRUE;
96 break;
97 default:
98 fLog = REPORT_VERBOSE < LogGetLevel();
99 break;
100 }
101
102 if (fLog)
103 {
104 LogErrorStringArgs(hrError, szFormat, args);
105 }
106}
diff --git a/src/burn/stub/stub.ico b/src/burn/stub/stub.ico
new file mode 100644
index 00000000..c2e2717c
--- /dev/null
+++ b/src/burn/stub/stub.ico
Binary files differ
diff --git a/src/burn/stub/stub.nuspec b/src/burn/stub/stub.nuspec
new file mode 100644
index 00000000..968feff3
--- /dev/null
+++ b/src/burn/stub/stub.nuspec
@@ -0,0 +1,25 @@
1<?xml version="1.0"?>
2<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3 <metadata minClientVersion="4.0">
4 <id>$id$</id>
5 <version>$version$</version>
6 <title>$title$</title>
7 <description>$description$</description>
8 <authors>$authors$</authors>
9 <license type="expression">MS-RL</license>
10 <requireLicenseAcceptance>false</requireLicenseAcceptance>
11 <copyright>$copyright$</copyright>
12 <projectUrl>$projectUrl$</projectUrl>
13 <repository type="$repositorytype$" url="$repositoryurl$" commit="$repositorycommit$" />
14 </metadata>
15
16 <files>
17 <file src="$projectFolder$$id$.props" target="buildTransitive" />
18 <file src="..\..\build\$configuration$\Win32\burn.exe" target="tools\x86" />
19 <file src="..\..\build\$configuration$\Win32\burn.pdb" target="tools\x86" />
20 <file src="..\..\build\$configuration$\x64\burn.exe" target="tools\x64" />
21 <file src="..\..\build\$configuration$\x64\burn.pdb" target="tools\x64" />
22 <file src="..\..\build\$configuration$\arm64\burn.exe" target="tools\arm64" />
23 <file src="..\..\build\$configuration$\arm64\burn.pdb" target="tools\arm64" />
24 </files>
25</package>
diff --git a/src/burn/stub/stub.rc b/src/burn/stub/stub.rc
new file mode 100644
index 00000000..80e1aac4
--- /dev/null
+++ b/src/burn/stub/stub.rc
@@ -0,0 +1,3 @@
1// 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.
2
31 ICON "stub.ico"
diff --git a/src/burn/stub/stub.vcxproj b/src/burn/stub/stub.vcxproj
new file mode 100644
index 00000000..97972848
--- /dev/null
+++ b/src/burn/stub/stub.vcxproj
@@ -0,0 +1,120 @@
1<?xml version="1.0" encoding="utf-8"?>
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<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <Import Project="..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" />
6 <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" />
7 <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" />
8 <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" />
9
10 <ItemGroup Label="ProjectConfigurations">
11 <ProjectConfiguration Include="Debug|Win32">
12 <Configuration>Debug</Configuration>
13 <Platform>Win32</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|Win32">
16 <Configuration>Release</Configuration>
17 <Platform>Win32</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Debug|x64">
20 <Configuration>Debug</Configuration>
21 <Platform>x64</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 <ProjectConfiguration Include="Debug|ARM64">
28 <Configuration>Debug</Configuration>
29 <Platform>ARM64</Platform>
30 </ProjectConfiguration>
31 <ProjectConfiguration Include="Release|ARM64">
32 <Configuration>Release</Configuration>
33 <Platform>ARM64</Platform>
34 </ProjectConfiguration>
35 </ItemGroup>
36
37 <PropertyGroup Label="Globals">
38 <ProjectGuid>{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}</ProjectGuid>
39 <ConfigurationType>Application</ConfigurationType>
40 <ProjectSubSystem>Windows</ProjectSubSystem>
41 <TargetName>burn</TargetName>
42 <PlatformToolset>v142</PlatformToolset>
43 <CharacterSet>Unicode</CharacterSet>
44 <GenerateManifest>false</GenerateManifest>
45 <Description>Native component of WixToolset.Burn</Description>
46 <!-- NBGV properties -->
47 <AssemblyLanguage>1033</AssemblyLanguage>
48 <AssemblyProduct>Burn</AssemblyProduct>
49 <PackageId>WixToolset.Burn</PackageId>
50 <SignOutput>false</SignOutput>
51 </PropertyGroup>
52
53 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
54 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
55
56 <ImportGroup Label="ExtensionSettings">
57 </ImportGroup>
58
59 <ImportGroup Label="Shared">
60 <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" />
61 <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" />
62 <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" />
63 <Import Project="..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" />
64 </ImportGroup>
65
66 <PropertyGroup>
67 <ProjectAdditionalIncludeDirectories>$(ProjectDir)..\engine\inc</ProjectAdditionalIncludeDirectories>
68 <ProjectAdditionalLinkLibraries>cabinet.lib;crypt32.lib;msi.lib;rpcrt4.lib;shlwapi.lib;wininet.lib;wuguid.lib;engine.res</ProjectAdditionalLinkLibraries>
69 </PropertyGroup>
70
71 <ItemDefinitionGroup>
72 <Link>
73 <SwapRunFromCD>true</SwapRunFromCD>
74 <SwapRunFromNET>true</SwapRunFromNET>
75 <DelayLoadDLLs>cabinet.dll;crypt32.dll;msi.dll;shlwapi.dll;version.dll;wininet.dll</DelayLoadDLLs>
76 </Link>
77 </ItemDefinitionGroup>
78
79 <ItemGroup>
80 <ClInclude Include="precomp.h" />
81 </ItemGroup>
82 <ItemGroup>
83 <ClCompile Include="precomp.cpp">
84 <PrecompiledHeader>Create</PrecompiledHeader>
85 </ClCompile>
86 <ClCompile Include="stub.cpp" />
87 <ClCompile Include="StubSection.cpp">
88 <!-- Workaround for VS2015 behavior change that omits the .wixburn section. -->
89 <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
90 </ClCompile>
91 </ItemGroup>
92 <ItemGroup>
93 <ResourceCompile Include="stub.rc" />
94 </ItemGroup>
95
96 <ItemGroup>
97 <ProjectReference Include="..\engine\engine.vcxproj">
98 <Project>{8119537D-E1D9-6591-D51A-49768A2F9C37}</Project>
99 </ProjectReference>
100 </ItemGroup>
101
102 <ItemGroup>
103 <None Include="packages.config" />
104 </ItemGroup>
105
106 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
107 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
108 <PropertyGroup>
109 <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
110 </PropertyGroup>
111 <Error Condition="!Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props'))" />
112 <Error Condition="!Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets'))" />
113 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props'))" />
114 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets'))" />
115 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" />
116 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" />
117 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets'))" />
118 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props'))" />
119 </Target>
120</Project>