@joebigelow / wix / commits / ad5aeb25

Port support for ISO/IEC 19770-2:2105 (aka SWID Tags-2)

Fixes wixtoolset/issues#8380

Rob Mensching committed Apr 12, 2021 at 14:17 UTC ad5aeb25c459196938cc88c404406bbbe1df9061
12 files changed +61 -51
src/engine/apply.cpp
+1 -1
@@ -435,7 +435,7 @@ extern "C" HRESULT ApplyUnregister(
435 }
436 else
437 {
438 - hr = RegistrationSessionEnd(&pEngineState->registration, &pEngineState->packages, resumeMode, restart, pEngineState->plan.dependencyRegistrationAction);
438 + hr = RegistrationSessionEnd(&pEngineState->registration, &pEngineState->variables, &pEngineState->packages, resumeMode, restart, pEngineState->plan.dependencyRegistrationAction);
439 ExitOnFailure(hr, "Failed to end session in per-user process.");
440 }
441
src/engine/elevation.cpp
+4 -2
@@ -156,6 +156,7 @@ static HRESULT OnSessionResume(
156 static HRESULT OnSessionEnd(
157 __in BURN_PACKAGES* pPackages,
158 __in BURN_REGISTRATION* pRegistration,
159 + __in BURN_VARIABLES* pVariables,
160 __in BYTE* pbData,
161 __in DWORD cbData
162 );
@@ -1650,7 +1651,7 @@ static HRESULT ProcessElevatedChildMessage(
1651 break;
1652
1653 case BURN_ELEVATION_MESSAGE_TYPE_SESSION_END:
1653 - hrResult = OnSessionEnd(pContext->pPackages, pContext->pRegistration, (BYTE*)pMsg->pvData, pMsg->cbData);
1654 + hrResult = OnSessionEnd(pContext->pPackages, pContext->pRegistration, pContext->pVariables, (BYTE*)pMsg->pvData, pMsg->cbData);
1655 break;
1656
1657 case BURN_ELEVATION_MESSAGE_TYPE_SAVE_STATE:
@@ -1969,6 +1970,7 @@ LExit:
1970 static HRESULT OnSessionEnd(
1971 __in BURN_PACKAGES* pPackages,
1972 __in BURN_REGISTRATION* pRegistration,
1973 + __in BURN_VARIABLES* pVariables,
1974 __in BYTE* pbData,
1975 __in DWORD cbData
1976 )
@@ -1990,7 +1992,7 @@ static HRESULT OnSessionEnd(
1992 ExitOnFailure(hr, "Failed to read dependency registration action.");
1993
1994 // suspend session in per-machine process
1993 - hr = RegistrationSessionEnd(pRegistration, pPackages, (BURN_RESUME_MODE)dwResumeMode, (BOOTSTRAPPER_APPLY_RESTART)dwRestart, (BURN_DEPENDENCY_REGISTRATION_ACTION)dwDependencyRegistrationAction);
1995 + hr = RegistrationSessionEnd(pRegistration, pVariables, pPackages, (BURN_RESUME_MODE)dwResumeMode, (BOOTSTRAPPER_APPLY_RESTART)dwRestart, (BURN_DEPENDENCY_REGISTRATION_ACTION)dwDependencyRegistrationAction);
1996 ExitOnFailure(hr, "Failed to suspend registration session.");
1997
1998 LExit:
src/engine/engine.vcxproj
+2 -2
@@ -1,7 +1,7 @@
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 <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4 - <Import Project="..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props')" />
4 + <Import Project="..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props')" />
5 <ItemGroup Label="ProjectConfigurations">
6 <ProjectConfiguration Include="Debug|Win32">
7 <Configuration>Debug</Configuration>
@@ -165,7 +165,7 @@ rc.exe -fo "$(OutDir)engine.res" "$(IntDir)engine.messages.rc"</Command>
165 <PropertyGroup>
166 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
167 </PropertyGroup>
168 - <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props'))" />
168 + <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props'))" />
169 <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'))" />
170 </Target>
171 </Project>
\ No newline at end of file
src/engine/packages.config
+1 -1
@@ -1,5 +1,5 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <packages>
3 <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" />
4 - <package id="WixToolset.DUtil" version="4.0.65" targetFramework="native" />
4 + <package id="WixToolset.DUtil" version="4.0.67" targetFramework="native" />
5 </packages>
\ No newline at end of file
src/engine/registration.cpp
+31 -25
@@ -31,6 +31,7 @@ const LPCWSTR REGISTRY_BUNDLE_UNINSTALL_STRING = L"UninstallString";
31 const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L"BundleResumeCommandLine";
32 const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L"VersionMajor";
33 const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L"VersionMinor";
34 +const LPCWSTR SWIDTAG_FOLDER = L"swidtag";
35
36 // internal function declarations
37
@@ -67,11 +68,11 @@ static HRESULT FormatUpdateRegistrationKey(
68 __out_z LPWSTR* psczKey
69 );
70 static HRESULT WriteSoftwareTags(
70 - __in BOOL fPerMachine,
71 + __in BURN_VARIABLES* pVariables,
72 __in BURN_SOFTWARE_TAGS* pSoftwareTags
73 );
74 static HRESULT RemoveSoftwareTags(
74 - __in BOOL fPerMachine,
75 + __in BURN_VARIABLES* pVariables,
76 __in BURN_SOFTWARE_TAGS* pSoftwareTags
77 );
78 static HRESULT WriteUpdateRegistration(
@@ -392,6 +393,7 @@ extern "C" void RegistrationUninitialize(
393 {
394 ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczFilename);
395 ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczRegid);
396 + ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczPath);
397 ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczTag);
398 }
399
@@ -778,7 +780,7 @@ extern "C" HRESULT RegistrationSessionBegin(
780
781 if (pRegistration->softwareTags.cSoftwareTags)
782 {
781 - hr = WriteSoftwareTags(pRegistration->fPerMachine, &pRegistration->softwareTags);
783 + hr = WriteSoftwareTags(pVariables, &pRegistration->softwareTags);
784 ExitOnFailure(hr, "Failed to write software tags.");
785 }
786
@@ -867,6 +869,7 @@ LExit:
869 *******************************************************************/
870 extern "C" HRESULT RegistrationSessionEnd(
871 __in BURN_REGISTRATION* pRegistration,
872 + __in BURN_VARIABLES* pVariables,
873 __in BURN_PACKAGES* pPackages,
874 __in BURN_RESUME_MODE resumeMode,
875 __in BOOTSTRAPPER_APPLY_RESTART restart,
@@ -920,7 +923,7 @@ extern "C" HRESULT RegistrationSessionEnd(
923 RemoveUpdateRegistration(pRegistration);
924 }
925
923 - RemoveSoftwareTags(pRegistration->fPerMachine, &pRegistration->softwareTags);
926 + RemoveSoftwareTags(pVariables, &pRegistration->softwareTags);
927
928 // Delete registration key.
929 hr = RegDelete(pRegistration->hkRoot, pRegistration->sczRegistrationKey, REG_KEY_DEFAULT, FALSE);
@@ -1063,6 +1066,9 @@ static HRESULT ParseSoftwareTagsFromXml(
1066 hr = XmlGetAttributeEx(pixnNode, L"Regid", &pSoftwareTag->sczRegid);
1067 ExitOnFailure(hr, "Failed to get @Regid.");
1068
1069 + hr = XmlGetAttributeEx(pixnNode, L"Path", &pSoftwareTag->sczPath);
1070 + ExitOnFailure(hr, "Failed to get @Path.");
1071 +
1072 hr = XmlGetText(pixnNode, &bstrTagXml);
1073 ExitOnFailure(hr, "Failed to get SoftwareTag text.");
1074
@@ -1370,30 +1376,30 @@ LExit:
1376 }
1377
1378 static HRESULT WriteSoftwareTags(
1373 - __in BOOL fPerMachine,
1379 + __in BURN_VARIABLES* pVariables,
1380 __in BURN_SOFTWARE_TAGS* pSoftwareTags
1381 )
1382 {
1383 HRESULT hr = S_OK;
1384 LPWSTR sczRootFolder = NULL;
1379 - LPWSTR sczRegidFolder = NULL;
1385 + LPWSTR sczTagFolder = NULL;
1386 LPWSTR sczPath = NULL;
1387
1382 - hr = PathGetKnownFolder(fPerMachine ? CSIDL_COMMON_APPDATA : CSIDL_LOCAL_APPDATA, &sczRootFolder);
1383 - ExitOnFailure(hr, "Failed to find local %hs appdata directory.", fPerMachine ? "per-machine" : "per-user");
1384 -
1388 for (DWORD iTag = 0; iTag < pSoftwareTags->cSoftwareTags; ++iTag)
1389 {
1390 BURN_SOFTWARE_TAG* pSoftwareTag = pSoftwareTags->rgSoftwareTags + iTag;
1391
1389 - hr = PathConcat(sczRootFolder, pSoftwareTag->sczRegid, &sczRegidFolder);
1390 - ExitOnFailure(hr, "Failed to allocate regid folder path.");
1392 + hr = VariableFormatString(pVariables, pSoftwareTag->sczPath, &sczRootFolder, NULL);
1393 + ExitOnFailure(hr, "Failed to format tag folder path.");
1394
1392 - hr = PathConcat(sczRegidFolder, pSoftwareTag->sczFilename, &sczPath);
1395 + hr = PathConcat(sczRootFolder, SWIDTAG_FOLDER, &sczTagFolder);
1396 ExitOnFailure(hr, "Failed to allocate regid folder path.");
1397
1395 - hr = DirEnsureExists(sczRegidFolder, NULL);
1396 - ExitOnFailure(hr, "Failed to create regid folder: %ls", sczRegidFolder);
1398 + hr = PathConcat(sczTagFolder, pSoftwareTag->sczFilename, &sczPath);
1399 + ExitOnFailure(hr, "Failed to allocate regid file path.");
1400 +
1401 + hr = DirEnsureExists(sczTagFolder, NULL);
1402 + ExitOnFailure(hr, "Failed to create regid folder: %ls", sczTagFolder);
1403
1404 hr = FileWrite(sczPath, FILE_ATTRIBUTE_NORMAL, reinterpret_cast<LPBYTE>(pSoftwareTag->sczTag), lstrlenA(pSoftwareTag->sczTag), NULL);
1405 ExitOnFailure(hr, "Failed to write tag xml to file: %ls", sczPath);
@@ -1401,44 +1407,44 @@ static HRESULT WriteSoftwareTags(
1407
1408 LExit:
1409 ReleaseStr(sczPath);
1404 - ReleaseStr(sczRegidFolder);
1410 + ReleaseStr(sczTagFolder);
1411 ReleaseStr(sczRootFolder);
1412
1413 return hr;
1414 }
1415
1416 static HRESULT RemoveSoftwareTags(
1411 - __in BOOL fPerMachine,
1417 + __in BURN_VARIABLES* pVariables,
1418 __in BURN_SOFTWARE_TAGS* pSoftwareTags
1419 )
1420 {
1421 HRESULT hr = S_OK;
1422 LPWSTR sczRootFolder = NULL;
1417 - LPWSTR sczRegidFolder = NULL;
1423 + LPWSTR sczTagFolder = NULL;
1424 LPWSTR sczPath = NULL;
1425
1420 - hr = PathGetKnownFolder(fPerMachine ? CSIDL_COMMON_APPDATA : CSIDL_LOCAL_APPDATA, &sczRootFolder);
1421 - ExitOnFailure(hr, "Failed to find local %hs appdata directory.", fPerMachine ? "per-machine" : "per-user");
1422 -
1426 for (DWORD iTag = 0; iTag < pSoftwareTags->cSoftwareTags; ++iTag)
1427 {
1428 BURN_SOFTWARE_TAG* pSoftwareTag = pSoftwareTags->rgSoftwareTags + iTag;
1429
1427 - hr = PathConcat(sczRootFolder, pSoftwareTag->sczRegid, &sczRegidFolder);
1428 - ExitOnFailure(hr, "Failed to allocate regid folder path.");
1430 + hr = VariableFormatString(pVariables, pSoftwareTag->sczPath, &sczRootFolder, NULL);
1431 + ExitOnFailure(hr, "Failed to format tag folder path.");
1432
1430 - hr = PathConcat(sczRegidFolder, pSoftwareTag->sczFilename, &sczPath);
1433 + hr = PathConcat(sczRootFolder, SWIDTAG_FOLDER, &sczTagFolder);
1434 ExitOnFailure(hr, "Failed to allocate regid folder path.");
1435
1436 + hr = PathConcat(sczTagFolder, pSoftwareTag->sczFilename, &sczPath);
1437 + ExitOnFailure(hr, "Failed to allocate regid file path.");
1438 +
1439 // Best effort to delete the software tag file and the regid folder.
1440 FileEnsureDelete(sczPath);
1441
1436 - ::RemoveDirectoryW(sczRegidFolder);
1442 + DirDeleteEmptyDirectoriesToRoot(sczTagFolder, 0);
1443 }
1444
1445 LExit:
1446 ReleaseStr(sczPath);
1441 - ReleaseStr(sczRegidFolder);
1447 + ReleaseStr(sczTagFolder);
1448 ReleaseStr(sczRootFolder);
1449
1450 return hr;
src/engine/registration.h
+2
@@ -77,6 +77,7 @@ typedef struct _BURN_SOFTWARE_TAG
77 {
78 LPWSTR sczFilename;
79 LPWSTR sczRegid;
80 + LPWSTR sczPath;
81 LPSTR sczTag;
82 } BURN_SOFTWARE_TAG;
83
@@ -198,6 +199,7 @@ HRESULT RegistrationSessionResume(
199 );
200 HRESULT RegistrationSessionEnd(
201 __in BURN_REGISTRATION* pRegistration,
202 + __in BURN_VARIABLES* pVariables,
203 __in BURN_PACKAGES* pPackages,
204 __in BURN_RESUME_MODE resumeMode,
205 __in BOOTSTRAPPER_APPLY_RESTART restart,
src/stub/packages.config
+1 -1
@@ -4,5 +4,5 @@
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.65" targetFramework="native" />
7 + <package id="WixToolset.DUtil" version="4.0.67" targetFramework="native" />
8 </packages>
\ No newline at end of file
src/stub/stub.vcxproj
+2 -2
@@ -5,7 +5,7 @@
5 <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')" />
6 <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')" />
7 <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')" />
8 - <Import Project="..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props')" />
8 + <Import Project="..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props')" />
9
10 <ItemGroup Label="ProjectConfigurations">
11 <ProjectConfiguration Include="Debug|Win32">
@@ -117,6 +117,6 @@
117 <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'))" />
118 <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'))" />
119 <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'))" />
120 - <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props'))" />
120 + <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props'))" />
121 </Target>
122 </Project>
\ No newline at end of file
src/test/BurnUnitTest/BurnUnitTest.vcxproj
+2 -2
@@ -4,7 +4,7 @@
4
5 <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
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.65\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props')" />
7 + <Import Project="..\..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props')" />
8 <ItemGroup Label="ProjectConfigurations">
9 <ProjectConfiguration Include="Debug|ARM64">
10 <Configuration>Debug</Configuration>
@@ -97,6 +97,6 @@
97 </PropertyGroup>
98 <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props'))" />
99 <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets'))" />
100 - <Error Condition="!Exists('..\..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props'))" />
100 + <Error Condition="!Exists('..\..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props'))" />
101 </Target>
102 </Project>
\ No newline at end of file
src/test/BurnUnitTest/RegistrationTest.cpp
+11 -11
@@ -123,7 +123,7 @@ namespace Bootstrapper
123 Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)(Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)));
124
125 // end session
126 - hr = RegistrationSessionEnd(&registration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
126 + hr = RegistrationSessionEnd(&registration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
127 TestThrowOnFailure(hr, L"Failed to unregister bundle.");
128
129 // verify that registration was removed
@@ -213,7 +213,7 @@ namespace Bootstrapper
213 Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr));
214
215 // complete registration
216 - hr = RegistrationSessionEnd(&registration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER);
216 + hr = RegistrationSessionEnd(&registration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER);
217 TestThrowOnFailure(hr, L"Failed to unregister bundle.");
218
219 // verify that registration was updated
@@ -235,7 +235,7 @@ namespace Bootstrapper
235 Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr));
236
237 // delete registration
238 - hr = RegistrationSessionEnd(&registration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
238 + hr = RegistrationSessionEnd(&registration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
239 TestThrowOnFailure(hr, L"Failed to unregister bundle.");
240
241 // verify that registration was removed
@@ -324,7 +324,7 @@ namespace Bootstrapper
324 Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr));
325
326 // complete registration
327 - hr = RegistrationSessionEnd(&registration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER);
327 + hr = RegistrationSessionEnd(&registration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER);
328 TestThrowOnFailure(hr, L"Failed to unregister bundle.");
329
330 // verify that registration variables were updated
@@ -344,7 +344,7 @@ namespace Bootstrapper
344 //
345
346 // delete registration
347 - hr = RegistrationSessionEnd(&registration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
347 + hr = RegistrationSessionEnd(&registration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
348 TestThrowOnFailure(hr, L"Failed to unregister bundle.");
349
350 // verify that registration was removed
@@ -435,7 +435,7 @@ namespace Bootstrapper
435 Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr));
436
437 // finish registration
438 - hr = RegistrationSessionEnd(&registration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER);
438 + hr = RegistrationSessionEnd(&registration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER);
439 TestThrowOnFailure(hr, L"Failed to register bundle.");
440
441 // verify that registration was updated
@@ -468,7 +468,7 @@ namespace Bootstrapper
468 Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr));
469
470 // delete registration
471 - hr = RegistrationSessionEnd(&registration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
471 + hr = RegistrationSessionEnd(&registration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
472 TestThrowOnFailure(hr, L"Failed to unregister bundle.");
473
474 // verify that registration was removed
@@ -509,7 +509,7 @@ namespace Bootstrapper
509 BYTE rgbData[256] = { };
510 BOOTSTRAPPER_RESUME_TYPE resumeType = BOOTSTRAPPER_RESUME_TYPE_NONE;
511 BYTE* pbBuffer = NULL;
512 - DWORD cbBuffer = 0;
512 + SIZE_T cbBuffer = 0;
513 String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"));
514 try
515 {
@@ -573,7 +573,7 @@ namespace Bootstrapper
573 Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType);
574
575 // suspend session
576 - hr = RegistrationSessionEnd(&registration, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER);
576 + hr = RegistrationSessionEnd(&registration, &variables, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER);
577 TestThrowOnFailure(hr, L"Failed to suspend session.");
578
579 // verify that run key was removed
@@ -589,7 +589,7 @@ namespace Bootstrapper
589 hr = RegistrationLoadState(&registration, &pbBuffer, &cbBuffer);
590 TestThrowOnFailure(hr, L"Failed to load state.");
591
592 - Assert::Equal((DWORD)sizeof(rgbData), cbBuffer);
592 + Assert::Equal((SIZE_T)sizeof(rgbData), cbBuffer);
593 Assert::True(0 == memcmp(pbBuffer, rgbData, sizeof(rgbData)));
594
595 // write active resume mode
@@ -600,7 +600,7 @@ namespace Bootstrapper
600 Assert::NotEqual((Object^)nullptr, Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr));
601
602 // end session
603 - hr = RegistrationSessionEnd(&registration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
603 + hr = RegistrationSessionEnd(&registration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER);
604 TestThrowOnFailure(hr, L"Failed to unregister bundle.");
605
606 // read resume type after session
src/test/BurnUnitTest/VariableTest.cpp
+3 -3
@@ -134,7 +134,7 @@ namespace Bootstrapper
134 HRESULT hr = S_OK;
135 BURN_VARIABLES variables = { };
136 LPWSTR scz = NULL;
137 - DWORD cch = 0;
137 + SIZE_T cch = 0;
138 BOOL fContainsHiddenData = FALSE;
139 try
140 {
@@ -180,12 +180,12 @@ namespace Bootstrapper
180 hr = VariableFormatString(&variables, L"PRE [PROP1] POST", &scz, &cch);
181 TestThrowOnFailure(hr, L"Failed to format string");
182
183 - Assert::Equal((DWORD)lstrlenW(scz), cch);
183 + Assert::Equal((SIZE_T)lstrlenW(scz), cch);
184
185 hr = VariableFormatString(&variables, L"PRE [PROP1] POST", NULL, &cch);
186 TestThrowOnFailure(hr, L"Failed to format string");
187
188 - Assert::Equal((DWORD)lstrlenW(scz), cch);
188 + Assert::Equal((SIZE_T)lstrlenW(scz), cch);
189 }
190 finally
191 {
src/test/BurnUnitTest/packages.config
+1 -1
@@ -10,5 +10,5 @@
10 <package id="xunit.runner.visualstudio" version="2.4.1" />
11 <package id="WixBuildTools.TestSupport" version="4.0.47" />
12 <package id="WixBuildTools.TestSupport.Native" version="4.0.47" />
13 - <package id="WixToolset.DUtil" version="4.0.65" targetFramework="native" />
13 + <package id="WixToolset.DUtil" version="4.0.67" targetFramework="native" />
14 </packages>
\ No newline at end of file