aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBevan Weiss <bevan.weiss@gmail.com>2024-07-20 13:39:08 +1000
committerRob Mensching <rob@firegiant.com>2024-12-26 06:40:14 -0800
commit1afc0bd5592ecf6e6547f36cfef25127b586f4c3 (patch)
tree975eb4fa3e89d052ab91dd324d0aa0604847a477
parentf440fb317c630e7bc6d4ee4d657a200654e2f876 (diff)
downloadwix-1afc0bd5592ecf6e6547f36cfef25127b586f4c3.tar.gz
wix-1afc0bd5592ecf6e6547f36cfef25127b586f4c3.tar.bz2
wix-1afc0bd5592ecf6e6547f36cfef25127b586f4c3.zip
Introduce early exception for overlength Windows Installer table name
Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
-rw-r--r--src/api/wix/WixToolset.Data/ErrorMessages.cs6
-rw-r--r--src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs14
2 files changed, 20 insertions, 0 deletions
diff --git a/src/api/wix/WixToolset.Data/ErrorMessages.cs b/src/api/wix/WixToolset.Data/ErrorMessages.cs
index d604e94f..f9a7d66d 100644
--- a/src/api/wix/WixToolset.Data/ErrorMessages.cs
+++ b/src/api/wix/WixToolset.Data/ErrorMessages.cs
@@ -2266,6 +2266,11 @@ namespace WixToolset.Data
2266 return Message(sourceLineNumbers, Ids.IllegalAttributeWhenNested, "The File element contains an attribute '{0}' that cannot be used in a File element that is a child of a Component element.", attributeName); 2266 return Message(sourceLineNumbers, Ids.IllegalAttributeWhenNested, "The File element contains an attribute '{0}' that cannot be used in a File element that is a child of a Component element.", attributeName);
2267 } 2267 }
2268 2268
2269 public static Message OverlengthTableNameInProductOrMergeModule(SourceLineNumber sourceLineNumbers, string tableName)
2270 {
2271 return Message(sourceLineNumbers, Ids.OverlengthTableNameInProductOrMergeModule, "The table name '{0}' is invalid because the table name exceeds 31 characters in length. For more information, see: https://learn.microsoft.com/en-au/windows/win32/msi/table-names", tableName);
2272 }
2273
2269 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) 2274 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
2270 { 2275 {
2271 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); 2276 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
@@ -2667,6 +2672,7 @@ namespace WixToolset.Data
2667 MsiTransactionInvalidPackage2 = 412, 2672 MsiTransactionInvalidPackage2 = 412,
2668 ExpectedAttributeOrElementWithOtherAttribute = 413, 2673 ExpectedAttributeOrElementWithOtherAttribute = 413,
2669 ExpectedAttributeOrElementWithoutOtherAttribute = 414, 2674 ExpectedAttributeOrElementWithoutOtherAttribute = 414,
2675 OverlengthTableNameInProductOrMergeModule = 415
2670 } 2676 }
2671 } 2677 }
2672} 2678}
diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs b/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs
index cd366883..eb0c69c6 100644
--- a/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs
+++ b/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs
@@ -1447,6 +1447,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1447 this.Messaging.Write(WarningMessages.DangerousTableInMergeModule(row.SourceLineNumbers, table.Name)); 1447 this.Messaging.Write(WarningMessages.DangerousTableInMergeModule(row.SourceLineNumbers, table.Name));
1448 } 1448 }
1449 } 1449 }
1450 else if (31 < table.Name.Length)
1451 {
1452 foreach (var row in table.Rows)
1453 {
1454 this.Messaging.Write(ErrorMessages.OverlengthTableNameInProductOrMergeModule(row.SourceLineNumbers, table.Name));
1455 }
1456 }
1450 break; 1457 break;
1451 1458
1452 case OutputType.PatchCreation: 1459 case OutputType.PatchCreation:
@@ -1506,6 +1513,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1506 this.Messaging.Write(WarningMessages.UnexpectedTableInProduct(row.SourceLineNumbers, table.Name)); 1513 this.Messaging.Write(WarningMessages.UnexpectedTableInProduct(row.SourceLineNumbers, table.Name));
1507 } 1514 }
1508 } 1515 }
1516 else if (31 < table.Name.Length)
1517 {
1518 foreach (var row in table.Rows)
1519 {
1520 this.Messaging.Write(ErrorMessages.OverlengthTableNameInProductOrMergeModule(row.SourceLineNumbers, table.Name));
1521 }
1522 }
1509 break; 1523 break;
1510 } 1524 }
1511 } 1525 }