diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-04-12 14:17:41 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-04-14 12:15:52 -0700 |
| commit | ad5aeb25c459196938cc88c404406bbbe1df9061 (patch) | |
| tree | e49b0e5d798ba7a4d666bfac23b1a0e88713dc1f /src/engine | |
| parent | e9a4f673511dd06a8209f3e4037ad20f153d6caa (diff) | |
| download | wix-ad5aeb25c459196938cc88c404406bbbe1df9061.tar.gz wix-ad5aeb25c459196938cc88c404406bbbe1df9061.tar.bz2 wix-ad5aeb25c459196938cc88c404406bbbe1df9061.zip | |
Port support for ISO/IEC 19770-2:2105 (aka SWID Tags-2)
Fixes wixtoolset/issues#8380
Diffstat (limited to 'src/engine')
| -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 |
6 files changed, 41 insertions, 31 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, |
