@joebigelow / wix / commits / a563fb99

First steps on Burn for x64 and ARM64

Bob Arnson committed Dec 26, 2020 at 22:15 UTC a563fb99daca852422d61ae8599a3dc32fa1bfe6
9 files changed +88 -12
appveyor.cmd
+2
@@ -6,6 +6,8 @@ nuget restore || exit /b
6 msbuild -t:Test -p:Configuration=Release src\test\BurnUnitTest || exit /b
7
8 msbuild -p:Configuration=Release;Platform=x86 || exit /b
9 +msbuild -p:Configuration=Release;Platform=x64 || exit /b
10 +msbuild -p:Configuration=Release;Platform=arm64 || exit /b
11
12 msbuild -p:Configuration=Release -t:Pack src\stub\stub.vcxproj || exit /b
13 msbuild -p:Configuration=Release -t:Pack src\WixToolset.BootstrapperCore.Native\WixToolset.BootstrapperCore.Native.proj || exit /b
burn.sln
+14 -2
@@ -1,7 +1,7 @@
1 
2 Microsoft Visual Studio Solution File, Format Version 12.00
3 -# Visual Studio 15
4 -VisualStudioVersion = 15.0.26730.12
3 +# Visual Studio Version 16
4 +VisualStudioVersion = 16.0.30711.63
5 MinimumVisualStudioVersion = 15.0.26124.0
6 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine", "src\engine\engine.vcxproj", "{8119537D-E1D9-6591-D51A-49768A2F9C37}"
7 EndProject
@@ -11,31 +11,43 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BurnUnitTest", "src\test\Bu
11 EndProject
12 Global
13 GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 + Debug|ARM64 = Debug|ARM64
15 Debug|x64 = Debug|x64
16 Debug|x86 = Debug|x86
17 + Release|ARM64 = Release|ARM64
18 Release|x64 = Release|x64
19 Release|x86 = Release|x86
20 EndGlobalSection
21 GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 + {8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|ARM64.ActiveCfg = Debug|ARM64
23 + {8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|ARM64.Build.0 = Debug|ARM64
24 {8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|x64.ActiveCfg = Debug|x64
25 {8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|x64.Build.0 = Debug|x64
26 {8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|x86.ActiveCfg = Debug|Win32
27 {8119537D-E1D9-6591-D51A-49768A2F9C37}.Debug|x86.Build.0 = Debug|Win32
28 + {8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|ARM64.ActiveCfg = Release|ARM64
29 + {8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|ARM64.Build.0 = Release|ARM64
30 {8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|x64.ActiveCfg = Release|x64
31 {8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|x64.Build.0 = Release|x64
32 {8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|x86.ActiveCfg = Release|Win32
33 {8119537D-E1D9-6591-D51A-49768A2F9C37}.Release|x86.Build.0 = Release|Win32
34 + {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|ARM64.ActiveCfg = Debug|ARM64
35 + {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|ARM64.Build.0 = Debug|ARM64
36 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|x64.ActiveCfg = Debug|x64
37 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|x64.Build.0 = Debug|x64
38 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|x86.ActiveCfg = Debug|Win32
39 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Debug|x86.Build.0 = Debug|Win32
40 + {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|ARM64.ActiveCfg = Release|ARM64
41 + {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|ARM64.Build.0 = Release|ARM64
42 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x64.ActiveCfg = Release|x64
43 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x64.Build.0 = Release|x64
44 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x86.ActiveCfg = Release|Win32
45 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x86.Build.0 = Release|Win32
46 + {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|ARM64.ActiveCfg = Debug|ARM64
47 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x64.ActiveCfg = Debug|Win32
48 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x86.ActiveCfg = Debug|Win32
49 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x86.Build.0 = Debug|Win32
50 + {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|ARM64.ActiveCfg = Release|ARM64
51 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|x64.ActiveCfg = Release|Win32
52 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|x86.ActiveCfg = Release|Win32
53 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|x86.Build.0 = Release|Win32
src/engine/engine.cpp
+28 -1
@@ -93,6 +93,7 @@ extern "C" HRESULT EngineRun(
93 BOOL fRegInitialized = FALSE;
94 BOOL fWiuInitialized = FALSE;
95 BOOL fXmlInitialized = FALSE;
96 + SYSTEM_INFO si = { };
97 OSVERSIONINFOEXW ovix = { };
98 LPWSTR sczExePath = NULL;
99 BOOL fRunNormal = FALSE;
@@ -155,8 +156,34 @@ extern "C" HRESULT EngineRun(
156 ExitWithLastError(hr, "Failed to get OS info.");
157 }
158
159 +#if defined(_M_ARM64)
160 + LPCSTR szBurnPlatform = "ARM64";
161 +#elif defined(_M_AMD64)
162 + LPCSTR szBurnPlatform = "x64";
163 +#else
164 + LPCSTR szBurnPlatform = "x86";
165 +#endif
166 +
167 + LPCSTR szMachinePlatform = "unknown architecture";
168 + ::GetNativeSystemInfo(&si);
169 + switch (si.wProcessorArchitecture)
170 + {
171 + case PROCESSOR_ARCHITECTURE_AMD64:
172 + szMachinePlatform = "x64";
173 + break;
174 + case PROCESSOR_ARCHITECTURE_ARM:
175 + szMachinePlatform = "ARM";
176 + break;
177 + case PROCESSOR_ARCHITECTURE_ARM64:
178 + szMachinePlatform = "ARM64";
179 + break;
180 + case PROCESSOR_ARCHITECTURE_INTEL:
181 + szMachinePlatform = "x86";
182 + break;
183 + }
184 +
185 PathForCurrentProcess(&sczExePath, NULL); // Ignore failure.
159 - LogId(REPORT_STANDARD, MSG_BURN_INFO, szVerMajorMinorBuild, ovix.dwMajorVersion, ovix.dwMinorVersion, ovix.dwBuildNumber, ovix.wServicePackMajor, sczExePath);
186 + LogId(REPORT_STANDARD, MSG_BURN_INFO, szVerMajorMinorBuild, ovix.dwMajorVersion, ovix.dwMinorVersion, ovix.dwBuildNumber, ovix.wServicePackMajor, sczExePath, szBurnPlatform, szMachinePlatform);
187 ReleaseNullStr(sczExePath);
188
189 // initialize core
src/engine/engine.mc
+1 -1
@@ -33,7 +33,7 @@ MessageId=1
33 Severity=Success
34 SymbolicName=MSG_BURN_INFO
35 Language=English
36 -Burn v%1!hs!, Windows v%2!d!.%3!d! (Build %4!d!: Service Pack %5!d!), path: %6!ls!
36 +Burn %7!hs! v%1!hs!, Windows v%2!d!.%3!d! %8!hs! (Build %4!d!: Service Pack %5!d!), path: %6!ls!
37 .
38
39 MessageId=2
src/engine/engine.vcxproj
+8
@@ -21,6 +21,14 @@
21 <Configuration>Release</Configuration>
22 <Platform>x64</Platform>
23 </ProjectConfiguration>
24 + <ProjectConfiguration Include="Debug|ARM64">
25 + <Configuration>Debug</Configuration>
26 + <Platform>ARM64</Platform>
27 + </ProjectConfiguration>
28 + <ProjectConfiguration Include="Release|ARM64">
29 + <Configuration>Release</Configuration>
30 + <Platform>ARM64</Platform>
31 + </ProjectConfiguration>
32 </ItemGroup>
33
34 <PropertyGroup Label="Globals">
src/engine/variable.cpp
+15 -8
@@ -157,10 +157,6 @@ static HRESULT InitializeVariableNumeric(
157 __in DWORD_PTR dwpData,
158 __inout BURN_VARIANT* pValue
159 );
160 -static HRESULT InitializeVariableRegistryFolder(
161 - __in DWORD_PTR dwpData,
162 - __inout BURN_VARIANT* pValue
163 - );
160 static HRESULT InitializeVariable6432Folder(
161 __in DWORD_PTR dwpData,
162 __inout BURN_VARIANT* pValue
@@ -190,6 +186,13 @@ static HRESULT Get64bitFolderFromRegistry(
186 __deref_out_z LPWSTR* psczPath
187 );
188
189 +#if !defined(_WIN64)
190 +static HRESULT InitializeVariableRegistryFolder(
191 + __in DWORD_PTR dwpData,
192 + __inout BURN_VARIANT* pValue
193 + );
194 +#endif
195 +
196
197 // function definitions
198
@@ -1101,13 +1104,17 @@ static HRESULT FormatString(
1104 LPWSTR* rgVariables = NULL;
1105 DWORD cVariables = 0;
1106 DWORD cch = 0;
1107 + size_t cchIn = 0;
1108 BOOL fHidden = FALSE;
1109 MSIHANDLE hRecord = NULL;
1110
1111 ::EnterCriticalSection(&pVariables->csAccess);
1112
1113 // allocate buffer for format string
1110 - hr = StrAlloc(&sczFormat, lstrlenW(wzIn) + 1);
1114 + hr = ::StringCchLengthW(wzIn, STRSAFE_MAX_CCH - 1, &cchIn);
1115 + ExitOnFailure(hr, "Failed to length of format string.");
1116 +
1117 + hr = StrAlloc(&sczFormat, cchIn + 1);
1118 ExitOnFailure(hr, "Failed to allocate buffer for format string.");
1119
1120 // read out variables from the unformatted string and build a format string
@@ -1133,7 +1140,7 @@ static HRESULT FormatString(
1140 ExitOnFailure(hr, "Failed to append string.");
1141 break;
1142 }
1136 - cch = wzClose - wzOpen - 1;
1143 + cch = (DWORD)(wzClose - wzOpen - 1);
1144
1145 if (0 == cch)
1146 {
@@ -2170,6 +2177,7 @@ LExit:
2177 return hr;
2178 }
2179
2180 +#if !defined(_WIN64)
2181 static HRESULT InitializeVariableRegistryFolder(
2182 __in DWORD_PTR dwpData,
2183 __inout BURN_VARIANT* pValue
@@ -2179,7 +2187,6 @@ static HRESULT InitializeVariableRegistryFolder(
2187 int nFolder = (int)dwpData;
2188 LPWSTR sczPath = NULL;
2189
2182 -#if !defined(_WIN64)
2190 BOOL fIsWow64 = FALSE;
2191
2192 ProcWow64(::GetCurrentProcess(), &fIsWow64);
@@ -2187,7 +2194,6 @@ static HRESULT InitializeVariableRegistryFolder(
2194 {
2195 ExitFunction();
2196 }
2190 -#endif
2197
2198 hr = Get64bitFolderFromRegistry(nFolder, &sczPath);
2199 ExitOnFailure(hr, "Failed to get 64-bit folder.");
@@ -2201,6 +2207,7 @@ LExit:
2207
2208 return hr;
2209 }
2210 +#endif
2211
2212 static HRESULT InitializeVariable6432Folder(
2213 __in DWORD_PTR dwpData,
src/stub/WixToolset.Burn.nuspec
+4
@@ -16,5 +16,9 @@
16 <file src="$projectFolder$$id$.props" target="buildTransitive" />
17 <file src="Win32\burn.exe" target="tools\x86" />
18 <file src="Win32\burn.pdb" target="tools\x86" />
19 + <file src="x64\burn.exe" target="tools\x64" />
20 + <file src="x64\burn.pdb" target="tools\x64" />
21 + <file src="arm64\burn.exe" target="tools\arm64" />
22 + <file src="arm64\burn.pdb" target="tools\arm64" />
23 </files>
24 </package>
src/stub/stub.vcxproj
+8
@@ -24,6 +24,14 @@
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">
src/test/BurnUnitTest/BurnUnitTest.vcxproj
+8
@@ -6,10 +6,18 @@
6 <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')" />
7 <Import Project="..\..\..\packages\WixToolset.DUtil.4.0.59\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\packages\WixToolset.DUtil.4.0.59\build\WixToolset.DUtil.props')" />
8 <ItemGroup Label="ProjectConfigurations">
9 + <ProjectConfiguration Include="Debug|ARM64">
10 + <Configuration>Debug</Configuration>
11 + <Platform>ARM64</Platform>
12 + </ProjectConfiguration>
13 <ProjectConfiguration Include="Debug|Win32">
14 <Configuration>Debug</Configuration>
15 <Platform>Win32</Platform>
16 </ProjectConfiguration>
17 + <ProjectConfiguration Include="Release|ARM64">
18 + <Configuration>Release</Configuration>
19 + <Platform>ARM64</Platform>
20 + </ProjectConfiguration>
21 <ProjectConfiguration Include="Release|Win32">
22 <Configuration>Release</Configuration>
23 <Platform>Win32</Platform>