First steps on Burn for x64 and ARM64

This commit is contained in:
Bob Arnson 2020-12-26 22:15:06 -05:00 коммит произвёл Sean Hall
Родитель a5b86b987b
Коммит a563fb99da
9 изменённых файлов: 88 добавлений и 12 удалений

Просмотреть файл

@ -6,6 +6,8 @@ nuget restore || exit /b
msbuild -t:Test -p:Configuration=Release src\test\BurnUnitTest || exit /b
msbuild -p:Configuration=Release;Platform=x86 || exit /b
msbuild -p:Configuration=Release;Platform=x64 || exit /b
msbuild -p:Configuration=Release;Platform=arm64 || exit /b
msbuild -p:Configuration=Release -t:Pack src\stub\stub.vcxproj || exit /b
msbuild -p:Configuration=Release -t:Pack src\WixToolset.BootstrapperCore.Native\WixToolset.BootstrapperCore.Native.proj || exit /b

Просмотреть файл

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.12
# Visual Studio Version 16
VisualStudioVersion = 16.0.30711.63
MinimumVisualStudioVersion = 15.0.26124.0
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine", "src\engine\engine.vcxproj", "{8119537D-E1D9-6591-D51A-49768A2F9C37}"
EndProject
@ -11,31 +11,43 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BurnUnitTest", "src\test\Bu
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|ARM64.ActiveCfg = Debug|ARM64
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|ARM64.Build.0 = Debug|ARM64
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|x64.ActiveCfg = Debug|x64
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|x64.Build.0 = Debug|x64
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|x86.ActiveCfg = Debug|Win32
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|x86.Build.0 = Debug|Win32
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|ARM64.ActiveCfg = Release|ARM64
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|ARM64.Build.0 = Release|ARM64
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|x64.ActiveCfg = Release|x64
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|x64.Build.0 = Release|x64
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|x86.ActiveCfg = Release|Win32
{8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|x86.Build.0 = Release|Win32
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|ARM64.ActiveCfg = Debug|ARM64
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|ARM64.Build.0 = Debug|ARM64
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|x64.ActiveCfg = Debug|x64
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|x64.Build.0 = Debug|x64
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|x86.ActiveCfg = Debug|Win32
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|x86.Build.0 = Debug|Win32
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|ARM64.ActiveCfg = Release|ARM64
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|ARM64.Build.0 = Release|ARM64
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x64.ActiveCfg = Release|x64
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x64.Build.0 = Release|x64
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x86.ActiveCfg = Release|Win32
{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x86.Build.0 = Release|Win32
{9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|ARM64.ActiveCfg = Debug|ARM64
{9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x64.ActiveCfg = Debug|Win32
{9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x86.ActiveCfg = Debug|Win32
{9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x86.Build.0 = Debug|Win32
{9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|ARM64.ActiveCfg = Release|ARM64
{9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|x64.ActiveCfg = Release|Win32
{9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|x86.ActiveCfg = Release|Win32
{9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|x86.Build.0 = Release|Win32

Просмотреть файл

@ -93,6 +93,7 @@ extern "C" HRESULT EngineRun(
BOOL fRegInitialized = FALSE;
BOOL fWiuInitialized = FALSE;
BOOL fXmlInitialized = FALSE;
SYSTEM_INFO si = { };
OSVERSIONINFOEXW ovix = { };
LPWSTR sczExePath = NULL;
BOOL fRunNormal = FALSE;
@ -155,8 +156,34 @@ extern "C" HRESULT EngineRun(
ExitWithLastError(hr, "Failed to get OS info.");
}
#if defined(_M_ARM64)
LPCSTR szBurnPlatform = "ARM64";
#elif defined(_M_AMD64)
LPCSTR szBurnPlatform = "x64";
#else
LPCSTR szBurnPlatform = "x86";
#endif
LPCSTR szMachinePlatform = "unknown architecture";
::GetNativeSystemInfo(&si);
switch (si.wProcessorArchitecture)
{
case PROCESSOR_ARCHITECTURE_AMD64:
szMachinePlatform = "x64";
break;
case PROCESSOR_ARCHITECTURE_ARM:
szMachinePlatform = "ARM";
break;
case PROCESSOR_ARCHITECTURE_ARM64:
szMachinePlatform = "ARM64";
break;
case PROCESSOR_ARCHITECTURE_INTEL:
szMachinePlatform = "x86";
break;
}
PathForCurrentProcess(&sczExePath, NULL); // Ignore failure.
LogId(REPORT_STANDARD, MSG_BURN_INFO, szVerMajorMinorBuild, ovix.dwMajorVersion, ovix.dwMinorVersion, ovix.dwBuildNumber, ovix.wServicePackMajor, sczExePath);
LogId(REPORT_STANDARD, MSG_BURN_INFO, szVerMajorMinorBuild, ovix.dwMajorVersion, ovix.dwMinorVersion, ovix.dwBuildNumber, ovix.wServicePackMajor, sczExePath, szBurnPlatform, szMachinePlatform);
ReleaseNullStr(sczExePath);
// initialize core

Просмотреть файл

@ -33,7 +33,7 @@ MessageId=1
Severity=Success
SymbolicName=MSG_BURN_INFO
Language=English
Burn v%1!hs!, Windows v%2!d!.%3!d! (Build %4!d!: Service Pack %5!d!), path: %6!ls!
Burn %7!hs! v%1!hs!, Windows v%2!d!.%3!d! %8!hs! (Build %4!d!: Service Pack %5!d!), path: %6!ls!
.
MessageId=2

Просмотреть файл

@ -21,6 +21,14 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">

Просмотреть файл

@ -157,10 +157,6 @@ static HRESULT InitializeVariableNumeric(
__in DWORD_PTR dwpData,
__inout BURN_VARIANT* pValue
);
static HRESULT InitializeVariableRegistryFolder(
__in DWORD_PTR dwpData,
__inout BURN_VARIANT* pValue
);
static HRESULT InitializeVariable6432Folder(
__in DWORD_PTR dwpData,
__inout BURN_VARIANT* pValue
@ -190,6 +186,13 @@ static HRESULT Get64bitFolderFromRegistry(
__deref_out_z LPWSTR* psczPath
);
#if !defined(_WIN64)
static HRESULT InitializeVariableRegistryFolder(
__in DWORD_PTR dwpData,
__inout BURN_VARIANT* pValue
);
#endif
// function definitions
@ -1101,13 +1104,17 @@ static HRESULT FormatString(
LPWSTR* rgVariables = NULL;
DWORD cVariables = 0;
DWORD cch = 0;
size_t cchIn = 0;
BOOL fHidden = FALSE;
MSIHANDLE hRecord = NULL;
::EnterCriticalSection(&pVariables->csAccess);
// allocate buffer for format string
hr = StrAlloc(&sczFormat, lstrlenW(wzIn) + 1);
hr = ::StringCchLengthW(wzIn, STRSAFE_MAX_CCH - 1, &cchIn);
ExitOnFailure(hr, "Failed to length of format string.");
hr = StrAlloc(&sczFormat, cchIn + 1);
ExitOnFailure(hr, "Failed to allocate buffer for format string.");
// read out variables from the unformatted string and build a format string
@ -1133,7 +1140,7 @@ static HRESULT FormatString(
ExitOnFailure(hr, "Failed to append string.");
break;
}
cch = wzClose - wzOpen - 1;
cch = (DWORD)(wzClose - wzOpen - 1);
if (0 == cch)
{
@ -2170,6 +2177,7 @@ LExit:
return hr;
}
#if !defined(_WIN64)
static HRESULT InitializeVariableRegistryFolder(
__in DWORD_PTR dwpData,
__inout BURN_VARIANT* pValue
@ -2179,7 +2187,6 @@ static HRESULT InitializeVariableRegistryFolder(
int nFolder = (int)dwpData;
LPWSTR sczPath = NULL;
#if !defined(_WIN64)
BOOL fIsWow64 = FALSE;
ProcWow64(::GetCurrentProcess(), &fIsWow64);
@ -2187,7 +2194,6 @@ static HRESULT InitializeVariableRegistryFolder(
{
ExitFunction();
}
#endif
hr = Get64bitFolderFromRegistry(nFolder, &sczPath);
ExitOnFailure(hr, "Failed to get 64-bit folder.");
@ -2201,6 +2207,7 @@ LExit:
return hr;
}
#endif
static HRESULT InitializeVariable6432Folder(
__in DWORD_PTR dwpData,

Просмотреть файл

@ -16,5 +16,9 @@
<file src="$projectFolder$$id$.props" target="buildTransitive" />
<file src="Win32\burn.exe" target="tools\x86" />
<file src="Win32\burn.pdb" target="tools\x86" />
<file src="x64\burn.exe" target="tools\x64" />
<file src="x64\burn.pdb" target="tools\x64" />
<file src="arm64\burn.exe" target="tools\arm64" />
<file src="arm64\burn.pdb" target="tools\arm64" />
</files>
</package>

Просмотреть файл

@ -24,6 +24,14 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">

Просмотреть файл

@ -6,10 +6,18 @@
<Import Project="..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props" Condition="Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" />
<Import Project="..\..\..\packages\WixToolset.DUtil.4.0.59\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\packages\WixToolset.DUtil.4.0.59\build\WixToolset.DUtil.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>