diff options
author | Rob Mensching <rob@firegiant.com> | 2023-03-09 04:13:27 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2023-03-09 06:17:00 -0700 |
commit | a14cb82fcca0b5522dfefe862493ad2e51240a84 (patch) | |
tree | df1c50db7bf25f67d7b494aa8f5b4c87601652ee | |
parent | 3efe3f3a8682f333741b3c52e10eea2297f43dc9 (diff) | |
download | wix-a14cb82fcca0b5522dfefe862493ad2e51240a84.tar.gz wix-a14cb82fcca0b5522dfefe862493ad2e51240a84.tar.bz2 wix-a14cb82fcca0b5522dfefe862493ad2e51240a84.zip |
Warn on mismatched output times and validate only Windows Installer databases
Fixes 7250
6 files changed, 22 insertions, 11 deletions
diff --git a/src/api/wix/WixToolset.Data/WarningMessages.cs b/src/api/wix/WixToolset.Data/WarningMessages.cs index 65716ba7..7659b4e5 100644 --- a/src/api/wix/WixToolset.Data/WarningMessages.cs +++ b/src/api/wix/WixToolset.Data/WarningMessages.cs | |||
@@ -613,9 +613,9 @@ namespace WixToolset.Data | |||
613 | return Message(sourceLineNumbers, Ids.UnclearShortcut, "Because it is an advertised shortcut, the target of shortcut '{0}' will be the keypath of component '{2}' rather than parent file '{1}'. To eliminate this warning, you can (1) make the Shortcut element a child of the File element that is the keypath of component '{2}', (2) make file '{1}' the keypath of component '{2}', or (3) remove the @Advertise attribute so the shortcut is a non-advertised shortcut.", shortcutId, fileId, componentId); | 613 | return Message(sourceLineNumbers, Ids.UnclearShortcut, "Because it is an advertised shortcut, the target of shortcut '{0}' will be the keypath of component '{2}' rather than parent file '{1}'. To eliminate this warning, you can (1) make the Shortcut element a child of the File element that is the keypath of component '{2}', (2) make file '{1}' the keypath of component '{2}', or (3) remove the @Advertise attribute so the shortcut is a non-advertised shortcut.", shortcutId, fileId, componentId); |
614 | } | 614 | } |
615 | 615 | ||
616 | public static Message UnexpectedEntrySection(SourceLineNumber sourceLineNumbers, string sectionType, string expectedType, string outputExtension) | 616 | public static Message UnexpectedEntrySection(SourceLineNumber sourceLineNumbers, string sectionType, string expectedType) |
617 | { | 617 | { |
618 | return Message(sourceLineNumbers, Ids.UnexpectedEntrySection, "Found mismatched entry point <{0}>. Expected <{1}> for specified output package type {2}.", sectionType, expectedType, outputExtension); | 618 | return Message(sourceLineNumbers, Ids.UnexpectedEntrySection, "Found entry point <{0}> that does not match expected <{1}> output type. Verify that your source code is correct and matches the expected output type.", sectionType, expectedType); |
619 | } | 619 | } |
620 | 620 | ||
621 | public static Message UnexpectedTableInProduct(SourceLineNumber sourceLineNumbers, string tableName) | 621 | public static Message UnexpectedTableInProduct(SourceLineNumber sourceLineNumbers, string tableName) |
diff --git a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs index f90b87f6..817ab7c9 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs | |||
@@ -301,7 +301,7 @@ namespace WixToolsetTest.Util | |||
301 | public void CanBuildModuleWithXmlConfig() | 301 | public void CanBuildModuleWithXmlConfig() |
302 | { | 302 | { |
303 | var folder = TestData.Get(@"TestData", "XmlConfigModule"); | 303 | var folder = TestData.Get(@"TestData", "XmlConfigModule"); |
304 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | 304 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }, "test.msm"); |
305 | 305 | ||
306 | var results = build.BuildAndQuery(BuildX64, "Wix4XmlConfig"); | 306 | var results = build.BuildAndQuery(BuildX64, "Wix4XmlConfig"); |
307 | WixAssert.CompareLineByLine(new[] | 307 | WixAssert.CompareLineByLine(new[] |
diff --git a/src/wix/WixToolset.Core.WindowsInstaller/CommandLine/ValidateSubcommand.cs b/src/wix/WixToolset.Core.WindowsInstaller/CommandLine/ValidateSubcommand.cs index 1294c87f..36ec0d21 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/CommandLine/ValidateSubcommand.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/CommandLine/ValidateSubcommand.cs | |||
@@ -90,7 +90,14 @@ namespace WixToolset.Core.WindowsInstaller.CommandLine | |||
90 | 90 | ||
91 | if (File.Exists(this.WixpdbPath)) | 91 | if (File.Exists(this.WixpdbPath)) |
92 | { | 92 | { |
93 | data = WindowsInstallerData.Load(this.WixpdbPath); | 93 | try |
94 | { | ||
95 | data = WindowsInstallerData.Load(this.WixpdbPath); | ||
96 | } | ||
97 | catch (ArgumentOutOfRangeException) | ||
98 | { | ||
99 | this.Messaging.Write(WindowsInstallerBackendErrors.InvalidWindowsInstallerWixpdbForValidation(this.WixpdbPath)); | ||
100 | } | ||
94 | } | 101 | } |
95 | 102 | ||
96 | var command = new ValidateDatabaseCommand(this.Messaging, this.FileSystem, this.IntermediateFolder, this.DatabasePath, data, this.CubeFiles, this.Ices, this.SuppressIces); | 103 | var command = new ValidateDatabaseCommand(this.Messaging, this.FileSystem, this.IntermediateFolder, this.DatabasePath, data, this.CubeFiles, this.Ices, this.SuppressIces); |
diff --git a/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendErrors.cs b/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendErrors.cs index ea867ea8..dbdbae0b 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendErrors.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendErrors.cs | |||
@@ -29,6 +29,11 @@ namespace WixToolset.Core.WindowsInstaller | |||
29 | return Message(originalLineNumber, Ids.InvalidModuleVersion, "The Module/@Version was not be able to be used as a four-part version. A valid four-part version has a max value of \"65535.65535.65535.65535\" and must be all numeric.", version); | 29 | return Message(originalLineNumber, Ids.InvalidModuleVersion, "The Module/@Version was not be able to be used as a four-part version. A valid four-part version has a max value of \"65535.65535.65535.65535\" and must be all numeric.", version); |
30 | } | 30 | } |
31 | 31 | ||
32 | public static Message InvalidWindowsInstallerWixpdbForValidation(string wixpdbPath) | ||
33 | { | ||
34 | return Message(null, Ids.InvalidWindowsInstallerWixpdbForValidation, "The validation .wixpdb file: {0} was not from a Windows Installer database build (.msi or .msm). Verify that the output type was actually an MSI Package or Merge Module.", wixpdbPath); | ||
35 | } | ||
36 | |||
32 | public static Message UnknownDecompileType(string decompileType, string filePath) | 37 | public static Message UnknownDecompileType(string decompileType, string filePath) |
33 | { | 38 | { |
34 | return Message(null, Ids.UnknownDecompileType, "Unknown decompile type '{0}' from input: {1}", decompileType, filePath); | 39 | return Message(null, Ids.UnknownDecompileType, "Unknown decompile type '{0}' from input: {1}", decompileType, filePath); |
@@ -52,6 +57,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
52 | ExceededMaximumAllowedFeatureDepthInMsi = 7503, | 57 | ExceededMaximumAllowedFeatureDepthInMsi = 7503, |
53 | UnknownDecompileType = 7504, | 58 | UnknownDecompileType = 7504, |
54 | UnknownValidationTargetFileExtension = 7505, | 59 | UnknownValidationTargetFileExtension = 7505, |
60 | InvalidWindowsInstallerWixpdbForValidation = 7506, | ||
55 | } // last available is 7999. 8000 is BurnBackendErrors. | 61 | } // last available is 7999. 8000 is BurnBackendErrors. |
56 | } | 62 | } |
57 | } | 63 | } |
diff --git a/src/wix/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs b/src/wix/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs index 426718b6..908476db 100644 --- a/src/wix/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs +++ b/src/wix/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs | |||
@@ -60,12 +60,10 @@ namespace WixToolset.Core.Link | |||
60 | // Try to find the one and only entry section. | 60 | // Try to find the one and only entry section. |
61 | if (SectionType.Package == section.Type || SectionType.Module == section.Type || SectionType.PatchCreation == section.Type || SectionType.Patch == section.Type || SectionType.Bundle == section.Type) | 61 | if (SectionType.Package == section.Type || SectionType.Module == section.Type || SectionType.PatchCreation == section.Type || SectionType.Patch == section.Type || SectionType.Bundle == section.Type) |
62 | { | 62 | { |
63 | // TODO: remove this? | 63 | if (SectionType.Unknown != expectedEntrySectionType && section.Type != expectedEntrySectionType) |
64 | //if (SectionType.Unknown != expectedEntrySectionType && section.Type != expectedEntrySectionType) | 64 | { |
65 | //{ | 65 | this.Messaging.Write(WarningMessages.UnexpectedEntrySection(section.Symbols.FirstOrDefault()?.SourceLineNumbers, section.Type.ToString(), expectedEntrySectionType.ToString())); |
66 | // string outputExtension = Output.GetExtension(this.ExpectedOutputType); | 66 | } |
67 | // this.Messaging.Write(WixWarnings.UnexpectedEntrySection(section.SourceLineNumbers, section.Type.ToString(), expectedEntrySectionType.ToString(), outputExtension)); | ||
68 | //} | ||
69 | 67 | ||
70 | if (null == this.EntrySection) | 68 | if (null == this.EntrySection) |
71 | { | 69 | { |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ClassFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ClassFixture.cs index 43f3b110..1f286ac6 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ClassFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ClassFixture.cs | |||
@@ -120,7 +120,7 @@ namespace WixToolsetTest.CoreIntegration | |||
120 | { | 120 | { |
121 | var baseFolder = fs.GetFolder(); | 121 | var baseFolder = fs.GetFolder(); |
122 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 122 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
123 | var msiPath = Path.Combine(baseFolder, @"bin", "test.msi"); | 123 | var msiPath = Path.Combine(baseFolder, @"bin", "test.msm"); |
124 | 124 | ||
125 | var result = WixRunner.Execute(new[] | 125 | var result = WixRunner.Execute(new[] |
126 | { | 126 | { |