diff options
Diffstat (limited to 'src')
69 files changed, 453 insertions, 122 deletions
diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 110ccb28..35d10c30 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | 41 | ||
| 42 | <PackageEulaSource>$(RootFolder)OSMFEULA.txt</PackageEulaSource> | 42 | <PackageEulaSource>$(RootFolder)OSMFEULA.txt</PackageEulaSource> |
| 43 | <PackageLicenseFile>OSMFEULA.txt</PackageLicenseFile> | 43 | <PackageLicenseFile>OSMFEULA.txt</PackageLicenseFile> |
| 44 | <PackageLicenseAcceptanceTargets>$(MSBuildThisFileDirectory)internal\targets\CheckLicenseAcceptance.targets</PackageLicenseAcceptanceTargets> | ||
| 44 | <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | 45 | <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> |
| 45 | 46 | ||
| 46 | <Product Condition=" '$(WixOfficialBuild)'!='true' ">WiX Dev Build</Product> | 47 | <Product Condition=" '$(WixOfficialBuild)'!='true' ">WiX Dev Build</Product> |
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 9cb7bbc2..45320d19 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | <NuspecProperties>$(NuspecProperties);Copyright=$(Copyright);Description=$(Description);Title=$(Title)</NuspecProperties> | 48 | <NuspecProperties>$(NuspecProperties);Copyright=$(Copyright);Description=$(Description);Title=$(Title)</NuspecProperties> |
| 49 | <NuspecProperties>$(NuspecProperties);RepositoryType=$(RepositoryType);RepositoryCommit=$(RepositoryCommit);RepositoryUrl=$(RepositoryUrl)</NuspecProperties> | 49 | <NuspecProperties>$(NuspecProperties);RepositoryType=$(RepositoryType);RepositoryCommit=$(RepositoryCommit);RepositoryUrl=$(RepositoryUrl)</NuspecProperties> |
| 50 | <NuspecProperties>$(NuspecProperties);PackageTags=$(PackageTags)</NuspecProperties> | 50 | <NuspecProperties>$(NuspecProperties);PackageTags=$(PackageTags)</NuspecProperties> |
| 51 | <NuspecProperties>$(NuspecProperties);ProjectUrl=$(ProjectUrl);ProjectFolder=$(MSBuildProjectDirectory);RootFolder=$(RootFolder);EulaTxt=$(PackageEulaSource);IconPng=$(PackageIconSource)</NuspecProperties> | 51 | <NuspecProperties>$(NuspecProperties);ProjectUrl=$(ProjectUrl);ProjectFolder=$(MSBuildProjectDirectory);RootFolder=$(RootFolder);EulaTxt=$(PackageEulaSource);IconPng=$(PackageIconSource);LicenseAcceptanceTargets=$(PackageLicenseAcceptanceTargets)</NuspecProperties> |
| 52 | </PropertyGroup> | 52 | </PropertyGroup> |
| 53 | </Target> | 53 | </Target> |
| 54 | 54 | ||
diff --git a/src/Directory.csproj.props b/src/Directory.csproj.props index 0663fb7f..42407929 100644 --- a/src/Directory.csproj.props +++ b/src/Directory.csproj.props | |||
| @@ -11,8 +11,7 @@ | |||
| 11 | <DebugType Condition=" '$(DebugType)'=='' ">embedded</DebugType> | 11 | <DebugType Condition=" '$(DebugType)'=='' ">embedded</DebugType> |
| 12 | </PropertyGroup> | 12 | </PropertyGroup> |
| 13 | 13 | ||
| 14 | <ItemGroup Condition=" '$(IsWixTestProject)'!='true' "> | 14 | <PropertyGroup> |
| 15 | <Content Include="$(PackageEulaSource)" Pack="true" PackagePath="/" /> | 15 | <AcceptEula>abc;wix7;xyz;123</AcceptEula> |
| 16 | <Content Include="$(PackageIconSource)" Pack="true" PackagePath="/" /> | 16 | </PropertyGroup> |
| 17 | </ItemGroup> | ||
| 18 | </Project> | 17 | </Project> |
diff --git a/src/Directory.csproj.targets b/src/Directory.csproj.targets index dbf9d604..b49c8c04 100644 --- a/src/Directory.csproj.targets +++ b/src/Directory.csproj.targets | |||
| @@ -13,13 +13,19 @@ | |||
| 13 | <SignOutput>false</SignOutput> | 13 | <SignOutput>false</SignOutput> |
| 14 | </PropertyGroup> | 14 | </PropertyGroup> |
| 15 | 15 | ||
| 16 | |||
| 17 | <PropertyGroup Condition=" '$(IsWixMSTestProject)' == 'true' "> | 16 | <PropertyGroup Condition=" '$(IsWixMSTestProject)' == 'true' "> |
| 18 | <!-- Force a .NET v6-compatible package. --> | 17 | <!-- Force a .NET v6-compatible package. --> |
| 19 | <MicrosoftTestingExtensionsCodeCoverageVersion>17.11.5</MicrosoftTestingExtensionsCodeCoverageVersion> | 18 | <MicrosoftTestingExtensionsCodeCoverageVersion>17.11.5</MicrosoftTestingExtensionsCodeCoverageVersion> |
| 20 | <TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure> | 19 | <TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure> |
| 21 | </PropertyGroup> | 20 | </PropertyGroup> |
| 22 | 21 | ||
| 22 | <ItemGroup Condition=" '$(IsWixTestProject)'!='true' "> | ||
| 23 | <Content Include="$(PackageEulaSource)" Pack="true" PackagePath="/" /> | ||
| 24 | <Content Include="$(PackageIconSource)" Pack="true" PackagePath="/" /> | ||
| 25 | <Content Include="$(PackageLicenseAcceptanceTargets)" Pack="true" PackagePath="build/$(MSBuildProjectName).targets" | ||
| 26 | Condition=" '$(IsWixExtension)' != 'true' " /> | ||
| 27 | </ItemGroup> | ||
| 28 | |||
| 23 | <ItemGroup Condition=" '$(IsWixTestProject)'=='true' "> | 29 | <ItemGroup Condition=" '$(IsWixTestProject)'=='true' "> |
| 24 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> | 30 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> |
| 25 | <PackageReference Include="xunit" /> | 31 | <PackageReference Include="xunit" /> |
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.nuspec b/src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.nuspec index 73fef99b..398a16b7 100644 --- a/src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.nuspec +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.nuspec | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | <file src="$projectFolder$\README.md" /> | 29 | <file src="$projectFolder$\README.md" /> |
| 30 | 30 | ||
| 31 | <file src="$projectFolder$\build\WixToolset.BootstrapperApplicationApi.props" target="build\" /> | 31 | <file src="$projectFolder$\build\WixToolset.BootstrapperApplicationApi.props" target="build\" /> |
| 32 | <file src="$licenseAcceptanceTargets$" target="build\$id$.targets" /> | ||
| 32 | 33 | ||
| 33 | <file src="$projectFolder$\build\_._" target="lib\native" /> | 34 | <file src="$projectFolder$\build\_._" target="lib\native" /> |
| 34 | <file src="net462\$id$.dll" target="lib\net462" /> | 35 | <file src="net462\$id$.dll" target="lib\net462" /> |
diff --git a/src/api/burn/bextutil/bextutil.nuspec b/src/api/burn/bextutil/bextutil.nuspec index 065b72a3..6efdf0fc 100644 --- a/src/api/burn/bextutil/bextutil.nuspec +++ b/src/api/burn/bextutil/bextutil.nuspec | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | <file src="$iconPng$" /> | 24 | <file src="$iconPng$" /> |
| 25 | <file src="$projectFolder$\README.md" /> | 25 | <file src="$projectFolder$\README.md" /> |
| 26 | <file src="$projectFolder$\build\$id$.props" target="build\" /> | 26 | <file src="$projectFolder$\build\$id$.props" target="build\" /> |
| 27 | <file src="$licenseAcceptanceTargets$" target="build\$id$.targets" /> | ||
| 27 | <file src="$projectFolder$\inc\*" target="build\native\include" /> | 28 | <file src="$projectFolder$\inc\*" target="build\native\include" /> |
| 28 | <file src="$projectFolder$\..\inc\BootstrapperExtensionTypes.h" target="build\native\include" /> | 29 | <file src="$projectFolder$\..\inc\BootstrapperExtensionTypes.h" target="build\native\include" /> |
| 29 | <file src="$projectFolder$\..\inc\BootstrapperExtensionEngineTypes.h" target="build\native\include" /> | 30 | <file src="$projectFolder$\..\inc\BootstrapperExtensionEngineTypes.h" target="build\native\include" /> |
diff --git a/src/burn/engine/bootstrapperapplication.cpp b/src/burn/engine/bootstrapperapplication.cpp index dc3bd5da..346c47a5 100644 --- a/src/burn/engine/bootstrapperapplication.cpp +++ b/src/burn/engine/bootstrapperapplication.cpp | |||
| @@ -674,7 +674,7 @@ static HRESULT VerifyPipeSecret( | |||
| 674 | hr = StrAlloc(&sczVerificationSecret, cbVerificationSecret / sizeof(WCHAR) + 1); | 674 | hr = StrAlloc(&sczVerificationSecret, cbVerificationSecret / sizeof(WCHAR) + 1); |
| 675 | ExitOnFailure(hr, "Failed to allocate buffer for bootstrapper application verification secret."); | 675 | ExitOnFailure(hr, "Failed to allocate buffer for bootstrapper application verification secret."); |
| 676 | 676 | ||
| 677 | FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(sczVerificationSecret), cbVerificationSecret); | 677 | hr = FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(sczVerificationSecret), cbVerificationSecret); |
| 678 | ExitOnFailure(hr, "Failed to read verification secret from bootstrapper application pipe."); | 678 | ExitOnFailure(hr, "Failed to read verification secret from bootstrapper application pipe."); |
| 679 | 679 | ||
| 680 | // Verify the secrets match. | 680 | // Verify the secrets match. |
diff --git a/src/burn/engine/burnpipe.cpp b/src/burn/engine/burnpipe.cpp index ec85822e..102ccb4f 100644 --- a/src/burn/engine/burnpipe.cpp +++ b/src/burn/engine/burnpipe.cpp | |||
| @@ -446,11 +446,11 @@ extern "C" HRESULT BurnPipeChildConnect( | |||
| 446 | 446 | ||
| 447 | // Try to connect to the parent. | 447 | // Try to connect to the parent. |
| 448 | hr = PipeClientConnect(pConnection->sczName, &pConnection->hPipe); | 448 | hr = PipeClientConnect(pConnection->sczName, &pConnection->hPipe); |
| 449 | ExitOnRootFailure(hr, "Failed to open parent pipe: %ls", sczPipeName) | 449 | ExitOnRootFailure(hr, "Failed to open parent pipe: %ls", pConnection->sczName) |
| 450 | 450 | ||
| 451 | // Verify the parent and notify it that the child connected. | 451 | // Verify the parent and notify it that the child connected. |
| 452 | hr = ChildPipeConnected(pConnection->hPipe, pConnection->sczSecret, &pConnection->dwProcessId); | 452 | hr = ChildPipeConnected(pConnection->hPipe, pConnection->sczSecret, &pConnection->dwProcessId); |
| 453 | ExitOnFailure(hr, "Failed to verify parent pipe: %ls", sczPipeName); | 453 | ExitOnFailure(hr, "Failed to verify parent pipe: %ls", pConnection->sczName); |
| 454 | 454 | ||
| 455 | if (fCompanion) | 455 | if (fCompanion) |
| 456 | { | 456 | { |
| @@ -511,7 +511,7 @@ static HRESULT ChildPipeConnected( | |||
| 511 | hr = StrAlloc(&sczVerificationSecret, cbVerificationSecret / sizeof(WCHAR) + 1); | 511 | hr = StrAlloc(&sczVerificationSecret, cbVerificationSecret / sizeof(WCHAR) + 1); |
| 512 | ExitOnFailure(hr, "Failed to allocate buffer for verification secret."); | 512 | ExitOnFailure(hr, "Failed to allocate buffer for verification secret."); |
| 513 | 513 | ||
| 514 | FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(sczVerificationSecret), cbVerificationSecret); | 514 | hr = FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(sczVerificationSecret), cbVerificationSecret); |
| 515 | ExitOnFailure(hr, "Failed to read verification secret from parent pipe."); | 515 | ExitOnFailure(hr, "Failed to read verification secret from parent pipe."); |
| 516 | 516 | ||
| 517 | // Verify the secrets match. | 517 | // Verify the secrets match. |
diff --git a/src/burn/engine/cabextract.cpp b/src/burn/engine/cabextract.cpp index 5663c3f7..2140130d 100644 --- a/src/burn/engine/cabextract.cpp +++ b/src/burn/engine/cabextract.cpp | |||
| @@ -833,9 +833,13 @@ static UINT FAR DIAMONDAPI CabWrite( | |||
| 833 | 833 | ||
| 834 | case BURN_CAB_OPERATION_STREAM_TO_BUFFER: | 834 | case BURN_CAB_OPERATION_STREAM_TO_BUFFER: |
| 835 | // copy to target buffer | 835 | // copy to target buffer |
| 836 | memcpy_s(pContext->Cabinet.pbTargetBuffer + pContext->Cabinet.iTargetBuffer, pContext->Cabinet.cbTargetBuffer - pContext->Cabinet.iTargetBuffer, pv, cb); | 836 | if (memcpy_s(pContext->Cabinet.pbTargetBuffer + pContext->Cabinet.iTargetBuffer, pContext->Cabinet.cbTargetBuffer - pContext->Cabinet.iTargetBuffer, pv, cb)) |
| 837 | pContext->Cabinet.iTargetBuffer += cb; | 837 | { |
| 838 | hr = E_INSUFFICIENT_BUFFER; | ||
| 839 | ExitOnRootFailure(hr, "Failed to copy data to target buffer during cabinet extraction."); | ||
| 840 | } | ||
| 838 | 841 | ||
| 842 | pContext->Cabinet.iTargetBuffer += cb; | ||
| 839 | cbWrite = cb; | 843 | cbWrite = cb; |
| 840 | break; | 844 | break; |
| 841 | 845 | ||
diff --git a/src/burn/engine/cache.cpp b/src/burn/engine/cache.cpp index f5df6500..c85a1be4 100644 --- a/src/burn/engine/cache.cpp +++ b/src/burn/engine/cache.cpp | |||
| @@ -363,6 +363,8 @@ extern "C" HRESULT CacheEnsureBaseWorkingFolder( | |||
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | pWorkingFolderAcl = reinterpret_cast<LPSECURITY_ATTRIBUTES>(MemAlloc(sizeof(SECURITY_ATTRIBUTES), TRUE)); | 365 | pWorkingFolderAcl = reinterpret_cast<LPSECURITY_ATTRIBUTES>(MemAlloc(sizeof(SECURITY_ATTRIBUTES), TRUE)); |
| 366 | ExitOnNull(pWorkingFolderAcl, hr, E_OUTOFMEMORY, "Failed to allocate security attributes."); | ||
| 367 | |||
| 366 | pWorkingFolderAcl->nLength = sizeof(SECURITY_ATTRIBUTES); | 368 | pWorkingFolderAcl->nLength = sizeof(SECURITY_ATTRIBUTES); |
| 367 | pWorkingFolderAcl->lpSecurityDescriptor = psd; | 369 | pWorkingFolderAcl->lpSecurityDescriptor = psd; |
| 368 | pWorkingFolderAcl->bInheritHandle = FALSE; | 370 | pWorkingFolderAcl->bInheritHandle = FALSE; |
| @@ -857,6 +859,7 @@ extern "C" HRESULT CacheSendProgressCallback( | |||
| 857 | case PROGRESS_STOP: | 859 | case PROGRESS_STOP: |
| 858 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); | 860 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); |
| 859 | ExitOnRootFailure(hr, "UX aborted on download progress."); | 861 | ExitOnRootFailure(hr, "UX aborted on download progress."); |
| 862 | break; | ||
| 860 | 863 | ||
| 861 | case PROGRESS_QUIET: // Not actually an error, just an indication to the caller to stop requesting progress. | 864 | case PROGRESS_QUIET: // Not actually an error, just an indication to the caller to stop requesting progress. |
| 862 | pCallback->pfnProgress = NULL; | 865 | pCallback->pfnProgress = NULL; |
| @@ -866,6 +869,7 @@ extern "C" HRESULT CacheSendProgressCallback( | |||
| 866 | default: | 869 | default: |
| 867 | hr = E_UNEXPECTED; | 870 | hr = E_UNEXPECTED; |
| 868 | ExitOnRootFailure(hr, "Invalid return code from progress routine."); | 871 | ExitOnRootFailure(hr, "Invalid return code from progress routine."); |
| 872 | break; | ||
| 869 | } | 873 | } |
| 870 | } | 874 | } |
| 871 | 875 | ||
| @@ -1435,8 +1439,8 @@ extern "C" void CacheUninitialize( | |||
| 1435 | ReleaseStr(pCache->sczBaseWorkingFolder); | 1439 | ReleaseStr(pCache->sczBaseWorkingFolder); |
| 1436 | ReleaseStr(pCache->sczAcquisitionFolder); | 1440 | ReleaseStr(pCache->sczAcquisitionFolder); |
| 1437 | ReleaseStr(pCache->sczSourceProcessFolder); | 1441 | ReleaseStr(pCache->sczSourceProcessFolder); |
| 1438 | ReleaseStr(pCache->sczBundleEngineWorkingPath) | 1442 | ReleaseStr(pCache->sczBundleEngineWorkingPath); |
| 1439 | ReleaseFileHandle(pCache->hBundleEngineWorkingFile) | 1443 | ReleaseFileHandle(pCache->hBundleEngineWorkingFile); |
| 1440 | 1444 | ||
| 1441 | memset(pCache, 0, sizeof(BURN_CACHE)); | 1445 | memset(pCache, 0, sizeof(BURN_CACHE)); |
| 1442 | } | 1446 | } |
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index de202321..2dfa4857 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp | |||
| @@ -1232,8 +1232,11 @@ HRESULT CoreAppendLogToCommandLine( | |||
| 1232 | hr = StrAllocConcat(psczCommandLine, szLogArgFormatted, 0); | 1232 | hr = StrAllocConcat(psczCommandLine, szLogArgFormatted, 0); |
| 1233 | ExitOnFailure(hr, "Failed concatenating '-log' to command line"); | 1233 | ExitOnFailure(hr, "Failed concatenating '-log' to command line"); |
| 1234 | 1234 | ||
| 1235 | hr = StrAllocConcat(psczObfuscatedCommandLine, szLogArgFormatted, 0); | 1235 | if (psczObfuscatedCommandLine) |
| 1236 | ExitOnFailure(hr, "Failed concatenating '-log' to obfuscated command line"); | 1236 | { |
| 1237 | hr = StrAllocConcat(psczObfuscatedCommandLine, szLogArgFormatted, 0); | ||
| 1238 | ExitOnFailure(hr, "Failed concatenating '-log' to obfuscated command line"); | ||
| 1239 | } | ||
| 1237 | 1240 | ||
| 1238 | LExit: | 1241 | LExit: |
| 1239 | if (rgszArgs) | 1242 | if (rgszArgs) |
diff --git a/src/burn/engine/dependency.cpp b/src/burn/engine/dependency.cpp index 6f80c21b..94a8a1e4 100644 --- a/src/burn/engine/dependency.cpp +++ b/src/burn/engine/dependency.cpp | |||
| @@ -601,8 +601,8 @@ extern "C" HRESULT DependencyPlanPackageBegin( | |||
| 601 | pProvider->dependentExecute = BURN_DEPENDENCY_ACTION_NONE; | 601 | pProvider->dependentExecute = BURN_DEPENDENCY_ACTION_NONE; |
| 602 | } | 602 | } |
| 603 | 603 | ||
| 604 | if (BURN_DEPENDENCY_ACTION_UNREGISTER == pProvider->dependentRollback && pProvider->fBundleRegisteredAsDependent || | 604 | if ((BURN_DEPENDENCY_ACTION_UNREGISTER == pProvider->dependentRollback && pProvider->fBundleRegisteredAsDependent) || |
| 605 | BURN_DEPENDENCY_ACTION_REGISTER == pProvider->dependentRollback && !pProvider->fBundleRegisteredAsDependent) | 605 | (BURN_DEPENDENCY_ACTION_REGISTER == pProvider->dependentRollback && !pProvider->fBundleRegisteredAsDependent)) |
| 606 | { | 606 | { |
| 607 | pProvider->dependentRollback = BURN_DEPENDENCY_ACTION_NONE; | 607 | pProvider->dependentRollback = BURN_DEPENDENCY_ACTION_NONE; |
| 608 | } | 608 | } |
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index aff05ae3..ef87841f 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
| @@ -1452,9 +1452,9 @@ extern "C" HRESULT ElevationExecutePackageDependencyAction( | |||
| 1452 | ExitOnFailure(hr, "Failed to write bundle dependency key to message buffer."); | 1452 | ExitOnFailure(hr, "Failed to write bundle dependency key to message buffer."); |
| 1453 | 1453 | ||
| 1454 | // Dependent actions. | 1454 | // Dependent actions. |
| 1455 | for (DWORD i = 0; i < pExecuteAction->packageProvider.pPackage->cDependencyProviders; ++i) | 1455 | for (DWORD i = 0; i < pExecuteAction->packageDependency.pPackage->cDependencyProviders; ++i) |
| 1456 | { | 1456 | { |
| 1457 | BURN_DEPENDENCY_PROVIDER* pProvider = pExecuteAction->packageProvider.pPackage->rgDependencyProviders + i; | 1457 | BURN_DEPENDENCY_PROVIDER* pProvider = pExecuteAction->packageDependency.pPackage->rgDependencyProviders + i; |
| 1458 | BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute; | 1458 | BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute; |
| 1459 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)*pAction); | 1459 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)*pAction); |
| 1460 | ExitOnFailure(hr, "Failed to write dependent action to message buffer."); | 1460 | ExitOnFailure(hr, "Failed to write dependent action to message buffer."); |
| @@ -2824,7 +2824,7 @@ LExit: | |||
| 2824 | // TODO: do the right thing here. | 2824 | // TODO: do the right thing here. |
| 2825 | //DependencyUninitializeRegistrationAction(&action); | 2825 | //DependencyUninitializeRegistrationAction(&action); |
| 2826 | ReleaseStr(action.sczDependentProviderKey); | 2826 | ReleaseStr(action.sczDependentProviderKey); |
| 2827 | ReleaseStr(action.sczBundleCode) | 2827 | ReleaseStr(action.sczBundleCode); |
| 2828 | 2828 | ||
| 2829 | return hr; | 2829 | return hr; |
| 2830 | } | 2830 | } |
| @@ -3486,9 +3486,9 @@ static HRESULT OnExecutePackageDependencyAction( | |||
| 3486 | ExitOnFailure(hr, "Failed to read bundle dependency key from message buffer."); | 3486 | ExitOnFailure(hr, "Failed to read bundle dependency key from message buffer."); |
| 3487 | 3487 | ||
| 3488 | // Read dependent actions. | 3488 | // Read dependent actions. |
| 3489 | for (DWORD i = 0; i < executeAction.packageProvider.pPackage->cDependencyProviders; ++i) | 3489 | for (DWORD i = 0; i < executeAction.packageDependency.pPackage->cDependencyProviders; ++i) |
| 3490 | { | 3490 | { |
| 3491 | BURN_DEPENDENCY_PROVIDER* pProvider = executeAction.packageProvider.pPackage->rgDependencyProviders + i; | 3491 | BURN_DEPENDENCY_PROVIDER* pProvider = executeAction.packageDependency.pPackage->rgDependencyProviders + i; |
| 3492 | BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute; | 3492 | BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute; |
| 3493 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)pAction); | 3493 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)pAction); |
| 3494 | ExitOnFailure(hr, "Failed to read dependent action."); | 3494 | ExitOnFailure(hr, "Failed to read dependent action."); |
diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp index c372772c..d432f732 100644 --- a/src/burn/engine/engine.cpp +++ b/src/burn/engine/engine.cpp | |||
| @@ -379,7 +379,8 @@ static HRESULT InitializeEngineState( | |||
| 379 | BurnPipeConnectionInitialize(&pEngineState->embeddedConnection); | 379 | BurnPipeConnectionInitialize(&pEngineState->embeddedConnection); |
| 380 | 380 | ||
| 381 | // Retain whether bundle was initially run elevated. | 381 | // Retain whether bundle was initially run elevated. |
| 382 | ProcElevated(::GetCurrentProcess(), &pEngineState->internalCommand.fInitiallyElevated); | 382 | hr = ProcIsHighIntegrity(::GetCurrentProcess(), &pEngineState->internalCommand.fInitiallyElevated); |
| 383 | ExitOnFailure(hr, "Failed to determine if process is running elevated."); | ||
| 383 | 384 | ||
| 384 | // Parse command line. | 385 | // Parse command line. |
| 385 | hr = CoreParseCommandLine(&pEngineState->internalCommand, &pEngineState->command, &pEngineState->companionConnection, &pEngineState->embeddedConnection, &hSectionFile, &hSourceEngineFile); | 386 | hr = CoreParseCommandLine(&pEngineState->internalCommand, &pEngineState->command, &pEngineState->companionConnection, &pEngineState->embeddedConnection, &hSectionFile, &hSourceEngineFile); |
diff --git a/src/burn/engine/exeengine.cpp b/src/burn/engine/exeengine.cpp index 4df762da..c001e563 100644 --- a/src/burn/engine/exeengine.cpp +++ b/src/burn/engine/exeengine.cpp | |||
| @@ -449,7 +449,7 @@ extern "C" HRESULT ExeEngineExecutePackage( | |||
| 449 | 449 | ||
| 450 | if (BURN_EXE_DETECTION_TYPE_ARP == pPackage->Exe.detectionType && | 450 | if (BURN_EXE_DETECTION_TYPE_ARP == pPackage->Exe.detectionType && |
| 451 | (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pExecuteAction->exePackage.action || | 451 | (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pExecuteAction->exePackage.action || |
| 452 | BOOTSTRAPPER_ACTION_STATE_INSTALL == pExecuteAction->exePackage.action && fRollback)) | 452 | (BOOTSTRAPPER_ACTION_STATE_INSTALL == pExecuteAction->exePackage.action && fRollback))) |
| 453 | { | 453 | { |
| 454 | hr = DetectArpEntry(pPackage, &applyState, &sczArpUninstallString); | 454 | hr = DetectArpEntry(pPackage, &applyState, &sczArpUninstallString); |
| 455 | ExitOnFailure(hr, "Failed to query ArpEntry for %hs.", BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pExecuteAction->exePackage.action ? "uninstall" : "install"); | 455 | ExitOnFailure(hr, "Failed to query ArpEntry for %hs.", BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pExecuteAction->exePackage.action ? "uninstall" : "install"); |
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp index 51b546ad..52123499 100644 --- a/src/burn/engine/logging.cpp +++ b/src/burn/engine/logging.cpp | |||
| @@ -322,15 +322,17 @@ extern "C" HRESULT LoggingSetPackageVariable( | |||
| 322 | ExitFunction(); | 322 | ExitFunction(); |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | // For burn packages we'll add logging even it it wasn't explictly specified | 325 | // For burn packages we'll add logging even it it wasn't explictly specified. |
| 326 | if (BURN_PACKAGE_TYPE_BUNDLE == pPackage->type || (BURN_PACKAGE_TYPE_EXE == pPackage->type && BURN_EXE_PROTOCOL_TYPE_BURN == pPackage->Exe.protocol)) | 326 | if (BURN_PACKAGE_TYPE_BUNDLE == pPackage->type || (BURN_PACKAGE_TYPE_EXE == pPackage->type && BURN_EXE_PROTOCOL_TYPE_BURN == pPackage->Exe.protocol)) |
| 327 | { | 327 | { |
| 328 | if (!fRollback && (!pPackage->sczLogPathVariable || !*pPackage->sczLogPathVariable)) | 328 | if (!fRollback && (!pPackage->sczLogPathVariable || !*pPackage->sczLogPathVariable)) |
| 329 | { | 329 | { |
| 330 | // Best effort, no need to fail if we can't set the logging path. | ||
| 330 | StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); | 331 | StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); |
| 331 | } | 332 | } |
| 332 | else if (fRollback && (!pPackage->sczRollbackLogPathVariable || !*pPackage->sczRollbackLogPathVariable)) | 333 | else if (fRollback && (!pPackage->sczRollbackLogPathVariable || !*pPackage->sczRollbackLogPathVariable)) |
| 333 | { | 334 | { |
| 335 | // Best effort, no need to fail if we can't set the logging path. | ||
| 334 | StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); | 336 | StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); |
| 335 | } | 337 | } |
| 336 | } | 338 | } |
| @@ -1052,7 +1054,8 @@ static HRESULT GetNonSessionSpecificTempFolder( | |||
| 1052 | hr = ::StringCchLengthW(sczSessionId, STRSAFE_MAX_CCH, reinterpret_cast<size_t*>(&cchSessionId)); | 1054 | hr = ::StringCchLengthW(sczSessionId, STRSAFE_MAX_CCH, reinterpret_cast<size_t*>(&cchSessionId)); |
| 1053 | ExitOnFailure(hr, "Failed to get length of session id string."); | 1055 | ExitOnFailure(hr, "Failed to get length of session id string."); |
| 1054 | 1056 | ||
| 1055 | if (CSTR_EQUAL == ::CompareStringOrdinal(sczTempFolder + cchTempFolder - cchSessionId, static_cast<DWORD>(cchSessionId), sczSessionId, static_cast<DWORD>(cchSessionId), FALSE)) | 1057 | if (cchTempFolder >= cchSessionId && |
| 1058 | CSTR_EQUAL == ::CompareStringOrdinal(sczTempFolder + cchTempFolder - cchSessionId, static_cast<DWORD>(cchSessionId), sczSessionId, static_cast<DWORD>(cchSessionId), FALSE)) | ||
| 1056 | { | 1059 | { |
| 1057 | cchTempFolder -= cchSessionId; | 1060 | cchTempFolder -= cchSessionId; |
| 1058 | } | 1061 | } |
diff --git a/src/burn/engine/msiengine.cpp b/src/burn/engine/msiengine.cpp index 48ec0c81..a1379054 100644 --- a/src/burn/engine/msiengine.cpp +++ b/src/burn/engine/msiengine.cpp | |||
| @@ -2158,7 +2158,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2158 | 2158 | ||
| 2159 | if (sczAddLocal) | 2159 | if (sczAddLocal) |
| 2160 | { | 2160 | { |
| 2161 | hr = StrAllocFormatted(&scz, L" ADDLOCAL=\"%s\"", sczAddLocal, 0); | 2161 | hr = StrAllocFormatted(&scz, L" ADDLOCAL=\"%s\"", sczAddLocal); |
| 2162 | ExitOnFailure(hr, "Failed to format ADDLOCAL string."); | 2162 | ExitOnFailure(hr, "Failed to format ADDLOCAL string."); |
| 2163 | 2163 | ||
| 2164 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2164 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2167,7 +2167,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2167 | 2167 | ||
| 2168 | if (sczAddSource) | 2168 | if (sczAddSource) |
| 2169 | { | 2169 | { |
| 2170 | hr = StrAllocFormatted(&scz, L" ADDSOURCE=\"%s\"", sczAddSource, 0); | 2170 | hr = StrAllocFormatted(&scz, L" ADDSOURCE=\"%s\"", sczAddSource); |
| 2171 | ExitOnFailure(hr, "Failed to format ADDSOURCE string."); | 2171 | ExitOnFailure(hr, "Failed to format ADDSOURCE string."); |
| 2172 | 2172 | ||
| 2173 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2173 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2176,7 +2176,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2176 | 2176 | ||
| 2177 | if (sczAddDefault) | 2177 | if (sczAddDefault) |
| 2178 | { | 2178 | { |
| 2179 | hr = StrAllocFormatted(&scz, L" ADDDEFAULT=\"%s\"", sczAddDefault, 0); | 2179 | hr = StrAllocFormatted(&scz, L" ADDDEFAULT=\"%s\"", sczAddDefault); |
| 2180 | ExitOnFailure(hr, "Failed to format ADDDEFAULT string."); | 2180 | ExitOnFailure(hr, "Failed to format ADDDEFAULT string."); |
| 2181 | 2181 | ||
| 2182 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2182 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2185,7 +2185,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2185 | 2185 | ||
| 2186 | if (sczReinstall) | 2186 | if (sczReinstall) |
| 2187 | { | 2187 | { |
| 2188 | hr = StrAllocFormatted(&scz, L" REINSTALL=\"%s\"", sczReinstall, 0); | 2188 | hr = StrAllocFormatted(&scz, L" REINSTALL=\"%s\"", sczReinstall); |
| 2189 | ExitOnFailure(hr, "Failed to format REINSTALL string."); | 2189 | ExitOnFailure(hr, "Failed to format REINSTALL string."); |
| 2190 | 2190 | ||
| 2191 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2191 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2194,7 +2194,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2194 | 2194 | ||
| 2195 | if (sczAdvertise) | 2195 | if (sczAdvertise) |
| 2196 | { | 2196 | { |
| 2197 | hr = StrAllocFormatted(&scz, L" ADVERTISE=\"%s\"", sczAdvertise, 0); | 2197 | hr = StrAllocFormatted(&scz, L" ADVERTISE=\"%s\"", sczAdvertise); |
| 2198 | ExitOnFailure(hr, "Failed to format ADVERTISE string."); | 2198 | ExitOnFailure(hr, "Failed to format ADVERTISE string."); |
| 2199 | 2199 | ||
| 2200 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2200 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2203,7 +2203,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2203 | 2203 | ||
| 2204 | if (sczRemove) | 2204 | if (sczRemove) |
| 2205 | { | 2205 | { |
| 2206 | hr = StrAllocFormatted(&scz, L" REMOVE=\"%s\"", sczRemove, 0); | 2206 | hr = StrAllocFormatted(&scz, L" REMOVE=\"%s\"", sczRemove); |
| 2207 | ExitOnFailure(hr, "Failed to format REMOVE string."); | 2207 | ExitOnFailure(hr, "Failed to format REMOVE string."); |
| 2208 | 2208 | ||
| 2209 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2209 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
diff --git a/src/burn/engine/msuengine.cpp b/src/burn/engine/msuengine.cpp index 43f5f76c..d31691a5 100644 --- a/src/burn/engine/msuengine.cpp +++ b/src/burn/engine/msuengine.cpp | |||
| @@ -313,6 +313,8 @@ LExit: | |||
| 313 | SetServiceStartType(schWu, SERVICE_DISABLED); | 313 | SetServiceStartType(schWu, SERVICE_DISABLED); |
| 314 | } | 314 | } |
| 315 | 315 | ||
| 316 | ReleaseServiceHandle(schWu); | ||
| 317 | |||
| 316 | // Best effort to clear the execute package cache folder variable. | 318 | // Best effort to clear the execute package cache folder variable. |
| 317 | VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, NULL, TRUE, FALSE); | 319 | VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, NULL, TRUE, FALSE); |
| 318 | 320 | ||
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index a6196e3c..edc09033 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
| @@ -1542,7 +1542,7 @@ extern "C" HRESULT PlanRelatedBundlesComplete( | |||
| 1542 | 1542 | ||
| 1543 | if (fBundle && BOOTSTRAPPER_ACTION_STATE_NONE != packageAction) | 1543 | if (fBundle && BOOTSTRAPPER_ACTION_STATE_NONE != packageAction) |
| 1544 | { | 1544 | { |
| 1545 | if (pPackage->cDependencyProviders) | 1545 | if (pPackage && pPackage->cDependencyProviders) |
| 1546 | { | 1546 | { |
| 1547 | // Bundles only support a single provider key. | 1547 | // Bundles only support a single provider key. |
| 1548 | const BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders; | 1548 | const BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders; |
| @@ -2015,6 +2015,7 @@ extern "C" HRESULT PlanRollbackBoundaryComplete( | |||
| 2015 | 2015 | ||
| 2016 | // Add checkpoints. | 2016 | // Add checkpoints. |
| 2017 | hr = PlanExecuteCheckpoint(pPlan); | 2017 | hr = PlanExecuteCheckpoint(pPlan); |
| 2018 | ExitOnFailure(hr, "Failed to append execute checkpoint for rollback boundary complete."); | ||
| 2018 | 2019 | ||
| 2019 | // Add complete rollback boundary to execute plan. | 2020 | // Add complete rollback boundary to execute plan. |
| 2020 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); | 2021 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); |
| @@ -2950,9 +2951,9 @@ static void ExecuteActionLog( | |||
| 2950 | 2951 | ||
| 2951 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: | 2952 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: |
| 2952 | LogStringLine(PlanDumpLevel, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey); | 2953 | LogStringLine(PlanDumpLevel, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey); |
| 2953 | for (DWORD j = 0; j < pAction->packageProvider.pPackage->cDependencyProviders; ++j) | 2954 | for (DWORD j = 0; j < pAction->packageDependency.pPackage->cDependencyProviders; ++j) |
| 2954 | { | 2955 | { |
| 2955 | const BURN_DEPENDENCY_PROVIDER* pProvider = pAction->packageProvider.pPackage->rgDependencyProviders + j; | 2956 | const BURN_DEPENDENCY_PROVIDER* pProvider = pAction->packageDependency.pPackage->rgDependencyProviders + j; |
| 2956 | LogStringLine(PlanDumpLevel, " Provider[%u]: key: %ls, action: %hs", j, pProvider->sczKey, LoggingDependencyActionToString(fRollback ? pProvider->dependentRollback : pProvider->dependentExecute)); | 2957 | LogStringLine(PlanDumpLevel, " Provider[%u]: key: %ls, action: %hs", j, pProvider->sczKey, LoggingDependencyActionToString(fRollback ? pProvider->dependentRollback : pProvider->dependentExecute)); |
| 2957 | } | 2958 | } |
| 2958 | break; | 2959 | break; |
diff --git a/src/burn/engine/pseudobundle.cpp b/src/burn/engine/pseudobundle.cpp index f0d67068..ff7f185c 100644 --- a/src/burn/engine/pseudobundle.cpp +++ b/src/burn/engine/pseudobundle.cpp | |||
| @@ -127,8 +127,8 @@ extern "C" HRESULT PseudoBundleInitializePassthrough( | |||
| 127 | ExitOnFailure(hr, "Failed to copy cache id for passthrough pseudo bundle."); | 127 | ExitOnFailure(hr, "Failed to copy cache id for passthrough pseudo bundle."); |
| 128 | 128 | ||
| 129 | // Log variables - best effort | 129 | // Log variables - best effort |
| 130 | StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); | 130 | StrAllocFormatted(&pPassthroughPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); |
| 131 | StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); | 131 | StrAllocFormatted(&pPassthroughPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); |
| 132 | 132 | ||
| 133 | hr = CoreCreatePassthroughBundleCommandLine(&sczArguments, pInternalCommand, pCommand); | 133 | hr = CoreCreatePassthroughBundleCommandLine(&sczArguments, pInternalCommand, pCommand); |
| 134 | ExitOnFailure(hr, "Failed to create command-line arguments."); | 134 | ExitOnFailure(hr, "Failed to create command-line arguments."); |
| @@ -155,6 +155,8 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( | |||
| 155 | { | 155 | { |
| 156 | HRESULT hr = S_OK; | 156 | HRESULT hr = S_OK; |
| 157 | BURN_PAYLOAD* pPayload = NULL; | 157 | BURN_PAYLOAD* pPayload = NULL; |
| 158 | BYTE* rgbHash = NULL; | ||
| 159 | DWORD cbHash = 0; | ||
| 158 | 160 | ||
| 159 | // Initialize the single payload, and fill out all the necessary fields | 161 | // Initialize the single payload, and fill out all the necessary fields |
| 160 | pPackage->payloads.rgItems = (BURN_PAYLOAD_GROUP_ITEM*)MemAlloc(sizeof(BURN_PAYLOAD_GROUP_ITEM), TRUE); | 162 | pPackage->payloads.rgItems = (BURN_PAYLOAD_GROUP_ITEM*)MemAlloc(sizeof(BURN_PAYLOAD_GROUP_ITEM), TRUE); |
| @@ -185,9 +187,6 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( | |||
| 185 | 187 | ||
| 186 | if (wzHash && *wzHash) | 188 | if (wzHash && *wzHash) |
| 187 | { | 189 | { |
| 188 | BYTE* rgbHash = NULL; | ||
| 189 | DWORD cbHash = 0; | ||
| 190 | |||
| 191 | hr = StrAllocHexDecode(wzHash, &rgbHash, &cbHash); | 190 | hr = StrAllocHexDecode(wzHash, &rgbHash, &cbHash); |
| 192 | ExitOnFailure(hr, "Failed to decode hash string: %ls.", wzHash); | 191 | ExitOnFailure(hr, "Failed to decode hash string: %ls.", wzHash); |
| 193 | 192 | ||
| @@ -223,5 +222,7 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( | |||
| 223 | ExitOnFailure(hr, "Failed to copy install arguments for update bundle package"); | 222 | ExitOnFailure(hr, "Failed to copy install arguments for update bundle package"); |
| 224 | 223 | ||
| 225 | LExit: | 224 | LExit: |
| 225 | ReleaseStr(rgbHash); | ||
| 226 | |||
| 226 | return hr; | 227 | return hr; |
| 227 | } | 228 | } |
diff --git a/src/burn/engine/search.cpp b/src/burn/engine/search.cpp index 1f128e95..a60215fe 100644 --- a/src/burn/engine/search.cpp +++ b/src/burn/engine/search.cpp | |||
| @@ -334,7 +334,7 @@ extern "C" HRESULT SearchesParseFromXml( | |||
| 334 | { | 334 | { |
| 335 | pSearch->MsiProductSearch.Type = BURN_MSI_PRODUCT_SEARCH_TYPE_ASSIGNMENT; | 335 | pSearch->MsiProductSearch.Type = BURN_MSI_PRODUCT_SEARCH_TYPE_ASSIGNMENT; |
| 336 | } | 336 | } |
| 337 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"exists", -1)) | 337 | else if (CSTR_EQUAL == ::CompareStringOrdinal(scz, -1, L"exists", -1, FALSE)) |
| 338 | { | 338 | { |
| 339 | pSearch->MsiProductSearch.Type = BURN_MSI_PRODUCT_SEARCH_TYPE_EXISTS; | 339 | pSearch->MsiProductSearch.Type = BURN_MSI_PRODUCT_SEARCH_TYPE_EXISTS; |
| 340 | } | 340 | } |
diff --git a/src/burn/engine/variant.cpp b/src/burn/engine/variant.cpp index 2267ee7b..3fc02aa8 100644 --- a/src/burn/engine/variant.cpp +++ b/src/burn/engine/variant.cpp | |||
| @@ -10,6 +10,9 @@ static HRESULT GetVersionInternal( | |||
| 10 | __in BOOL fSilent, | 10 | __in BOOL fSilent, |
| 11 | __out VERUTIL_VERSION** ppValue | 11 | __out VERUTIL_VERSION** ppValue |
| 12 | ); | 12 | ); |
| 13 | static void FreeVariantValue( | ||
| 14 | __in BURN_VARIANT* pVariant | ||
| 15 | ); | ||
| 13 | 16 | ||
| 14 | // function definitions | 17 | // function definitions |
| 15 | 18 | ||
| @@ -17,12 +20,7 @@ extern "C" void BVariantUninitialize( | |||
| 17 | __in BURN_VARIANT* pVariant | 20 | __in BURN_VARIANT* pVariant |
| 18 | ) | 21 | ) |
| 19 | { | 22 | { |
| 20 | if (BURN_VARIANT_TYPE_FORMATTED == pVariant->Type || | 23 | FreeVariantValue(pVariant); |
| 21 | BURN_VARIANT_TYPE_STRING == pVariant->Type) | ||
| 22 | { | ||
| 23 | StrSecureZeroFreeString(pVariant->sczValue); | ||
| 24 | } | ||
| 25 | SecureZeroMemory(pVariant, sizeof(BURN_VARIANT)); | ||
| 26 | } | 24 | } |
| 27 | 25 | ||
| 28 | extern "C" HRESULT BVariantGetNumeric( | 26 | extern "C" HRESULT BVariantGetNumeric( |
| @@ -164,12 +162,8 @@ extern "C" HRESULT BVariantSetNumeric( | |||
| 164 | { | 162 | { |
| 165 | HRESULT hr = S_OK; | 163 | HRESULT hr = S_OK; |
| 166 | 164 | ||
| 167 | if (BURN_VARIANT_TYPE_FORMATTED == pVariant->Type || | 165 | FreeVariantValue(pVariant); |
| 168 | BURN_VARIANT_TYPE_STRING == pVariant->Type) | 166 | |
| 169 | { | ||
| 170 | StrSecureZeroFreeString(pVariant->sczValue); | ||
| 171 | } | ||
| 172 | memset(pVariant, 0, sizeof(BURN_VARIANT)); | ||
| 173 | pVariant->llValue = llValue; | 167 | pVariant->llValue = llValue; |
| 174 | pVariant->Type = BURN_VARIANT_TYPE_NUMERIC; | 168 | pVariant->Type = BURN_VARIANT_TYPE_NUMERIC; |
| 175 | 169 | ||
| @@ -194,7 +188,7 @@ extern "C" HRESULT BVariantSetString( | |||
| 194 | if (BURN_VARIANT_TYPE_FORMATTED != pVariant->Type && | 188 | if (BURN_VARIANT_TYPE_FORMATTED != pVariant->Type && |
| 195 | BURN_VARIANT_TYPE_STRING != pVariant->Type) | 189 | BURN_VARIANT_TYPE_STRING != pVariant->Type) |
| 196 | { | 190 | { |
| 197 | memset(pVariant, 0, sizeof(BURN_VARIANT)); | 191 | FreeVariantValue(pVariant); |
| 198 | } | 192 | } |
| 199 | 193 | ||
| 200 | hr = StrAllocStringSecure(&pVariant->sczValue, wzValue, cchValue); | 194 | hr = StrAllocStringSecure(&pVariant->sczValue, wzValue, cchValue); |
| @@ -220,12 +214,8 @@ extern "C" HRESULT BVariantSetVersion( | |||
| 220 | } | 214 | } |
| 221 | else // assign the value. | 215 | else // assign the value. |
| 222 | { | 216 | { |
| 223 | if (BURN_VARIANT_TYPE_FORMATTED == pVariant->Type || | 217 | FreeVariantValue(pVariant); |
| 224 | BURN_VARIANT_TYPE_STRING == pVariant->Type) | 218 | |
| 225 | { | ||
| 226 | StrSecureZeroFreeString(pVariant->sczValue); | ||
| 227 | } | ||
| 228 | memset(pVariant, 0, sizeof(BURN_VARIANT)); | ||
| 229 | hr = VerCopyVersion(pValue, &pVariant->pValue); | 219 | hr = VerCopyVersion(pValue, &pVariant->pValue); |
| 230 | pVariant->Type = BURN_VARIANT_TYPE_VERSION; | 220 | pVariant->Type = BURN_VARIANT_TYPE_VERSION; |
| 231 | } | 221 | } |
| @@ -319,3 +309,20 @@ extern "C" HRESULT BVariantChangeType( | |||
| 319 | LExit: | 309 | LExit: |
| 320 | return hr; | 310 | return hr; |
| 321 | } | 311 | } |
| 312 | |||
| 313 | static void FreeVariantValue( | ||
| 314 | __in BURN_VARIANT* pVariant | ||
| 315 | ) | ||
| 316 | { | ||
| 317 | if ((BURN_VARIANT_TYPE_FORMATTED == pVariant->Type || BURN_VARIANT_TYPE_STRING == pVariant->Type) && | ||
| 318 | pVariant->sczValue) | ||
| 319 | { | ||
| 320 | StrSecureZeroFreeString(pVariant->sczValue); | ||
| 321 | } | ||
| 322 | else if (BURN_VARIANT_TYPE_VERSION == pVariant->Type && pVariant->pValue) | ||
| 323 | { | ||
| 324 | VerFreeVersion(pVariant->pValue); | ||
| 325 | } | ||
| 326 | |||
| 327 | SecureZeroMemory(pVariant, sizeof(BURN_VARIANT)); | ||
| 328 | } | ||
diff --git a/src/burn/stub/precomp.h b/src/burn/stub/precomp.h index 46239a6c..b72cd012 100644 --- a/src/burn/stub/precomp.h +++ b/src/burn/stub/precomp.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <strutil.h> | 13 | #include <strutil.h> |
| 14 | #include <fileutil.h> | 14 | #include <fileutil.h> |
| 15 | #include <pathutil.h> | 15 | #include <pathutil.h> |
| 16 | #include <polcutil.h> | ||
| 16 | #include <logutil.h> | 17 | #include <logutil.h> |
| 17 | 18 | ||
| 18 | #include "engine.h" | 19 | #include "engine.h" |
diff --git a/src/burn/stub/stub.cpp b/src/burn/stub/stub.cpp index d8cee9f1..ea5d88f0 100644 --- a/src/burn/stub/stub.cpp +++ b/src/burn/stub/stub.cpp | |||
| @@ -34,6 +34,8 @@ int WINAPI wWinMain( | |||
| 34 | L"feclient.dll", // unsafely loaded by DecryptFile(). | 34 | L"feclient.dll", // unsafely loaded by DecryptFile(). |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | AppSetDefaultProcessMitigationPolicy(POLICY_BURN_REGISTRY_PATH); | ||
| 38 | |||
| 37 | // Best effort attempt to get our file handle as soon as possible. | 39 | // Best effort attempt to get our file handle as soon as possible. |
| 38 | hr = PathForCurrentProcess(&sczPath, NULL); | 40 | hr = PathForCurrentProcess(&sczPath, NULL); |
| 39 | if (SUCCEEDED(hr)) | 41 | if (SUCCEEDED(hr)) |
diff --git a/src/dtf/SfxCA/SfxUtil.cpp b/src/dtf/SfxCA/SfxUtil.cpp index 079f1617..4d85aab7 100644 --- a/src/dtf/SfxCA/SfxUtil.cpp +++ b/src/dtf/SfxCA/SfxUtil.cpp | |||
| @@ -163,24 +163,70 @@ static HRESULT CreateGuid( | |||
| 163 | return hr; | 163 | return hr; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | static HRESULT ProcessElevated() | 166 | static HRESULT LogLastError(__in MSIHANDLE hSession, __in_z const wchar_t* wzMessage) |
| 167 | { | 167 | { |
| 168 | HRESULT hr = S_OK; | 168 | HRESULT hr = HRESULT_FROM_WIN32(::GetLastError()); |
| 169 | HANDLE hToken = NULL; | ||
| 170 | TOKEN_ELEVATION tokenElevated = {}; | ||
| 171 | DWORD cbToken = 0; | ||
| 172 | 169 | ||
| 173 | if (::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &hToken) && | 170 | Log(hSession, L"%ls. Error code 0x%08X", wzMessage, hr); |
| 174 | ::GetTokenInformation(hToken, TokenElevation, &tokenElevated, sizeof(TOKEN_ELEVATION), &cbToken)) | 171 | |
| 175 | { | 172 | return hr; |
| 176 | hr = (0 != tokenElevated.TokenIsElevated) ? S_OK : S_FALSE; | 173 | } |
| 177 | } | 174 | |
| 178 | else | 175 | static HRESULT HighIntegrityProcess(__in MSIHANDLE hSession, __out BOOL* pfHighIntegrity) |
| 176 | { | ||
| 177 | HRESULT hr = S_OK; | ||
| 178 | HANDLE hToken = NULL; | ||
| 179 | DWORD dwTokenLength = 0; | ||
| 180 | DWORD cbToken = 0; | ||
| 181 | PTOKEN_MANDATORY_LABEL pTokenMandatoryLabel = NULL; | ||
| 182 | DWORD rid = 0; | ||
| 183 | |||
| 184 | *pfHighIntegrity = FALSE; | ||
| 185 | |||
| 186 | if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &hToken)) | ||
| 187 | { | ||
| 188 | hr = LogLastError(hSession, L"Failed to open process token"); | ||
| 189 | goto LExit; | ||
| 190 | } | ||
| 191 | |||
| 192 | if (!::GetTokenInformation(hToken, TokenIntegrityLevel, NULL, 0, &dwTokenLength)) | ||
| 193 | { | ||
| 194 | DWORD er = ::GetLastError(); | ||
| 195 | if (er != ERROR_INSUFFICIENT_BUFFER) | ||
| 179 | { | 196 | { |
| 180 | hr = HRESULT_FROM_WIN32(::GetLastError()); | 197 | hr = LogLastError(hSession, L"Failed to get token integrity information length"); |
| 198 | goto LExit; | ||
| 181 | } | 199 | } |
| 200 | } | ||
| 182 | 201 | ||
| 183 | return hr; | 202 | pTokenMandatoryLabel = reinterpret_cast<PTOKEN_MANDATORY_LABEL>(::HeapAlloc(::GetProcessHeap(), HEAP_ZERO_MEMORY, dwTokenLength)); |
| 203 | if (!pTokenMandatoryLabel) | ||
| 204 | { | ||
| 205 | hr = LogLastError(hSession, L"Failed to allocate memory for token integrity information"); | ||
| 206 | goto LExit; | ||
| 207 | } | ||
| 208 | |||
| 209 | if (!::GetTokenInformation(hToken, TokenIntegrityLevel, pTokenMandatoryLabel, dwTokenLength, &cbToken)) | ||
| 210 | { | ||
| 211 | hr = LogLastError(hSession, L"Failed to get token integrity information"); | ||
| 212 | goto LExit; | ||
| 213 | } | ||
| 214 | |||
| 215 | rid = *::GetSidSubAuthority(pTokenMandatoryLabel->Label.Sid, *::GetSidSubAuthorityCount(pTokenMandatoryLabel->Label.Sid) - 1); | ||
| 216 | *pfHighIntegrity = (SECURITY_MANDATORY_HIGH_RID <= rid); | ||
| 217 | |||
| 218 | LExit: | ||
| 219 | if (pTokenMandatoryLabel) | ||
| 220 | { | ||
| 221 | ::HeapFree(::GetProcessHeap(), 0, pTokenMandatoryLabel); | ||
| 222 | } | ||
| 223 | |||
| 224 | if (hToken) | ||
| 225 | { | ||
| 226 | ::CloseHandle(hToken); | ||
| 227 | } | ||
| 228 | |||
| 229 | return hr; | ||
| 184 | } | 230 | } |
| 185 | 231 | ||
| 186 | /// <summary> | 232 | /// <summary> |
| @@ -203,6 +249,7 @@ bool ExtractToTempDirectory(__in MSIHANDLE hSession, __in HMODULE hModule, | |||
| 203 | HRESULT hr = S_OK; | 249 | HRESULT hr = S_OK; |
| 204 | wchar_t szModule[MAX_PATH] = {}; | 250 | wchar_t szModule[MAX_PATH] = {}; |
| 205 | wchar_t szGuid[GUID_STRING_LENGTH] = {}; | 251 | wchar_t szGuid[GUID_STRING_LENGTH] = {}; |
| 252 | BOOL fHighIntegrity = FALSE; | ||
| 206 | 253 | ||
| 207 | DWORD cchCopied = ::GetModuleFileName(hModule, szModule, MAX_PATH - 1); | 254 | DWORD cchCopied = ::GetModuleFileName(hModule, szModule, MAX_PATH - 1); |
| 208 | if (cchCopied == 0 || cchCopied == MAX_PATH - 1) | 255 | if (cchCopied == 0 || cchCopied == MAX_PATH - 1) |
| @@ -224,9 +271,15 @@ bool ExtractToTempDirectory(__in MSIHANDLE hSession, __in HMODULE hModule, | |||
| 224 | goto LExit; | 271 | goto LExit; |
| 225 | } | 272 | } |
| 226 | 273 | ||
| 227 | // Unelevated we use the user's temp directory. | 274 | // Non-high-integrity we use the user's temp directory. |
| 228 | hr = ProcessElevated(); | 275 | hr = HighIntegrityProcess(hSession, &fHighIntegrity); |
| 229 | if (S_FALSE == hr) | 276 | if (FAILED(hr)) |
| 277 | { | ||
| 278 | Log(hSession, L"Failed to determine if process is high integrity. Assuming high integrity. Error code 0x%x", hr); | ||
| 279 | fHighIntegrity = TRUE; | ||
| 280 | } | ||
| 281 | |||
| 282 | if (!fHighIntegrity) | ||
| 230 | { | 283 | { |
| 231 | // Temp path is documented to be returned with a trailing backslash. | 284 | // Temp path is documented to be returned with a trailing backslash. |
| 232 | cchCopied = ::GetTempPath(cchTempDirBuf, szTempDir); | 285 | cchCopied = ::GetTempPath(cchTempDirBuf, szTempDir); |
| @@ -242,7 +295,7 @@ bool ExtractToTempDirectory(__in MSIHANDLE hSession, __in HMODULE hModule, | |||
| 242 | goto LExit; | 295 | goto LExit; |
| 243 | } | 296 | } |
| 244 | } | 297 | } |
| 245 | else // elevated or we couldn't check (in the latter case, assume we're elevated since it's safer to use) | 298 | else // high integrity or we couldn't check (in the latter case, assume high integrity since it's safer to use because if we're not elevated we'll fail safely). |
| 246 | { | 299 | { |
| 247 | // Windows directory will not contain a trailing backslash, so we add it next. | 300 | // Windows directory will not contain a trailing backslash, so we add it next. |
| 248 | cchCopied = ::GetWindowsDirectoryW(szTempDir, cchTempDirBuf); | 301 | cchCopied = ::GetWindowsDirectoryW(szTempDir, cchTempDirBuf); |
| @@ -261,7 +314,7 @@ bool ExtractToTempDirectory(__in MSIHANDLE hSession, __in HMODULE hModule, | |||
| 261 | hr = ::StringCchCat(szTempDir, cchTempDirBuf, L"\\Installer\\"); | 314 | hr = ::StringCchCat(szTempDir, cchTempDirBuf, L"\\Installer\\"); |
| 262 | if (FAILED(hr)) | 315 | if (FAILED(hr)) |
| 263 | { | 316 | { |
| 264 | Log(hSession, L"Failed append 'Installer' to Windows directory. Error code 0x%x", hr); | 317 | Log(hSession, L"Failed to append 'Installer' to Windows directory '%ls'. Error code 0x%x", szTempDir, hr); |
| 265 | goto LExit; | 318 | goto LExit; |
| 266 | } | 319 | } |
| 267 | } | 320 | } |
| @@ -269,14 +322,14 @@ bool ExtractToTempDirectory(__in MSIHANDLE hSession, __in HMODULE hModule, | |||
| 269 | hr = ::StringCchCat(szTempDir, cchTempDirBuf, szGuid); | 322 | hr = ::StringCchCat(szTempDir, cchTempDirBuf, szGuid); |
| 270 | if (FAILED(hr)) | 323 | if (FAILED(hr)) |
| 271 | { | 324 | { |
| 272 | Log(hSession, L"Failed append GUID to temp path. Error code 0x%x", hr); | 325 | Log(hSession, L"Failed append GUID to temp path '%ls'. Error code 0x%x", szTempDir, hr); |
| 273 | goto LExit; | 326 | goto LExit; |
| 274 | } | 327 | } |
| 275 | 328 | ||
| 276 | if (!::CreateDirectory(szTempDir, NULL)) | 329 | if (!::CreateDirectory(szTempDir, NULL)) |
| 277 | { | 330 | { |
| 278 | hr = HRESULT_FROM_WIN32(::GetLastError()); | 331 | hr = HRESULT_FROM_WIN32(::GetLastError()); |
| 279 | Log(hSession, L"Failed to create temp directory. Error code 0x%x", hr); | 332 | Log(hSession, L"Failed to create temp directory '%ls'. Error code 0x%x", szTempDir, hr); |
| 280 | goto LExit; | 333 | goto LExit; |
| 281 | } | 334 | } |
| 282 | 335 | ||
diff --git a/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.nuspec b/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.nuspec index bac680dc..37cc3e86 100644 --- a/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.nuspec +++ b/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.nuspec | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | <file src="$iconPng$" /> | 24 | <file src="$iconPng$" /> |
| 25 | <file src="$projectFolder$\README.md" /> | 25 | <file src="$projectFolder$\README.md" /> |
| 26 | <file src="$projectFolder$\$id$.targets" target="build" /> | 26 | <file src="$projectFolder$\$id$.targets" target="build" /> |
| 27 | <file src="$licenseAcceptanceTargets$" target="build" /> | ||
| 27 | <file src="net472\WixToolset.Dtf.MakeSfxCA.exe" target="tools" /> | 28 | <file src="net472\WixToolset.Dtf.MakeSfxCA.exe" target="tools" /> |
| 28 | <file src="net472\WixToolset.Dtf.MakeSfxCA.exe.config" target="tools" /> | 29 | <file src="net472\WixToolset.Dtf.MakeSfxCA.exe.config" target="tools" /> |
| 29 | <file src="net472\WixToolset.Dtf.Compression.dll" target="tools" /> | 30 | <file src="net472\WixToolset.Dtf.Compression.dll" target="tools" /> |
diff --git a/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.targets b/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.targets index e83272a2..440a1298 100644 --- a/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.targets +++ b/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.targets | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | 5 | ||
| 6 | <Import Project="$(CustomBeforeWixCATargets)" Condition=" '$(CustomBeforeWixCATargets)' != '' and Exists('$(CustomBeforeWixCATargets)')" /> | 6 | <Import Project="$(CustomBeforeWixCATargets)" Condition=" '$(CustomBeforeWixCATargets)' != '' and Exists('$(CustomBeforeWixCATargets)')" /> |
| 7 | 7 | ||
| 8 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 9 | |||
| 8 | <PropertyGroup> | 10 | <PropertyGroup> |
| 9 | <WixCATargetsImported>true</WixCATargetsImported> | 11 | <WixCATargetsImported>true</WixCATargetsImported> |
| 10 | 12 | ||
diff --git a/src/ext/Bal/wixext-backward-compatible/WixToolset.Bal.wixext.nuspec b/src/ext/Bal/wixext-backward-compatible/WixToolset.Bal.wixext.nuspec index 2af1e037..c7b4a6ea 100644 --- a/src/ext/Bal/wixext-backward-compatible/WixToolset.Bal.wixext.nuspec +++ b/src/ext/Bal/wixext-backward-compatible/WixToolset.Bal.wixext.nuspec | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | <file src="$iconPng$" /> | 21 | <file src="$iconPng$" /> |
| 22 | <file src="$projectFolder$\README.md" /> | 22 | <file src="$projectFolder$\README.md" /> |
| 23 | <file src="$projectFolder$\WixToolset.Bal.wixext.targets" target="build" /> | 23 | <file src="$projectFolder$\WixToolset.Bal.wixext.targets" target="build" /> |
| 24 | <file src="$licenseAcceptanceTargets$" target="build" /> | ||
| 24 | <file src="WixToolset.BootstrapperApplications.wixext.dll" target="$wixExtensionPackageFolder$" /> | 25 | <file src="WixToolset.BootstrapperApplications.wixext.dll" target="$wixExtensionPackageFolder$" /> |
| 25 | </files> | 26 | </files> |
| 26 | </package> | 27 | </package> |
diff --git a/src/ext/Bal/wixext-backward-compatible/WixToolset.Bal.wixext.targets b/src/ext/Bal/wixext-backward-compatible/WixToolset.Bal.wixext.targets index 8203d95b..dd2960ab 100644 --- a/src/ext/Bal/wixext-backward-compatible/WixToolset.Bal.wixext.targets +++ b/src/ext/Bal/wixext-backward-compatible/WixToolset.Bal.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="WixToolset.BootstrapperApplications.wixext" | 8 | <UnsupportedWixExtension Include="WixToolset.BootstrapperApplications.wixext" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\WixToolset.BootstrapperApplications.wixext.dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\WixToolset.BootstrapperApplications.wixext.dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/Bal/wixext/WixToolset.BootstrapperApplications.wixext.targets b/src/ext/Bal/wixext/WixToolset.BootstrapperApplications.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/Bal/wixext/WixToolset.BootstrapperApplications.wixext.targets +++ b/src/ext/Bal/wixext/WixToolset.BootstrapperApplications.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/Bal/wixstdfn/wixstdfn.nuspec b/src/ext/Bal/wixstdfn/wixstdfn.nuspec index d4b6e104..b125ff7c 100644 --- a/src/ext/Bal/wixstdfn/wixstdfn.nuspec +++ b/src/ext/Bal/wixstdfn/wixstdfn.nuspec | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | <file src="$iconPng$" /> | 27 | <file src="$iconPng$" /> |
| 28 | <file src="$projectFolder$\README.md" /> | 28 | <file src="$projectFolder$\README.md" /> |
| 29 | <file src="$projectFolder$\build\$id$.props" target="build\" /> | 29 | <file src="$projectFolder$\build\$id$.props" target="build\" /> |
| 30 | <file src="$licenseAcceptanceTargets$" target="build\$id$.targets" /> | ||
| 30 | <file src="$projectFolder$\inc\*" target="lib\native\include" /> | 31 | <file src="$projectFolder$\inc\*" target="lib\native\include" /> |
| 31 | <file src="..\..\v143\x86\wixstdfn.lib" target="lib\native\v14\x86" /> | 32 | <file src="..\..\v143\x86\wixstdfn.lib" target="lib\native\v14\x86" /> |
| 32 | <file src="..\..\v143\x64\wixstdfn.lib" target="lib\native\v14\x64" /> | 33 | <file src="..\..\v143\x64\wixstdfn.lib" target="lib\native\v14\x64" /> |
diff --git a/src/ext/ComPlus/wixext/WixToolset.ComPlus.wixext.targets b/src/ext/ComPlus/wixext/WixToolset.ComPlus.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/ComPlus/wixext/WixToolset.ComPlus.wixext.targets +++ b/src/ext/ComPlus/wixext/WixToolset.ComPlus.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/Dependency/wixext/WixToolset.Dependency.wixext.targets b/src/ext/Dependency/wixext/WixToolset.Dependency.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/Dependency/wixext/WixToolset.Dependency.wixext.targets +++ b/src/ext/Dependency/wixext/WixToolset.Dependency.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/DirectX/wixext/WixToolset.DirectX.wixext.targets b/src/ext/DirectX/wixext/WixToolset.DirectX.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/DirectX/wixext/WixToolset.DirectX.wixext.targets +++ b/src/ext/DirectX/wixext/WixToolset.DirectX.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/Firewall/wixext/WixToolset.Firewall.wixext.targets b/src/ext/Firewall/wixext/WixToolset.Firewall.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/Firewall/wixext/WixToolset.Firewall.wixext.targets +++ b/src/ext/Firewall/wixext/WixToolset.Firewall.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/Http/wixext/WixToolset.Http.wixext.targets b/src/ext/Http/wixext/WixToolset.Http.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/Http/wixext/WixToolset.Http.wixext.targets +++ b/src/ext/Http/wixext/WixToolset.Http.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/Iis/wixext/WixToolset.Iis.wixext.targets b/src/ext/Iis/wixext/WixToolset.Iis.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/Iis/wixext/WixToolset.Iis.wixext.targets +++ b/src/ext/Iis/wixext/WixToolset.Iis.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/Msmq/wixext/WixToolset.Msmq.wixext.targets b/src/ext/Msmq/wixext/WixToolset.Msmq.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/Msmq/wixext/WixToolset.Msmq.wixext.targets +++ b/src/ext/Msmq/wixext/WixToolset.Msmq.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.targets b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.targets +++ b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/PowerShell/wixext/WixToolset.PowerShell.wixext.targets b/src/ext/PowerShell/wixext/WixToolset.PowerShell.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/PowerShell/wixext/WixToolset.PowerShell.wixext.targets +++ b/src/ext/PowerShell/wixext/WixToolset.PowerShell.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/Sql/wixext/WixToolset.Sql.wixext.targets b/src/ext/Sql/wixext/WixToolset.Sql.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/Sql/wixext/WixToolset.Sql.wixext.targets +++ b/src/ext/Sql/wixext/WixToolset.Sql.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/UI/wixext/WixToolset.UI.wixext.targets b/src/ext/UI/wixext/WixToolset.UI.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/UI/wixext/WixToolset.UI.wixext.targets +++ b/src/ext/UI/wixext/WixToolset.UI.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/Util/wixext/WixToolset.Util.wixext.targets b/src/ext/Util/wixext/WixToolset.Util.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/Util/wixext/WixToolset.Util.wixext.targets +++ b/src/ext/Util/wixext/WixToolset.Util.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/VisualStudio/wixext/WixToolset.VisualStudio.wixext.targets b/src/ext/VisualStudio/wixext/WixToolset.VisualStudio.wixext.targets index bf6df083..b0a7c5b8 100644 --- a/src/ext/VisualStudio/wixext/WixToolset.VisualStudio.wixext.targets +++ b/src/ext/VisualStudio/wixext/WixToolset.VisualStudio.wixext.targets | |||
| @@ -8,4 +8,6 @@ | |||
| 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" | 8 | <UnsupportedWixExtension Include="$(MSBuildThisFileName)" |
| 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> | 9 | Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> |
| 10 | </ItemGroup> | 10 | </ItemGroup> |
| 11 | |||
| 12 | <Import Project="CheckLicenseAcceptance.targets" /> | ||
| 11 | </Project> | 13 | </Project> |
diff --git a/src/ext/WixExt.props b/src/ext/WixExt.props index 538c6b97..d2c4929a 100644 --- a/src/ext/WixExt.props +++ b/src/ext/WixExt.props | |||
| @@ -6,12 +6,14 @@ | |||
| 6 | <IncludeBuildOutput>false</IncludeBuildOutput> | 6 | <IncludeBuildOutput>false</IncludeBuildOutput> |
| 7 | <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> | 7 | <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> |
| 8 | <NoWarn>NU5100</NoWarn> | 8 | <NoWarn>NU5100</NoWarn> |
| 9 | <WixExtensionPackageFolder>wixext6</WixExtensionPackageFolder> | 9 | <WixExtensionPackageFolder>wixext7</WixExtensionPackageFolder> |
| 10 | <PackageTags>$(PackageTags) wixext CustomActions</PackageTags> | 10 | <PackageTags>$(PackageTags) wixext CustomActions</PackageTags> |
| 11 | <IsWixExtension>true</IsWixExtension> | ||
| 11 | </PropertyGroup> | 12 | </PropertyGroup> |
| 12 | 13 | ||
| 13 | <ItemGroup> | 14 | <ItemGroup> |
| 14 | <Content Include="$(MSBuildProjectName).targets" PackagePath="build" /> | 15 | <Content Include="$(MSBuildProjectName).targets" PackagePath="build" /> |
| 16 | <Content Include="$(PackageLicenseAcceptanceTargets)" Pack="true" PackagePath="build/CheckLicenseAcceptance.targets" /> | ||
| 15 | <Content Include="$(TargetPath)" PackagePath="$(WixExtensionPackageFolder)" /> | 17 | <Content Include="$(TargetPath)" PackagePath="$(WixExtensionPackageFolder)" /> |
| 16 | 18 | ||
| 17 | <PackageReference Include="WixToolset.Extensibility" PrivateAssets="all" /> | 19 | <PackageReference Include="WixToolset.Extensibility" PrivateAssets="all" /> |
diff --git a/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs b/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs index d950bca9..61d7095d 100644 --- a/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs +++ b/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs | |||
| @@ -76,6 +76,26 @@ namespace WixToolset.BaseBuildTasks | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | /// <summary> | 78 | /// <summary> |
| 79 | /// Append a switch to the command-line for each value in a split text. | ||
| 80 | /// </summary> | ||
| 81 | /// <param name="switchName">Switch to append.</param> | ||
| 82 | /// <param name="values">Text to split and append.</param> | ||
| 83 | /// <param name="split">Character to use to split the string</param> | ||
| 84 | public void AppendTextAsArray(string switchName, string values, char splitter = ';') | ||
| 85 | { | ||
| 86 | if (!String.IsNullOrEmpty(values)) | ||
| 87 | { | ||
| 88 | foreach (string value in values.Split([ splitter ], StringSplitOptions.RemoveEmptyEntries)) | ||
| 89 | { | ||
| 90 | if (!String.IsNullOrWhiteSpace(value)) | ||
| 91 | { | ||
| 92 | this.AppendSwitchIfNotNull(switchName, value.Trim()); | ||
| 93 | } | ||
| 94 | } | ||
| 95 | } | ||
| 96 | } | ||
| 97 | |||
| 98 | /// <summary> | ||
| 79 | /// Append arbitrary text to the command-line if specified. | 99 | /// Append arbitrary text to the command-line if specified. |
| 80 | /// </summary> | 100 | /// </summary> |
| 81 | /// <param name="textToAppend">Text to append.</param> | 101 | /// <param name="textToAppend">Text to append.</param> |
diff --git a/src/internal/targets/CheckLicenseAcceptance.targets b/src/internal/targets/CheckLicenseAcceptance.targets new file mode 100644 index 00000000..61155827 --- /dev/null +++ b/src/internal/targets/CheckLicenseAcceptance.targets | |||
| @@ -0,0 +1,30 @@ | |||
| 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 | |||
| 4 | <Project> | ||
| 5 | |||
| 6 | <Target | ||
| 7 | Name="CheckWix7LicenseAcceptance" | ||
| 8 | BeforeTargets="CoreCompile"> | ||
| 9 | |||
| 10 | <ItemGroup> | ||
| 11 | <_AcceptEula Include="$(AcceptEula)" /> | ||
| 12 | </ItemGroup> | ||
| 13 | |||
| 14 | <PropertyGroup> | ||
| 15 | <_Wix7EulaFile>$(USERPROFILE)\.wix\wix7-osmf-eula.txt</_Wix7EulaFile> | ||
| 16 | </PropertyGroup> | ||
| 17 | |||
| 18 | <FindInList List="@(_AcceptEula)" ItemSpecToFind="wix7"> | ||
| 19 | <Output TaskParameter="ItemFound" ItemName="_Wix7LicenseAccepted" /> | ||
| 20 | </FindInList> | ||
| 21 | |||
| 22 | <Error | ||
| 23 | Text="You must accept the Open Source Maintenance Fee (OSMF) EULA to use WiX Toolset v7. For instructions, see https://wixtoolset.org/osmf/" | ||
| 24 | Code="WIX7015" | ||
| 25 | File="$(MSBuildProjectFile)" | ||
| 26 | HelpLink="https://wixtoolset.org/osmf" | ||
| 27 | Condition=" '@(_Wix7LicenseAccepted)' == '' and !Exists('$(_Wix7EulaFile)')" /> | ||
| 28 | </Target> | ||
| 29 | |||
| 30 | </Project> | ||
diff --git a/src/libs/dutil/WixToolset.DUtil/apputil.cpp b/src/libs/dutil/WixToolset.DUtil/apputil.cpp index c08fffc7..6c56f1a0 100644 --- a/src/libs/dutil/WixToolset.DUtil/apputil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/apputil.cpp | |||
| @@ -19,10 +19,15 @@ | |||
| 19 | 19 | ||
| 20 | typedef BOOL(WINAPI *LPFN_SETDEFAULTDLLDIRECTORIES)(DWORD); | 20 | typedef BOOL(WINAPI *LPFN_SETDEFAULTDLLDIRECTORIES)(DWORD); |
| 21 | typedef BOOL(WINAPI *LPFN_SETDLLDIRECTORYW)(LPCWSTR); | 21 | typedef BOOL(WINAPI *LPFN_SETDLLDIRECTORYW)(LPCWSTR); |
| 22 | typedef BOOL(WINAPI *LPFN_SETPROCESSMITIGATIONPOLICY)(PROCESS_MITIGATION_POLICY, PVOID, SIZE_T); | ||
| 22 | 23 | ||
| 23 | static BOOL vfInitialized = FALSE; | 24 | static BOOL vfInitialized = FALSE; |
| 24 | static LPFN_SETDEFAULTDLLDIRECTORIES vpfnSetDefaultDllDirectories = NULL; | 25 | static LPFN_SETDEFAULTDLLDIRECTORIES vpfnSetDefaultDllDirectories = NULL; |
| 25 | static LPFN_SETDLLDIRECTORYW vpfnSetDllDirectory = NULL; | 26 | static LPFN_SETDLLDIRECTORYW vpfnSetDllDirectory = NULL; |
| 27 | static LPFN_SETPROCESSMITIGATIONPOLICY vpfnSetProcessMitigationPolicy = NULL; | ||
| 28 | |||
| 29 | static const DWORD APP_MITIGATION_POLICY_DISABLED = 0; | ||
| 30 | static const DWORD APP_MITIGATION_POLICY_ENABLED = 1; | ||
| 26 | 31 | ||
| 27 | /******************************************************************** | 32 | /******************************************************************** |
| 28 | EscapeCommandLineArgument - encodes wzArgument such that | 33 | EscapeCommandLineArgument - encodes wzArgument such that |
| @@ -50,6 +55,7 @@ static void Initialize() | |||
| 50 | 55 | ||
| 51 | vpfnSetDefaultDllDirectories = (LPFN_SETDEFAULTDLLDIRECTORIES)::GetProcAddress(hKernel32, "SetDefaultDllDirectories"); | 56 | vpfnSetDefaultDllDirectories = (LPFN_SETDEFAULTDLLDIRECTORIES)::GetProcAddress(hKernel32, "SetDefaultDllDirectories"); |
| 52 | vpfnSetDllDirectory = (LPFN_SETDLLDIRECTORYW)::GetProcAddress(hKernel32, "SetDllDirectoryW"); | 57 | vpfnSetDllDirectory = (LPFN_SETDLLDIRECTORYW)::GetProcAddress(hKernel32, "SetDllDirectoryW"); |
| 58 | vpfnSetProcessMitigationPolicy = (LPFN_SETPROCESSMITIGATIONPOLICY)::GetProcAddress(hKernel32, "SetProcessMitigationPolicy"); | ||
| 53 | 59 | ||
| 54 | vfInitialized = TRUE; | 60 | vfInitialized = TRUE; |
| 55 | 61 | ||
| @@ -190,6 +196,100 @@ DAPI_(void) AppInitializeUnsafe() | |||
| 190 | ::HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); | 196 | ::HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); |
| 191 | } | 197 | } |
| 192 | 198 | ||
| 199 | DAPI_(HRESULT) AppSetDefaultProcessMitigationPolicy( | ||
| 200 | __in_z LPCWSTR wzPolicyPath | ||
| 201 | ) | ||
| 202 | { | ||
| 203 | HRESULT hr = S_OK; | ||
| 204 | HRESULT hrPolicy = S_OK; | ||
| 205 | DWORD dwPolicy = APP_MITIGATION_POLICY_DISABLED; | ||
| 206 | BOOL fApplied = FALSE; | ||
| 207 | PROCESS_MITIGATION_REDIRECTION_TRUST_POLICY redirectionTrustPolicy = { }; | ||
| 208 | PROCESS_MITIGATION_DYNAMIC_CODE_POLICY dynamicCodePolicy = { }; | ||
| 209 | PROCESS_MITIGATION_FONT_DISABLE_POLICY fontDisablePolicy = { }; | ||
| 210 | |||
| 211 | Initialize(); | ||
| 212 | |||
| 213 | if (!vpfnSetProcessMitigationPolicy) | ||
| 214 | { | ||
| 215 | ExitFunction1(hr = S_FALSE); | ||
| 216 | } | ||
| 217 | |||
| 218 | hrPolicy = PolcReadNumber(wzPolicyPath, L"RedirectionGuard", APP_MITIGATION_POLICY_ENABLED, &dwPolicy); | ||
| 219 | if (FAILED(hrPolicy)) | ||
| 220 | { | ||
| 221 | TraceError(hrPolicy, "Failed to read mitigation policy setting: RedirectionGuard."); | ||
| 222 | dwPolicy = APP_MITIGATION_POLICY_ENABLED; | ||
| 223 | } | ||
| 224 | |||
| 225 | if (APP_MITIGATION_POLICY_ENABLED == dwPolicy) | ||
| 226 | { | ||
| 227 | redirectionTrustPolicy.EnforceRedirectionTrust = 1; | ||
| 228 | |||
| 229 | if (!vpfnSetProcessMitigationPolicy(ProcessRedirectionTrustPolicy, &redirectionTrustPolicy, sizeof(redirectionTrustPolicy))) | ||
| 230 | { | ||
| 231 | hr = HRESULT_FROM_WIN32(::GetLastError()); | ||
| 232 | TraceError(hr, "Failed to set RedirectionGuard mitigation policy."); | ||
| 233 | } | ||
| 234 | else | ||
| 235 | { | ||
| 236 | fApplied = TRUE; | ||
| 237 | } | ||
| 238 | } | ||
| 239 | |||
| 240 | hrPolicy = PolcReadNumber(wzPolicyPath, L"DynamicCode", APP_MITIGATION_POLICY_DISABLED, &dwPolicy); | ||
| 241 | if (FAILED(hrPolicy)) | ||
| 242 | { | ||
| 243 | TraceError(hrPolicy, "Failed to read mitigation policy setting: DynamicCode."); | ||
| 244 | dwPolicy = APP_MITIGATION_POLICY_DISABLED; | ||
| 245 | } | ||
| 246 | |||
| 247 | if (APP_MITIGATION_POLICY_ENABLED == dwPolicy) | ||
| 248 | { | ||
| 249 | dynamicCodePolicy.ProhibitDynamicCode = 1; | ||
| 250 | |||
| 251 | if (!vpfnSetProcessMitigationPolicy(ProcessDynamicCodePolicy, &dynamicCodePolicy, sizeof(dynamicCodePolicy))) | ||
| 252 | { | ||
| 253 | hr = HRESULT_FROM_WIN32(::GetLastError()); | ||
| 254 | TraceError(hr, "Failed to set DynamicCode mitigation policy."); | ||
| 255 | } | ||
| 256 | else | ||
| 257 | { | ||
| 258 | fApplied = TRUE; | ||
| 259 | } | ||
| 260 | } | ||
| 261 | |||
| 262 | hrPolicy = PolcReadNumber(wzPolicyPath, L"FontDisable", APP_MITIGATION_POLICY_DISABLED, &dwPolicy); | ||
| 263 | if (FAILED(hrPolicy)) | ||
| 264 | { | ||
| 265 | TraceError(hrPolicy, "Failed to read mitigation policy setting: FontDisable."); | ||
| 266 | dwPolicy = APP_MITIGATION_POLICY_DISABLED; | ||
| 267 | } | ||
| 268 | |||
| 269 | if (APP_MITIGATION_POLICY_ENABLED == dwPolicy) | ||
| 270 | { | ||
| 271 | fontDisablePolicy.DisableNonSystemFonts = 1; | ||
| 272 | |||
| 273 | if (!vpfnSetProcessMitigationPolicy(ProcessFontDisablePolicy, &fontDisablePolicy, sizeof(fontDisablePolicy))) | ||
| 274 | { | ||
| 275 | hr = HRESULT_FROM_WIN32(::GetLastError()); | ||
| 276 | TraceError(hr, "Failed to set FontDisable mitigation policy."); | ||
| 277 | } | ||
| 278 | else | ||
| 279 | { | ||
| 280 | fApplied = TRUE; | ||
| 281 | } | ||
| 282 | } | ||
| 283 | |||
| 284 | LExit: | ||
| 285 | if (SUCCEEDED(hr) && !fApplied) | ||
| 286 | { | ||
| 287 | hr = S_FALSE; | ||
| 288 | } | ||
| 289 | |||
| 290 | return hr; | ||
| 291 | } | ||
| 292 | |||
| 193 | DAPI_(HRESULT) AppAppendCommandLineArgument( | 293 | DAPI_(HRESULT) AppAppendCommandLineArgument( |
| 194 | __deref_inout_z LPWSTR* psczCommandLine, | 294 | __deref_inout_z LPWSTR* psczCommandLine, |
| 195 | __in_z LPCWSTR wzArgument | 295 | __in_z LPCWSTR wzArgument |
diff --git a/src/libs/dutil/WixToolset.DUtil/dutil.nuspec b/src/libs/dutil/WixToolset.DUtil/dutil.nuspec index 534ccd69..eb3833a5 100644 --- a/src/libs/dutil/WixToolset.DUtil/dutil.nuspec +++ b/src/libs/dutil/WixToolset.DUtil/dutil.nuspec | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | <file src="$iconPng$" /> | 21 | <file src="$iconPng$" /> |
| 22 | <file src="$projectFolder$\..\README.md" /> | 22 | <file src="$projectFolder$\..\README.md" /> |
| 23 | <file src="$projectFolder$\build\$id$.props" target="build\" /> | 23 | <file src="$projectFolder$\build\$id$.props" target="build\" /> |
| 24 | <file src="$licenseAcceptanceTargets$" target="build\$id$.targets" /> | ||
| 24 | <file src="$projectFolder$\inc\*" target="build\native\include" /> | 25 | <file src="$projectFolder$\inc\*" target="build\native\include" /> |
| 25 | <file src="..\..\v143\x64\dutil.lib" target="build\native\v14\x64" /> | 26 | <file src="..\..\v143\x64\dutil.lib" target="build\native\v14\x64" /> |
| 26 | <file src="..\..\v143\x86\dutil.lib" target="build\native\v14\x86" /> | 27 | <file src="..\..\v143\x86\dutil.lib" target="build\native\v14\x86" /> |
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/apputil.h b/src/libs/dutil/WixToolset.DUtil/inc/apputil.h index e2812ee4..711f28c0 100644 --- a/src/libs/dutil/WixToolset.DUtil/inc/apputil.h +++ b/src/libs/dutil/WixToolset.DUtil/inc/apputil.h | |||
| @@ -34,6 +34,16 @@ AppInitializeUnsafe - initializes without the full standard safety | |||
| 34 | void DAPI AppInitializeUnsafe(); | 34 | void DAPI AppInitializeUnsafe(); |
| 35 | 35 | ||
| 36 | /******************************************************************** | 36 | /******************************************************************** |
| 37 | AppSetDefaultProcessMitigationPolicy - enables default process | ||
| 38 | mitigations, with per-mitigation policy overrides. | ||
| 39 | |||
| 40 | NOTE: Best effort. S_FALSE indicates not supported or disabled. | ||
| 41 | ********************************************************************/ | ||
| 42 | HRESULT DAPI AppSetDefaultProcessMitigationPolicy( | ||
| 43 | __in_z LPCWSTR wzPolicyPath | ||
| 44 | ); | ||
| 45 | |||
| 46 | /******************************************************************** | ||
| 37 | AppParseCommandLine - parses the command line using CommandLineToArgvW. | 47 | AppParseCommandLine - parses the command line using CommandLineToArgvW. |
| 38 | The caller must free the value of pArgv on success | 48 | The caller must free the value of pArgv on success |
| 39 | by calling AppFreeCommandLineArgs. | 49 | by calling AppFreeCommandLineArgs. |
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/procutil.h b/src/libs/dutil/WixToolset.DUtil/inc/procutil.h index e7e91705..974003eb 100644 --- a/src/libs/dutil/WixToolset.DUtil/inc/procutil.h +++ b/src/libs/dutil/WixToolset.DUtil/inc/procutil.h | |||
| @@ -28,7 +28,10 @@ HRESULT DAPI ProcGetTokenInformation( | |||
| 28 | __in TOKEN_INFORMATION_CLASS tokenInformationClass, | 28 | __in TOKEN_INFORMATION_CLASS tokenInformationClass, |
| 29 | __out LPVOID* ppvTokenInformation | 29 | __out LPVOID* ppvTokenInformation |
| 30 | ); | 30 | ); |
| 31 | 31 | HRESULT DAPI ProcIsHighIntegrity( | |
| 32 | __in HANDLE hProcess, | ||
| 33 | __out BOOL* pfHighIntegrity | ||
| 34 | ); | ||
| 32 | HRESULT DAPI ProcHasPrivilege( | 35 | HRESULT DAPI ProcHasPrivilege( |
| 33 | __in HANDLE hProcess, | 36 | __in HANDLE hProcess, |
| 34 | __in LPCWSTR wzPrivilegeName, | 37 | __in LPCWSTR wzPrivilegeName, |
diff --git a/src/libs/dutil/WixToolset.DUtil/procutil.cpp b/src/libs/dutil/WixToolset.DUtil/procutil.cpp index 6cd3214c..7109551b 100644 --- a/src/libs/dutil/WixToolset.DUtil/procutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/procutil.cpp | |||
| @@ -34,7 +34,6 @@ static BOOL CALLBACK CloseWindowEnumCallback( | |||
| 34 | __in LPARAM lParam | 34 | __in LPARAM lParam |
| 35 | ); | 35 | ); |
| 36 | 36 | ||
| 37 | |||
| 38 | extern "C" HRESULT DAPI ProcElevated( | 37 | extern "C" HRESULT DAPI ProcElevated( |
| 39 | __in HANDLE hProcess, | 38 | __in HANDLE hProcess, |
| 40 | __out BOOL* pfElevated | 39 | __out BOOL* pfElevated |
| @@ -141,6 +140,30 @@ LExit: | |||
| 141 | return hr; | 140 | return hr; |
| 142 | } | 141 | } |
| 143 | 142 | ||
| 143 | extern "C" HRESULT DAPI ProcIsHighIntegrity( | ||
| 144 | __in HANDLE hProcess, | ||
| 145 | __out BOOL* pfHighIntegrity | ||
| 146 | ) | ||
| 147 | { | ||
| 148 | HRESULT hr = S_OK; | ||
| 149 | TOKEN_MANDATORY_LABEL* pTokenMandatoryLabel = NULL; | ||
| 150 | DWORD integrityRid = 0; | ||
| 151 | |||
| 152 | *pfHighIntegrity = FALSE; | ||
| 153 | |||
| 154 | hr = ProcGetTokenInformation(hProcess, TokenIntegrityLevel, reinterpret_cast<LPVOID*>(&pTokenMandatoryLabel)); | ||
| 155 | ProcExitOnFailure(hr, "Failed to get token mandatory label."); | ||
| 156 | |||
| 157 | integrityRid = *::GetSidSubAuthority(pTokenMandatoryLabel->Label.Sid, *::GetSidSubAuthorityCount(pTokenMandatoryLabel->Label.Sid) - 1); | ||
| 158 | |||
| 159 | *pfHighIntegrity = (SECURITY_MANDATORY_HIGH_RID <= integrityRid); | ||
| 160 | |||
| 161 | LExit: | ||
| 162 | ReleaseMem(pTokenMandatoryLabel); | ||
| 163 | |||
| 164 | return hr; | ||
| 165 | } | ||
| 166 | |||
| 144 | extern "C" HRESULT DAPI ProcHasPrivilege( | 167 | extern "C" HRESULT DAPI ProcHasPrivilege( |
| 145 | __in HANDLE hProcess, | 168 | __in HANDLE hProcess, |
| 146 | __in LPCWSTR wzPrivilegeName, | 169 | __in LPCWSTR wzPrivilegeName, |
diff --git a/src/libs/dutil/WixToolset.DUtil/rmutil.cpp b/src/libs/dutil/WixToolset.DUtil/rmutil.cpp index 95c8c8a4..a73ffde1 100644 --- a/src/libs/dutil/WixToolset.DUtil/rmutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/rmutil.cpp | |||
| @@ -168,41 +168,40 @@ extern "C" HRESULT DAPI RmuAddProcessById( | |||
| 168 | DWORD cbPrevPriv = 0; | 168 | DWORD cbPrevPriv = 0; |
| 169 | DWORD er = ERROR_SUCCESS; | 169 | DWORD er = ERROR_SUCCESS; |
| 170 | BOOL fAdjustedPrivileges = FALSE; | 170 | BOOL fAdjustedPrivileges = FALSE; |
| 171 | BOOL fElevated = FALSE; | ||
| 172 | ProcElevated(::GetCurrentProcess(), &fElevated); | ||
| 173 | |||
| 174 | // Must be elevated to adjust process privileges | ||
| 175 | if (fElevated) { | ||
| 176 | // Adding SeDebugPrivilege in the event that the process targeted by ::OpenProcess() is in a another user context. | ||
| 177 | if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &hToken)) | ||
| 178 | { | ||
| 179 | RmExitWithLastError(hr, "Failed to get process token."); | ||
| 180 | } | ||
| 181 | 171 | ||
| 172 | // Best-effort attempt to enable SeDebugPrivilege in case the target process is in another user context. | ||
| 173 | if (::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &hToken)) | ||
| 174 | { | ||
| 182 | priv.PrivilegeCount = 1; | 175 | priv.PrivilegeCount = 1; |
| 183 | priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; | 176 | priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; |
| 184 | if (!::LookupPrivilegeValueW(NULL, L"SeDebugPrivilege", &priv.Privileges[0].Luid)) | 177 | if (::LookupPrivilegeValueW(NULL, L"SeDebugPrivilege", &priv.Privileges[0].Luid)) |
| 185 | { | ||
| 186 | RmExitWithLastError(hr, "Failed to get debug privilege LUID."); | ||
| 187 | } | ||
| 188 | |||
| 189 | cbPrevPriv = sizeof(TOKEN_PRIVILEGES); | ||
| 190 | pPrevPriv = static_cast<TOKEN_PRIVILEGES*>(MemAlloc(cbPrevPriv, TRUE)); | ||
| 191 | RmExitOnNull(pPrevPriv, hr, E_OUTOFMEMORY, "Failed to allocate memory for empty previous privileges."); | ||
| 192 | |||
| 193 | if (!::AdjustTokenPrivileges(hToken, FALSE, &priv, cbPrevPriv, pPrevPriv, &cbPrevPriv)) | ||
| 194 | { | 178 | { |
| 195 | LPVOID pv = MemReAlloc(pPrevPriv, cbPrevPriv, TRUE); | 179 | cbPrevPriv = sizeof(TOKEN_PRIVILEGES); |
| 196 | RmExitOnNull(pv, hr, E_OUTOFMEMORY, "Failed to allocate memory for previous privileges."); | 180 | pPrevPriv = static_cast<TOKEN_PRIVILEGES*>(MemAlloc(cbPrevPriv, TRUE)); |
| 197 | pPrevPriv = static_cast<TOKEN_PRIVILEGES*>(pv); | 181 | if (pPrevPriv) |
| 198 | |||
| 199 | if (!::AdjustTokenPrivileges(hToken, FALSE, &priv, cbPrevPriv, pPrevPriv, &cbPrevPriv)) | ||
| 200 | { | 182 | { |
| 201 | RmExitWithLastError(hr, "Failed to get debug privilege LUID."); | 183 | fAdjustedPrivileges = ::AdjustTokenPrivileges(hToken, FALSE, &priv, cbPrevPriv, pPrevPriv, &cbPrevPriv); |
| 184 | er = ::GetLastError(); // AdjustTokenPrivileges may succeed but still return ERROR_NOT_ALL_ASSIGNED. | ||
| 185 | |||
| 186 | if (!fAdjustedPrivileges && ERROR_INSUFFICIENT_BUFFER == er) | ||
| 187 | { | ||
| 188 | LPVOID pv = MemReAlloc(pPrevPriv, cbPrevPriv, TRUE); | ||
| 189 | pPrevPriv = static_cast<TOKEN_PRIVILEGES*>(pv); | ||
| 190 | |||
| 191 | if (pPrevPriv) | ||
| 192 | { | ||
| 193 | fAdjustedPrivileges = ::AdjustTokenPrivileges(hToken, FALSE, &priv, cbPrevPriv, pPrevPriv, &cbPrevPriv); | ||
| 194 | er = ::GetLastError(); // AdjustTokenPrivileges may succeed but still return ERROR_NOT_ALL_ASSIGNED. | ||
| 195 | } | ||
| 196 | } | ||
| 197 | |||
| 198 | // We actually only adjusted privileges if the privilege was assigned AND *succeeded*. | ||
| 199 | if (ERROR_SUCCESS != er) | ||
| 200 | { | ||
| 201 | fAdjustedPrivileges = FALSE; | ||
| 202 | } | ||
| 202 | } | 203 | } |
| 203 | } | 204 | } |
| 204 | |||
| 205 | fAdjustedPrivileges = TRUE; | ||
| 206 | } | 205 | } |
| 207 | 206 | ||
| 208 | hProcess = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwProcessId); | 207 | hProcess = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwProcessId); |
diff --git a/src/libs/wcautil/WixToolset.WcaUtil/wcautil.nuspec b/src/libs/wcautil/WixToolset.WcaUtil/wcautil.nuspec index 915e00d9..78ac10a4 100644 --- a/src/libs/wcautil/WixToolset.WcaUtil/wcautil.nuspec +++ b/src/libs/wcautil/WixToolset.WcaUtil/wcautil.nuspec | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | <file src="$iconPng$" /> | 24 | <file src="$iconPng$" /> |
| 25 | <file src="$projectFolder$\..\README.md" /> | 25 | <file src="$projectFolder$\..\README.md" /> |
| 26 | <file src="$projectFolder$\build\$id$.props" target="build\" /> | 26 | <file src="$projectFolder$\build\$id$.props" target="build\" /> |
| 27 | <file src="$licenseAcceptanceTargets$" target="build\$id$.targets" /> | ||
| 27 | <file src="$projectFolder$\inc\*" target="build\native\include" /> | 28 | <file src="$projectFolder$\inc\*" target="build\native\include" /> |
| 28 | <file src="..\..\v143\x64\wcautil.lib" target="build\native\v14\x64" /> | 29 | <file src="..\..\v143\x64\wcautil.lib" target="build\native\v14\x64" /> |
| 29 | <file src="..\..\v143\x86\wcautil.lib" target="build\native\v14\x86" /> | 30 | <file src="..\..\v143\x86\wcautil.lib" target="build\native\v14\x86" /> |
diff --git a/src/test/burn/TestData/PatchTests/BundleA/BundleA.wxs b/src/test/burn/TestData/PatchTests/BundleA/BundleA.wxs index e3e0f4d7..ede5d56f 100644 --- a/src/test/burn/TestData/PatchTests/BundleA/BundleA.wxs +++ b/src/test/burn/TestData/PatchTests/BundleA/BundleA.wxs | |||
| @@ -1,7 +1,9 @@ | |||
| 1 | <!-- 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. --> | 1 | <!-- 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 | 2 | ||
| 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
| 4 | <Fragment> | 4 | <Fragment> |
| 5 | <RelatedBundle Code="1fb1f910-dd59-4348-9bfe-5822b5a64108" Action="detect" /> | ||
| 6 | |||
| 5 | <PackageGroup Id="BundlePackages"> | 7 | <PackageGroup Id="BundlePackages"> |
| 6 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" /> | 8 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" /> |
| 7 | </PackageGroup> | 9 | </PackageGroup> |
diff --git a/src/test/burn/TestData/PatchTests/BundlePatchA/BundlePatchA.wxs b/src/test/burn/TestData/PatchTests/BundlePatchA/BundlePatchA.wxs index bf0c0451..ffdbda06 100644 --- a/src/test/burn/TestData/PatchTests/BundlePatchA/BundlePatchA.wxs +++ b/src/test/burn/TestData/PatchTests/BundlePatchA/BundlePatchA.wxs | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
| 4 | <Fragment> | 4 | <Fragment> |
| 5 | <RelatedBundle Code="1fb1f910-dd59-4348-9bfe-5822b5a64108" Action="patch" /> | ||
| 6 | |||
| 5 | <PackageGroup Id="BundlePackages"> | 7 | <PackageGroup Id="BundlePackages"> |
| 6 | <MspPackage Id="PatchA" SourceFile="$(var.PatchA.TargetPath)" PerMachine="yes" /> | 8 | <MspPackage Id="PatchA" SourceFile="$(var.PatchA.TargetPath)" PerMachine="yes" /> |
| 7 | </PackageGroup> | 9 | </PackageGroup> |
diff --git a/src/test/burn/TestData/PatchTests/BundlePatchA2/BundlePatchA2.wxs b/src/test/burn/TestData/PatchTests/BundlePatchA2/BundlePatchA2.wxs index 24063db3..d8df611a 100644 --- a/src/test/burn/TestData/PatchTests/BundlePatchA2/BundlePatchA2.wxs +++ b/src/test/burn/TestData/PatchTests/BundlePatchA2/BundlePatchA2.wxs | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
| 4 | <Fragment> | 4 | <Fragment> |
| 5 | <RelatedBundle Code="1fb1f910-dd59-4348-9bfe-5822b5a64108" Action="patch" /> | ||
| 6 | |||
| 5 | <PackageGroup Id="BundlePackages"> | 7 | <PackageGroup Id="BundlePackages"> |
| 6 | <MspPackage Id="PatchA" SourceFile="$(var.PatchA.TargetPath)" PerMachine="yes" /> | 8 | <MspPackage Id="PatchA" SourceFile="$(var.PatchA.TargetPath)" PerMachine="yes" /> |
| 7 | <MspPackage Id="PatchA2" SourceFile="$(var.PatchA2.TargetPath)" PerMachine="yes" /> | 9 | <MspPackage Id="PatchA2" SourceFile="$(var.PatchA2.TargetPath)" PerMachine="yes" /> |
diff --git a/src/test/msi/TestData/CustomActionTests/TestCA/TestCA.csproj b/src/test/msi/TestData/CustomActionTests/TestCA/TestCA.csproj index 80602295..00fb5a41 100644 --- a/src/test/msi/TestData/CustomActionTests/TestCA/TestCA.csproj +++ b/src/test/msi/TestData/CustomActionTests/TestCA/TestCA.csproj | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | <Project Sdk="Microsoft.NET.Sdk"> | 3 | <Project Sdk="Microsoft.NET.Sdk"> |
| 4 | <PropertyGroup> | 4 | <PropertyGroup> |
| 5 | <TargetFramework>net472</TargetFramework> | 5 | <TargetFramework>net472</TargetFramework> |
| 6 | |||
| 7 | <!-- Add some random EULA Ids for testing purposes. --> | ||
| 8 | <AcceptEula>foo;wix7;bar</AcceptEula> | ||
| 6 | </PropertyGroup> | 9 | </PropertyGroup> |
| 7 | 10 | ||
| 8 | <ItemGroup> | 11 | <ItemGroup> |
diff --git a/src/test/wix/TestData/WixprojPackageVcxprojWindowsApp/WixprojPackageVcxprojWindowsApp.wixproj b/src/test/wix/TestData/WixprojPackageVcxprojWindowsApp/WixprojPackageVcxprojWindowsApp.wixproj index 27affb11..1e137761 100644 --- a/src/test/wix/TestData/WixprojPackageVcxprojWindowsApp/WixprojPackageVcxprojWindowsApp.wixproj +++ b/src/test/wix/TestData/WixprojPackageVcxprojWindowsApp/WixprojPackageVcxprojWindowsApp.wixproj | |||
| @@ -4,6 +4,9 @@ | |||
| 4 | <PropertyGroup> | 4 | <PropertyGroup> |
| 5 | <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | 5 | <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> |
| 6 | <SignOutput>true</SignOutput> | 6 | <SignOutput>true</SignOutput> |
| 7 | |||
| 8 | <!-- Add some random EULA Ids for testing purposes. --> | ||
| 9 | <AcceptEula>abc;xyz;123;wix7</AcceptEula> | ||
| 7 | </PropertyGroup> | 10 | </PropertyGroup> |
| 8 | 11 | ||
| 9 | <ItemGroup> | 12 | <ItemGroup> |
| @@ -12,6 +15,7 @@ | |||
| 12 | <ProjectReference Include="..\WixprojModuleCsprojWinFormsNetFx\WixprojModuleCsprojWinFormsNetFx.wixproj" /> | 15 | <ProjectReference Include="..\WixprojModuleCsprojWinFormsNetFx\WixprojModuleCsprojWinFormsNetFx.wixproj" /> |
| 13 | 16 | ||
| 14 | <PackageReference Include="Wixtoolset.UI.wixext" /> | 17 | <PackageReference Include="Wixtoolset.UI.wixext" /> |
| 18 | <PackageReference Include="Wixtoolset.Util.wixext" /> | ||
| 15 | </ItemGroup> | 19 | </ItemGroup> |
| 16 | 20 | ||
| 17 | <Target Name="SignMsi"> | 21 | <Target Name="SignMsi"> |
diff --git a/src/test/wix/WixE2E/WixE2EFixture.cs b/src/test/wix/WixE2E/WixE2EFixture.cs index f15571e4..512e80f5 100644 --- a/src/test/wix/WixE2E/WixE2EFixture.cs +++ b/src/test/wix/WixE2E/WixE2EFixture.cs | |||
| @@ -71,7 +71,7 @@ namespace WixE2E | |||
| 71 | .ToArray(); | 71 | .ToArray(); |
| 72 | WixAssert.CompareLineByLine(new[] | 72 | WixAssert.CompareLineByLine(new[] |
| 73 | { | 73 | { |
| 74 | @"<projectFolder>\WixprojPackageVcxprojWindowsApp.wixproj(18,5): warning : SignMsi = obj\<configuration>\en-US\WixprojPackageVcxprojWindowsApp.msi;obj\<configuration>\ja-JP\WixprojPackageVcxprojWindowsApp.msi" | 74 | @"<projectFolder>\WixprojPackageVcxprojWindowsApp.wixproj(22,5): warning : SignMsi = obj\<configuration>\en-US\WixprojPackageVcxprojWindowsApp.msi;obj\<configuration>\ja-JP\WixprojPackageVcxprojWindowsApp.msi" |
| 75 | }, signingStatement); | 75 | }, signingStatement); |
| 76 | } | 76 | } |
| 77 | 77 | ||
diff --git a/src/wix/WixToolset.BuildTasks/DetachBundleEngineForSigning.cs b/src/wix/WixToolset.BuildTasks/DetachBundleEngineForSigning.cs index c438d417..3a4ee36d 100644 --- a/src/wix/WixToolset.BuildTasks/DetachBundleEngineForSigning.cs +++ b/src/wix/WixToolset.BuildTasks/DetachBundleEngineForSigning.cs | |||
| @@ -45,7 +45,7 @@ namespace WixToolset.BuildTasks | |||
| 45 | commandLineBuilder.AppendFileNameIfNotNull(this.BundleFile); | 45 | commandLineBuilder.AppendFileNameIfNotNull(this.BundleFile); |
| 46 | commandLineBuilder.AppendSwitchIfNotNull("-engine ", this.OutputFile); | 46 | commandLineBuilder.AppendSwitchIfNotNull("-engine ", this.OutputFile); |
| 47 | commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); | 47 | commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); |
| 48 | commandLineBuilder.AppendSwitchIfNotNull("-acceptEula ", this.AcceptEula); | 48 | commandLineBuilder.AppendTextAsArray("-acceptEula ", this.AcceptEula); |
| 49 | 49 | ||
| 50 | base.BuildCommandLine(commandLineBuilder); | 50 | base.BuildCommandLine(commandLineBuilder); |
| 51 | } | 51 | } |
diff --git a/src/wix/WixToolset.BuildTasks/InscribeMsiWithCabinetSignatures.cs b/src/wix/WixToolset.BuildTasks/InscribeMsiWithCabinetSignatures.cs index dacae1a8..c88c14e7 100644 --- a/src/wix/WixToolset.BuildTasks/InscribeMsiWithCabinetSignatures.cs +++ b/src/wix/WixToolset.BuildTasks/InscribeMsiWithCabinetSignatures.cs | |||
| @@ -30,7 +30,7 @@ namespace WixToolset.BuildTasks | |||
| 30 | commandLineBuilder.AppendFileNameIfNotNull(this.DatabaseFile); | 30 | commandLineBuilder.AppendFileNameIfNotNull(this.DatabaseFile); |
| 31 | commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); | 31 | commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); |
| 32 | commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); | 32 | commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); |
| 33 | commandLineBuilder.AppendSwitchIfNotNull("-acceptEula ", this.AcceptEula); | 33 | commandLineBuilder.AppendTextAsArray("-acceptEula ", this.AcceptEula); |
| 34 | 34 | ||
| 35 | base.BuildCommandLine(commandLineBuilder); | 35 | base.BuildCommandLine(commandLineBuilder); |
| 36 | } | 36 | } |
diff --git a/src/wix/WixToolset.BuildTasks/ReattachSignedBundleEngine.cs b/src/wix/WixToolset.BuildTasks/ReattachSignedBundleEngine.cs index 433328bf..424263a5 100644 --- a/src/wix/WixToolset.BuildTasks/ReattachSignedBundleEngine.cs +++ b/src/wix/WixToolset.BuildTasks/ReattachSignedBundleEngine.cs | |||
| @@ -52,7 +52,7 @@ namespace WixToolset.BuildTasks | |||
| 52 | commandLineBuilder.AppendSwitchIfNotNull("-engine ", this.BundleEngineFile); | 52 | commandLineBuilder.AppendSwitchIfNotNull("-engine ", this.BundleEngineFile); |
| 53 | commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); | 53 | commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); |
| 54 | commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); | 54 | commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); |
| 55 | commandLineBuilder.AppendSwitchIfNotNull("-acceptEula ", this.AcceptEula); | 55 | commandLineBuilder.AppendTextAsArray("-acceptEula ", this.AcceptEula); |
| 56 | 56 | ||
| 57 | base.BuildCommandLine(commandLineBuilder); | 57 | base.BuildCommandLine(commandLineBuilder); |
| 58 | } | 58 | } |
diff --git a/src/wix/WixToolset.BuildTasks/WindowsInstallerValidation.cs b/src/wix/WixToolset.BuildTasks/WindowsInstallerValidation.cs index 75b99951..1a7ffa2c 100644 --- a/src/wix/WixToolset.BuildTasks/WindowsInstallerValidation.cs +++ b/src/wix/WixToolset.BuildTasks/WindowsInstallerValidation.cs | |||
| @@ -56,7 +56,7 @@ namespace WixToolset.BuildTasks | |||
| 56 | commandLineBuilder.AppendArrayIfNotNull("-cub ", this.CubeFiles); | 56 | commandLineBuilder.AppendArrayIfNotNull("-cub ", this.CubeFiles); |
| 57 | commandLineBuilder.AppendArrayIfNotNull("-ice ", this.Ices); | 57 | commandLineBuilder.AppendArrayIfNotNull("-ice ", this.Ices); |
| 58 | commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces); | 58 | commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces); |
| 59 | commandLineBuilder.AppendSwitchIfNotNull("-acceptEula ", this.AcceptEula); | 59 | commandLineBuilder.AppendTextAsArray("-acceptEula ", this.AcceptEula); |
| 60 | 60 | ||
| 61 | base.BuildCommandLine(commandLineBuilder); | 61 | base.BuildCommandLine(commandLineBuilder); |
| 62 | } | 62 | } |
diff --git a/src/wix/WixToolset.BuildTasks/WixBuild.cs b/src/wix/WixToolset.BuildTasks/WixBuild.cs index 73da56d3..e3353b7f 100644 --- a/src/wix/WixToolset.BuildTasks/WixBuild.cs +++ b/src/wix/WixToolset.BuildTasks/WixBuild.cs | |||
| @@ -79,7 +79,7 @@ namespace WixToolset.BuildTasks | |||
| 79 | commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); | 79 | commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); |
| 80 | commandLineBuilder.AppendSwitchIfNotNull("-trackingfile ", this.BindTrackingFile); | 80 | commandLineBuilder.AppendSwitchIfNotNull("-trackingfile ", this.BindTrackingFile); |
| 81 | commandLineBuilder.AppendSwitchIfNotNull("-defaultcompressionlevel ", this.DefaultCompressionLevel); | 81 | commandLineBuilder.AppendSwitchIfNotNull("-defaultcompressionlevel ", this.DefaultCompressionLevel); |
| 82 | commandLineBuilder.AppendSwitchIfNotNull("-acceptEula ", this.AcceptEula); | 82 | commandLineBuilder.AppendTextAsArray("-acceptEula ", this.AcceptEula); |
| 83 | 83 | ||
| 84 | base.BuildCommandLine(commandLineBuilder); | 84 | base.BuildCommandLine(commandLineBuilder); |
| 85 | 85 | ||
diff --git a/src/wix/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs b/src/wix/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs index 4a08ff63..970928f5 100644 --- a/src/wix/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs +++ b/src/wix/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs | |||
| @@ -17,7 +17,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 17 | internal class ExtensionManager : IExtensionManager | 17 | internal class ExtensionManager : IExtensionManager |
| 18 | { | 18 | { |
| 19 | // This value needs to stay in sync with the Property in "wix.props" with the same name. | 19 | // This value needs to stay in sync with the Property in "wix.props" with the same name. |
| 20 | private const string WixToolsetExtensionPackageFolder = "wixext6"; | 20 | private const string WixToolsetExtensionPackageFolder = "wixext7"; |
| 21 | 21 | ||
| 22 | private const string UserWixFolderName = ".wix"; | 22 | private const string UserWixFolderName = ".wix"; |
| 23 | private const string MachineWixFolderName = "WixToolset"; | 23 | private const string MachineWixFolderName = "WixToolset"; |
diff --git a/src/wix/WixToolset.Sdk/tools/wix.props b/src/wix/WixToolset.Sdk/tools/wix.props index a7239225..dde51e8a 100644 --- a/src/wix/WixToolset.Sdk/tools/wix.props +++ b/src/wix/WixToolset.Sdk/tools/wix.props | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | <WixToolsetPatchVersion>$$WixToolsetPatchVersion$$</WixToolsetPatchVersion> | 9 | <WixToolsetPatchVersion>$$WixToolsetPatchVersion$$</WixToolsetPatchVersion> |
| 10 | <WixToolsetMajorMinorVersion>$$WixToolsetMajorMinorVersion$$</WixToolsetMajorMinorVersion> | 10 | <WixToolsetMajorMinorVersion>$$WixToolsetMajorMinorVersion$$</WixToolsetMajorMinorVersion> |
| 11 | <WixToolsetVersion>$$WixToolsetVersion$$</WixToolsetVersion> | 11 | <WixToolsetVersion>$$WixToolsetVersion$$</WixToolsetVersion> |
| 12 | <WixToolsetExtensionPackageFolder>wixext6</WixToolsetExtensionPackageFolder> | 12 | <WixToolsetExtensionPackageFolder>wixext7</WixToolsetExtensionPackageFolder> |
| 13 | </PropertyGroup> | 13 | </PropertyGroup> |
| 14 | 14 | ||
| 15 | <ImportGroup> | 15 | <ImportGroup> |
diff --git a/src/wix/WixToolset.Sdk/tools/wix.targets b/src/wix/WixToolset.Sdk/tools/wix.targets index ec20c404..2dcfd0e9 100644 --- a/src/wix/WixToolset.Sdk/tools/wix.targets +++ b/src/wix/WixToolset.Sdk/tools/wix.targets | |||
| @@ -697,7 +697,10 @@ | |||
| 697 | <_WixBuildCabinetCachePath Condition=" '$(CabinetCachePath)'!='' ">$([MSBuild]::NormalizeDirectory($(CabinetCachePath), %(CultureGroup.OutputFolder)))</_WixBuildCabinetCachePath> | 697 | <_WixBuildCabinetCachePath Condition=" '$(CabinetCachePath)'!='' ">$([MSBuild]::NormalizeDirectory($(CabinetCachePath), %(CultureGroup.OutputFolder)))</_WixBuildCabinetCachePath> |
| 698 | </PropertyGroup> | 698 | </PropertyGroup> |
| 699 | 699 | ||
| 700 | <Warning Text="@(UnsupportedWixExtension->'%(Identity)') does not have support for WiX Toolset v$(WixToolsetVersion)." | 700 | <Warning |
| 701 | Text="The WiX Extension '%(UnsupportedWixExtension.Identity)' does not support WiX Toolset v$(WixToolsetVersion). Check the Version of the PackageReference for '%(UnsupportedWixExtension.Identity)' in your project and ensure it supports WiX v$(WixToolsetVersion)." | ||
| 702 | Code="WIX1031" | ||
| 703 | File="$(MSBuildProjectFile)" | ||
| 701 | Condition=" '@(UnsupportedWixExtension)' != '' "/> | 704 | Condition=" '@(UnsupportedWixExtension)' != '' "/> |
| 702 | 705 | ||
| 703 | <WixBuild | 706 | <WixBuild |
diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MultiTargetingWixlib/PackageUsingExplicitProperties/PackageUsingExplicitProperties.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiTargetingWixlib/PackageUsingExplicitProperties/PackageUsingExplicitProperties.wixproj index d93d9e3e..84d0db4d 100644 --- a/src/wix/test/WixToolsetTest.Sdk/TestData/MultiTargetingWixlib/PackageUsingExplicitProperties/PackageUsingExplicitProperties.wixproj +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiTargetingWixlib/PackageUsingExplicitProperties/PackageUsingExplicitProperties.wixproj | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | <Import Project="$(WixMSBuildProps)" /> | 3 | <Import Project="$(WixMSBuildProps)" /> |
| 4 | 4 | ||
| 5 | <PropertyGroup> | 5 | <PropertyGroup> |
| 6 | <!-- Add some random EULA Ids for testing purposes. --> | ||
| 6 | <AcceptEula>foo;wix7;bar</AcceptEula> | 7 | <AcceptEula>foo;wix7;bar</AcceptEula> |
| 7 | </PropertyGroup> | 8 | </PropertyGroup> |
| 8 | 9 | ||
