diff options
Diffstat (limited to '')
4 files changed, 47 insertions, 5 deletions
diff --git a/src/ext/NetFx/wixlib/NetCoreShared.wxs b/src/ext/NetFx/wixlib/NetCoreShared.wxs index 0332041a..2045a5b9 100644 --- a/src/ext/NetFx/wixlib/NetCoreShared.wxs +++ b/src/ext/NetFx/wixlib/NetCoreShared.wxs | |||
| @@ -1,6 +1,5 @@ | |||
| 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 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> |
| 5 | 4 | ||
| 6 | <?foreach PLATFORM in x86;x64?> | 5 | <?foreach PLATFORM in x86;x64?> |
diff --git a/src/wix/WixToolset.Core/Compile/CompilerPayload.cs b/src/wix/WixToolset.Core/Compile/CompilerPayload.cs index a83f1d8b..e3dfc342 100644 --- a/src/wix/WixToolset.Core/Compile/CompilerPayload.cs +++ b/src/wix/WixToolset.Core/Compile/CompilerPayload.cs | |||
| @@ -115,22 +115,22 @@ namespace WixToolset.Core | |||
| 115 | 115 | ||
| 116 | if (!String.IsNullOrEmpty(this.Description)) | 116 | if (!String.IsNullOrEmpty(this.Description)) |
| 117 | { | 117 | { |
| 118 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Description", "SourceFile")); | 118 | this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(this.SourceLineNumbers, this.Element.Name.LocalName, "Description", "Hash", "CertificatePublicKey")); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | if (!String.IsNullOrEmpty(this.ProductName)) | 121 | if (!String.IsNullOrEmpty(this.ProductName)) |
| 122 | { | 122 | { |
| 123 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "ProductName", "SourceFile")); | 123 | this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(this.SourceLineNumbers, this.Element.Name.LocalName, "ProductName", "Hash", "CertificatePublicKey")); |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | if (this.Size.HasValue) | 126 | if (this.Size.HasValue) |
| 127 | { | 127 | { |
| 128 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Size", "SourceFile")); | 128 | this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(this.SourceLineNumbers, this.Element.Name.LocalName, "Size", "Hash", "CertificatePublicKey")); |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | if (!String.IsNullOrEmpty(this.Version)) | 131 | if (!String.IsNullOrEmpty(this.Version)) |
| 132 | { | 132 | { |
| 133 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Version", "SourceFile")); | 133 | this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(this.SourceLineNumbers, this.Element.Name.LocalName, "Version", "Hash", "CertificatePublicKey")); |
| 134 | } | 134 | } |
| 135 | } | 135 | } |
| 136 | else | 136 | else |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs index 647a5386..882a7861 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs | |||
| @@ -469,5 +469,35 @@ namespace WixToolsetTest.CoreIntegration | |||
| 469 | Assert.Equal(10, result.ExitCode); | 469 | Assert.Equal(10, result.ExitCode); |
| 470 | } | 470 | } |
| 471 | } | 471 | } |
| 472 | |||
| 473 | [Fact] | ||
| 474 | public void CannotBuildBundleWithExePackageWithoutSourceOrHashOrCertificate() | ||
| 475 | { | ||
| 476 | var dotDatafolder = TestData.Get(@"TestData", ".Data"); | ||
| 477 | var folder = TestData.Get(@"TestData", "ExePackage"); | ||
| 478 | |||
| 479 | using (var fs = new DisposableFileSystem()) | ||
| 480 | { | ||
| 481 | var baseFolder = fs.GetFolder(); | ||
| 482 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 483 | |||
| 484 | var result = WixRunner.Execute(new[] | ||
| 485 | { | ||
| 486 | "build", | ||
| 487 | Path.Combine(folder, "ExePackageWithoutSourceHashOrCertificate.wxs"), | ||
| 488 | "-bindpath", Path.Combine(folder, "data"), | ||
| 489 | "-bindpath", dotDatafolder, | ||
| 490 | "-intermediateFolder", intermediateFolder, | ||
| 491 | "-o", Path.Combine(baseFolder, "bin", "test.exe") | ||
| 492 | }); | ||
| 493 | |||
| 494 | WixAssert.CompareLineByLine(new[] | ||
| 495 | { | ||
| 496 | "The ExePackagePayload/@Description attribute can only be specified with one of the following attributes: Hash or CertificatePublicKey present.", | ||
| 497 | "The ExePackagePayload/@Size attribute can only be specified with one of the following attributes: Hash or CertificatePublicKey present.", | ||
| 498 | "The ExePackagePayload/@Version attribute can only be specified with one of the following attributes: Hash or CertificatePublicKey present.", | ||
| 499 | }, result.Messages.Select(m => m.ToString()).ToArray()); | ||
| 500 | } | ||
| 501 | } | ||
| 472 | } | 502 | } |
| 473 | } | 503 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/ExePackage/ExePackageWithoutSourceHashOrCertificate.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/ExePackage/ExePackageWithoutSourceHashOrCertificate.wxs new file mode 100644 index 00000000..21ea3524 --- /dev/null +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/ExePackage/ExePackageWithoutSourceHashOrCertificate.wxs | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Bundle Name="BurnBundle" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="B94478B1-E1F3-4700-9CE8-6AA090854AEC"> | ||
| 3 | <BootstrapperApplication> | ||
| 4 | <BootstrapperApplicationDll SourceFile="fakeba.dll" /> | ||
| 5 | </BootstrapperApplication> | ||
| 6 | |||
| 7 | <Chain> | ||
| 8 | <ExePackage DetectCondition="DetectedTheMsu" UninstallArguments="-uninstall"> | ||
| 9 | <ExePackagePayload Name='foo.exe' DownloadUrl='http://wixtoolset.org' Description='Some description' Size='10' Version="1.2" /> | ||
| 10 | </ExePackage> | ||
| 11 | </Chain> | ||
| 12 | </Bundle> | ||
| 13 | </Wix> | ||
