diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/apply.cpp | 2 | ||||
| -rw-r--r-- | src/engine/elevation.cpp | 6 | ||||
| -rw-r--r-- | src/engine/engine.vcxproj | 4 | ||||
| -rw-r--r-- | src/engine/packages.config | 2 | ||||
| -rw-r--r-- | src/engine/registration.cpp | 56 | ||||
| -rw-r--r-- | src/engine/registration.h | 2 | ||||
| -rw-r--r-- | src/stub/packages.config | 2 | ||||
| -rw-r--r-- | src/stub/stub.vcxproj | 4 | ||||
| -rw-r--r-- | src/test/BurnUnitTest/BurnUnitTest.vcxproj | 4 | ||||
| -rw-r--r-- | src/test/BurnUnitTest/RegistrationTest.cpp | 22 | ||||
| -rw-r--r-- | src/test/BurnUnitTest/VariableTest.cpp | 6 | ||||
| -rw-r--r-- | src/test/BurnUnitTest/packages.config | 2 |
12 files changed, 61 insertions, 51 deletions
diff --git a/src/engine/apply.cpp b/src/engine/apply.cpp index 77080c76..dc40c50d 100644 --- a/src/engine/apply.cpp +++ b/src/engine/apply.cpp | |||
| @@ -435,7 +435,7 @@ extern "C" HRESULT ApplyUnregister( | |||
| 435 | } | 435 | } |
| 436 | else | 436 | else |
| 437 | { | 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."); | 439 | ExitOnFailure(hr, "Failed to end session in per-user process."); |
| 440 | } | 440 | } |
| 441 | 441 | ||
diff --git a/src/engine/elevation.cpp b/src/engine/elevation.cpp index 1737bf5b..82d5a9b1 100644 --- a/src/engine/elevation.cpp +++ b/src/engine/elevation.cpp | |||
| @@ -156,6 +156,7 @@ static HRESULT OnSessionResume( | |||
| 156 | static HRESULT OnSessionEnd( | 156 | static HRESULT OnSessionEnd( |
| 157 | __in BURN_PACKAGES* pPackages, | 157 | __in BURN_PACKAGES* pPackages, |
| 158 | __in BURN_REGISTRATION* pRegistration, | 158 | __in BURN_REGISTRATION* pRegistration, |
| 159 | __in BURN_VARIABLES* pVariables, | ||
| 159 | __in BYTE* pbData, | 160 | __in BYTE* pbData, |
| 160 | __in DWORD cbData | 161 | __in DWORD cbData |
| 161 | ); | 162 | ); |
| @@ -1650,7 +1651,7 @@ static HRESULT ProcessElevatedChildMessage( | |||
| 1650 | break; | 1651 | break; |
| 1651 | 1652 | ||
| 1652 | case BURN_ELEVATION_MESSAGE_TYPE_SESSION_END: | 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); |
| 1654 | break; | 1655 | break; |
| 1655 | 1656 | ||
| 1656 | case BURN_ELEVATION_MESSAGE_TYPE_SAVE_STATE: | 1657 | case BURN_ELEVATION_MESSAGE_TYPE_SAVE_STATE: |
| @@ -1969,6 +1970,7 @@ LExit: | |||
| 1969 | static HRESULT OnSessionEnd( | 1970 | static HRESULT OnSessionEnd( |
| 1970 | __in BURN_PACKAGES* pPackages, | 1971 | __in BURN_PACKAGES* pPackages, |
| 1971 | __in BURN_REGISTRATION* pRegistration, | 1972 | __in BURN_REGISTRATION* pRegistration, |
| 1973 | __in BURN_VARIABLES* pVariables, | ||
| 1972 | __in BYTE* pbData, | 1974 | __in BYTE* pbData, |
| 1973 | __in DWORD cbData | 1975 | __in DWORD cbData |
| 1974 | ) | 1976 | ) |
| @@ -1990,7 +1992,7 @@ static HRESULT OnSessionEnd( | |||
| 1990 | ExitOnFailure(hr, "Failed to read dependency registration action."); | 1992 | ExitOnFailure(hr, "Failed to read dependency registration action."); |
| 1991 | 1993 | ||
| 1992 | // suspend session in per-machine process | 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); |
| 1994 | ExitOnFailure(hr, "Failed to suspend registration session."); | 1996 | ExitOnFailure(hr, "Failed to suspend registration session."); |
| 1995 | 1997 | ||
| 1996 | LExit: | 1998 | LExit: |
diff --git a/src/engine/engine.vcxproj b/src/engine/engine.vcxproj index e418e6f4..666b3f37 100644 --- a/src/engine/engine.vcxproj +++ b/src/engine/engine.vcxproj | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 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. --> | 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"> | 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"> | 5 | <ItemGroup Label="ProjectConfigurations"> |
| 6 | <ProjectConfiguration Include="Debug|Win32"> | 6 | <ProjectConfiguration Include="Debug|Win32"> |
| 7 | <Configuration>Debug</Configuration> | 7 | <Configuration>Debug</Configuration> |
| @@ -165,7 +165,7 @@ rc.exe -fo "$(OutDir)engine.res" "$(IntDir)engine.messages.rc"</Command> | |||
| 165 | <PropertyGroup> | 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> | 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> | 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'))" /> | 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> | 170 | </Target> |
| 171 | </Project> \ No newline at end of file | 171 | </Project> \ No newline at end of file |
diff --git a/src/engine/packages.config b/src/engine/packages.config index 84e3078b..1d09f0a7 100644 --- a/src/engine/packages.config +++ b/src/engine/packages.config | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <packages> | 2 | <packages> |
| 3 | <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" /> | 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 | 5 | </packages> \ No newline at end of file |
diff --git a/src/engine/registration.cpp b/src/engine/registration.cpp index fc5ae627..b8a2283f 100644 --- a/src/engine/registration.cpp +++ b/src/engine/registration.cpp | |||
| @@ -31,6 +31,7 @@ const LPCWSTR REGISTRY_BUNDLE_UNINSTALL_STRING = L"UninstallString"; | |||
| 31 | const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L"BundleResumeCommandLine"; | 31 | const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L"BundleResumeCommandLine"; |
| 32 | const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L"VersionMajor"; | 32 | const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L"VersionMajor"; |
| 33 | const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L"VersionMinor"; | 33 | const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L"VersionMinor"; |
| 34 | const LPCWSTR SWIDTAG_FOLDER = L"swidtag"; | ||
| 34 | 35 | ||
| 35 | // internal function declarations | 36 | // internal function declarations |
| 36 | 37 | ||
| @@ -67,11 +68,11 @@ static HRESULT FormatUpdateRegistrationKey( | |||
| 67 | __out_z LPWSTR* psczKey | 68 | __out_z LPWSTR* psczKey |
| 68 | ); | 69 | ); |
| 69 | static HRESULT WriteSoftwareTags( | 70 | static HRESULT WriteSoftwareTags( |
| 70 | __in BOOL fPerMachine, | 71 | __in BURN_VARIABLES* pVariables, |
| 71 | __in BURN_SOFTWARE_TAGS* pSoftwareTags | 72 | __in BURN_SOFTWARE_TAGS* pSoftwareTags |
| 72 | ); | 73 | ); |
| 73 | static HRESULT RemoveSoftwareTags( | 74 | static HRESULT RemoveSoftwareTags( |
| 74 | __in BOOL fPerMachine, | 75 | __in BURN_VARIABLES* pVariables, |
| 75 | __in BURN_SOFTWARE_TAGS* pSoftwareTags | 76 | __in BURN_SOFTWARE_TAGS* pSoftwareTags |
| 76 | ); | 77 | ); |
| 77 | static HRESULT WriteUpdateRegistration( | 78 | static HRESULT WriteUpdateRegistration( |
| @@ -392,6 +393,7 @@ extern "C" void RegistrationUninitialize( | |||
| 392 | { | 393 | { |
| 393 | ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczFilename); | 394 | ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczFilename); |
| 394 | ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczRegid); | 395 | ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczRegid); |
| 396 | ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczPath); | ||
| 395 | ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczTag); | 397 | ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczTag); |
| 396 | } | 398 | } |
| 397 | 399 | ||
| @@ -778,7 +780,7 @@ extern "C" HRESULT RegistrationSessionBegin( | |||
| 778 | 780 | ||
| 779 | if (pRegistration->softwareTags.cSoftwareTags) | 781 | if (pRegistration->softwareTags.cSoftwareTags) |
| 780 | { | 782 | { |
| 781 | hr = WriteSoftwareTags(pRegistration->fPerMachine, &pRegistration->softwareTags); | 783 | hr = WriteSoftwareTags(pVariables, &pRegistration->softwareTags); |
| 782 | ExitOnFailure(hr, "Failed to write software tags."); | 784 | ExitOnFailure(hr, "Failed to write software tags."); |
| 783 | } | 785 | } |
| 784 | 786 | ||
| @@ -867,6 +869,7 @@ LExit: | |||
| 867 | *******************************************************************/ | 869 | *******************************************************************/ |
| 868 | extern "C" HRESULT RegistrationSessionEnd( | 870 | extern "C" HRESULT RegistrationSessionEnd( |
| 869 | __in BURN_REGISTRATION* pRegistration, | 871 | __in BURN_REGISTRATION* pRegistration, |
| 872 | __in BURN_VARIABLES* pVariables, | ||
| 870 | __in BURN_PACKAGES* pPackages, | 873 | __in BURN_PACKAGES* pPackages, |
| 871 | __in BURN_RESUME_MODE resumeMode, | 874 | __in BURN_RESUME_MODE resumeMode, |
| 872 | __in BOOTSTRAPPER_APPLY_RESTART restart, | 875 | __in BOOTSTRAPPER_APPLY_RESTART restart, |
| @@ -920,7 +923,7 @@ extern "C" HRESULT RegistrationSessionEnd( | |||
| 920 | RemoveUpdateRegistration(pRegistration); | 923 | RemoveUpdateRegistration(pRegistration); |
| 921 | } | 924 | } |
| 922 | 925 | ||
| 923 | RemoveSoftwareTags(pRegistration->fPerMachine, &pRegistration->softwareTags); | 926 | RemoveSoftwareTags(pVariables, &pRegistration->softwareTags); |
| 924 | 927 | ||
| 925 | // Delete registration key. | 928 | // Delete registration key. |
| 926 | hr = RegDelete(pRegistration->hkRoot, pRegistration->sczRegistrationKey, REG_KEY_DEFAULT, FALSE); | 929 | hr = RegDelete(pRegistration->hkRoot, pRegistration->sczRegistrationKey, REG_KEY_DEFAULT, FALSE); |
| @@ -1063,6 +1066,9 @@ static HRESULT ParseSoftwareTagsFromXml( | |||
| 1063 | hr = XmlGetAttributeEx(pixnNode, L"Regid", &pSoftwareTag->sczRegid); | 1066 | hr = XmlGetAttributeEx(pixnNode, L"Regid", &pSoftwareTag->sczRegid); |
| 1064 | ExitOnFailure(hr, "Failed to get @Regid."); | 1067 | ExitOnFailure(hr, "Failed to get @Regid."); |
| 1065 | 1068 | ||
| 1069 | hr = XmlGetAttributeEx(pixnNode, L"Path", &pSoftwareTag->sczPath); | ||
| 1070 | ExitOnFailure(hr, "Failed to get @Path."); | ||
| 1071 | |||
| 1066 | hr = XmlGetText(pixnNode, &bstrTagXml); | 1072 | hr = XmlGetText(pixnNode, &bstrTagXml); |
| 1067 | ExitOnFailure(hr, "Failed to get SoftwareTag text."); | 1073 | ExitOnFailure(hr, "Failed to get SoftwareTag text."); |
| 1068 | 1074 | ||
| @@ -1370,30 +1376,30 @@ LExit: | |||
| 1370 | } | 1376 | } |
| 1371 | 1377 | ||
| 1372 | static HRESULT WriteSoftwareTags( | 1378 | static HRESULT WriteSoftwareTags( |
| 1373 | __in BOOL fPerMachine, | 1379 | __in BURN_VARIABLES* pVariables, |
| 1374 | __in BURN_SOFTWARE_TAGS* pSoftwareTags | 1380 | __in BURN_SOFTWARE_TAGS* pSoftwareTags |
| 1375 | ) | 1381 | ) |
| 1376 | { | 1382 | { |
| 1377 | HRESULT hr = S_OK; | 1383 | HRESULT hr = S_OK; |
| 1378 | LPWSTR sczRootFolder = NULL; | 1384 | LPWSTR sczRootFolder = NULL; |
| 1379 | LPWSTR sczRegidFolder = NULL; | 1385 | LPWSTR sczTagFolder = NULL; |
| 1380 | LPWSTR sczPath = NULL; | 1386 | LPWSTR sczPath = NULL; |
| 1381 | 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 | |||
| 1385 | for (DWORD iTag = 0; iTag < pSoftwareTags->cSoftwareTags; ++iTag) | 1388 | for (DWORD iTag = 0; iTag < pSoftwareTags->cSoftwareTags; ++iTag) |
| 1386 | { | 1389 | { |
| 1387 | BURN_SOFTWARE_TAG* pSoftwareTag = pSoftwareTags->rgSoftwareTags + iTag; | 1390 | BURN_SOFTWARE_TAG* pSoftwareTag = pSoftwareTags->rgSoftwareTags + iTag; |
| 1388 | 1391 | ||
| 1389 | hr = PathConcat(sczRootFolder, pSoftwareTag->sczRegid, &sczRegidFolder); | 1392 | hr = VariableFormatString(pVariables, pSoftwareTag->sczPath, &sczRootFolder, NULL); |
| 1390 | ExitOnFailure(hr, "Failed to allocate regid folder path."); | 1393 | ExitOnFailure(hr, "Failed to format tag folder path."); |
| 1391 | 1394 | ||
| 1392 | hr = PathConcat(sczRegidFolder, pSoftwareTag->sczFilename, &sczPath); | 1395 | hr = PathConcat(sczRootFolder, SWIDTAG_FOLDER, &sczTagFolder); |
| 1393 | ExitOnFailure(hr, "Failed to allocate regid folder path."); | 1396 | ExitOnFailure(hr, "Failed to allocate regid folder path."); |
| 1394 | 1397 | ||
| 1395 | hr = DirEnsureExists(sczRegidFolder, NULL); | 1398 | hr = PathConcat(sczTagFolder, pSoftwareTag->sczFilename, &sczPath); |
| 1396 | ExitOnFailure(hr, "Failed to create regid folder: %ls", sczRegidFolder); | 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); | ||
| 1397 | 1403 | ||
| 1398 | hr = FileWrite(sczPath, FILE_ATTRIBUTE_NORMAL, reinterpret_cast<LPBYTE>(pSoftwareTag->sczTag), lstrlenA(pSoftwareTag->sczTag), NULL); | 1404 | hr = FileWrite(sczPath, FILE_ATTRIBUTE_NORMAL, reinterpret_cast<LPBYTE>(pSoftwareTag->sczTag), lstrlenA(pSoftwareTag->sczTag), NULL); |
| 1399 | ExitOnFailure(hr, "Failed to write tag xml to file: %ls", sczPath); | 1405 | ExitOnFailure(hr, "Failed to write tag xml to file: %ls", sczPath); |
| @@ -1401,44 +1407,44 @@ static HRESULT WriteSoftwareTags( | |||
| 1401 | 1407 | ||
| 1402 | LExit: | 1408 | LExit: |
| 1403 | ReleaseStr(sczPath); | 1409 | ReleaseStr(sczPath); |
| 1404 | ReleaseStr(sczRegidFolder); | 1410 | ReleaseStr(sczTagFolder); |
| 1405 | ReleaseStr(sczRootFolder); | 1411 | ReleaseStr(sczRootFolder); |
| 1406 | 1412 | ||
| 1407 | return hr; | 1413 | return hr; |
| 1408 | } | 1414 | } |
| 1409 | 1415 | ||
| 1410 | static HRESULT RemoveSoftwareTags( | 1416 | static HRESULT RemoveSoftwareTags( |
| 1411 | __in BOOL fPerMachine, | 1417 | __in BURN_VARIABLES* pVariables, |
| 1412 | __in BURN_SOFTWARE_TAGS* pSoftwareTags | 1418 | __in BURN_SOFTWARE_TAGS* pSoftwareTags |
| 1413 | ) | 1419 | ) |
| 1414 | { | 1420 | { |
| 1415 | HRESULT hr = S_OK; | 1421 | HRESULT hr = S_OK; |
| 1416 | LPWSTR sczRootFolder = NULL; | 1422 | LPWSTR sczRootFolder = NULL; |
| 1417 | LPWSTR sczRegidFolder = NULL; | 1423 | LPWSTR sczTagFolder = NULL; |
| 1418 | LPWSTR sczPath = NULL; | 1424 | LPWSTR sczPath = NULL; |
| 1419 | 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 | |||
| 1423 | for (DWORD iTag = 0; iTag < pSoftwareTags->cSoftwareTags; ++iTag) | 1426 | for (DWORD iTag = 0; iTag < pSoftwareTags->cSoftwareTags; ++iTag) |
| 1424 | { | 1427 | { |
| 1425 | BURN_SOFTWARE_TAG* pSoftwareTag = pSoftwareTags->rgSoftwareTags + iTag; | 1428 | BURN_SOFTWARE_TAG* pSoftwareTag = pSoftwareTags->rgSoftwareTags + iTag; |
| 1426 | 1429 | ||
| 1427 | hr = PathConcat(sczRootFolder, pSoftwareTag->sczRegid, &sczRegidFolder); | 1430 | hr = VariableFormatString(pVariables, pSoftwareTag->sczPath, &sczRootFolder, NULL); |
| 1428 | ExitOnFailure(hr, "Failed to allocate regid folder path."); | 1431 | ExitOnFailure(hr, "Failed to format tag folder path."); |
| 1429 | 1432 | ||
| 1430 | hr = PathConcat(sczRegidFolder, pSoftwareTag->sczFilename, &sczPath); | 1433 | hr = PathConcat(sczRootFolder, SWIDTAG_FOLDER, &sczTagFolder); |
| 1431 | ExitOnFailure(hr, "Failed to allocate regid folder path."); | 1434 | ExitOnFailure(hr, "Failed to allocate regid folder path."); |
| 1432 | 1435 | ||
| 1436 | hr = PathConcat(sczTagFolder, pSoftwareTag->sczFilename, &sczPath); | ||
| 1437 | ExitOnFailure(hr, "Failed to allocate regid file path."); | ||
| 1438 | |||
| 1433 | // Best effort to delete the software tag file and the regid folder. | 1439 | // Best effort to delete the software tag file and the regid folder. |
| 1434 | FileEnsureDelete(sczPath); | 1440 | FileEnsureDelete(sczPath); |
| 1435 | 1441 | ||
| 1436 | ::RemoveDirectoryW(sczRegidFolder); | 1442 | DirDeleteEmptyDirectoriesToRoot(sczTagFolder, 0); |
| 1437 | } | 1443 | } |
| 1438 | 1444 | ||
| 1439 | LExit: | 1445 | LExit: |
| 1440 | ReleaseStr(sczPath); | 1446 | ReleaseStr(sczPath); |
| 1441 | ReleaseStr(sczRegidFolder); | 1447 | ReleaseStr(sczTagFolder); |
| 1442 | ReleaseStr(sczRootFolder); | 1448 | ReleaseStr(sczRootFolder); |
| 1443 | 1449 | ||
| 1444 | return hr; | 1450 | return hr; |
diff --git a/src/engine/registration.h b/src/engine/registration.h index 39fee65f..ed0641eb 100644 --- a/src/engine/registration.h +++ b/src/engine/registration.h | |||
| @@ -77,6 +77,7 @@ typedef struct _BURN_SOFTWARE_TAG | |||
| 77 | { | 77 | { |
| 78 | LPWSTR sczFilename; | 78 | LPWSTR sczFilename; |
| 79 | LPWSTR sczRegid; | 79 | LPWSTR sczRegid; |
| 80 | LPWSTR sczPath; | ||
| 80 | LPSTR sczTag; | 81 | LPSTR sczTag; |
| 81 | } BURN_SOFTWARE_TAG; | 82 | } BURN_SOFTWARE_TAG; |
| 82 | 83 | ||
| @@ -198,6 +199,7 @@ HRESULT RegistrationSessionResume( | |||
| 198 | ); | 199 | ); |
| 199 | HRESULT RegistrationSessionEnd( | 200 | HRESULT RegistrationSessionEnd( |
| 200 | __in BURN_REGISTRATION* pRegistration, | 201 | __in BURN_REGISTRATION* pRegistration, |
| 202 | __in BURN_VARIABLES* pVariables, | ||
| 201 | __in BURN_PACKAGES* pPackages, | 203 | __in BURN_PACKAGES* pPackages, |
| 202 | __in BURN_RESUME_MODE resumeMode, | 204 | __in BURN_RESUME_MODE resumeMode, |
| 203 | __in BOOTSTRAPPER_APPLY_RESTART restart, | 205 | __in BOOTSTRAPPER_APPLY_RESTART restart, |
diff --git a/src/stub/packages.config b/src/stub/packages.config index 44bf19aa..eb05a40b 100644 --- a/src/stub/packages.config +++ b/src/stub/packages.config | |||
| @@ -4,5 +4,5 @@ | |||
| 4 | <package id="Microsoft.SourceLink.Common" 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" /> | 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" /> | 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 | 8 | </packages> \ No newline at end of file |
diff --git a/src/stub/stub.vcxproj b/src/stub/stub.vcxproj index f235a1fd..ae9c21df 100644 --- a/src/stub/stub.vcxproj +++ b/src/stub/stub.vcxproj | |||
| @@ -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')" /> | 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')" /> | 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')" /> | 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 | 9 | ||
| 10 | <ItemGroup Label="ProjectConfigurations"> | 10 | <ItemGroup Label="ProjectConfigurations"> |
| 11 | <ProjectConfiguration Include="Debug|Win32"> | 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'))" /> | 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'))" /> | 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'))" /> | 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> | 121 | </Target> |
| 122 | </Project> \ No newline at end of file | 122 | </Project> \ No newline at end of file |
diff --git a/src/test/BurnUnitTest/BurnUnitTest.vcxproj b/src/test/BurnUnitTest/BurnUnitTest.vcxproj index 529ab727..b57ebb16 100644 --- a/src/test/BurnUnitTest/BurnUnitTest.vcxproj +++ b/src/test/BurnUnitTest/BurnUnitTest.vcxproj | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 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')" /> | 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"> | 8 | <ItemGroup Label="ProjectConfigurations"> |
| 9 | <ProjectConfiguration Include="Debug|ARM64"> | 9 | <ProjectConfiguration Include="Debug|ARM64"> |
| 10 | <Configuration>Debug</Configuration> | 10 | <Configuration>Debug</Configuration> |
| @@ -97,6 +97,6 @@ | |||
| 97 | </PropertyGroup> | 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'))" /> | 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'))" /> | 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> | 101 | </Target> |
| 102 | </Project> \ No newline at end of file | 102 | </Project> \ No newline at end of file |
diff --git a/src/test/BurnUnitTest/RegistrationTest.cpp b/src/test/BurnUnitTest/RegistrationTest.cpp index 883a1258..2cb66c3f 100644 --- a/src/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/test/BurnUnitTest/RegistrationTest.cpp | |||
| @@ -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))); | 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 | 124 | ||
| 125 | // end session | 125 | // end session |
| 126 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 126 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
| 127 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 127 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
| 128 | 128 | ||
| 129 | // verify that registration was removed | 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)); | 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 | 214 | ||
| 215 | // complete registration | 215 | // complete registration |
| 216 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); | 216 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); |
| 217 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 217 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
| 218 | 218 | ||
| 219 | // verify that registration was updated | 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)); | 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 | 236 | ||
| 237 | // delete registration | 237 | // delete registration |
| 238 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 238 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
| 239 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 239 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
| 240 | 240 | ||
| 241 | // verify that registration was removed | 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)); | 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 | 325 | ||
| 326 | // complete registration | 326 | // complete registration |
| 327 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); | 327 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); |
| 328 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 328 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
| 329 | 329 | ||
| 330 | // verify that registration variables were updated | 330 | // verify that registration variables were updated |
| @@ -344,7 +344,7 @@ namespace Bootstrapper | |||
| 344 | // | 344 | // |
| 345 | 345 | ||
| 346 | // delete registration | 346 | // delete registration |
| 347 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 347 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
| 348 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 348 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
| 349 | 349 | ||
| 350 | // verify that registration was removed | 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)); | 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 | 436 | ||
| 437 | // finish registration | 437 | // finish registration |
| 438 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); | 438 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); |
| 439 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 439 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
| 440 | 440 | ||
| 441 | // verify that registration was updated | 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)); | 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 | 469 | ||
| 470 | // delete registration | 470 | // delete registration |
| 471 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 471 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
| 472 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 472 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
| 473 | 473 | ||
| 474 | // verify that registration was removed | 474 | // verify that registration was removed |
| @@ -509,7 +509,7 @@ namespace Bootstrapper | |||
| 509 | BYTE rgbData[256] = { }; | 509 | BYTE rgbData[256] = { }; |
| 510 | BOOTSTRAPPER_RESUME_TYPE resumeType = BOOTSTRAPPER_RESUME_TYPE_NONE; | 510 | BOOTSTRAPPER_RESUME_TYPE resumeType = BOOTSTRAPPER_RESUME_TYPE_NONE; |
| 511 | BYTE* pbBuffer = NULL; | 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}")); | 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 | 514 | try |
| 515 | { | 515 | { |
| @@ -573,7 +573,7 @@ namespace Bootstrapper | |||
| 573 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType); | 573 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType); |
| 574 | 574 | ||
| 575 | // suspend session | 575 | // suspend session |
| 576 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); | 576 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); |
| 577 | TestThrowOnFailure(hr, L"Failed to suspend session."); | 577 | TestThrowOnFailure(hr, L"Failed to suspend session."); |
| 578 | 578 | ||
| 579 | // verify that run key was removed | 579 | // verify that run key was removed |
| @@ -589,7 +589,7 @@ namespace Bootstrapper | |||
| 589 | hr = RegistrationLoadState(®istration, &pbBuffer, &cbBuffer); | 589 | hr = RegistrationLoadState(®istration, &pbBuffer, &cbBuffer); |
| 590 | TestThrowOnFailure(hr, L"Failed to load state."); | 590 | TestThrowOnFailure(hr, L"Failed to load state."); |
| 591 | 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))); | 593 | Assert::True(0 == memcmp(pbBuffer, rgbData, sizeof(rgbData))); |
| 594 | 594 | ||
| 595 | // write active resume mode | 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)); | 600 | Assert::NotEqual((Object^)nullptr, Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); |
| 601 | 601 | ||
| 602 | // end session | 602 | // end session |
| 603 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 603 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
| 604 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 604 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
| 605 | 605 | ||
| 606 | // read resume type after session | 606 | // read resume type after session |
diff --git a/src/test/BurnUnitTest/VariableTest.cpp b/src/test/BurnUnitTest/VariableTest.cpp index ab45a73f..5c9dce03 100644 --- a/src/test/BurnUnitTest/VariableTest.cpp +++ b/src/test/BurnUnitTest/VariableTest.cpp | |||
| @@ -134,7 +134,7 @@ namespace Bootstrapper | |||
| 134 | HRESULT hr = S_OK; | 134 | HRESULT hr = S_OK; |
| 135 | BURN_VARIABLES variables = { }; | 135 | BURN_VARIABLES variables = { }; |
| 136 | LPWSTR scz = NULL; | 136 | LPWSTR scz = NULL; |
| 137 | DWORD cch = 0; | 137 | SIZE_T cch = 0; |
| 138 | BOOL fContainsHiddenData = FALSE; | 138 | BOOL fContainsHiddenData = FALSE; |
| 139 | try | 139 | try |
| 140 | { | 140 | { |
| @@ -180,12 +180,12 @@ namespace Bootstrapper | |||
| 180 | hr = VariableFormatString(&variables, L"PRE [PROP1] POST", &scz, &cch); | 180 | hr = VariableFormatString(&variables, L"PRE [PROP1] POST", &scz, &cch); |
| 181 | TestThrowOnFailure(hr, L"Failed to format string"); | 181 | TestThrowOnFailure(hr, L"Failed to format string"); |
| 182 | 182 | ||
| 183 | Assert::Equal((DWORD)lstrlenW(scz), cch); | 183 | Assert::Equal((SIZE_T)lstrlenW(scz), cch); |
| 184 | 184 | ||
| 185 | hr = VariableFormatString(&variables, L"PRE [PROP1] POST", NULL, &cch); | 185 | hr = VariableFormatString(&variables, L"PRE [PROP1] POST", NULL, &cch); |
| 186 | TestThrowOnFailure(hr, L"Failed to format string"); | 186 | TestThrowOnFailure(hr, L"Failed to format string"); |
| 187 | 187 | ||
| 188 | Assert::Equal((DWORD)lstrlenW(scz), cch); | 188 | Assert::Equal((SIZE_T)lstrlenW(scz), cch); |
| 189 | } | 189 | } |
| 190 | finally | 190 | finally |
| 191 | { | 191 | { |
diff --git a/src/test/BurnUnitTest/packages.config b/src/test/BurnUnitTest/packages.config index accce624..a7b88aa1 100644 --- a/src/test/BurnUnitTest/packages.config +++ b/src/test/BurnUnitTest/packages.config | |||
| @@ -10,5 +10,5 @@ | |||
| 10 | <package id="xunit.runner.visualstudio" version="2.4.1" /> | 10 | <package id="xunit.runner.visualstudio" version="2.4.1" /> |
| 11 | <package id="WixBuildTools.TestSupport" version="4.0.47" /> | 11 | <package id="WixBuildTools.TestSupport" version="4.0.47" /> |
| 12 | <package id="WixBuildTools.TestSupport.Native" 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 | 14 | </packages> \ No newline at end of file |
