aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2026-01-07 01:28:43 -0800
committerRob Mensching <rob@firegiant.com>2026-01-07 16:15:16 -0800
commit130bbb7be53435479203209ec713f6cd9c9d1b45 (patch)
tree589ccba3dc564f6ceff776b926548e632f8f61b2 /src
parentdb560a43d6f6e6749a212ceca262ad5e6eec85fd (diff)
downloadwix-130bbb7be53435479203209ec713f6cd9c9d1b45.tar.gz
wix-130bbb7be53435479203209ec713f6cd9c9d1b45.tar.bz2
wix-130bbb7be53435479203209ec713f6cd9c9d1b45.zip
Prevent crashes when there is an error when parsing File element
Diffstat (limited to 'src')
-rw-r--r--src/wix/WixToolset.Core/Compiler.cs5183
1 files changed, 2593 insertions, 2590 deletions
diff --git a/src/wix/WixToolset.Core/Compiler.cs b/src/wix/WixToolset.Core/Compiler.cs
index 9bcdca4a..3a703fb7 100644
--- a/src/wix/WixToolset.Core/Compiler.cs
+++ b/src/wix/WixToolset.Core/Compiler.cs
@@ -185,12 +185,12 @@ namespace WixToolset.Core
185 { 185 {
186 switch (attrib.Name.LocalName) 186 switch (attrib.Name.LocalName)
187 { 187 {
188 case "RequiredVersion": 188 case "RequiredVersion":
189 requiredVersion = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib); 189 requiredVersion = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib);
190 break; 190 break;
191 default: 191 default:
192 this.Core.UnexpectedAttribute(node, attrib); 192 this.Core.UnexpectedAttribute(node, attrib);
193 break; 193 break;
194 } 194 }
195 } 195 }
196 else 196 else
@@ -210,27 +210,27 @@ namespace WixToolset.Core
210 { 210 {
211 switch (child.Name.LocalName) 211 switch (child.Name.LocalName)
212 { 212 {
213 case "Bundle": 213 case "Bundle":
214 this.ParseBundleElement(child); 214 this.ParseBundleElement(child);
215 break; 215 break;
216 case "Fragment": 216 case "Fragment":
217 this.ParseFragmentElement(child); 217 this.ParseFragmentElement(child);
218 break; 218 break;
219 case "Module": 219 case "Module":
220 this.ParseModuleElement(child); 220 this.ParseModuleElement(child);
221 break; 221 break;
222 case "PatchCreation": 222 case "PatchCreation":
223 this.Core.Write(CompilerWarnings.PatchCreationDeprecated(sourceLineNumbers)); 223 this.Core.Write(CompilerWarnings.PatchCreationDeprecated(sourceLineNumbers));
224 break; 224 break;
225 case "Package": 225 case "Package":
226 this.ParsePackageElement(child); 226 this.ParsePackageElement(child);
227 break; 227 break;
228 case "Patch": 228 case "Patch":
229 this.ParsePatchElement(child); 229 this.ParsePatchElement(child);
230 break; 230 break;
231 default: 231 default:
232 this.Core.UnexpectedElement(node, child); 232 this.Core.UnexpectedElement(node, child);
233 break; 233 break;
234 } 234 }
235 } 235 }
236 else 236 else
@@ -472,36 +472,36 @@ namespace WixToolset.Core
472 { 472 {
473 switch (attrib.Name.LocalName) 473 switch (attrib.Name.LocalName)
474 { 474 {
475 case "Id": 475 case "Id":
476 appId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 476 appId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
477 break; 477 break;
478 case "ActivateAtStorage": 478 case "ActivateAtStorage":
479 activateAtStorage = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 479 activateAtStorage = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
480 break; 480 break;
481 case "Advertise": 481 case "Advertise":
482 appIdAdvertise = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 482 appIdAdvertise = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
483 break; 483 break;
484 case "Description": 484 case "Description":
485 description = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 485 description = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
486 break; 486 break;
487 case "DllSurrogate": 487 case "DllSurrogate":
488 dllSurrogate = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); 488 dllSurrogate = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty);
489 break; 489 break;
490 case "LocalService": 490 case "LocalService":
491 localService = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 491 localService = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
492 break; 492 break;
493 case "RemoteServerName": 493 case "RemoteServerName":
494 remoteServerName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 494 remoteServerName = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
495 break; 495 break;
496 case "RunAsInteractiveUser": 496 case "RunAsInteractiveUser":
497 runAsInteractiveUser = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 497 runAsInteractiveUser = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
498 break; 498 break;
499 case "ServiceParameters": 499 case "ServiceParameters":
500 serviceParameters = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 500 serviceParameters = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
501 break; 501 break;
502 default: 502 default:
503 this.Core.UnexpectedAttribute(node, attrib); 503 this.Core.UnexpectedAttribute(node, attrib);
504 break; 504 break;
505 } 505 }
506 } 506 }
507 else 507 else
@@ -536,12 +536,12 @@ namespace WixToolset.Core
536 { 536 {
537 switch (child.Name.LocalName) 537 switch (child.Name.LocalName)
538 { 538 {
539 case "Class": 539 case "Class":
540 this.ParseClassElement(child, componentId, advertise, fileServer, typeLibId, typeLibVersion, appId); 540 this.ParseClassElement(child, componentId, advertise, fileServer, typeLibId, typeLibVersion, appId);
541 break; 541 break;
542 default: 542 default:
543 this.Core.UnexpectedElement(node, child); 543 this.Core.UnexpectedElement(node, child);
544 break; 544 break;
545 } 545 }
546 } 546 }
547 else 547 else
@@ -631,15 +631,15 @@ namespace WixToolset.Core
631 { 631 {
632 switch (attrib.Name.LocalName) 632 switch (attrib.Name.LocalName)
633 { 633 {
634 case "Id": 634 case "Id":
635 id = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 635 id = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
636 break; 636 break;
637 case "Value": 637 case "Value":
638 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 638 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
639 break; 639 break;
640 default: 640 default:
641 this.Core.UnexpectedAttribute(node, attrib); 641 this.Core.UnexpectedAttribute(node, attrib);
642 break; 642 break;
643 } 643 }
644 } 644 }
645 else 645 else
@@ -684,18 +684,18 @@ namespace WixToolset.Core
684 { 684 {
685 switch (attrib.Name.LocalName) 685 switch (attrib.Name.LocalName)
686 { 686 {
687 case "Id": 687 case "Id":
688 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 688 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
689 break; 689 break;
690 case "SourceFile": 690 case "SourceFile":
691 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 691 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
692 break; 692 break;
693 case "SuppressModularization": 693 case "SuppressModularization":
694 suppressModularization = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 694 suppressModularization = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
695 break; 695 break;
696 default: 696 default:
697 this.Core.UnexpectedAttribute(node, attrib); 697 this.Core.UnexpectedAttribute(node, attrib);
698 break; 698 break;
699 } 699 }
700 } 700 }
701 else 701 else
@@ -767,15 +767,15 @@ namespace WixToolset.Core
767 { 767 {
768 switch (attrib.Name.LocalName) 768 switch (attrib.Name.LocalName)
769 { 769 {
770 case "Id": 770 case "Id":
771 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 771 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
772 break; 772 break;
773 case "SourceFile": 773 case "SourceFile":
774 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 774 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
775 break; 775 break;
776 default: 776 default:
777 this.Core.UnexpectedAttribute(node, attrib); 777 this.Core.UnexpectedAttribute(node, attrib);
778 break; 778 break;
779 } 779 }
780 } 780 }
781 else 781 else
@@ -837,13 +837,13 @@ namespace WixToolset.Core
837 { 837 {
838 switch (attrib.Name.LocalName) 838 switch (attrib.Name.LocalName)
839 { 839 {
840 case "Property": 840 case "Property":
841 property = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 841 property = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
842 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Property, property); 842 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Property, property);
843 break; 843 break;
844 default: 844 default:
845 this.Core.UnexpectedAttribute(node, attrib); 845 this.Core.UnexpectedAttribute(node, attrib);
846 break; 846 break;
847 } 847 }
848 } 848 }
849 else 849 else
@@ -864,12 +864,12 @@ namespace WixToolset.Core
864 { 864 {
865 switch (child.Name.LocalName) 865 switch (child.Name.LocalName)
866 { 866 {
867 case "Instance": 867 case "Instance":
868 this.ParseInstanceElement(child, property); 868 this.ParseInstanceElement(child, property);
869 break; 869 break;
870 default: 870 default:
871 this.Core.UnexpectedElement(node, child); 871 this.Core.UnexpectedElement(node, child);
872 break; 872 break;
873 } 873 }
874 } 874 }
875 else 875 else
@@ -898,21 +898,21 @@ namespace WixToolset.Core
898 { 898 {
899 switch (attrib.Name.LocalName) 899 switch (attrib.Name.LocalName)
900 { 900 {
901 case "Id": 901 case "Id":
902 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 902 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
903 break; 903 break;
904 case "ProductCode": 904 case "ProductCode":
905 productCode = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, true); 905 productCode = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, true);
906 break; 906 break;
907 case "ProductName": 907 case "ProductName":
908 productName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 908 productName = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
909 break; 909 break;
910 case "UpgradeCode": 910 case "UpgradeCode":
911 upgradeCode = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 911 upgradeCode = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
912 break; 912 break;
913 default: 913 default:
914 this.Core.UnexpectedAttribute(node, attrib); 914 this.Core.UnexpectedAttribute(node, attrib);
915 break; 915 break;
916 } 916 }
917 } 917 }
918 else 918 else
@@ -964,22 +964,22 @@ namespace WixToolset.Core
964 { 964 {
965 switch (attrib.Name.LocalName) 965 switch (attrib.Name.LocalName)
966 { 966 {
967 case "Id": 967 case "Id":
968 id = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 968 id = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
969 break; 969 break;
970 case "AppData": 970 case "AppData":
971 appData = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 971 appData = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
972 break; 972 break;
973 case "Feature": 973 case "Feature":
974 feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 974 feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
975 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Feature, feature); 975 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Feature, feature);
976 break; 976 break;
977 case "Qualifier": 977 case "Qualifier":
978 qualifier = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 978 qualifier = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
979 break; 979 break;
980 default: 980 default:
981 this.Core.UnexpectedAttribute(node, attrib); 981 this.Core.UnexpectedAttribute(node, attrib);
982 break; 982 break;
983 } 983 }
984 } 984 }
985 else 985 else
@@ -1059,71 +1059,71 @@ namespace WixToolset.Core
1059 { 1059 {
1060 switch (attrib.Name.LocalName) 1060 switch (attrib.Name.LocalName)
1061 { 1061 {
1062 case "Id": 1062 case "Id":
1063 classId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 1063 classId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
1064 break; 1064 break;
1065 case "Advertise": 1065 case "Advertise":
1066 classAdvertise = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1066 classAdvertise = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1067 break; 1067 break;
1068 case "AppId": 1068 case "AppId":
1069 appId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 1069 appId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
1070 break; 1070 break;
1071 case "Argument": 1071 case "Argument":
1072 argument = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1072 argument = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1073 break; 1073 break;
1074 case "Context": 1074 case "Context":
1075 contexts = this.Core.GetAttributeValue(sourceLineNumbers, attrib).Split("\r\n\t ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); 1075 contexts = this.Core.GetAttributeValue(sourceLineNumbers, attrib).Split("\r\n\t ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
1076 break; 1076 break;
1077 case "Control": 1077 case "Control":
1078 control = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1078 control = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1079 break; 1079 break;
1080 case "Description": 1080 case "Description":
1081 description = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1081 description = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1082 break; 1082 break;
1083 case "Handler": 1083 case "Handler":
1084 defaultInprocHandler = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1084 defaultInprocHandler = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1085 break; 1085 break;
1086 case "Icon": 1086 case "Icon":
1087 icon = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 1087 icon = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1088 break; 1088 break;
1089 case "IconIndex": 1089 case "IconIndex":
1090 iconIndex = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, Int16.MinValue + 1, Int16.MaxValue); 1090 iconIndex = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, Int16.MinValue + 1, Int16.MaxValue);
1091 break; 1091 break;
1092 case "RelativePath": 1092 case "RelativePath":
1093 relativePath = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1093 relativePath = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1094 break; 1094 break;
1095 1095
1096 // The following attributes result in rows always added to the Registry table rather than the Class table 1096 // The following attributes result in rows always added to the Registry table rather than the Class table
1097 case "Insertable": 1097 case "Insertable":
1098 insertable = (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) ? "Insertable" : "NotInsertable"; 1098 insertable = (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) ? "Insertable" : "NotInsertable";
1099 break; 1099 break;
1100 case "Programmable": 1100 case "Programmable":
1101 programmable = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1101 programmable = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1102 break; 1102 break;
1103 case "SafeForInitializing": 1103 case "SafeForInitializing":
1104 safeForInit = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1104 safeForInit = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1105 break; 1105 break;
1106 case "SafeForScripting": 1106 case "SafeForScripting":
1107 safeForScripting = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1107 safeForScripting = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1108 break; 1108 break;
1109 case "ForeignServer": 1109 case "ForeignServer":
1110 foreignServer = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1110 foreignServer = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1111 break; 1111 break;
1112 case "Server": 1112 case "Server":
1113 localFileServer = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1113 localFileServer = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1114 break; 1114 break;
1115 case "ShortPath": 1115 case "ShortPath":
1116 shortServerPath = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1116 shortServerPath = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1117 break; 1117 break;
1118 case "ThreadingModel": 1118 case "ThreadingModel":
1119 threadingModel = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1119 threadingModel = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1120 break; 1120 break;
1121 case "Version": 1121 case "Version":
1122 version = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1122 version = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1123 break; 1123 break;
1124 default: 1124 default:
1125 this.Core.UnexpectedAttribute(node, attrib); 1125 this.Core.UnexpectedAttribute(node, attrib);
1126 break; 1126 break;
1127 } 1127 }
1128 } 1128 }
1129 else 1129 else
@@ -1199,35 +1199,35 @@ namespace WixToolset.Core
1199 { 1199 {
1200 switch (child.Name.LocalName) 1200 switch (child.Name.LocalName)
1201 { 1201 {
1202 case "FileTypeMask": 1202 case "FileTypeMask":
1203 if (YesNoType.Yes == advertise) 1203 if (YesNoType.Yes == advertise)
1204 { 1204 {
1205 fileTypeMask = String.Concat(fileTypeMask, null == fileTypeMask ? String.Empty : ";", this.ParseFileTypeMaskElement(child)); 1205 fileTypeMask = String.Concat(fileTypeMask, null == fileTypeMask ? String.Empty : ";", this.ParseFileTypeMaskElement(child));
1206 } 1206 }
1207 else if (YesNoType.No == advertise) 1207 else if (YesNoType.No == advertise)
1208 { 1208 {
1209 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); 1209 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child);
1210 this.Core.CreateRegistryStringSymbol(childSourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("FileType\\", classId, "\\", fileTypeMaskIndex.ToString()), String.Empty, this.ParseFileTypeMaskElement(child), componentId); 1210 this.Core.CreateRegistryStringSymbol(childSourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("FileType\\", classId, "\\", fileTypeMaskIndex.ToString()), String.Empty, this.ParseFileTypeMaskElement(child), componentId);
1211 fileTypeMaskIndex++; 1211 fileTypeMaskIndex++;
1212 } 1212 }
1213 break; 1213 break;
1214 case "Interface": 1214 case "Interface":
1215 this.ParseInterfaceElement(child, componentId, class16bit ? classId : null, class32bit ? classId : null, typeLibId, typeLibVersion); 1215 this.ParseInterfaceElement(child, componentId, class16bit ? classId : null, class32bit ? classId : null, typeLibId, typeLibVersion);
1216 break; 1216 break;
1217 case "ProgId": 1217 case "ProgId":
1218 {
1219 var foundExtension = false;
1220 var progId = this.ParseProgIdElement(child, componentId, advertise, classId, description, null, ref foundExtension, firstProgIdForClass);
1221 if (null == defaultProgId)
1222 { 1218 {
1223 defaultProgId = progId; 1219 var foundExtension = false;
1220 var progId = this.ParseProgIdElement(child, componentId, advertise, classId, description, null, ref foundExtension, firstProgIdForClass);
1221 if (null == defaultProgId)
1222 {
1223 defaultProgId = progId;
1224 }
1225 firstProgIdForClass = YesNoType.No;
1224 } 1226 }
1225 firstProgIdForClass = YesNoType.No;
1226 }
1227 break;
1228 default:
1229 this.Core.UnexpectedElement(node, child);
1230 break; 1227 break;
1228 default:
1229 this.Core.UnexpectedElement(node, child);
1230 break;
1231 } 1231 }
1232 } 1232 }
1233 else 1233 else
@@ -1394,19 +1394,19 @@ namespace WixToolset.Core
1394 { 1394 {
1395 switch (defaultInprocHandler) // ClassId Default Inproc Handler 1395 switch (defaultInprocHandler) // ClassId Default Inproc Handler
1396 { 1396 {
1397 case "1": 1397 case "1":
1398 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler"), String.Empty, "ole2.dll", componentId); 1398 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler"), String.Empty, "ole2.dll", componentId);
1399 break; 1399 break;
1400 case "2": 1400 case "2":
1401 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler32"), String.Empty, "ole32.dll", componentId); 1401 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler32"), String.Empty, "ole32.dll", componentId);
1402 break; 1402 break;
1403 case "3": 1403 case "3":
1404 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler"), String.Empty, "ole2.dll", componentId); 1404 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler"), String.Empty, "ole2.dll", componentId);
1405 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler32"), String.Empty, "ole32.dll", componentId); 1405 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler32"), String.Empty, "ole32.dll", componentId);
1406 break; 1406 break;
1407 default: 1407 default:
1408 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler32"), String.Empty, defaultInprocHandler, componentId); 1408 this.Core.CreateRegistryStringSymbol(sourceLineNumbers, RegistryRootType.ClassesRoot, String.Concat("CLSID\\", classId, "\\InprocHandler32"), String.Empty, defaultInprocHandler, componentId);
1409 break; 1409 break;
1410 } 1410 }
1411 } 1411 }
1412 1412
@@ -1490,30 +1490,30 @@ namespace WixToolset.Core
1490 { 1490 {
1491 switch (attrib.Name.LocalName) 1491 switch (attrib.Name.LocalName)
1492 { 1492 {
1493 case "Id": 1493 case "Id":
1494 interfaceId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 1494 interfaceId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
1495 break; 1495 break;
1496 case "BaseInterface": 1496 case "BaseInterface":
1497 baseInterface = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 1497 baseInterface = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
1498 break; 1498 break;
1499 case "Name": 1499 case "Name":
1500 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1500 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1501 break; 1501 break;
1502 case "NumMethods": 1502 case "NumMethods":
1503 numMethods = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue); 1503 numMethods = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue);
1504 break; 1504 break;
1505 case "ProxyStubClassId": 1505 case "ProxyStubClassId":
1506 proxyId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib); 1506 proxyId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib);
1507 break; 1507 break;
1508 case "ProxyStubClassId32": 1508 case "ProxyStubClassId32":
1509 proxyId32 = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 1509 proxyId32 = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
1510 break; 1510 break;
1511 case "Versioned": 1511 case "Versioned":
1512 versioned = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1512 versioned = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1513 break; 1513 break;
1514 default: 1514 default:
1515 this.Core.UnexpectedAttribute(node, attrib); 1515 this.Core.UnexpectedAttribute(node, attrib);
1516 break; 1516 break;
1517 } 1517 }
1518 } 1518 }
1519 else 1519 else
@@ -1584,18 +1584,18 @@ namespace WixToolset.Core
1584 { 1584 {
1585 switch (attrib.Name.LocalName) 1585 switch (attrib.Name.LocalName)
1586 { 1586 {
1587 case "Mask": 1587 case "Mask":
1588 mask = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1588 mask = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1589 break; 1589 break;
1590 case "Offset": 1590 case "Offset":
1591 offset = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue); 1591 offset = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue);
1592 break; 1592 break;
1593 case "Value": 1593 case "Value":
1594 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1594 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1595 break; 1595 break;
1596 default: 1596 default:
1597 this.Core.UnexpectedAttribute(node, attrib); 1597 this.Core.UnexpectedAttribute(node, attrib);
1598 break; 1598 break;
1599 } 1599 }
1600 } 1600 }
1601 else 1601 else
@@ -1658,30 +1658,30 @@ namespace WixToolset.Core
1658 { 1658 {
1659 switch (attrib.Name.LocalName) 1659 switch (attrib.Name.LocalName)
1660 { 1660 {
1661 case "ExcludeLanguages": 1661 case "ExcludeLanguages":
1662 excludeLanguages = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1662 excludeLanguages = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1663 break; 1663 break;
1664 case "IncludeMaximum": 1664 case "IncludeMaximum":
1665 maxInclusive = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1665 maxInclusive = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1666 break; 1666 break;
1667 case "IncludeMinimum": 1667 case "IncludeMinimum":
1668 minInclusive = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 1668 minInclusive = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1669 break; 1669 break;
1670 case "Language": 1670 case "Language":
1671 language = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1671 language = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1672 break; 1672 break;
1673 case "Minimum": 1673 case "Minimum":
1674 minimum = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1674 minimum = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1675 break; 1675 break;
1676 case "Maximum": 1676 case "Maximum":
1677 maximum = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 1677 maximum = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1678 break; 1678 break;
1679 case "UpgradeCode": 1679 case "UpgradeCode":
1680 upgradeCode = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 1680 upgradeCode = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
1681 break; 1681 break;
1682 default: 1682 default:
1683 this.Core.UnexpectedAttribute(node, attrib); 1683 this.Core.UnexpectedAttribute(node, attrib);
1684 break; 1684 break;
1685 } 1685 }
1686 } 1686 }
1687 else 1687 else
@@ -1735,59 +1735,59 @@ namespace WixToolset.Core
1735 { 1735 {
1736 switch (attrib.Name.LocalName) 1736 switch (attrib.Name.LocalName)
1737 { 1737 {
1738 case "Id": 1738 case "Id":
1739 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 1739 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
1740 break;
1741 case "Bitness":
1742 var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1743 switch (bitnessValue)
1744 {
1745 case "always32":
1746 search64bit = false;
1747 break;
1748 case "always64":
1749 search64bit = true;
1750 break;
1751 case "default":
1752 case "":
1753 break; 1740 break;
1754 default: 1741 case "Bitness":
1755 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64")); 1742 var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1743 switch (bitnessValue)
1744 {
1745 case "always32":
1746 search64bit = false;
1747 break;
1748 case "always64":
1749 search64bit = true;
1750 break;
1751 case "default":
1752 case "":
1753 break;
1754 default:
1755 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64"));
1756 break;
1757 }
1756 break; 1758 break;
1757 } 1759 case "Key":
1758 break; 1760 key = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1759 case "Key":
1760 key = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1761 break;
1762 case "Name":
1763 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1764 break;
1765 case "Root":
1766 root = this.Core.GetAttributeRegistryRootValue(sourceLineNumbers, attrib, false);
1767 break;
1768 case "Type":
1769 var typeValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1770 switch (typeValue)
1771 {
1772 case "directory":
1773 type = RegLocatorType.Directory;
1774 break; 1761 break;
1775 case "file": 1762 case "Name":
1776 type = RegLocatorType.FileName; 1763 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1777 break; 1764 break;
1778 case "raw": 1765 case "Root":
1779 type = RegLocatorType.Raw; 1766 root = this.Core.GetAttributeRegistryRootValue(sourceLineNumbers, attrib, false);
1780 break; 1767 break;
1781 case "": 1768 case "Type":
1769 var typeValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
1770 switch (typeValue)
1771 {
1772 case "directory":
1773 type = RegLocatorType.Directory;
1774 break;
1775 case "file":
1776 type = RegLocatorType.FileName;
1777 break;
1778 case "raw":
1779 type = RegLocatorType.Raw;
1780 break;
1781 case "":
1782 break;
1783 default:
1784 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Type", typeValue, "directory", "file", "raw"));
1785 break;
1786 }
1782 break; 1787 break;
1783 default: 1788 default:
1784 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Type", typeValue, "directory", "file", "raw")); 1789 this.Core.UnexpectedAttribute(node, attrib);
1785 break; 1790 break;
1786 }
1787 break;
1788 default:
1789 this.Core.UnexpectedAttribute(node, attrib);
1790 break;
1791 } 1791 }
1792 } 1792 }
1793 else 1793 else
@@ -1824,46 +1824,46 @@ namespace WixToolset.Core
1824 { 1824 {
1825 switch (child.Name.LocalName) 1825 switch (child.Name.LocalName)
1826 { 1826 {
1827 case "DirectorySearch": 1827 case "DirectorySearch":
1828 if (oneChild) 1828 if (oneChild)
1829 { 1829 {
1830 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 1830 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
1831 } 1831 }
1832 oneChild = true; 1832 oneChild = true;
1833 1833
1834 // directorysearch parentage should work like directory element, not the rest of the signature type because of the DrLocator.Parent column 1834 // directorysearch parentage should work like directory element, not the rest of the signature type because of the DrLocator.Parent column
1835 signature = this.ParseDirectorySearchElement(child, id.Id); 1835 signature = this.ParseDirectorySearchElement(child, id.Id);
1836 break; 1836 break;
1837 case "DirectorySearchRef": 1837 case "DirectorySearchRef":
1838 if (oneChild) 1838 if (oneChild)
1839 { 1839 {
1840 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 1840 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
1841 } 1841 }
1842 oneChild = true; 1842 oneChild = true;
1843 signature = this.ParseDirectorySearchRefElement(child, id.Id); 1843 signature = this.ParseDirectorySearchRefElement(child, id.Id);
1844 break; 1844 break;
1845 case "FileSearch": 1845 case "FileSearch":
1846 if (oneChild) 1846 if (oneChild)
1847 { 1847 {
1848 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 1848 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
1849 } 1849 }
1850 oneChild = true; 1850 oneChild = true;
1851 signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet); 1851 signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet);
1852 id = new Identifier(AccessModifier.Section, signature); // FileSearch signatures override parent signatures 1852 id = new Identifier(AccessModifier.Section, signature); // FileSearch signatures override parent signatures
1853 break; 1853 break;
1854 case "FileSearchRef": 1854 case "FileSearchRef":
1855 if (oneChild) 1855 if (oneChild)
1856 { 1856 {
1857 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 1857 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
1858 } 1858 }
1859 oneChild = true; 1859 oneChild = true;
1860 var newId = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature); // FileSearch signatures override parent signatures 1860 var newId = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature); // FileSearch signatures override parent signatures
1861 id = new Identifier(AccessModifier.Section, newId); 1861 id = new Identifier(AccessModifier.Section, newId);
1862 signature = null; 1862 signature = null;
1863 break; 1863 break;
1864 default: 1864 default:
1865 this.Core.UnexpectedElement(node, child); 1865 this.Core.UnexpectedElement(node, child);
1866 break; 1866 break;
1867 } 1867 }
1868 } 1868 }
1869 else 1869 else
@@ -1903,13 +1903,13 @@ namespace WixToolset.Core
1903 { 1903 {
1904 switch (attrib.Name.LocalName) 1904 switch (attrib.Name.LocalName)
1905 { 1905 {
1906 case "Id": 1906 case "Id":
1907 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 1907 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1908 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.RegLocator, id); 1908 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.RegLocator, id);
1909 break; 1909 break;
1910 default: 1910 default:
1911 this.Core.UnexpectedAttribute(node, attrib); 1911 this.Core.UnexpectedAttribute(node, attrib);
1912 break; 1912 break;
1913 } 1913 }
1914 } 1914 }
1915 else 1915 else
@@ -1944,33 +1944,33 @@ namespace WixToolset.Core
1944 { 1944 {
1945 switch (child.Name.LocalName) 1945 switch (child.Name.LocalName)
1946 { 1946 {
1947 case "ComplianceDrive": 1947 case "ComplianceDrive":
1948 signature = this.ParseComplianceDriveElement(child); 1948 signature = this.ParseComplianceDriveElement(child);
1949 break; 1949 break;
1950 case "ComponentSearch": 1950 case "ComponentSearch":
1951 signature = this.ParseComponentSearchElement(child); 1951 signature = this.ParseComponentSearchElement(child);
1952 break; 1952 break;
1953 case "DirectorySearch": 1953 case "DirectorySearch":
1954 signature = this.ParseDirectorySearchElement(child, null); 1954 signature = this.ParseDirectorySearchElement(child, null);
1955 break; 1955 break;
1956 case "DirectorySearchRef": 1956 case "DirectorySearchRef":
1957 signature = this.ParseDirectorySearchRefElement(child, null); 1957 signature = this.ParseDirectorySearchRefElement(child, null);
1958 break; 1958 break;
1959 case "IniFileSearch": 1959 case "IniFileSearch":
1960 signature = this.ParseIniFileSearchElement(child); 1960 signature = this.ParseIniFileSearchElement(child);
1961 break; 1961 break;
1962 case "ProductSearch": 1962 case "ProductSearch":
1963 // handled in ParsePropertyElement 1963 // handled in ParsePropertyElement
1964 break; 1964 break;
1965 case "RegistrySearch": 1965 case "RegistrySearch":
1966 signature = this.ParseRegistrySearchElement(child); 1966 signature = this.ParseRegistrySearchElement(child);
1967 break; 1967 break;
1968 case "RegistrySearchRef": 1968 case "RegistrySearchRef":
1969 signature = this.ParseRegistrySearchRefElement(child); 1969 signature = this.ParseRegistrySearchRefElement(child);
1970 break; 1970 break;
1971 default: 1971 default:
1972 this.Core.UnexpectedElement(node, child); 1972 this.Core.UnexpectedElement(node, child);
1973 break; 1973 break;
1974 } 1974 }
1975 } 1975 }
1976 else 1976 else
@@ -2006,25 +2006,25 @@ namespace WixToolset.Core
2006 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 2006 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
2007 switch (child.Name.LocalName) 2007 switch (child.Name.LocalName)
2008 { 2008 {
2009 case "DirectorySearch": 2009 case "DirectorySearch":
2010 if (oneChild) 2010 if (oneChild)
2011 { 2011 {
2012 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); 2012 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName));
2013 } 2013 }
2014 oneChild = true; 2014 oneChild = true;
2015 signature = this.ParseDirectorySearchElement(child, "CCP_DRIVE"); 2015 signature = this.ParseDirectorySearchElement(child, "CCP_DRIVE");
2016 break; 2016 break;
2017 case "DirectorySearchRef": 2017 case "DirectorySearchRef":
2018 if (oneChild) 2018 if (oneChild)
2019 { 2019 {
2020 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); 2020 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName));
2021 } 2021 }
2022 oneChild = true; 2022 oneChild = true;
2023 signature = this.ParseDirectorySearchRefElement(child, "CCP_DRIVE"); 2023 signature = this.ParseDirectorySearchRefElement(child, "CCP_DRIVE");
2024 break; 2024 break;
2025 default: 2025 default:
2026 this.Core.UnexpectedElement(node, child); 2026 this.Core.UnexpectedElement(node, child);
2027 break; 2027 break;
2028 } 2028 }
2029 } 2029 }
2030 else 2030 else
@@ -2055,9 +2055,9 @@ namespace WixToolset.Core
2055 { 2055 {
2056 switch (attrib.Name.LocalName) 2056 switch (attrib.Name.LocalName)
2057 { 2057 {
2058 default: 2058 default:
2059 this.Core.UnexpectedAttribute(node, attrib); 2059 this.Core.UnexpectedAttribute(node, attrib);
2060 break; 2060 break;
2061 } 2061 }
2062 } 2062 }
2063 else 2063 else
@@ -2143,103 +2143,103 @@ namespace WixToolset.Core
2143 { 2143 {
2144 switch (attrib.Name.LocalName) 2144 switch (attrib.Name.LocalName)
2145 { 2145 {
2146 case "Id": 2146 case "Id":
2147 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 2147 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
2148 break;
2149 case "Bitness":
2150 var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2151 switch (bitnessValue)
2152 {
2153 case "always32":
2154 win64 = false;
2155 break; 2148 break;
2156 case "always64": 2149 case "Bitness":
2157 win64 = true; 2150 var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2151 switch (bitnessValue)
2152 {
2153 case "always32":
2154 win64 = false;
2155 break;
2156 case "always64":
2157 win64 = true;
2158 break;
2159 case "default":
2160 case "":
2161 break;
2162 default:
2163 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64"));
2164 break;
2165 }
2158 break; 2166 break;
2159 case "default": 2167 case "ComPlusFlags":
2160 case "": 2168 comPlusBits = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
2161 break; 2169 break;
2162 default: 2170 case "DisableRegistryReflection":
2163 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64")); 2171 disableRegistryReflection = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2164 break; 2172 break;
2165 } 2173 case "Condition":
2166 break; 2174 condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2167 case "ComPlusFlags":
2168 comPlusBits = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
2169 break;
2170 case "DisableRegistryReflection":
2171 disableRegistryReflection = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2172 break;
2173 case "Condition":
2174 condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2175 break;
2176 case "Directory":
2177 directoryId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2178 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, directoryId);
2179 break;
2180 case "Subdirectory":
2181 subdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true);
2182 break;
2183 case "DiskId":
2184 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue);
2185 break;
2186 case "Feature":
2187 feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2188 break;
2189 case "Guid":
2190 guid = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, true, true);
2191 break;
2192 case "KeyPath":
2193 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
2194 {
2195 keyFound = true;
2196 keyPath = null;
2197 }
2198 break;
2199 case "Location":
2200 var locationValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2201 switch (locationValue)
2202 {
2203 case "either":
2204 location = ComponentLocation.Either;
2205 break; 2175 break;
2206 case "local": // this is the default 2176 case "Directory":
2207 location = ComponentLocation.LocalOnly; 2177 directoryId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2178 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, directoryId);
2208 break; 2179 break;
2209 case "source": 2180 case "Subdirectory":
2210 location = ComponentLocation.SourceOnly; 2181 subdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true);
2211 break; 2182 break;
2212 case "": 2183 case "DiskId":
2184 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue);
2185 break;
2186 case "Feature":
2187 feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2188 break;
2189 case "Guid":
2190 guid = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, true, true);
2191 break;
2192 case "KeyPath":
2193 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
2194 {
2195 keyFound = true;
2196 keyPath = null;
2197 }
2198 break;
2199 case "Location":
2200 var locationValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2201 switch (locationValue)
2202 {
2203 case "either":
2204 location = ComponentLocation.Either;
2205 break;
2206 case "local": // this is the default
2207 location = ComponentLocation.LocalOnly;
2208 break;
2209 case "source":
2210 location = ComponentLocation.SourceOnly;
2211 break;
2212 case "":
2213 break;
2214 default:
2215 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, locationValue, "either", "local", "source"));
2216 break;
2217 }
2218 break;
2219 case "MultiInstance":
2220 multiInstance = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2221 break;
2222 case "NeverOverwrite":
2223 neverOverwrite = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2224 break;
2225 case "Permanent":
2226 permanent = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2227 break;
2228 case "Shared":
2229 shared = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2230 break;
2231 case "SharedDllRefCount":
2232 sharedDllRefCount = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2233 break;
2234 case "Transitive":
2235 transitive = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2236 break;
2237 case "UninstallWhenSuperseded":
2238 uninstallWhenSuperseded = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2213 break; 2239 break;
2214 default: 2240 default:
2215 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, locationValue, "either", "local", "source")); 2241 this.Core.UnexpectedAttribute(node, attrib);
2216 break; 2242 break;
2217 }
2218 break;
2219 case "MultiInstance":
2220 multiInstance = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2221 break;
2222 case "NeverOverwrite":
2223 neverOverwrite = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2224 break;
2225 case "Permanent":
2226 permanent = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2227 break;
2228 case "Shared":
2229 shared = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2230 break;
2231 case "SharedDllRefCount":
2232 sharedDllRefCount = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2233 break;
2234 case "Transitive":
2235 transitive = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2236 break;
2237 case "UninstallWhenSuperseded":
2238 uninstallWhenSuperseded = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2239 break;
2240 default:
2241 this.Core.UnexpectedAttribute(node, attrib);
2242 break;
2243 } 2243 }
2244 } 2244 }
2245 else 2245 else
@@ -2305,113 +2305,113 @@ namespace WixToolset.Core
2305 { 2305 {
2306 switch (child.Name.LocalName) 2306 switch (child.Name.LocalName)
2307 { 2307 {
2308 case "AppId": 2308 case "AppId":
2309 this.ParseAppIdElement(child, id.Id, YesNoType.NotSet, null, null, null); 2309 this.ParseAppIdElement(child, id.Id, YesNoType.NotSet, null, null, null);
2310 break; 2310 break;
2311 case "Category": 2311 case "Category":
2312 this.ParseCategoryElement(child, id.Id); 2312 this.ParseCategoryElement(child, id.Id);
2313 break; 2313 break;
2314 case "Class": 2314 case "Class":
2315 this.ParseClassElement(child, id.Id, YesNoType.NotSet, null, null, null, null); 2315 this.ParseClassElement(child, id.Id, YesNoType.NotSet, null, null, null, null);
2316 break; 2316 break;
2317 case "CopyFile": 2317 case "CopyFile":
2318 this.ParseCopyFileElement(child, id.Id, null); 2318 this.ParseCopyFileElement(child, id.Id, null);
2319 break; 2319 break;
2320 case "CreateFolder": 2320 case "CreateFolder":
2321 var createdFolder = this.ParseCreateFolderElement(child, id.Id, directoryId, win64); 2321 var createdFolder = this.ParseCreateFolderElement(child, id.Id, directoryId, win64);
2322 break; 2322 break;
2323 case "Environment": 2323 case "Environment":
2324 this.ParseEnvironmentElement(child, id.Id); 2324 this.ParseEnvironmentElement(child, id.Id);
2325 break; 2325 break;
2326 case "Extension": 2326 case "Extension":
2327 this.ParseExtensionElement(child, id.Id, YesNoType.NotSet, null); 2327 this.ParseExtensionElement(child, id.Id, YesNoType.NotSet, null);
2328 break; 2328 break;
2329 case "File": 2329 case "File":
2330 keyPathSet = this.ParseFileElement(child, id.Id, directoryId, diskId, srcPath, out keyPossible, win64, guid); 2330 keyPathSet = this.ParseFileElement(child, id.Id, directoryId, diskId, srcPath, out keyPossible, win64, guid);
2331 keyBit = ComponentKeyPathType.File; 2331 keyBit = ComponentKeyPathType.File;
2332 files++; 2332 files++;
2333 break; 2333 break;
2334 case "IniFile": 2334 case "IniFile":
2335 this.ParseIniFileElement(child, id.Id); 2335 this.ParseIniFileElement(child, id.Id);
2336 break; 2336 break;
2337 case "Interface": 2337 case "Interface":
2338 this.ParseInterfaceElement(child, id.Id, null, null, null, null); 2338 this.ParseInterfaceElement(child, id.Id, null, null, null, null);
2339 break; 2339 break;
2340 case "IsolateComponent": 2340 case "IsolateComponent":
2341 this.ParseIsolateComponentElement(child, id.Id); 2341 this.ParseIsolateComponentElement(child, id.Id);
2342 break; 2342 break;
2343 case "ODBCDataSource": 2343 case "ODBCDataSource":
2344 keyPathSet = this.ParseODBCDataSource(child, id.Id, null, out keyPossible); 2344 keyPathSet = this.ParseODBCDataSource(child, id.Id, null, out keyPossible);
2345 keyBit = ComponentKeyPathType.OdbcDataSource; 2345 keyBit = ComponentKeyPathType.OdbcDataSource;
2346 encounteredODBCDataSource = true; 2346 encounteredODBCDataSource = true;
2347 break; 2347 break;
2348 case "ODBCDriver": 2348 case "ODBCDriver":
2349 this.ParseODBCDriverOrTranslator(child, id.Id, null, SymbolDefinitionType.ODBCDriver); 2349 this.ParseODBCDriverOrTranslator(child, id.Id, null, SymbolDefinitionType.ODBCDriver);
2350 break; 2350 break;
2351 case "ODBCTranslator": 2351 case "ODBCTranslator":
2352 this.ParseODBCDriverOrTranslator(child, id.Id, null, SymbolDefinitionType.ODBCTranslator); 2352 this.ParseODBCDriverOrTranslator(child, id.Id, null, SymbolDefinitionType.ODBCTranslator);
2353 break; 2353 break;
2354 case "ProgId": 2354 case "ProgId":
2355 var foundExtension = false; 2355 var foundExtension = false;
2356 this.ParseProgIdElement(child, id.Id, YesNoType.NotSet, null, null, null, ref foundExtension, YesNoType.NotSet); 2356 this.ParseProgIdElement(child, id.Id, YesNoType.NotSet, null, null, null, ref foundExtension, YesNoType.NotSet);
2357 break; 2357 break;
2358 case "Provides": 2358 case "Provides":
2359 if (win64) 2359 if (win64)
2360 { 2360 {
2361 this.Messaging.Write(CompilerWarnings.Win64Component(sourceLineNumbers, id.Id)); 2361 this.Messaging.Write(CompilerWarnings.Win64Component(sourceLineNumbers, id.Id));
2362 } 2362 }
2363 2363
2364 keyPathSet = this.ParseProvidesElement(child, null, id.Id, out keyPossible); 2364 keyPathSet = this.ParseProvidesElement(child, null, id.Id, out keyPossible);
2365 keyBit = ComponentKeyPathType.Registry; 2365 keyBit = ComponentKeyPathType.Registry;
2366 break; 2366 break;
2367 2367
2368 case "RegistryKey": 2368 case "RegistryKey":
2369 keyPathSet = this.ParseRegistryKeyElement(child, id.Id, null, null, win64, out keyPossible); 2369 keyPathSet = this.ParseRegistryKeyElement(child, id.Id, null, null, win64, out keyPossible);
2370 keyBit = ComponentKeyPathType.Registry; 2370 keyBit = ComponentKeyPathType.Registry;
2371 break; 2371 break;
2372 case "RegistryValue": 2372 case "RegistryValue":
2373 keyPathSet = this.ParseRegistryValueElement(child, id.Id, null, null, win64, out keyPossible); 2373 keyPathSet = this.ParseRegistryValueElement(child, id.Id, null, null, win64, out keyPossible);
2374 keyBit = ComponentKeyPathType.Registry; 2374 keyBit = ComponentKeyPathType.Registry;
2375 break; 2375 break;
2376 case "RemoveFile": 2376 case "RemoveFile":
2377 this.ParseRemoveFileElement(child, id.Id, directoryId); 2377 this.ParseRemoveFileElement(child, id.Id, directoryId);
2378 break; 2378 break;
2379 case "RemoveFolder": 2379 case "RemoveFolder":
2380 this.ParseRemoveFolderElement(child, id.Id, directoryId); 2380 this.ParseRemoveFolderElement(child, id.Id, directoryId);
2381 break; 2381 break;
2382 case "RemoveRegistryKey": 2382 case "RemoveRegistryKey":
2383 this.ParseRemoveRegistryKeyElement(child, id.Id); 2383 this.ParseRemoveRegistryKeyElement(child, id.Id);
2384 break; 2384 break;
2385 case "RemoveRegistryValue": 2385 case "RemoveRegistryValue":
2386 this.ParseRemoveRegistryValueElement(child, id.Id); 2386 this.ParseRemoveRegistryValueElement(child, id.Id);
2387 break; 2387 break;
2388 case "ReserveCost": 2388 case "ReserveCost":
2389 this.ParseReserveCostElement(child, id.Id, directoryId); 2389 this.ParseReserveCostElement(child, id.Id, directoryId);
2390 break; 2390 break;
2391 case "ServiceConfig": 2391 case "ServiceConfig":
2392 this.ParseServiceConfigElement(child, id.Id, null); 2392 this.ParseServiceConfigElement(child, id.Id, null);
2393 break; 2393 break;
2394 case "ServiceConfigFailureActions": 2394 case "ServiceConfigFailureActions":
2395 this.ParseServiceConfigFailureActionsElement(child, id.Id, null); 2395 this.ParseServiceConfigFailureActionsElement(child, id.Id, null);
2396 break; 2396 break;
2397 case "ServiceControl": 2397 case "ServiceControl":
2398 this.ParseServiceControlElement(child, id.Id); 2398 this.ParseServiceControlElement(child, id.Id);
2399 break; 2399 break;
2400 case "ServiceInstall": 2400 case "ServiceInstall":
2401 this.ParseServiceInstallElement(child, id.Id, win64); 2401 this.ParseServiceInstallElement(child, id.Id, win64);
2402 break; 2402 break;
2403 case "Shortcut": 2403 case "Shortcut":
2404 this.ParseShortcutElement(child, id.Id, node.Name.LocalName, directoryId, YesNoType.No); 2404 this.ParseShortcutElement(child, id.Id, node.Name.LocalName, directoryId, YesNoType.No);
2405 break; 2405 break;
2406 case "SymbolPath": 2406 case "SymbolPath":
2407 symbols.Add(this.ParseSymbolPathElement(child)); 2407 symbols.Add(this.ParseSymbolPathElement(child));
2408 break; 2408 break;
2409 case "TypeLib": 2409 case "TypeLib":
2410 this.ParseTypeLibElement(child, id.Id, null, win64); 2410 this.ParseTypeLibElement(child, id.Id, null, win64);
2411 break; 2411 break;
2412 default: 2412 default:
2413 this.Core.UnexpectedElement(node, child); 2413 this.Core.UnexpectedElement(node, child);
2414 break; 2414 break;
2415 } 2415 }
2416 } 2416 }
2417 else 2417 else
@@ -2605,22 +2605,22 @@ namespace WixToolset.Core
2605 { 2605 {
2606 switch (attrib.Name.LocalName) 2606 switch (attrib.Name.LocalName)
2607 { 2607 {
2608 case "Id": 2608 case "Id":
2609 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 2609 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
2610 break; 2610 break;
2611 case "Directory": 2611 case "Directory":
2612 directoryId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 2612 directoryId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2613 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, directoryId); 2613 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, directoryId);
2614 break; 2614 break;
2615 case "Subdirectory": 2615 case "Subdirectory":
2616 subdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true); 2616 subdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true);
2617 break; 2617 break;
2618 case "Source": 2618 case "Source":
2619 source = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 2619 source = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2620 break; 2620 break;
2621 default: 2621 default:
2622 this.Core.UnexpectedAttribute(node, attrib); 2622 this.Core.UnexpectedAttribute(node, attrib);
2623 break; 2623 break;
2624 } 2624 }
2625 } 2625 }
2626 else 2626 else
@@ -2648,24 +2648,24 @@ namespace WixToolset.Core
2648 { 2648 {
2649 switch (child.Name.LocalName) 2649 switch (child.Name.LocalName)
2650 { 2650 {
2651 case "ComponentGroupRef": 2651 case "ComponentGroupRef":
2652 this.ParseComponentGroupRefElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, null); 2652 this.ParseComponentGroupRefElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, null);
2653 break; 2653 break;
2654 case "ComponentRef": 2654 case "ComponentRef":
2655 this.ParseComponentRefElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, null); 2655 this.ParseComponentRefElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, null);
2656 break; 2656 break;
2657 case "Component": 2657 case "Component":
2658 this.ParseComponentElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, null, CompilerConstants.IntegerNotSet, directoryId, source); 2658 this.ParseComponentElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, null, CompilerConstants.IntegerNotSet, directoryId, source);
2659 break; 2659 break;
2660 case "File": 2660 case "File":
2661 this.ParseNakedFileElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, directoryId, source); 2661 this.ParseNakedFileElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, directoryId, source);
2662 break; 2662 break;
2663 case "Files": 2663 case "Files":
2664 this.ParseFilesElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, directoryId, source); 2664 this.ParseFilesElement(child, ComplexReferenceParentType.ComponentGroup, id.Id, directoryId, source);
2665 break; 2665 break;
2666 default: 2666 default:
2667 this.Core.UnexpectedElement(node, child); 2667 this.Core.UnexpectedElement(node, child);
2668 break; 2668 break;
2669 } 2669 }
2670 } 2670 }
2671 else 2671 else
@@ -2707,16 +2707,16 @@ namespace WixToolset.Core
2707 { 2707 {
2708 switch (attrib.Name.LocalName) 2708 switch (attrib.Name.LocalName)
2709 { 2709 {
2710 case "Id": 2710 case "Id":
2711 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 2711 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2712 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixComponentGroup, id); 2712 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixComponentGroup, id);
2713 break; 2713 break;
2714 case "Primary": 2714 case "Primary":
2715 primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 2715 primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2716 break; 2716 break;
2717 default: 2717 default:
2718 this.Core.UnexpectedAttribute(node, attrib); 2718 this.Core.UnexpectedAttribute(node, attrib);
2719 break; 2719 break;
2720 } 2720 }
2721 } 2721 }
2722 else 2722 else
@@ -2756,16 +2756,16 @@ namespace WixToolset.Core
2756 { 2756 {
2757 switch (attrib.Name.LocalName) 2757 switch (attrib.Name.LocalName)
2758 { 2758 {
2759 case "Id": 2759 case "Id":
2760 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 2760 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2761 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Component, id); 2761 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Component, id);
2762 break; 2762 break;
2763 case "Primary": 2763 case "Primary":
2764 primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 2764 primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2765 break; 2765 break;
2766 default: 2766 default:
2767 this.Core.UnexpectedAttribute(node, attrib); 2767 this.Core.UnexpectedAttribute(node, attrib);
2768 break; 2768 break;
2769 } 2769 }
2770 } 2770 }
2771 else 2771 else
@@ -2802,32 +2802,32 @@ namespace WixToolset.Core
2802 { 2802 {
2803 switch (attrib.Name.LocalName) 2803 switch (attrib.Name.LocalName)
2804 { 2804 {
2805 case "Id": 2805 case "Id":
2806 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 2806 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
2807 break;
2808 case "Guid":
2809 componentId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
2810 break;
2811 case "Type":
2812 var typeValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2813 switch (typeValue)
2814 {
2815 case "directory":
2816 type = LocatorType.Directory;
2817 break; 2807 break;
2818 case "file": 2808 case "Guid":
2819 type = LocatorType.Filename; 2809 componentId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
2820 break; 2810 break;
2821 case "": 2811 case "Type":
2812 var typeValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2813 switch (typeValue)
2814 {
2815 case "directory":
2816 type = LocatorType.Directory;
2817 break;
2818 case "file":
2819 type = LocatorType.Filename;
2820 break;
2821 case "":
2822 break;
2823 default:
2824 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typeValue, "directory", "file"));
2825 break;
2826 }
2822 break; 2827 break;
2823 default: 2828 default:
2824 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typeValue, "directory", "file")); 2829 this.Core.UnexpectedAttribute(node, attrib);
2825 break; 2830 break;
2826 }
2827 break;
2828 default:
2829 this.Core.UnexpectedAttribute(node, attrib);
2830 break;
2831 } 2831 }
2832 } 2832 }
2833 else 2833 else
@@ -2849,46 +2849,46 @@ namespace WixToolset.Core
2849 { 2849 {
2850 switch (child.Name.LocalName) 2850 switch (child.Name.LocalName)
2851 { 2851 {
2852 case "DirectorySearch": 2852 case "DirectorySearch":
2853 if (oneChild) 2853 if (oneChild)
2854 { 2854 {
2855 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 2855 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
2856 } 2856 }
2857 oneChild = true; 2857 oneChild = true;
2858 2858
2859 // directorysearch parentage should work like directory element, not the rest of the signature type because of the DrLocator.Parent column 2859 // directorysearch parentage should work like directory element, not the rest of the signature type because of the DrLocator.Parent column
2860 signature = this.ParseDirectorySearchElement(child, id.Id); 2860 signature = this.ParseDirectorySearchElement(child, id.Id);
2861 break; 2861 break;
2862 case "DirectorySearchRef": 2862 case "DirectorySearchRef":
2863 if (oneChild) 2863 if (oneChild)
2864 { 2864 {
2865 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 2865 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
2866 } 2866 }
2867 oneChild = true; 2867 oneChild = true;
2868 signature = this.ParseDirectorySearchRefElement(child, id.Id); 2868 signature = this.ParseDirectorySearchRefElement(child, id.Id);
2869 break; 2869 break;
2870 case "FileSearch": 2870 case "FileSearch":
2871 if (oneChild) 2871 if (oneChild)
2872 { 2872 {
2873 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 2873 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
2874 } 2874 }
2875 oneChild = true; 2875 oneChild = true;
2876 signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet); 2876 signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet);
2877 id = new Identifier(AccessModifier.Section, signature); // FileSearch signatures override parent signatures 2877 id = new Identifier(AccessModifier.Section, signature); // FileSearch signatures override parent signatures
2878 break; 2878 break;
2879 case "FileSearchRef": 2879 case "FileSearchRef":
2880 if (oneChild) 2880 if (oneChild)
2881 { 2881 {
2882 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 2882 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
2883 } 2883 }
2884 oneChild = true; 2884 oneChild = true;
2885 var newId = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature); // FileSearch signatures override parent signatures 2885 var newId = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature); // FileSearch signatures override parent signatures
2886 id = new Identifier(AccessModifier.Section, newId); 2886 id = new Identifier(AccessModifier.Section, newId);
2887 signature = null; 2887 signature = null;
2888 break; 2888 break;
2889 default: 2889 default:
2890 this.Core.UnexpectedElement(node, child); 2890 this.Core.UnexpectedElement(node, child);
2891 break; 2891 break;
2892 } 2892 }
2893 } 2893 }
2894 else 2894 else
@@ -3016,52 +3016,52 @@ namespace WixToolset.Core
3016 { 3016 {
3017 switch (attrib.Name.LocalName) 3017 switch (attrib.Name.LocalName)
3018 { 3018 {
3019 case "Id": 3019 case "Id":
3020 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 3020 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
3021 break; 3021 break;
3022 case "Delete": 3022 case "Delete":
3023 delete = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 3023 delete = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3024 break; 3024 break;
3025 case "DestinationDirectory": 3025 case "DestinationDirectory":
3026 destinationDirectory = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3026 destinationDirectory = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3027 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, destinationDirectory); 3027 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, destinationDirectory);
3028 break; 3028 break;
3029 case "DestinationSubdirectory": 3029 case "DestinationSubdirectory":
3030 destinationSubdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true); 3030 destinationSubdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true);
3031 break; 3031 break;
3032 case "DestinationName": 3032 case "DestinationName":
3033 destinationName = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib); 3033 destinationName = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib);
3034 break; 3034 break;
3035 case "DestinationProperty": 3035 case "DestinationProperty":
3036 destinationProperty = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3036 destinationProperty = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3037 break; 3037 break;
3038 case "DestinationShortName": 3038 case "DestinationShortName":
3039 destinationShortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib); 3039 destinationShortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib);
3040 break; 3040 break;
3041 case "FileId": 3041 case "FileId":
3042 if (null != fileId) 3042 if (null != fileId)
3043 { 3043 {
3044 this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); 3044 this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName));
3045 } 3045 }
3046 fileId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3046 fileId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3047 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, fileId); 3047 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, fileId);
3048 break; 3048 break;
3049 case "SourceDirectory": 3049 case "SourceDirectory":
3050 sourceDirectory = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3050 sourceDirectory = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3051 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, sourceDirectory); 3051 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, sourceDirectory);
3052 break; 3052 break;
3053 case "SourceSubdirectory": 3053 case "SourceSubdirectory":
3054 sourceSubdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true); 3054 sourceSubdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true);
3055 break; 3055 break;
3056 case "SourceName": 3056 case "SourceName":
3057 sourceName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 3057 sourceName = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3058 break; 3058 break;
3059 case "SourceProperty": 3059 case "SourceProperty":
3060 sourceProperty = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3060 sourceProperty = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3061 break; 3061 break;
3062 default: 3062 default:
3063 this.Core.UnexpectedAttribute(node, attrib); 3063 this.Core.UnexpectedAttribute(node, attrib);
3064 break; 3064 break;
3065 } 3065 }
3066 } 3066 }
3067 else 3067 else
@@ -3203,233 +3203,233 @@ namespace WixToolset.Core
3203 { 3203 {
3204 switch (attrib.Name.LocalName) 3204 switch (attrib.Name.LocalName)
3205 { 3205 {
3206 case "Id": 3206 case "Id":
3207 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 3207 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
3208 break;
3209 case "BinaryRef":
3210 if (null != source)
3211 {
3212 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryRef", "Directory", "FileRef", "Property", "Script"));
3213 }
3214 source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3215 sourceType = CustomActionSourceType.Binary;
3216 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Binary, source); // add a reference to the appropriate Binary
3217 break;
3218 case "Bitness":
3219 var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3220 switch (bitnessValue)
3221 {
3222 case "always32":
3223 explicitWin64 = true;
3224 win64 = false;
3225 break;
3226 case "always64":
3227 explicitWin64 = true;
3228 win64 = true;
3229 break;
3230 case "default":
3231 case "":
3232 break;
3233 default:
3234 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64"));
3235 break; 3208 break;
3236 } 3209 case "BinaryRef":
3237 break; 3210 if (null != source)
3238 case "Directory": 3211 {
3239 if (null != source) 3212 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryRef", "Directory", "FileRef", "Property", "Script"));
3240 { 3213 }
3241 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileRef", "Property", "Script")); 3214 source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3242 } 3215 sourceType = CustomActionSourceType.Binary;
3243 source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3216 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Binary, source); // add a reference to the appropriate Binary
3244 sourceType = CustomActionSourceType.Directory;
3245 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, source);
3246 break;
3247 case "DllEntry":
3248 if (null != target)
3249 {
3250 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3251 }
3252 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3253 targetType = CustomActionTargetType.Dll;
3254 break;
3255 case "Error":
3256 if (null != target)
3257 {
3258 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3259 }
3260 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3261 sourceType = CustomActionSourceType.File;
3262 targetType = CustomActionTargetType.TextData;
3263
3264 // The target can be either a formatted error string or a literal
3265 // error number. Try to convert to error number to determine whether
3266 // to add a reference. No need to look at the value.
3267 if (Int32.TryParse(target, out var ignored))
3268 {
3269 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Error, target);
3270 }
3271 break;
3272 case "ExeCommand":
3273 if (null != target)
3274 {
3275 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3276 }
3277 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid
3278 targetType = CustomActionTargetType.Exe;
3279 break;
3280 case "Execute":
3281 var execute = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3282 switch (execute)
3283 {
3284 case "commit":
3285 executionType = CustomActionExecutionType.Commit;
3286 break; 3217 break;
3287 case "deferred": 3218 case "Bitness":
3288 executionType = CustomActionExecutionType.Deferred; 3219 var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3220 switch (bitnessValue)
3221 {
3222 case "always32":
3223 explicitWin64 = true;
3224 win64 = false;
3225 break;
3226 case "always64":
3227 explicitWin64 = true;
3228 win64 = true;
3229 break;
3230 case "default":
3231 case "":
3232 break;
3233 default:
3234 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64"));
3235 break;
3236 }
3289 break; 3237 break;
3290 case "firstSequence": 3238 case "Directory":
3291 executionType = CustomActionExecutionType.FirstSequence; 3239 if (null != source)
3240 {
3241 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileRef", "Property", "Script"));
3242 }
3243 source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3244 sourceType = CustomActionSourceType.Directory;
3245 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, source);
3292 break; 3246 break;
3293 case "immediate": 3247 case "DllEntry":
3294 executionType = CustomActionExecutionType.Immediate; 3248 if (null != target)
3249 {
3250 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3251 }
3252 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3253 targetType = CustomActionTargetType.Dll;
3295 break; 3254 break;
3296 case "oncePerProcess": 3255 case "Error":
3297 executionType = CustomActionExecutionType.OncePerProcess; 3256 if (null != target)
3257 {
3258 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3259 }
3260 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3261 sourceType = CustomActionSourceType.File;
3262 targetType = CustomActionTargetType.TextData;
3263
3264 // The target can be either a formatted error string or a literal
3265 // error number. Try to convert to error number to determine whether
3266 // to add a reference. No need to look at the value.
3267 if (Int32.TryParse(target, out var ignored))
3268 {
3269 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Error, target);
3270 }
3298 break; 3271 break;
3299 case "rollback": 3272 case "ExeCommand":
3300 executionType = CustomActionExecutionType.Rollback; 3273 if (null != target)
3274 {
3275 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3276 }
3277 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid
3278 targetType = CustomActionTargetType.Exe;
3301 break; 3279 break;
3302 case "secondSequence": 3280 case "Execute":
3303 executionType = CustomActionExecutionType.ClientRepeat; 3281 var execute = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3282 switch (execute)
3283 {
3284 case "commit":
3285 executionType = CustomActionExecutionType.Commit;
3286 break;
3287 case "deferred":
3288 executionType = CustomActionExecutionType.Deferred;
3289 break;
3290 case "firstSequence":
3291 executionType = CustomActionExecutionType.FirstSequence;
3292 break;
3293 case "immediate":
3294 executionType = CustomActionExecutionType.Immediate;
3295 break;
3296 case "oncePerProcess":
3297 executionType = CustomActionExecutionType.OncePerProcess;
3298 break;
3299 case "rollback":
3300 executionType = CustomActionExecutionType.Rollback;
3301 break;
3302 case "secondSequence":
3303 executionType = CustomActionExecutionType.ClientRepeat;
3304 break;
3305 default:
3306 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, execute, "commit", "deferred", "firstSequence", "immediate", "oncePerProcess", "rollback", "secondSequence"));
3307 break;
3308 }
3304 break; 3309 break;
3305 default: 3310 case "FileRef":
3306 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, execute, "commit", "deferred", "firstSequence", "immediate", "oncePerProcess", "rollback", "secondSequence")); 3311 if (null != source)
3312 {
3313 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryRef", "Directory", "FileRef", "Property", "Script"));
3314 }
3315 source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3316 sourceType = CustomActionSourceType.File;
3317 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, source); // add a reference to the appropriate File
3307 break; 3318 break;
3308 } 3319 case "HideTarget":
3309 break; 3320 hidden = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3310 case "FileRef":
3311 if (null != source)
3312 {
3313 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryRef", "Directory", "FileRef", "Property", "Script"));
3314 }
3315 source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3316 sourceType = CustomActionSourceType.File;
3317 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, source); // add a reference to the appropriate File
3318 break;
3319 case "HideTarget":
3320 hidden = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3321 break;
3322 case "Impersonate":
3323 impersonate = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3324 break;
3325 case "JScriptCall":
3326 if (null != target)
3327 {
3328 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3329 }
3330 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid
3331 targetType = CustomActionTargetType.JScript;
3332 break;
3333 case "PatchUninstall":
3334 patchUninstall = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3335 break;
3336 case "Property":
3337 if (null != source)
3338 {
3339 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryRef", "Directory", "FileRef", "Property", "Script"));
3340 }
3341 source = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3342 sourceType = CustomActionSourceType.Property;
3343 break;
3344 case "Return":
3345 var returnValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3346 switch (returnValue)
3347 {
3348 case "asyncNoWait":
3349 async = true;
3350 ignoreResult = true;
3351 break; 3321 break;
3352 case "asyncWait": 3322 case "Impersonate":
3353 async = true; 3323 impersonate = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3354 break; 3324 break;
3355 case "check": 3325 case "JScriptCall":
3326 if (null != target)
3327 {
3328 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3329 }
3330 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid
3331 targetType = CustomActionTargetType.JScript;
3356 break; 3332 break;
3357 case "ignore": 3333 case "PatchUninstall":
3358 ignoreResult = true; 3334 patchUninstall = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3359 break; 3335 break;
3360 case "": 3336 case "Property":
3337 if (null != source)
3338 {
3339 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryRef", "Directory", "FileRef", "Property", "Script"));
3340 }
3341 source = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3342 sourceType = CustomActionSourceType.Property;
3361 break; 3343 break;
3362 default: 3344 case "Return":
3363 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, returnValue, "asyncNoWait", "asyncWait", "check", "ignore")); 3345 var returnValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3346 switch (returnValue)
3347 {
3348 case "asyncNoWait":
3349 async = true;
3350 ignoreResult = true;
3351 break;
3352 case "asyncWait":
3353 async = true;
3354 break;
3355 case "check":
3356 break;
3357 case "ignore":
3358 ignoreResult = true;
3359 break;
3360 case "":
3361 break;
3362 default:
3363 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, returnValue, "asyncNoWait", "asyncWait", "check", "ignore"));
3364 break;
3365 }
3364 break; 3366 break;
3365 } 3367 case "Script":
3366 break; 3368 if (null != source)
3367 case "Script": 3369 {
3368 if (null != source) 3370 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryRef", "Directory", "FileRef", "Property", "Script"));
3369 { 3371 }
3370 this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryRef", "Directory", "FileRef", "Property", "Script"));
3371 }
3372 3372
3373 if (null != target) 3373 if (null != target)
3374 { 3374 {
3375 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); 3375 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3376 } 3376 }
3377 3377
3378 // set the source and target to empty string for error messages when the user sets multiple sources or targets 3378 // set the source and target to empty string for error messages when the user sets multiple sources or targets
3379 source = String.Empty; 3379 source = String.Empty;
3380 target = String.Empty; 3380 target = String.Empty;
3381 3381
3382 inlineScript = true; 3382 inlineScript = true;
3383 3383
3384 var script = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 3384 var script = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3385 switch (script) 3385 switch (script)
3386 { 3386 {
3387 case "jscript": 3387 case "jscript":
3388 sourceType = CustomActionSourceType.Directory; 3388 sourceType = CustomActionSourceType.Directory;
3389 targetType = CustomActionTargetType.JScript; 3389 targetType = CustomActionTargetType.JScript;
3390 break;
3391 case "vbscript":
3392 sourceType = CustomActionSourceType.Directory;
3393 targetType = CustomActionTargetType.VBScript;
3394 break;
3395 case "":
3396 break;
3397 default:
3398 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, script, "jscript", "vbscript"));
3399 break;
3400 }
3390 break; 3401 break;
3391 case "vbscript": 3402 case "ScriptSourceFile":
3392 sourceType = CustomActionSourceType.Directory; 3403 scriptFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3393 targetType = CustomActionTargetType.VBScript; 3404 break;
3405 case "Subdirectory":
3406 subdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true);
3394 break; 3407 break;
3395 case "": 3408 case "SuppressModularization":
3409 suppressModularization = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3410 break;
3411 case "TerminalServerAware":
3412 tsAware = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3413 break;
3414 case "Value":
3415 if (null != target)
3416 {
3417 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3418 }
3419 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid
3420 targetType = CustomActionTargetType.TextData;
3421 break;
3422 case "VBScriptCall":
3423 if (null != target)
3424 {
3425 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3426 }
3427 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid
3428 targetType = CustomActionTargetType.VBScript;
3396 break; 3429 break;
3397 default: 3430 default:
3398 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, script, "jscript", "vbscript")); 3431 this.Core.UnexpectedAttribute(node, attrib);
3399 break; 3432 break;
3400 }
3401 break;
3402 case "ScriptSourceFile":
3403 scriptFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3404 break;
3405 case "Subdirectory":
3406 subdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true);
3407 break;
3408 case "SuppressModularization":
3409 suppressModularization = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3410 break;
3411 case "TerminalServerAware":
3412 tsAware = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3413 break;
3414 case "Value":
3415 if (null != target)
3416 {
3417 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3418 }
3419 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid
3420 targetType = CustomActionTargetType.TextData;
3421 break;
3422 case "VBScriptCall":
3423 if (null != target)
3424 {
3425 this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3426 }
3427 target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid
3428 targetType = CustomActionTargetType.VBScript;
3429 break;
3430 default:
3431 this.Core.UnexpectedAttribute(node, attrib);
3432 break;
3433 } 3433 }
3434 } 3434 }
3435 else 3435 else
@@ -3600,13 +3600,13 @@ namespace WixToolset.Core
3600 { 3600 {
3601 switch (attrib.Name.LocalName) 3601 switch (attrib.Name.LocalName)
3602 { 3602 {
3603 case "Id": 3603 case "Id":
3604 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3604 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3605 this.Core.CreateSimpleReference(sourceLineNumbers, symbolDefinition.Name, id); 3605 this.Core.CreateSimpleReference(sourceLineNumbers, symbolDefinition.Name, id);
3606 break; 3606 break;
3607 default: 3607 default:
3608 this.Core.UnexpectedAttribute(node, attrib); 3608 this.Core.UnexpectedAttribute(node, attrib);
3609 break; 3609 break;
3610 } 3610 }
3611 } 3611 }
3612 else 3612 else
@@ -3643,15 +3643,15 @@ namespace WixToolset.Core
3643 { 3643 {
3644 switch (attrib.Name.LocalName) 3644 switch (attrib.Name.LocalName)
3645 { 3645 {
3646 case "Id": 3646 case "Id":
3647 primaryKeys[0] = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3647 primaryKeys[0] = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3648 break; 3648 break;
3649 case "ProductCode": 3649 case "ProductCode":
3650 primaryKeys[1] = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3650 primaryKeys[1] = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3651 break; 3651 break;
3652 default: 3652 default:
3653 this.Core.UnexpectedAttribute(node, attrib); 3653 this.Core.UnexpectedAttribute(node, attrib);
3654 break; 3654 break;
3655 } 3655 }
3656 } 3656 }
3657 else 3657 else
@@ -3690,12 +3690,12 @@ namespace WixToolset.Core
3690 { 3690 {
3691 switch (attrib.Name.LocalName) 3691 switch (attrib.Name.LocalName)
3692 { 3692 {
3693 case "Id": 3693 case "Id":
3694 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3694 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3695 break; 3695 break;
3696 default: 3696 default:
3697 this.Core.UnexpectedAttribute(node, attrib); 3697 this.Core.UnexpectedAttribute(node, attrib);
3698 break; 3698 break;
3699 } 3699 }
3700 } 3700 }
3701 else 3701 else
@@ -3744,49 +3744,49 @@ namespace WixToolset.Core
3744 { 3744 {
3745 switch (attrib.Name.LocalName) 3745 switch (attrib.Name.LocalName)
3746 { 3746 {
3747 case "Id": 3747 case "Id":
3748 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 3748 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
3749 break; 3749 break;
3750 case "ComponentGuidGenerationSeed": 3750 case "ComponentGuidGenerationSeed":
3751 componentGuidGenerationSeed = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 3751 componentGuidGenerationSeed = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
3752 break; 3752 break;
3753 case "DiskId": 3753 case "DiskId":
3754 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); 3754 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue);
3755 break; 3755 break;
3756 case "FileSource": 3756 case "FileSource":
3757 fileSource = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 3757 fileSource = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3758 fileSourceAttribSet = true; 3758 fileSourceAttribSet = true;
3759 break; 3759 break;
3760 case "Name": 3760 case "Name":
3761 if ("." == attrib.Value) 3761 if ("." == attrib.Value)
3762 { 3762 {
3763 name = attrib.Value; 3763 name = attrib.Value;
3764 } 3764 }
3765 else 3765 else
3766 { 3766 {
3767 name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true); 3767 name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true);
3768 } 3768 }
3769 nameAttribute = attrib; 3769 nameAttribute = attrib;
3770 break; 3770 break;
3771 case "ShortName": 3771 case "ShortName":
3772 shortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false); 3772 shortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false);
3773 break; 3773 break;
3774 case "ShortSourceName": 3774 case "ShortSourceName":
3775 shortSourceName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false); 3775 shortSourceName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false);
3776 break; 3776 break;
3777 case "SourceName": 3777 case "SourceName":
3778 if ("." == attrib.Value) 3778 if ("." == attrib.Value)
3779 { 3779 {
3780 sourceName = attrib.Value; 3780 sourceName = attrib.Value;
3781 } 3781 }
3782 else 3782 else
3783 { 3783 {
3784 sourceName = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false); 3784 sourceName = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false);
3785 } 3785 }
3786 break; 3786 break;
3787 default: 3787 default:
3788 this.Core.UnexpectedAttribute(node, attrib); 3788 this.Core.UnexpectedAttribute(node, attrib);
3789 break; 3789 break;
3790 } 3790 }
3791 } 3791 }
3792 else 3792 else
@@ -3880,34 +3880,34 @@ namespace WixToolset.Core
3880 { 3880 {
3881 switch (child.Name.LocalName) 3881 switch (child.Name.LocalName)
3882 { 3882 {
3883 case "Component": 3883 case "Component":
3884 this.ParseComponentElement(child, ComplexReferenceParentType.Unknown, null, null, diskId, id.Id, fileSource); 3884 this.ParseComponentElement(child, ComplexReferenceParentType.Unknown, null, null, diskId, id.Id, fileSource);
3885 break; 3885 break;
3886 case "Directory": 3886 case "Directory":
3887 this.ParseDirectoryElement(child, id.Id, diskId, fileSource); 3887 this.ParseDirectoryElement(child, id.Id, diskId, fileSource);
3888 break; 3888 break;
3889 case "File": 3889 case "File":
3890 this.ParseNakedFileElement(child, ComplexReferenceParentType.Unknown, null, id.Id, fileSource); 3890 this.ParseNakedFileElement(child, ComplexReferenceParentType.Unknown, null, id.Id, fileSource);
3891 break; 3891 break;
3892 case "Files": 3892 case "Files":
3893 this.ParseFilesElement(child, ComplexReferenceParentType.Unknown, null, id.Id, fileSource); 3893 this.ParseFilesElement(child, ComplexReferenceParentType.Unknown, null, id.Id, fileSource);
3894 break; 3894 break;
3895 case "Merge": 3895 case "Merge":
3896 this.ParseMergeElement(child, id.Id, diskId); 3896 this.ParseMergeElement(child, id.Id, diskId);
3897 break; 3897 break;
3898 case "SymbolPath": 3898 case "SymbolPath":
3899 if (null != symbols) 3899 if (null != symbols)
3900 { 3900 {
3901 symbols += ";" + this.ParseSymbolPathElement(child); 3901 symbols += ";" + this.ParseSymbolPathElement(child);
3902 } 3902 }
3903 else 3903 else
3904 { 3904 {
3905 symbols = this.ParseSymbolPathElement(child); 3905 symbols = this.ParseSymbolPathElement(child);
3906 } 3906 }
3907 break; 3907 break;
3908 default: 3908 default:
3909 this.Core.UnexpectedElement(node, child); 3909 this.Core.UnexpectedElement(node, child);
3910 break; 3910 break;
3911 } 3911 }
3912 } 3912 }
3913 else 3913 else
@@ -3957,19 +3957,19 @@ namespace WixToolset.Core
3957 { 3957 {
3958 switch (attrib.Name.LocalName) 3958 switch (attrib.Name.LocalName)
3959 { 3959 {
3960 case "Id": 3960 case "Id":
3961 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 3961 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3962 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, id); 3962 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, id);
3963 break; 3963 break;
3964 case "DiskId": 3964 case "DiskId":
3965 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); 3965 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue);
3966 break; 3966 break;
3967 case "FileSource": 3967 case "FileSource":
3968 fileSource = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 3968 fileSource = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
3969 break; 3969 break;
3970 default: 3970 default:
3971 this.Core.UnexpectedAttribute(node, attrib); 3971 this.Core.UnexpectedAttribute(node, attrib);
3972 break; 3972 break;
3973 } 3973 }
3974 } 3974 }
3975 else 3975 else
@@ -4002,24 +4002,24 @@ namespace WixToolset.Core
4002 { 4002 {
4003 switch (child.Name.LocalName) 4003 switch (child.Name.LocalName)
4004 { 4004 {
4005 case "Component": 4005 case "Component":
4006 this.ParseComponentElement(child, ComplexReferenceParentType.Unknown, null, null, diskId, id, fileSource); 4006 this.ParseComponentElement(child, ComplexReferenceParentType.Unknown, null, null, diskId, id, fileSource);
4007 break; 4007 break;
4008 case "Directory": 4008 case "Directory":
4009 this.ParseDirectoryElement(child, id, diskId, fileSource); 4009 this.ParseDirectoryElement(child, id, diskId, fileSource);
4010 break; 4010 break;
4011 case "File": 4011 case "File":
4012 this.ParseNakedFileElement(child, ComplexReferenceParentType.Unknown, null, id, fileSource); 4012 this.ParseNakedFileElement(child, ComplexReferenceParentType.Unknown, null, id, fileSource);
4013 break; 4013 break;
4014 case "Files": 4014 case "Files":
4015 this.ParseFilesElement(child, ComplexReferenceParentType.Unknown, null, id, fileSource); 4015 this.ParseFilesElement(child, ComplexReferenceParentType.Unknown, null, id, fileSource);
4016 break; 4016 break;
4017 case "Merge": 4017 case "Merge":
4018 this.ParseMergeElement(child, id, diskId); 4018 this.ParseMergeElement(child, id, diskId);
4019 break; 4019 break;
4020 default: 4020 default:
4021 this.Core.UnexpectedElement(node, child); 4021 this.Core.UnexpectedElement(node, child);
4022 break; 4022 break;
4023 } 4023 }
4024 } 4024 }
4025 else 4025 else
@@ -4049,21 +4049,21 @@ namespace WixToolset.Core
4049 { 4049 {
4050 switch (attrib.Name.LocalName) 4050 switch (attrib.Name.LocalName)
4051 { 4051 {
4052 case "Id": 4052 case "Id":
4053 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 4053 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
4054 break; 4054 break;
4055 case "Depth": 4055 case "Depth":
4056 depth = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue); 4056 depth = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
4057 break; 4057 break;
4058 case "Path": 4058 case "Path":
4059 path = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 4059 path = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4060 break; 4060 break;
4061 case "AssignToProperty": 4061 case "AssignToProperty":
4062 assignToProperty = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 4062 assignToProperty = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
4063 break; 4063 break;
4064 default: 4064 default:
4065 this.Core.UnexpectedAttribute(node, attrib); 4065 this.Core.UnexpectedAttribute(node, attrib);
4066 break; 4066 break;
4067 } 4067 }
4068 } 4068 }
4069 else 4069 else
@@ -4088,42 +4088,42 @@ namespace WixToolset.Core
4088 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); 4088 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child);
4089 switch (child.Name.LocalName) 4089 switch (child.Name.LocalName)
4090 { 4090 {
4091 case "DirectorySearch": 4091 case "DirectorySearch":
4092 if (oneChild) 4092 if (oneChild)
4093 { 4093 {
4094 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); 4094 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName));
4095 } 4095 }
4096 oneChild = true; 4096 oneChild = true;
4097 signature = this.ParseDirectorySearchElement(child, id.Id); 4097 signature = this.ParseDirectorySearchElement(child, id.Id);
4098 break; 4098 break;
4099 case "DirectorySearchRef": 4099 case "DirectorySearchRef":
4100 if (oneChild) 4100 if (oneChild)
4101 { 4101 {
4102 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); 4102 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName));
4103 } 4103 }
4104 oneChild = true; 4104 oneChild = true;
4105 signature = this.ParseDirectorySearchRefElement(child, id.Id); 4105 signature = this.ParseDirectorySearchRefElement(child, id.Id);
4106 break; 4106 break;
4107 case "FileSearch": 4107 case "FileSearch":
4108 if (oneChild) 4108 if (oneChild)
4109 { 4109 {
4110 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 4110 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
4111 } 4111 }
4112 oneChild = true; 4112 oneChild = true;
4113 hasFileSearch = true; 4113 hasFileSearch = true;
4114 signature = this.ParseFileSearchElement(child, id.Id, assignToProperty, depth); 4114 signature = this.ParseFileSearchElement(child, id.Id, assignToProperty, depth);
4115 break; 4115 break;
4116 case "FileSearchRef": 4116 case "FileSearchRef":
4117 if (oneChild) 4117 if (oneChild)
4118 { 4118 {
4119 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 4119 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
4120 } 4120 }
4121 oneChild = true; 4121 oneChild = true;
4122 signature = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature); 4122 signature = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature);
4123 break; 4123 break;
4124 default: 4124 default:
4125 this.Core.UnexpectedElement(node, child); 4125 this.Core.UnexpectedElement(node, child);
4126 break; 4126 break;
4127 } 4127 }
4128 4128
4129 // If AssignToProperty is set, only a FileSearch 4129 // If AssignToProperty is set, only a FileSearch
@@ -4199,18 +4199,18 @@ namespace WixToolset.Core
4199 { 4199 {
4200 switch (attrib.Name.LocalName) 4200 switch (attrib.Name.LocalName)
4201 { 4201 {
4202 case "Id": 4202 case "Id":
4203 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 4203 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
4204 break; 4204 break;
4205 case "Parent": 4205 case "Parent":
4206 parent = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 4206 parent = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
4207 break; 4207 break;
4208 case "Path": 4208 case "Path":
4209 path = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 4209 path = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4210 break; 4210 break;
4211 default: 4211 default:
4212 this.Core.UnexpectedAttribute(node, attrib); 4212 this.Core.UnexpectedAttribute(node, attrib);
4213 break; 4213 break;
4214 } 4214 }
4215 } 4215 }
4216 else 4216 else
@@ -4246,41 +4246,41 @@ namespace WixToolset.Core
4246 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); 4246 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child);
4247 switch (child.Name.LocalName) 4247 switch (child.Name.LocalName)
4248 { 4248 {
4249 case "DirectorySearch": 4249 case "DirectorySearch":
4250 if (oneChild) 4250 if (oneChild)
4251 { 4251 {
4252 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); 4252 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName));
4253 } 4253 }
4254 oneChild = true; 4254 oneChild = true;
4255 signature = this.ParseDirectorySearchElement(child, id.Id); 4255 signature = this.ParseDirectorySearchElement(child, id.Id);
4256 break; 4256 break;
4257 case "DirectorySearchRef": 4257 case "DirectorySearchRef":
4258 if (oneChild) 4258 if (oneChild)
4259 { 4259 {
4260 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); 4260 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName));
4261 } 4261 }
4262 oneChild = true; 4262 oneChild = true;
4263 signature = this.ParseDirectorySearchRefElement(child, id.Id); 4263 signature = this.ParseDirectorySearchRefElement(child, id.Id);
4264 break; 4264 break;
4265 case "FileSearch": 4265 case "FileSearch":
4266 if (oneChild) 4266 if (oneChild)
4267 { 4267 {
4268 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); 4268 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName));
4269 } 4269 }
4270 oneChild = true; 4270 oneChild = true;
4271 signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet); 4271 signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet);
4272 break; 4272 break;
4273 case "FileSearchRef": 4273 case "FileSearchRef":
4274 if (oneChild) 4274 if (oneChild)
4275 { 4275 {
4276 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 4276 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
4277 } 4277 }
4278 oneChild = true; 4278 oneChild = true;
4279 signature = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature); 4279 signature = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature);
4280 break; 4280 break;
4281 default: 4281 default:
4282 this.Core.UnexpectedElement(node, child); 4282 this.Core.UnexpectedElement(node, child);
4283 break; 4283 break;
4284 } 4284 }
4285 } 4285 }
4286 else 4286 else
@@ -4324,80 +4324,80 @@ namespace WixToolset.Core
4324 { 4324 {
4325 switch (attrib.Name.LocalName) 4325 switch (attrib.Name.LocalName)
4326 { 4326 {
4327 case "Id": 4327 case "Id":
4328 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 4328 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
4329 break;
4330 case "AllowAbsent":
4331 disallowAbsent = (this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib) == YesNoType.No);
4332 break;
4333 case "AllowAdvertise":
4334 disallowAdvertise = (this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib) == YesNoType.No);
4335 break;
4336 case "ConfigurableDirectory":
4337 configurableDirectory = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
4338 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, configurableDirectory);
4339 break;
4340 case "Description":
4341 description = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4342 break;
4343 case "Display":
4344 displayValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4345 break;
4346 case "InstallDefault":
4347 var installDefaultValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4348 switch (installDefaultValue)
4349 {
4350 case "followParent":
4351 if (ComplexReferenceParentType.Product == parentType)
4352 {
4353 this.Core.Write(ErrorMessages.RootFeatureCannotFollowParent(sourceLineNumbers));
4354 }
4355 //bits = bits | MsiInterop.MsidbFeatureAttributesFollowParent;
4356 installDefault = FeatureInstallDefault.FollowParent;
4357 break; 4329 break;
4358 case "local": // this is the default 4330 case "AllowAbsent":
4359 installDefault = FeatureInstallDefault.Local; 4331 disallowAbsent = (this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib) == YesNoType.No);
4360 break; 4332 break;
4361 case "source": 4333 case "AllowAdvertise":
4362 //bits = bits | MsiInterop.MsidbFeatureAttributesFavorSource; 4334 disallowAdvertise = (this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib) == YesNoType.No);
4363 installDefault = FeatureInstallDefault.Source;
4364 break; 4335 break;
4365 case "": 4336 case "ConfigurableDirectory":
4337 configurableDirectory = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
4338 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, configurableDirectory);
4366 break; 4339 break;
4367 default: 4340 case "Description":
4368 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installDefaultValue, "followParent", "local", "source")); 4341 description = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4369 break; 4342 break;
4370 } 4343 case "Display":
4371 break; 4344 displayValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4372 case "Level":
4373 level = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
4374 break;
4375 case "Title":
4376 title = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4377 if ("PUT-FEATURE-TITLE-HERE" == title)
4378 {
4379 this.Core.Write(WarningMessages.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, title));
4380 }
4381 break;
4382 case "TypicalDefault":
4383 var typicalValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4384 switch (typicalValue)
4385 {
4386 case "advertise":
4387 //bits |= MsiInterop.MsidbFeatureAttributesFavorAdvertise;
4388 typicalDefault = FeatureTypicalDefault.Advertise;
4389 break; 4345 break;
4390 case "install": // this is the default 4346 case "InstallDefault":
4391 typicalDefault = FeatureTypicalDefault.Install; 4347 var installDefaultValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4348 switch (installDefaultValue)
4349 {
4350 case "followParent":
4351 if (ComplexReferenceParentType.Product == parentType)
4352 {
4353 this.Core.Write(ErrorMessages.RootFeatureCannotFollowParent(sourceLineNumbers));
4354 }
4355 //bits = bits | MsiInterop.MsidbFeatureAttributesFollowParent;
4356 installDefault = FeatureInstallDefault.FollowParent;
4357 break;
4358 case "local": // this is the default
4359 installDefault = FeatureInstallDefault.Local;
4360 break;
4361 case "source":
4362 //bits = bits | MsiInterop.MsidbFeatureAttributesFavorSource;
4363 installDefault = FeatureInstallDefault.Source;
4364 break;
4365 case "":
4366 break;
4367 default:
4368 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installDefaultValue, "followParent", "local", "source"));
4369 break;
4370 }
4371 break;
4372 case "Level":
4373 level = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
4374 break;
4375 case "Title":
4376 title = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4377 if ("PUT-FEATURE-TITLE-HERE" == title)
4378 {
4379 this.Core.Write(WarningMessages.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, title));
4380 }
4381 break;
4382 case "TypicalDefault":
4383 var typicalValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4384 switch (typicalValue)
4385 {
4386 case "advertise":
4387 //bits |= MsiInterop.MsidbFeatureAttributesFavorAdvertise;
4388 typicalDefault = FeatureTypicalDefault.Advertise;
4389 break;
4390 case "install": // this is the default
4391 typicalDefault = FeatureTypicalDefault.Install;
4392 break;
4393 default:
4394 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typicalValue, "advertise", "install"));
4395 break;
4396 }
4392 break; 4397 break;
4393 default: 4398 default:
4394 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typicalValue, "advertise", "install")); 4399 this.Core.UnexpectedAttribute(node, attrib);
4395 break; 4400 break;
4396 }
4397 break;
4398 default:
4399 this.Core.UnexpectedAttribute(node, attrib);
4400 break;
4401 } 4401 }
4402 } 4402 }
4403 else 4403 else
@@ -4433,39 +4433,39 @@ namespace WixToolset.Core
4433 { 4433 {
4434 switch (child.Name.LocalName) 4434 switch (child.Name.LocalName)
4435 { 4435 {
4436 case "ComponentGroupRef": 4436 case "ComponentGroupRef":
4437 this.ParseComponentGroupRefElement(child, ComplexReferenceParentType.Feature, id.Id, null); 4437 this.ParseComponentGroupRefElement(child, ComplexReferenceParentType.Feature, id.Id, null);
4438 break; 4438 break;
4439 case "ComponentRef": 4439 case "ComponentRef":
4440 this.ParseComponentRefElement(child, ComplexReferenceParentType.Feature, id.Id, null); 4440 this.ParseComponentRefElement(child, ComplexReferenceParentType.Feature, id.Id, null);
4441 break; 4441 break;
4442 case "Component": 4442 case "Component":
4443 this.ParseComponentElement(child, ComplexReferenceParentType.Feature, id.Id, null, CompilerConstants.IntegerNotSet, null, null); 4443 this.ParseComponentElement(child, ComplexReferenceParentType.Feature, id.Id, null, CompilerConstants.IntegerNotSet, null, null);
4444 break; 4444 break;
4445 case "Feature": 4445 case "Feature":
4446 this.ParseFeatureElement(child, ComplexReferenceParentType.Feature, id.Id, ref childDisplay); 4446 this.ParseFeatureElement(child, ComplexReferenceParentType.Feature, id.Id, ref childDisplay);
4447 break; 4447 break;
4448 case "FeatureGroupRef": 4448 case "FeatureGroupRef":
4449 this.ParseFeatureGroupRefElement(child, ComplexReferenceParentType.Feature, id.Id); 4449 this.ParseFeatureGroupRefElement(child, ComplexReferenceParentType.Feature, id.Id);
4450 break; 4450 break;
4451 case "FeatureRef": 4451 case "FeatureRef":
4452 this.ParseFeatureRefElement(child, ComplexReferenceParentType.Feature, id.Id); 4452 this.ParseFeatureRefElement(child, ComplexReferenceParentType.Feature, id.Id);
4453 break; 4453 break;
4454 case "File": 4454 case "File":
4455 this.ParseNakedFileElement(child, ComplexReferenceParentType.Feature, id.Id, null, null); 4455 this.ParseNakedFileElement(child, ComplexReferenceParentType.Feature, id.Id, null, null);
4456 break; 4456 break;
4457 case "Files": 4457 case "Files":
4458 this.ParseFilesElement(child, ComplexReferenceParentType.Feature, id.Id, null, null); 4458 this.ParseFilesElement(child, ComplexReferenceParentType.Feature, id.Id, null, null);
4459 break; 4459 break;
4460 case "Level": 4460 case "Level":
4461 this.ParseLevelElement(child, id.Id); 4461 this.ParseLevelElement(child, id.Id);
4462 break; 4462 break;
4463 case "MergeRef": 4463 case "MergeRef":
4464 this.ParseMergeRefElement(child, ComplexReferenceParentType.Feature, id.Id); 4464 this.ParseMergeRefElement(child, ComplexReferenceParentType.Feature, id.Id);
4465 break; 4465 break;
4466 default: 4466 default:
4467 this.Core.UnexpectedElement(node, child); 4467 this.Core.UnexpectedElement(node, child);
4468 break; 4468 break;
4469 } 4469 }
4470 } 4470 }
4471 else 4471 else
@@ -4477,31 +4477,31 @@ namespace WixToolset.Core
4477 int display; 4477 int display;
4478 switch (displayValue) 4478 switch (displayValue)
4479 { 4479 {
4480 case "collapse": 4480 case "collapse":
4481 lastDisplay = (lastDisplay | 1) + 1; 4481 lastDisplay = (lastDisplay | 1) + 1;
4482 display = lastDisplay; 4482 display = lastDisplay;
4483 break; 4483 break;
4484 case "expand": 4484 case "expand":
4485 lastDisplay = (lastDisplay + 1) | 1; 4485 lastDisplay = (lastDisplay + 1) | 1;
4486 display = lastDisplay; 4486 display = lastDisplay;
4487 break; 4487 break;
4488 case "hidden": 4488 case "hidden":
4489 display = 0; 4489 display = 0;
4490 break; 4490 break;
4491 default: 4491 default:
4492 if (!Int32.TryParse(displayValue, NumberStyles.Integer, CultureInfo.InvariantCulture, out display)) 4492 if (!Int32.TryParse(displayValue, NumberStyles.Integer, CultureInfo.InvariantCulture, out display))
4493 {
4494 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Display", displayValue, "collapse", "expand", "hidden"));
4495 }
4496 else
4497 {
4498 // Save the display value (if its not hidden) for subsequent rows
4499 if (0 != display)
4500 { 4493 {
4501 lastDisplay = display; 4494 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Display", displayValue, "collapse", "expand", "hidden"));
4502 } 4495 }
4503 } 4496 else
4504 break; 4497 {
4498 // Save the display value (if its not hidden) for subsequent rows
4499 if (0 != display)
4500 {
4501 lastDisplay = display;
4502 }
4503 }
4504 break;
4505 } 4505 }
4506 4506
4507 if (!this.Core.EncounteredError) 4507 if (!this.Core.EncounteredError)
@@ -4545,16 +4545,16 @@ namespace WixToolset.Core
4545 { 4545 {
4546 switch (attrib.Name.LocalName) 4546 switch (attrib.Name.LocalName)
4547 { 4547 {
4548 case "Id": 4548 case "Id":
4549 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 4549 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
4550 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Feature, id); 4550 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Feature, id);
4551 break; 4551 break;
4552 case "IgnoreParent": 4552 case "IgnoreParent":
4553 ignoreParent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 4553 ignoreParent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
4554 break; 4554 break;
4555 default: 4555 default:
4556 this.Core.UnexpectedAttribute(node, attrib); 4556 this.Core.UnexpectedAttribute(node, attrib);
4557 break; 4557 break;
4558 } 4558 }
4559 } 4559 }
4560 else 4560 else
@@ -4576,39 +4576,39 @@ namespace WixToolset.Core
4576 { 4576 {
4577 switch (child.Name.LocalName) 4577 switch (child.Name.LocalName)
4578 { 4578 {
4579 case "ComponentGroupRef": 4579 case "ComponentGroupRef":
4580 this.ParseComponentGroupRefElement(child, ComplexReferenceParentType.Feature, id, null); 4580 this.ParseComponentGroupRefElement(child, ComplexReferenceParentType.Feature, id, null);
4581 break; 4581 break;
4582 case "ComponentRef": 4582 case "ComponentRef":
4583 this.ParseComponentRefElement(child, ComplexReferenceParentType.Feature, id, null); 4583 this.ParseComponentRefElement(child, ComplexReferenceParentType.Feature, id, null);
4584 break; 4584 break;
4585 case "Component": 4585 case "Component":
4586 this.ParseComponentElement(child, ComplexReferenceParentType.Feature, id, null, CompilerConstants.IntegerNotSet, null, null); 4586 this.ParseComponentElement(child, ComplexReferenceParentType.Feature, id, null, CompilerConstants.IntegerNotSet, null, null);
4587 break; 4587 break;
4588 case "Feature": 4588 case "Feature":
4589 this.ParseFeatureElement(child, ComplexReferenceParentType.Feature, id, ref lastDisplay); 4589 this.ParseFeatureElement(child, ComplexReferenceParentType.Feature, id, ref lastDisplay);
4590 break; 4590 break;
4591 case "FeatureGroup": 4591 case "FeatureGroup":
4592 this.ParseFeatureGroupElement(child, ComplexReferenceParentType.Feature, id); 4592 this.ParseFeatureGroupElement(child, ComplexReferenceParentType.Feature, id);
4593 break; 4593 break;
4594 case "FeatureGroupRef": 4594 case "FeatureGroupRef":
4595 this.ParseFeatureGroupRefElement(child, ComplexReferenceParentType.Feature, id); 4595 this.ParseFeatureGroupRefElement(child, ComplexReferenceParentType.Feature, id);
4596 break; 4596 break;
4597 case "FeatureRef": 4597 case "FeatureRef":
4598 this.ParseFeatureRefElement(child, ComplexReferenceParentType.Feature, id); 4598 this.ParseFeatureRefElement(child, ComplexReferenceParentType.Feature, id);
4599 break; 4599 break;
4600 case "File": 4600 case "File":
4601 this.ParseNakedFileElement(child, ComplexReferenceParentType.Feature, id, null, null); 4601 this.ParseNakedFileElement(child, ComplexReferenceParentType.Feature, id, null, null);
4602 break; 4602 break;
4603 case "Files": 4603 case "Files":
4604 this.ParseFilesElement(child, ComplexReferenceParentType.Feature, id, null, null); 4604 this.ParseFilesElement(child, ComplexReferenceParentType.Feature, id, null, null);
4605 break; 4605 break;
4606 case "MergeRef": 4606 case "MergeRef":
4607 this.ParseMergeRefElement(child, ComplexReferenceParentType.Feature, id); 4607 this.ParseMergeRefElement(child, ComplexReferenceParentType.Feature, id);
4608 break; 4608 break;
4609 default: 4609 default:
4610 this.Core.UnexpectedElement(node, child); 4610 this.Core.UnexpectedElement(node, child);
4611 break; 4611 break;
4612 } 4612 }
4613 } 4613 }
4614 else 4614 else
@@ -4643,12 +4643,12 @@ namespace WixToolset.Core
4643 { 4643 {
4644 switch (attrib.Name.LocalName) 4644 switch (attrib.Name.LocalName)
4645 { 4645 {
4646 case "Id": 4646 case "Id":
4647 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 4647 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
4648 break; 4648 break;
4649 default: 4649 default:
4650 this.Core.UnexpectedAttribute(node, attrib); 4650 this.Core.UnexpectedAttribute(node, attrib);
4651 break; 4651 break;
4652 } 4652 }
4653 } 4653 }
4654 else 4654 else
@@ -4670,36 +4670,36 @@ namespace WixToolset.Core
4670 { 4670 {
4671 switch (child.Name.LocalName) 4671 switch (child.Name.LocalName)
4672 { 4672 {
4673 case "ComponentGroupRef": 4673 case "ComponentGroupRef":
4674 this.ParseComponentGroupRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, null); 4674 this.ParseComponentGroupRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, null);
4675 break; 4675 break;
4676 case "ComponentRef": 4676 case "ComponentRef":
4677 this.ParseComponentRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, null); 4677 this.ParseComponentRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, null);
4678 break; 4678 break;
4679 case "Component": 4679 case "Component":
4680 this.ParseComponentElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, null, CompilerConstants.IntegerNotSet, null, null); 4680 this.ParseComponentElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, null, CompilerConstants.IntegerNotSet, null, null);
4681 break; 4681 break;
4682 case "Feature": 4682 case "Feature":
4683 this.ParseFeatureElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, ref lastDisplay); 4683 this.ParseFeatureElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, ref lastDisplay);
4684 break; 4684 break;
4685 case "FeatureGroupRef": 4685 case "FeatureGroupRef":
4686 this.ParseFeatureGroupRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id); 4686 this.ParseFeatureGroupRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id);
4687 break; 4687 break;
4688 case "FeatureRef": 4688 case "FeatureRef":
4689 this.ParseFeatureRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id); 4689 this.ParseFeatureRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id);
4690 break; 4690 break;
4691 case "File": 4691 case "File":
4692 this.ParseNakedFileElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, null, null); 4692 this.ParseNakedFileElement(child, ComplexReferenceParentType.FeatureGroup, id.Id, null, null);
4693 break; 4693 break;
4694 case "Files": 4694 case "Files":
4695 this.ParseFilesElement(child, ComplexReferenceParentType.Feature, id.Id, null, null); 4695 this.ParseFilesElement(child, ComplexReferenceParentType.Feature, id.Id, null, null);
4696 break; 4696 break;
4697 case "MergeRef": 4697 case "MergeRef":
4698 this.ParseMergeRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id); 4698 this.ParseMergeRefElement(child, ComplexReferenceParentType.FeatureGroup, id.Id);
4699 break; 4699 break;
4700 default: 4700 default:
4701 this.Core.UnexpectedElement(node, child); 4701 this.Core.UnexpectedElement(node, child);
4702 break; 4702 break;
4703 } 4703 }
4704 } 4704 }
4705 else 4705 else
@@ -4738,19 +4738,19 @@ namespace WixToolset.Core
4738 { 4738 {
4739 switch (attrib.Name.LocalName) 4739 switch (attrib.Name.LocalName)
4740 { 4740 {
4741 case "Id": 4741 case "Id":
4742 id = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 4742 id = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4743 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixFeatureGroup, id); 4743 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixFeatureGroup, id);
4744 break; 4744 break;
4745 case "IgnoreParent": 4745 case "IgnoreParent":
4746 ignoreParent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 4746 ignoreParent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
4747 break; 4747 break;
4748 case "Primary": 4748 case "Primary":
4749 primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 4749 primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
4750 break; 4750 break;
4751 default: 4751 default:
4752 this.Core.UnexpectedAttribute(node, attrib); 4752 this.Core.UnexpectedAttribute(node, attrib);
4753 break; 4753 break;
4754 } 4754 }
4755 } 4755 }
4756 else 4756 else
@@ -4798,65 +4798,65 @@ namespace WixToolset.Core
4798 { 4798 {
4799 switch (attrib.Name.LocalName) 4799 switch (attrib.Name.LocalName)
4800 { 4800 {
4801 case "Id": 4801 case "Id":
4802 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 4802 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
4803 break;
4804 case "Action":
4805 var actionValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4806 switch (actionValue)
4807 {
4808 case "create":
4809 action = EnvironmentActionType.Create;
4810 break; 4803 break;
4811 case "set": 4804 case "Action":
4812 action = EnvironmentActionType.Set; 4805 var actionValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4806 switch (actionValue)
4807 {
4808 case "create":
4809 action = EnvironmentActionType.Create;
4810 break;
4811 case "set":
4812 action = EnvironmentActionType.Set;
4813 break;
4814 case "remove":
4815 action = EnvironmentActionType.Remove;
4816 break;
4817 default:
4818 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "create", "set", "remove"));
4819 break;
4820 }
4813 break; 4821 break;
4814 case "remove": 4822 case "Name":
4815 action = EnvironmentActionType.Remove; 4823 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4816 break; 4824 break;
4817 default: 4825 case "Part":
4818 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "create", "set", "remove")); 4826 var partValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4827 switch (partValue)
4828 {
4829 case "all":
4830 part = EnvironmentPartType.All;
4831 break;
4832 case "first":
4833 part = EnvironmentPartType.First;
4834 break;
4835 case "last":
4836 part = EnvironmentPartType.Last;
4837 break;
4838 case "":
4839 break;
4840 default:
4841 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Part", partValue, "all", "first", "last"));
4842 break;
4843 }
4819 break; 4844 break;
4820 } 4845 case "Permanent":
4821 break; 4846 permanent = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
4822 case "Name":
4823 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4824 break;
4825 case "Part":
4826 var partValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4827 switch (partValue)
4828 {
4829 case "all":
4830 part = EnvironmentPartType.All;
4831 break; 4847 break;
4832 case "first": 4848 case "Separator":
4833 part = EnvironmentPartType.First; 4849 separator = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4834 break; 4850 break;
4835 case "last": 4851 case "System":
4836 part = EnvironmentPartType.Last; 4852 system = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
4837 break; 4853 break;
4838 case "": 4854 case "Value":
4855 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4839 break; 4856 break;
4840 default: 4857 default:
4841 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Part", partValue, "all", "first", "last")); 4858 this.Core.UnexpectedAttribute(node, attrib);
4842 break; 4859 break;
4843 }
4844 break;
4845 case "Permanent":
4846 permanent = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
4847 break;
4848 case "Separator":
4849 separator = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4850 break;
4851 case "System":
4852 system = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
4853 break;
4854 case "Value":
4855 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4856 break;
4857 default:
4858 this.Core.UnexpectedAttribute(node, attrib);
4859 break;
4860 } 4860 }
4861 } 4861 }
4862 else 4862 else
@@ -4939,15 +4939,15 @@ namespace WixToolset.Core
4939 { 4939 {
4940 switch (attrib.Name.LocalName) 4940 switch (attrib.Name.LocalName)
4941 { 4941 {
4942 case "Id": 4942 case "Id":
4943 id = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue); 4943 id = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
4944 break; 4944 break;
4945 case "Message": 4945 case "Message":
4946 message = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); 4946 message = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty);
4947 break; 4947 break;
4948 default: 4948 default:
4949 this.Core.UnexpectedAttribute(node, attrib); 4949 this.Core.UnexpectedAttribute(node, attrib);
4950 break; 4950 break;
4951 } 4951 }
4952 } 4952 }
4953 else 4953 else
@@ -4992,23 +4992,23 @@ namespace WixToolset.Core
4992 { 4992 {
4993 switch (attrib.Name.LocalName) 4993 switch (attrib.Name.LocalName)
4994 { 4994 {
4995 case "Id": 4995 case "Id":
4996 extension = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 4996 extension = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
4997 break; 4997 break;
4998 case "Advertise": 4998 case "Advertise":
4999 var extensionAdvertise = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 4999 var extensionAdvertise = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5000 if ((YesNoType.No == advertise && YesNoType.Yes == extensionAdvertise) || (YesNoType.Yes == advertise && YesNoType.No == extensionAdvertise)) 5000 if ((YesNoType.No == advertise && YesNoType.Yes == extensionAdvertise) || (YesNoType.Yes == advertise && YesNoType.No == extensionAdvertise))
5001 { 5001 {
5002 this.Core.Write(ErrorMessages.AdvertiseStateMustMatch(sourceLineNumbers, extensionAdvertise.ToString(), advertise.ToString())); 5002 this.Core.Write(ErrorMessages.AdvertiseStateMustMatch(sourceLineNumbers, extensionAdvertise.ToString(), advertise.ToString()));
5003 } 5003 }
5004 advertise = extensionAdvertise; 5004 advertise = extensionAdvertise;
5005 break; 5005 break;
5006 case "ContentType": 5006 case "ContentType":
5007 mime = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 5007 mime = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5008 break; 5008 break;
5009 default: 5009 default:
5010 this.Core.UnexpectedAttribute(node, attrib); 5010 this.Core.UnexpectedAttribute(node, attrib);
5011 break; 5011 break;
5012 } 5012 }
5013 } 5013 }
5014 else 5014 else
@@ -5029,19 +5029,19 @@ namespace WixToolset.Core
5029 { 5029 {
5030 switch (child.Name.LocalName) 5030 switch (child.Name.LocalName)
5031 { 5031 {
5032 case "Verb": 5032 case "Verb":
5033 this.ParseVerbElement(child, extension, progId, componentId, advertise); 5033 this.ParseVerbElement(child, extension, progId, componentId, advertise);
5034 break; 5034 break;
5035 case "MIME": 5035 case "MIME":
5036 var newMime = this.ParseMIMEElement(child, extension, componentId, advertise); 5036 var newMime = this.ParseMIMEElement(child, extension, componentId, advertise);
5037 if (null != newMime && null == mime) 5037 if (null != newMime && null == mime)
5038 { 5038 {
5039 mime = newMime; 5039 mime = newMime;
5040 } 5040 }
5041 break; 5041 break;
5042 default: 5042 default:
5043 this.Core.UnexpectedElement(node, child); 5043 this.Core.UnexpectedElement(node, child);
5044 break; 5044 break;
5045 } 5045 }
5046 } 5046 }
5047 else 5047 else
@@ -5207,175 +5207,175 @@ namespace WixToolset.Core
5207 { 5207 {
5208 switch (attrib.Name.LocalName) 5208 switch (attrib.Name.LocalName)
5209 { 5209 {
5210 case "Id": 5210 case "Id":
5211 case "Name": 5211 case "Name":
5212 case "ShortName": 5212 case "ShortName":
5213 case "Source": 5213 case "Source":
5214 // Handled in ParseFileNamingAttributes 5214 // Handled in ParseFileNamingAttributes
5215 break; 5215 break;
5216 5216
5217 case "Bitness": 5217 case "Bitness":
5218 case "Condition": 5218 case "Condition":
5219 case "Directory": 5219 case "Directory":
5220 case "Subdirectory": 5220 case "Subdirectory":
5221 // Naked files handle their attributes in ParseNakedFileElement. 5221 // Naked files handle their attributes in ParseNakedFileElement.
5222 if (!isNakedFile) 5222 if (!isNakedFile)
5223 { 5223 {
5224 this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, attrib.Name.LocalName)); 5224 this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, attrib.Name.LocalName));
5225 } 5225 }
5226 break;
5227 case "Assembly":
5228 var assemblyValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5229 switch (assemblyValue)
5230 {
5231 case ".net":
5232 assemblyType = AssemblyType.DotNetAssembly;
5233 break; 5226 break;
5234 case "no": 5227 case "Assembly":
5235 assemblyType = AssemblyType.NotAnAssembly; 5228 var assemblyValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5229 switch (assemblyValue)
5230 {
5231 case ".net":
5232 assemblyType = AssemblyType.DotNetAssembly;
5233 break;
5234 case "no":
5235 assemblyType = AssemblyType.NotAnAssembly;
5236 break;
5237 case "win32":
5238 assemblyType = AssemblyType.Win32Assembly;
5239 break;
5240 default:
5241 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, "File", "Assembly", assemblyValue, "no", "win32", ".net"));
5242 break;
5243 }
5236 break; 5244 break;
5237 case "win32": 5245 case "AssemblyApplication":
5238 assemblyType = AssemblyType.Win32Assembly; 5246 assemblyApplication = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
5247 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, assemblyApplication);
5239 break; 5248 break;
5240 default: 5249 case "AssemblyManifest":
5241 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, "File", "Assembly", assemblyValue, "no", "win32", ".net")); 5250 assemblyManifest = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
5251 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, assemblyManifest);
5242 break; 5252 break;
5243 } 5253 case "BindPath":
5244 break; 5254 bindPath = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty);
5245 case "AssemblyApplication": 5255 break;
5246 assemblyApplication = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 5256 case "Checksum":
5247 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, assemblyApplication); 5257 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
5248 break; 5258 {
5249 case "AssemblyManifest": 5259 checksum = true;
5250 assemblyManifest = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 5260 //bits |= MsiInterop.MsidbFileAttributesChecksum;
5251 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, assemblyManifest); 5261 }
5252 break; 5262 break;
5253 case "BindPath": 5263 case "CompanionFile":
5254 bindPath = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); 5264 companionFile = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
5255 break; 5265 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, companionFile);
5256 case "Checksum": 5266 break;
5257 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 5267 case "Compressed":
5258 { 5268 var compressedValue = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib);
5259 checksum = true; 5269 if (YesNoDefaultType.Yes == compressedValue)
5260 //bits |= MsiInterop.MsidbFileAttributesChecksum; 5270 {
5261 } 5271 compressed = true;
5262 break; 5272 //bits |= MsiInterop.MsidbFileAttributesCompressed;
5263 case "CompanionFile": 5273 }
5264 companionFile = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 5274 else if (YesNoDefaultType.No == compressedValue)
5265 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.File, companionFile); 5275 {
5266 break; 5276 compressed = false;
5267 case "Compressed": 5277 //bits |= MsiInterop.MsidbFileAttributesNoncompressed;
5268 var compressedValue = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib); 5278 }
5269 if (YesNoDefaultType.Yes == compressedValue) 5279 break;
5270 { 5280 case "DefaultLanguage":
5271 compressed = true; 5281 defaultLanguage = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5272 //bits |= MsiInterop.MsidbFileAttributesCompressed; 5282 break;
5273 } 5283 case "DefaultSize":
5274 else if (YesNoDefaultType.No == compressedValue) 5284 defaultSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue);
5275 { 5285 break;
5276 compressed = false; 5286 case "DefaultVersion":
5277 //bits |= MsiInterop.MsidbFileAttributesNoncompressed; 5287 defaultVersion = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5278 } 5288 break;
5279 break; 5289 case "DiskId":
5280 case "DefaultLanguage": 5290 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue);
5281 defaultLanguage = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 5291 break;
5282 break; 5292 case "FontTitle":
5283 case "DefaultSize": 5293 fontTitle = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5284 defaultSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue); 5294 break;
5285 break; 5295 case "Hidden":
5286 case "DefaultVersion": 5296 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
5287 defaultVersion = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 5297 {
5288 break; 5298 hidden = true;
5289 case "DiskId": 5299 //bits |= MsiInterop.MsidbFileAttributesHidden;
5290 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); 5300 }
5291 break; 5301 break;
5292 case "FontTitle": 5302 case "KeyPath":
5293 fontTitle = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 5303 keyPath = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5294 break;
5295 case "Hidden":
5296 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
5297 {
5298 hidden = true;
5299 //bits |= MsiInterop.MsidbFileAttributesHidden;
5300 }
5301 break;
5302 case "KeyPath":
5303 keyPath = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5304 break;
5305 case "PatchGroup":
5306 patchGroup = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int32.MaxValue);
5307 break;
5308 case "PatchIgnore":
5309 patchIgnore = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5310 break;
5311 case "PatchWholeFile":
5312 patchIncludeWholeFile = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5313 break;
5314 case "PatchAllowIgnoreOnError":
5315 patchAllowIgnoreOnError = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5316 break;
5317 case "ProcessorArchitecture":
5318 var procArchValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5319 switch (procArchValue)
5320 {
5321 case "msil":
5322 procArch = "MSIL";
5323 break; 5304 break;
5324 case "x86": 5305 case "PatchGroup":
5325 procArch = "x86"; 5306 patchGroup = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int32.MaxValue);
5326 break; 5307 break;
5327 case "x64": 5308 case "PatchIgnore":
5328 procArch = "amd64"; 5309 patchIgnore = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5329 break; 5310 break;
5330 case "arm64": 5311 case "PatchWholeFile":
5331 procArch = "arm64"; 5312 patchIncludeWholeFile = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5332 break; 5313 break;
5333 case "": 5314 case "PatchAllowIgnoreOnError":
5315 patchAllowIgnoreOnError = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5316 break;
5317 case "ProcessorArchitecture":
5318 var procArchValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5319 switch (procArchValue)
5320 {
5321 case "msil":
5322 procArch = "MSIL";
5323 break;
5324 case "x86":
5325 procArch = "x86";
5326 break;
5327 case "x64":
5328 procArch = "amd64";
5329 break;
5330 case "arm64":
5331 procArch = "arm64";
5332 break;
5333 case "":
5334 break;
5335 default:
5336 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, "File", "ProcessorArchitecture", procArchValue, "msil", "x86", "x64"));
5337 break;
5338 }
5339 break;
5340 case "ReadOnly":
5341 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
5342 {
5343 readOnly = true;
5344 //bits |= MsiInterop.MsidbFileAttributesReadOnly;
5345 }
5346 break;
5347 case "SelfRegCost":
5348 selfRegCost = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
5349 break;
5350 case "System":
5351 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
5352 {
5353 system = true;
5354 //bits |= MsiInterop.MsidbFileAttributesSystem;
5355 }
5356 break;
5357 case "TrueType":
5358 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
5359 {
5360 fontTitle = String.Empty;
5361 }
5362 break;
5363 case "Vital":
5364 var isVital = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5365 if (YesNoType.Yes == isVital)
5366 {
5367 vital = true;
5368 //bits |= MsiInterop.MsidbFileAttributesVital;
5369 }
5370 else if (YesNoType.No == isVital)
5371 {
5372 vital = false;
5373 //bits &= ~MsiInterop.MsidbFileAttributesVital;
5374 }
5334 break; 5375 break;
5335 default: 5376 default:
5336 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, "File", "ProcessorArchitecture", procArchValue, "msil", "x86", "x64")); 5377 this.Core.UnexpectedAttribute(node, attrib);
5337 break; 5378 break;
5338 }
5339 break;
5340 case "ReadOnly":
5341 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
5342 {
5343 readOnly = true;
5344 //bits |= MsiInterop.MsidbFileAttributesReadOnly;
5345 }
5346 break;
5347 case "SelfRegCost":
5348 selfRegCost = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
5349 break;
5350 case "System":
5351 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
5352 {
5353 system = true;
5354 //bits |= MsiInterop.MsidbFileAttributesSystem;
5355 }
5356 break;
5357 case "TrueType":
5358 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
5359 {
5360 fontTitle = String.Empty;
5361 }
5362 break;
5363 case "Vital":
5364 var isVital = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
5365 if (YesNoType.Yes == isVital)
5366 {
5367 vital = true;
5368 //bits |= MsiInterop.MsidbFileAttributesVital;
5369 }
5370 else if (YesNoType.No == isVital)
5371 {
5372 vital = false;
5373 //bits &= ~MsiInterop.MsidbFileAttributesVital;
5374 }
5375 break;
5376 default:
5377 this.Core.UnexpectedAttribute(node, attrib);
5378 break;
5379 } 5379 }
5380 } 5380 }
5381 else 5381 else
@@ -5528,55 +5528,55 @@ namespace WixToolset.Core
5528 { 5528 {
5529 switch (child.Name.LocalName) 5529 switch (child.Name.LocalName)
5530 { 5530 {
5531 case "AppId": 5531 case "AppId":
5532 this.ParseAppIdElement(child, componentId, YesNoType.NotSet, id.Id, null, null); 5532 this.ParseAppIdElement(child, componentId, YesNoType.NotSet, id.Id, null, null);
5533 break; 5533 break;
5534 case "AssemblyName": 5534 case "AssemblyName":
5535 this.ParseAssemblyName(child, componentId); 5535 this.ParseAssemblyName(child, componentId);
5536 break; 5536 break;
5537 case "Class": 5537 case "Class":
5538 this.ParseClassElement(child, componentId, YesNoType.NotSet, id.Id, null, null, null); 5538 this.ParseClassElement(child, componentId, YesNoType.NotSet, id.Id, null, null, null);
5539 break; 5539 break;
5540 case "CopyFile": 5540 case "CopyFile":
5541 this.ParseCopyFileElement(child, componentId, id.Id); 5541 this.ParseCopyFileElement(child, componentId, id.Id);
5542 break; 5542 break;
5543 case "IgnoreRange": 5543 case "IgnoreRange":
5544 this.ParseRangeElement(child, ref ignoreOffsets, ref ignoreLengths); 5544 this.ParseRangeElement(child, ref ignoreOffsets, ref ignoreLengths);
5545 break; 5545 break;
5546 case "ODBCDriver": 5546 case "ODBCDriver":
5547 this.ParseODBCDriverOrTranslator(child, componentId, id.Id, SymbolDefinitionType.ODBCDriver); 5547 this.ParseODBCDriverOrTranslator(child, componentId, id.Id, SymbolDefinitionType.ODBCDriver);
5548 break; 5548 break;
5549 case "ODBCTranslator": 5549 case "ODBCTranslator":
5550 this.ParseODBCDriverOrTranslator(child, componentId, id.Id, SymbolDefinitionType.ODBCTranslator); 5550 this.ParseODBCDriverOrTranslator(child, componentId, id.Id, SymbolDefinitionType.ODBCTranslator);
5551 break; 5551 break;
5552 case "Permission": 5552 case "Permission":
5553 this.ParsePermissionElement(child, id.Id, "File"); 5553 this.ParsePermissionElement(child, id.Id, "File");
5554 break; 5554 break;
5555 case "PermissionEx": 5555 case "PermissionEx":
5556 this.ParsePermissionExElement(child, id.Id, "File"); 5556 this.ParsePermissionExElement(child, id.Id, "File");
5557 break; 5557 break;
5558 case "ProtectRange": 5558 case "ProtectRange":
5559 this.ParseRangeElement(child, ref protectOffsets, ref protectLengths); 5559 this.ParseRangeElement(child, ref protectOffsets, ref protectLengths);
5560 break; 5560 break;
5561 case "Shortcut": 5561 case "Shortcut":
5562 this.ParseShortcutElement(child, componentId, node.Name.LocalName, id.Id, keyPath); 5562 this.ParseShortcutElement(child, componentId, node.Name.LocalName, id.Id, keyPath);
5563 break; 5563 break;
5564 case "SymbolPath": 5564 case "SymbolPath":
5565 if (null != symbols) 5565 if (null != symbols)
5566 { 5566 {
5567 symbols += ";" + this.ParseSymbolPathElement(child); 5567 symbols += ";" + this.ParseSymbolPathElement(child);
5568 } 5568 }
5569 else 5569 else
5570 { 5570 {
5571 symbols = this.ParseSymbolPathElement(child); 5571 symbols = this.ParseSymbolPathElement(child);
5572 } 5572 }
5573 break; 5573 break;
5574 case "TypeLib": 5574 case "TypeLib":
5575 this.ParseTypeLibElement(child, componentId, id.Id, win64Component); 5575 this.ParseTypeLibElement(child, componentId, id.Id, win64Component);
5576 break; 5576 break;
5577 default: 5577 default:
5578 this.Core.UnexpectedElement(node, child); 5578 this.Core.UnexpectedElement(node, child);
5579 break; 5579 break;
5580 } 5580 }
5581 } 5581 }
5582 else 5582 else
@@ -5652,34 +5652,34 @@ namespace WixToolset.Core
5652 { 5652 {
5653 switch (attrib.Name.LocalName) 5653 switch (attrib.Name.LocalName)
5654 { 5654 {
5655 case "Bitness": 5655 case "Bitness":
5656 var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 5656 var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5657 switch (bitnessValue) 5657 switch (bitnessValue)
5658 { 5658 {
5659 case "always32": 5659 case "always32":
5660 win64 = false; 5660 win64 = false;
5661 break; 5661 break;
5662 case "always64": 5662 case "always64":
5663 win64 = true; 5663 win64 = true;
5664 break; 5664 break;
5665 case "default": 5665 case "default":
5666 case "": 5666 case "":
5667 break; 5667 break;
5668 default: 5668 default:
5669 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64")); 5669 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64"));
5670 break; 5670 break;
5671 } 5671 }
5672 break; 5672 break;
5673 case "Condition": 5673 case "Condition":
5674 condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 5674 condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5675 break; 5675 break;
5676 case "Directory": 5676 case "Directory":
5677 directoryId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 5677 directoryId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
5678 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, directoryId); 5678 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Directory, directoryId);
5679 break; 5679 break;
5680 case "Subdirectory": 5680 case "Subdirectory":
5681 subdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true); 5681 subdirectory = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, allowRelative: true);
5682 break; 5682 break;
5683 } 5683 }
5684 } 5684 }
5685 } 5685 }
@@ -5700,42 +5700,45 @@ namespace WixToolset.Core
5700 5700
5701 this.ParseFileElementOtherAttributes(node, id.Id, directoryId, diskId: CompilerConstants.IntegerNotSet, id, name, shortName, source, out var _, componentGuid: "*", isNakedFile: true, fileSymbol: out var fileSymbol, assemblySymbol: out var assemblySymbol); 5701 this.ParseFileElementOtherAttributes(node, id.Id, directoryId, diskId: CompilerConstants.IntegerNotSet, id, name, shortName, source, out var _, componentGuid: "*", isNakedFile: true, fileSymbol: out var fileSymbol, assemblySymbol: out var assemblySymbol);
5702 5702
5703 this.Core.AddSymbol(fileSymbol); 5703 if (!this.Core.EncounteredError)
5704
5705 this.Core.AddSymbol(new ComponentSymbol(sourceLineNumbers, id)
5706 { 5704 {
5707 ComponentId = "*", 5705 this.Core.AddSymbol(fileSymbol);
5708 DirectoryRef = directoryId, 5706
5709 Location = ComponentLocation.LocalOnly, 5707 this.Core.AddSymbol(new ComponentSymbol(sourceLineNumbers, id)
5710 Condition = condition, 5708 {
5711 KeyPath = id.Id, 5709 ComponentId = "*",
5712 KeyPathType = ComponentKeyPathType.File, 5710 DirectoryRef = directoryId,
5713 DisableRegistryReflection = false, 5711 Location = ComponentLocation.LocalOnly,
5714 NeverOverwrite = false, 5712 Condition = condition,
5715 Permanent = false, 5713 KeyPath = id.Id,
5716 SharedDllRefCount = false, 5714 KeyPathType = ComponentKeyPathType.File,
5717 Shared = false, 5715 DisableRegistryReflection = false,
5718 Transitive = false, 5716 NeverOverwrite = false,
5719 UninstallWhenSuperseded = false, 5717 Permanent = false,
5720 Win64 = win64, 5718 SharedDllRefCount = false,
5721 }); 5719 Shared = false,
5720 Transitive = false,
5721 UninstallWhenSuperseded = false,
5722 Win64 = win64,
5723 });
5722 5724
5723 if (assemblySymbol != null) 5725 if (assemblySymbol != null)
5724 { 5726 {
5725 this.Core.AddSymbol(assemblySymbol); 5727 this.Core.AddSymbol(assemblySymbol);
5726 } 5728 }
5727 5729
5728 this.ParseFileElementChildren(node, fileSymbol, keyPath: YesNoType.Yes, win64); 5730 this.ParseFileElementChildren(node, fileSymbol, keyPath: YesNoType.Yes, win64);
5729 5731
5730 // if this is a module, automatically add this component to the references to ensure it gets in the ModuleComponents table 5732 // if this is a module, automatically add this component to the references to ensure it gets in the ModuleComponents table
5731 if (this.compilingModule) 5733 if (this.compilingModule)
5732 { 5734 {
5733 this.Core.CreateComplexReference(sourceLineNumbers, ComplexReferenceParentType.Module, this.activeName, this.activeLanguage, ComplexReferenceChildType.Component, fileSymbol.Id.Id, false); 5735 this.Core.CreateComplexReference(sourceLineNumbers, ComplexReferenceParentType.Module, this.activeName, this.activeLanguage, ComplexReferenceChildType.Component, fileSymbol.Id.Id, false);
5734 } 5736 }
5735 else if (ComplexReferenceParentType.Unknown != parentType && null != parentId) // if parent was provided, add a complex reference to that. 5737 else if (ComplexReferenceParentType.Unknown != parentType && null != parentId) // if parent was provided, add a complex reference to that.
5736 { 5738 {
5737 // If the naked file's component is defined directly under a feature, then mark the complex reference primary. 5739 // If the naked file's component is defined directly under a feature, then mark the complex reference primary.
5738 this.Core.CreateComplexReference(sourceLineNumbers, parentType, parentId, null, ComplexReferenceChildType.Component, id.Id, ComplexReferenceParentType.Feature == parentType); 5740 this.Core.CreateComplexReference(sourceLineNumbers, parentType, parentId, null, ComplexReferenceChildType.Component, id.Id, ComplexReferenceParentType.Feature == parentType);
5741 }
5739 } 5742 }
5740 } 5743 }
5741 } 5744 }
@@ -5892,39 +5895,39 @@ namespace WixToolset.Core
5892 { 5895 {
5893 switch (attrib.Name.LocalName) 5896 switch (attrib.Name.LocalName)
5894 { 5897 {
5895 case "Id": 5898 case "Id":
5896 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 5899 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
5897 break; 5900 break;
5898 case "Name": 5901 case "Name":
5899 name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false); 5902 name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false);
5900 break; 5903 break;
5901 case "MinVersion": 5904 case "MinVersion":
5902 minVersion = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 5905 minVersion = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5903 break; 5906 break;
5904 case "MaxVersion": 5907 case "MaxVersion":
5905 maxVersion = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 5908 maxVersion = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5906 break; 5909 break;
5907 case "MinSize": 5910 case "MinSize":
5908 minSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue); 5911 minSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue);
5909 break; 5912 break;
5910 case "MaxSize": 5913 case "MaxSize":
5911 maxSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue); 5914 maxSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue);
5912 break; 5915 break;
5913 case "MinDate": 5916 case "MinDate":
5914 minDate = this.Core.GetAttributeDateTimeValue(sourceLineNumbers, attrib); 5917 minDate = this.Core.GetAttributeDateTimeValue(sourceLineNumbers, attrib);
5915 break; 5918 break;
5916 case "MaxDate": 5919 case "MaxDate":
5917 maxDate = this.Core.GetAttributeDateTimeValue(sourceLineNumbers, attrib); 5920 maxDate = this.Core.GetAttributeDateTimeValue(sourceLineNumbers, attrib);
5918 break; 5921 break;
5919 case "Languages": 5922 case "Languages":
5920 languages = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 5923 languages = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
5921 break; 5924 break;
5922 case "ShortName": 5925 case "ShortName":
5923 shortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false); 5926 shortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false);
5924 break; 5927 break;
5925 default: 5928 default:
5926 this.Core.UnexpectedAttribute(node, attrib); 5929 this.Core.UnexpectedAttribute(node, attrib);
5927 break; 5930 break;
5928 } 5931 }
5929 } 5932 }
5930 else 5933 else
@@ -6067,12 +6070,12 @@ namespace WixToolset.Core
6067 { 6070 {
6068 switch (attrib.Name.LocalName) 6071 switch (attrib.Name.LocalName)
6069 { 6072 {
6070 case "Id": 6073 case "Id":
6071 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 6074 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
6072 break; 6075 break;
6073 default: 6076 default:
6074 this.Core.UnexpectedAttribute(node, attrib); 6077 this.Core.UnexpectedAttribute(node, attrib);
6075 break; 6078 break;
6076 } 6079 }
6077 } 6080 }
6078 else 6081 else
@@ -6092,181 +6095,181 @@ namespace WixToolset.Core
6092 { 6095 {
6093 switch (child.Name.LocalName) 6096 switch (child.Name.LocalName)
6094 { 6097 {
6095 case "_locDefinition": 6098 case "_locDefinition":
6096 break; 6099 break;
6097 case "AdminExecuteSequence": 6100 case "AdminExecuteSequence":
6098 this.ParseSequenceElement(child, SequenceTable.AdminExecuteSequence); 6101 this.ParseSequenceElement(child, SequenceTable.AdminExecuteSequence);
6099 break; 6102 break;
6100 case "AdminUISequence": 6103 case "AdminUISequence":
6101 this.ParseSequenceElement(child, SequenceTable.AdminUISequence); 6104 this.ParseSequenceElement(child, SequenceTable.AdminUISequence);
6102 break; 6105 break;
6103 case "AdvertiseExecuteSequence": 6106 case "AdvertiseExecuteSequence":
6104 this.ParseSequenceElement(child, SequenceTable.AdvertiseExecuteSequence); 6107 this.ParseSequenceElement(child, SequenceTable.AdvertiseExecuteSequence);
6105 break; 6108 break;
6106 case "InstallExecuteSequence": 6109 case "InstallExecuteSequence":
6107 this.ParseSequenceElement(child, SequenceTable.InstallExecuteSequence); 6110 this.ParseSequenceElement(child, SequenceTable.InstallExecuteSequence);
6108 break; 6111 break;
6109 case "InstallUISequence": 6112 case "InstallUISequence":
6110 this.ParseSequenceElement(child, SequenceTable.InstallUISequence); 6113 this.ParseSequenceElement(child, SequenceTable.InstallUISequence);
6111 break; 6114 break;
6112 case "AppId": 6115 case "AppId":
6113 this.ParseAppIdElement(child, null, YesNoType.Yes, null, null, null); 6116 this.ParseAppIdElement(child, null, YesNoType.Yes, null, null, null);
6114 break; 6117 break;
6115 case "Binary": 6118 case "Binary":
6116 this.ParseBinaryElement(child); 6119 this.ParseBinaryElement(child);
6117 break; 6120 break;
6118 case "BootstrapperApplication": 6121 case "BootstrapperApplication":
6119 this.ParseBootstrapperApplicationElement(child); 6122 this.ParseBootstrapperApplicationElement(child);
6120 break; 6123 break;
6121 case "BootstrapperApplicationRef": 6124 case "BootstrapperApplicationRef":
6122 this.ParseBootstrapperApplicationRefElement(child); 6125 this.ParseBootstrapperApplicationRefElement(child);
6123 break; 6126 break;
6124 case "BundleCustomData": 6127 case "BundleCustomData":
6125 this.ParseBundleCustomDataElement(child); 6128 this.ParseBundleCustomDataElement(child);
6126 break; 6129 break;
6127 case "BundleCustomDataRef": 6130 case "BundleCustomDataRef":
6128 this.ParseBundleCustomDataRefElement(child); 6131 this.ParseBundleCustomDataRefElement(child);
6129 break; 6132 break;
6130 case "BootstrapperExtension": 6133 case "BootstrapperExtension":
6131 this.ParseBootstrapperExtensionElement(child); 6134 this.ParseBootstrapperExtensionElement(child);
6132 break; 6135 break;
6133 case "BootstrapperExtensionRef": 6136 case "BootstrapperExtensionRef":
6134 this.ParseSimpleRefElement(child, SymbolDefinitions.WixBootstrapperExtension); 6137 this.ParseSimpleRefElement(child, SymbolDefinitions.WixBootstrapperExtension);
6135 break; 6138 break;
6136 case "ComplianceCheck": 6139 case "ComplianceCheck":
6137 this.ParseComplianceCheckElement(child); 6140 this.ParseComplianceCheckElement(child);
6138 break; 6141 break;
6139 case "Component": 6142 case "Component":
6140 this.ParseComponentElement(child, ComplexReferenceParentType.Unknown, null, null, CompilerConstants.IntegerNotSet, null, null); 6143 this.ParseComponentElement(child, ComplexReferenceParentType.Unknown, null, null, CompilerConstants.IntegerNotSet, null, null);
6141 break; 6144 break;
6142 case "ComponentGroup": 6145 case "ComponentGroup":
6143 this.ParseComponentGroupElement(child, ComplexReferenceParentType.Unknown, id?.Id); 6146 this.ParseComponentGroupElement(child, ComplexReferenceParentType.Unknown, id?.Id);
6144 break; 6147 break;
6145 case "Container": 6148 case "Container":
6146 this.ParseContainerElement(child); 6149 this.ParseContainerElement(child);
6147 break; 6150 break;
6148 case "CustomAction": 6151 case "CustomAction":
6149 this.ParseCustomActionElement(child); 6152 this.ParseCustomActionElement(child);
6150 break; 6153 break;
6151 case "CustomActionRef": 6154 case "CustomActionRef":
6152 this.ParseSimpleRefElement(child, SymbolDefinitions.CustomAction); 6155 this.ParseSimpleRefElement(child, SymbolDefinitions.CustomAction);
6153 break; 6156 break;
6154 case "CustomTable": 6157 case "CustomTable":
6155 this.ParseCustomTableElement(child); 6158 this.ParseCustomTableElement(child);
6156 break; 6159 break;
6157 case "CustomTableRef": 6160 case "CustomTableRef":
6158 this.ParseCustomTableRefElement(child); 6161 this.ParseCustomTableRefElement(child);
6159 break; 6162 break;
6160 case "Directory": 6163 case "Directory":
6161 this.ParseDirectoryElement(child, null, CompilerConstants.IntegerNotSet, String.Empty); 6164 this.ParseDirectoryElement(child, null, CompilerConstants.IntegerNotSet, String.Empty);
6162 break; 6165 break;
6163 case "DirectoryRef": 6166 case "DirectoryRef":
6164 this.ParseDirectoryRefElement(child); 6167 this.ParseDirectoryRefElement(child);
6165 break; 6168 break;
6166 case "EmbeddedChainer": 6169 case "EmbeddedChainer":
6167 this.ParseEmbeddedChainerElement(child); 6170 this.ParseEmbeddedChainerElement(child);
6168 break; 6171 break;
6169 case "EmbeddedChainerRef": 6172 case "EmbeddedChainerRef":
6170 this.ParseSimpleRefElement(child, SymbolDefinitions.MsiEmbeddedChainer); 6173 this.ParseSimpleRefElement(child, SymbolDefinitions.MsiEmbeddedChainer);
6171 break; 6174 break;
6172 case "EnsureTable": 6175 case "EnsureTable":
6173 this.ParseEnsureTableElement(child); 6176 this.ParseEnsureTableElement(child);
6174 break; 6177 break;
6175 case "Feature": 6178 case "Feature":
6176 this.ParseFeatureElement(child, ComplexReferenceParentType.Unknown, null, ref featureDisplay); 6179 this.ParseFeatureElement(child, ComplexReferenceParentType.Unknown, null, ref featureDisplay);
6177 break; 6180 break;
6178 case "FeatureGroup": 6181 case "FeatureGroup":
6179 this.ParseFeatureGroupElement(child, ComplexReferenceParentType.Unknown, id?.Id); 6182 this.ParseFeatureGroupElement(child, ComplexReferenceParentType.Unknown, id?.Id);
6180 break; 6183 break;
6181 case "FeatureRef": 6184 case "FeatureRef":
6182 this.ParseFeatureRefElement(child, ComplexReferenceParentType.Unknown, null); 6185 this.ParseFeatureRefElement(child, ComplexReferenceParentType.Unknown, null);
6183 break; 6186 break;
6184 case "File": 6187 case "File":
6185 this.ParseNakedFileElement(child, ComplexReferenceParentType.Unknown, null, null, null); 6188 this.ParseNakedFileElement(child, ComplexReferenceParentType.Unknown, null, null, null);
6186 break; 6189 break;
6187 case "Files": 6190 case "Files":
6188 this.ParseFilesElement(child, ComplexReferenceParentType.Unknown, null, null, null); 6191 this.ParseFilesElement(child, ComplexReferenceParentType.Unknown, null, null, null);
6189 break; 6192 break;
6190 case "Icon": 6193 case "Icon":
6191 this.ParseIconElement(child); 6194 this.ParseIconElement(child);
6192 break; 6195 break;
6193 case "Media": 6196 case "Media":
6194 this.ParseMediaElement(child, null); 6197 this.ParseMediaElement(child, null);
6195 break; 6198 break;
6196 case "MediaTemplate": 6199 case "MediaTemplate":
6197 this.ParseMediaTemplateElement(child, null); 6200 this.ParseMediaTemplateElement(child, null);
6198 break; 6201 break;
6199 case "Launch": 6202 case "Launch":
6200 this.ParseLaunchElement(child); 6203 this.ParseLaunchElement(child);
6201 break; 6204 break;
6202 case "PackageGroup": 6205 case "PackageGroup":
6203 this.ParsePackageGroupElement(child); 6206 this.ParsePackageGroupElement(child);
6204 break; 6207 break;
6205 case "PackageCertificates": 6208 case "PackageCertificates":
6206 case "PatchCertificates": 6209 case "PatchCertificates":
6207 this.ParseCertificatesElement(child); 6210 this.ParseCertificatesElement(child);
6208 break; 6211 break;
6209 case "PatchFamily": 6212 case "PatchFamily":
6210 this.ParsePatchFamilyElement(child, ComplexReferenceParentType.Unknown, id?.Id); 6213 this.ParsePatchFamilyElement(child, ComplexReferenceParentType.Unknown, id?.Id);
6211 break; 6214 break;
6212 case "PatchFamilyGroup": 6215 case "PatchFamilyGroup":
6213 this.ParsePatchFamilyGroupElement(child, ComplexReferenceParentType.Unknown, id?.Id); 6216 this.ParsePatchFamilyGroupElement(child, ComplexReferenceParentType.Unknown, id?.Id);
6214 break; 6217 break;
6215 case "PatchFamilyGroupRef": 6218 case "PatchFamilyGroupRef":
6216 this.ParsePatchFamilyGroupRefElement(child, ComplexReferenceParentType.Unknown, id?.Id); 6219 this.ParsePatchFamilyGroupRefElement(child, ComplexReferenceParentType.Unknown, id?.Id);
6217 break; 6220 break;
6218 case "PayloadGroup": 6221 case "PayloadGroup":
6219 this.ParsePayloadGroupElement(child, ComplexReferenceParentType.Unknown, null); 6222 this.ParsePayloadGroupElement(child, ComplexReferenceParentType.Unknown, null);
6220 break; 6223 break;
6221 case "Property": 6224 case "Property":
6222 this.ParsePropertyElement(child); 6225 this.ParsePropertyElement(child);
6223 break; 6226 break;
6224 case "PropertyRef": 6227 case "PropertyRef":
6225 this.ParseSimpleRefElement(child, SymbolDefinitions.Property); 6228 this.ParseSimpleRefElement(child, SymbolDefinitions.Property);
6226 break; 6229 break;
6227 case "RelatedBundle": 6230 case "RelatedBundle":
6228 this.ParseRelatedBundleElement(child); 6231 this.ParseRelatedBundleElement(child);
6229 break; 6232 break;
6230 case "Requires": 6233 case "Requires":
6231 this.ParseRequiresElement(child, null); 6234 this.ParseRequiresElement(child, null);
6232 break; 6235 break;
6233 case "SetDirectory": 6236 case "SetDirectory":
6234 this.ParseSetDirectoryElement(child); 6237 this.ParseSetDirectoryElement(child);
6235 break; 6238 break;
6236 case "SetProperty": 6239 case "SetProperty":
6237 this.ParseSetPropertyElement(child); 6240 this.ParseSetPropertyElement(child);
6238 break; 6241 break;
6239 case "SetVariable": 6242 case "SetVariable":
6240 this.ParseSetVariableElement(child); 6243 this.ParseSetVariableElement(child);
6241 break; 6244 break;
6242 case "SetVariableRef": 6245 case "SetVariableRef":
6243 this.ParseSimpleRefElement(child, SymbolDefinitions.WixSetVariable); 6246 this.ParseSimpleRefElement(child, SymbolDefinitions.WixSetVariable);
6244 break; 6247 break;
6245 case "SFPCatalog": 6248 case "SFPCatalog":
6246 string parentName = null; 6249 string parentName = null;
6247 this.ParseSFPCatalogElement(child, ref parentName); 6250 this.ParseSFPCatalogElement(child, ref parentName);
6248 break; 6251 break;
6249 case "StandardDirectory": 6252 case "StandardDirectory":
6250 this.ParseStandardDirectoryElement(child); 6253 this.ParseStandardDirectoryElement(child);
6251 break; 6254 break;
6252 case "UI": 6255 case "UI":
6253 this.ParseUIElement(child); 6256 this.ParseUIElement(child);
6254 break; 6257 break;
6255 case "UIRef": 6258 case "UIRef":
6256 this.ParseSimpleRefElement(child, SymbolDefinitions.WixUI); 6259 this.ParseSimpleRefElement(child, SymbolDefinitions.WixUI);
6257 break; 6260 break;
6258 case "Upgrade": 6261 case "Upgrade":
6259 this.ParseUpgradeElement(child); 6262 this.ParseUpgradeElement(child);
6260 break; 6263 break;
6261 case "Variable": 6264 case "Variable":
6262 this.ParseVariableElement(child); 6265 this.ParseVariableElement(child);
6263 break; 6266 break;
6264 case "WixVariable": 6267 case "WixVariable":
6265 this.ParseWixVariableElement(child); 6268 this.ParseWixVariableElement(child);
6266 break; 6269 break;
6267 default: 6270 default:
6268 this.Core.UnexpectedElement(node, child); 6271 this.Core.UnexpectedElement(node, child);
6269 break; 6272 break;
6270 } 6273 }
6271 } 6274 }
6272 else 6275 else
@@ -6359,56 +6362,56 @@ namespace WixToolset.Core
6359 { 6362 {
6360 switch (attrib.Name.LocalName) 6363 switch (attrib.Name.LocalName)
6361 { 6364 {
6362 case "Id": 6365 case "Id":
6363 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 6366 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
6364 break; 6367 break;
6365 case "Action": 6368 case "Action":
6366 var actionValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6369 var actionValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6367 switch (actionValue) 6370 switch (actionValue)
6368 { 6371 {
6369 case "addLine": 6372 case "addLine":
6370 action = IniFileActionType.AddLine; 6373 action = IniFileActionType.AddLine;
6371 break; 6374 break;
6372 case "addTag": 6375 case "addTag":
6373 action = IniFileActionType.AddTag; 6376 action = IniFileActionType.AddTag;
6374 break; 6377 break;
6375 case "createLine": 6378 case "createLine":
6376 action = IniFileActionType.CreateLine; 6379 action = IniFileActionType.CreateLine;
6377 break; 6380 break;
6378 case "removeLine": 6381 case "removeLine":
6379 action = IniFileActionType.RemoveLine; 6382 action = IniFileActionType.RemoveLine;
6380 break; 6383 break;
6381 case "removeTag": 6384 case "removeTag":
6382 action = IniFileActionType.RemoveTag; 6385 action = IniFileActionType.RemoveTag;
6383 break; 6386 break;
6384 case "": // error case handled by GetAttributeValue() 6387 case "": // error case handled by GetAttributeValue()
6385 break; 6388 break;
6386 default: 6389 default:
6387 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Action", actionValue, "addLine", "addTag", "createLine", "removeLine", "removeTag")); 6390 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Action", actionValue, "addLine", "addTag", "createLine", "removeLine", "removeTag"));
6388 break; 6391 break;
6389 } 6392 }
6390 break; 6393 break;
6391 case "Directory": 6394 case "Directory":
6392 directory = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 6395 directory = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
6393 break; 6396 break;
6394 case "Key": 6397 case "Key":
6395 key = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6398 key = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6396 break; 6399 break;
6397 case "Name": 6400 case "Name":
6398 name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false); 6401 name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false);
6399 break; 6402 break;
6400 case "Section": 6403 case "Section":
6401 section = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6404 section = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6402 break; 6405 break;
6403 case "ShortName": 6406 case "ShortName":
6404 shortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false); 6407 shortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false);
6405 break; 6408 break;
6406 case "Value": 6409 case "Value":
6407 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6410 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6408 break; 6411 break;
6409 default: 6412 default:
6410 this.Core.UnexpectedAttribute(node, attrib); 6413 this.Core.UnexpectedAttribute(node, attrib);
6411 break; 6414 break;
6412 } 6415 }
6413 } 6416 }
6414 else 6417 else
@@ -6489,47 +6492,47 @@ namespace WixToolset.Core
6489 { 6492 {
6490 switch (attrib.Name.LocalName) 6493 switch (attrib.Name.LocalName)
6491 { 6494 {
6492 case "Id": 6495 case "Id":
6493 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 6496 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
6494 break;
6495 case "Field":
6496 field = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
6497 break;
6498 case "Key":
6499 key = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6500 break;
6501 case "Name":
6502 name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false);
6503 break;
6504 case "Section":
6505 section = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6506 break;
6507 case "ShortName":
6508 shortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false);
6509 break;
6510 case "Type":
6511 var typeValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6512 switch (typeValue)
6513 {
6514 case "directory":
6515 type = 0;
6516 break; 6497 break;
6517 case "file": 6498 case "Field":
6518 type = 1; 6499 field = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
6519 break; 6500 break;
6520 case "raw": 6501 case "Key":
6521 type = 2; 6502 key = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6522 break; 6503 break;
6523 case "": 6504 case "Name":
6505 name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false);
6506 break;
6507 case "Section":
6508 section = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6509 break;
6510 case "ShortName":
6511 shortName = this.Core.GetAttributeShortFilename(sourceLineNumbers, attrib, false);
6512 break;
6513 case "Type":
6514 var typeValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6515 switch (typeValue)
6516 {
6517 case "directory":
6518 type = 0;
6519 break;
6520 case "file":
6521 type = 1;
6522 break;
6523 case "raw":
6524 type = 2;
6525 break;
6526 case "":
6527 break;
6528 default:
6529 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Type", typeValue, "directory", "file", "registry"));
6530 break;
6531 }
6524 break; 6532 break;
6525 default: 6533 default:
6526 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Type", typeValue, "directory", "file", "registry")); 6534 this.Core.UnexpectedAttribute(node, attrib);
6527 break; 6535 break;
6528 }
6529 break;
6530 default:
6531 this.Core.UnexpectedAttribute(node, attrib);
6532 break;
6533 } 6536 }
6534 } 6537 }
6535 else 6538 else
@@ -6568,46 +6571,46 @@ namespace WixToolset.Core
6568 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); 6571 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child);
6569 switch (child.Name.LocalName) 6572 switch (child.Name.LocalName)
6570 { 6573 {
6571 case "DirectorySearch": 6574 case "DirectorySearch":
6572 if (oneChild) 6575 if (oneChild)
6573 { 6576 {
6574 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); 6577 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName));
6575 } 6578 }
6576 oneChild = true; 6579 oneChild = true;
6577 6580
6578 // directorysearch parentage should work like directory element, not the rest of the signature type because of the DrLocator.Parent column 6581 // directorysearch parentage should work like directory element, not the rest of the signature type because of the DrLocator.Parent column
6579 signature = this.ParseDirectorySearchElement(child, id.Id); 6582 signature = this.ParseDirectorySearchElement(child, id.Id);
6580 break; 6583 break;
6581 case "DirectorySearchRef": 6584 case "DirectorySearchRef":
6582 if (oneChild) 6585 if (oneChild)
6583 { 6586 {
6584 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); 6587 this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName));
6585 } 6588 }
6586 oneChild = true; 6589 oneChild = true;
6587 signature = this.ParseDirectorySearchRefElement(child, id.Id); 6590 signature = this.ParseDirectorySearchRefElement(child, id.Id);
6588 break; 6591 break;
6589 case "FileSearch": 6592 case "FileSearch":
6590 if (oneChild) 6593 if (oneChild)
6591 { 6594 {
6592 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 6595 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
6593 } 6596 }
6594 oneChild = true; 6597 oneChild = true;
6595 signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet); 6598 signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet);
6596 id = new Identifier(AccessModifier.Section, signature); // FileSearch signatures override parent signatures 6599 id = new Identifier(AccessModifier.Section, signature); // FileSearch signatures override parent signatures
6597 break; 6600 break;
6598 case "FileSearchRef": 6601 case "FileSearchRef":
6599 if (oneChild) 6602 if (oneChild)
6600 { 6603 {
6601 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); 6604 this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName));
6602 } 6605 }
6603 oneChild = true; 6606 oneChild = true;
6604 var newId = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature); // FileSearch signatures override parent signatures 6607 var newId = this.ParseSimpleRefElement(child, SymbolDefinitions.Signature); // FileSearch signatures override parent signatures
6605 id = new Identifier(AccessModifier.Section, newId); 6608 id = new Identifier(AccessModifier.Section, newId);
6606 signature = null; 6609 signature = null;
6607 break; 6610 break;
6608 default: 6611 default:
6609 this.Core.UnexpectedElement(node, child); 6612 this.Core.UnexpectedElement(node, child);
6610 break; 6613 break;
6611 } 6614 }
6612 } 6615 }
6613 else 6616 else
@@ -6652,13 +6655,13 @@ namespace WixToolset.Core
6652 { 6655 {
6653 switch (attrib.Name.LocalName) 6656 switch (attrib.Name.LocalName)
6654 { 6657 {
6655 case "Shared": 6658 case "Shared":
6656 shared = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 6659 shared = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
6657 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Component, shared); 6660 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Component, shared);
6658 break; 6661 break;
6659 default: 6662 default:
6660 this.Core.UnexpectedAttribute(node, attrib); 6663 this.Core.UnexpectedAttribute(node, attrib);
6661 break; 6664 break;
6662 } 6665 }
6663 } 6666 }
6664 else 6667 else
@@ -6711,32 +6714,32 @@ namespace WixToolset.Core
6711 { 6714 {
6712 switch (child.Name.LocalName) 6715 switch (child.Name.LocalName)
6713 { 6716 {
6714 case "DigitalCertificate": 6717 case "DigitalCertificate":
6715 var name = this.ParseDigitalCertificateElement(child); 6718 var name = this.ParseDigitalCertificateElement(child);
6716 6719
6717 if (!this.Core.EncounteredError) 6720 if (!this.Core.EncounteredError)
6718 {
6719 if ("PatchCertificates" == node.Name.LocalName)
6720 { 6721 {
6721 this.Core.AddSymbol(new MsiPatchCertificateSymbol(sourceLineNumbers) 6722 if ("PatchCertificates" == node.Name.LocalName)
6722 { 6723 {
6723 PatchCertificate = name, 6724 this.Core.AddSymbol(new MsiPatchCertificateSymbol(sourceLineNumbers)
6724 DigitalCertificateRef = name, 6725 {
6725 }); 6726 PatchCertificate = name,
6726 } 6727 DigitalCertificateRef = name,
6727 else 6728 });
6728 { 6729 }
6729 this.Core.AddSymbol(new MsiPackageCertificateSymbol(sourceLineNumbers) 6730 else
6730 { 6731 {
6731 PackageCertificate = name, 6732 this.Core.AddSymbol(new MsiPackageCertificateSymbol(sourceLineNumbers)
6732 DigitalCertificateRef = name, 6733 {
6733 }); 6734 PackageCertificate = name,
6735 DigitalCertificateRef = name,
6736 });
6737 }
6734 } 6738 }
6735 } 6739 break;
6736 break; 6740 default:
6737 default: 6741 this.Core.UnexpectedElement(node, child);
6738 this.Core.UnexpectedElement(node, child); 6742 break;
6739 break;
6740 } 6743 }
6741 } 6744 }
6742 else 6745 else
@@ -6763,15 +6766,15 @@ namespace WixToolset.Core
6763 { 6766 {
6764 switch (attrib.Name.LocalName) 6767 switch (attrib.Name.LocalName)
6765 { 6768 {
6766 case "Id": 6769 case "Id":
6767 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 6770 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
6768 break; 6771 break;
6769 case "SourceFile": 6772 case "SourceFile":
6770 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6773 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6771 break; 6774 break;
6772 default: 6775 default:
6773 this.Core.UnexpectedAttribute(node, attrib); 6776 this.Core.UnexpectedAttribute(node, attrib);
6774 break; 6777 break;
6775 } 6778 }
6776 } 6779 }
6777 else 6780 else
@@ -6828,12 +6831,12 @@ namespace WixToolset.Core
6828 { 6831 {
6829 switch (attrib.Name.LocalName) 6832 switch (attrib.Name.LocalName)
6830 { 6833 {
6831 case "SourceFile": 6834 case "SourceFile":
6832 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6835 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6833 break; 6836 break;
6834 default: 6837 default:
6835 this.Core.UnexpectedAttribute(node, attrib); 6838 this.Core.UnexpectedAttribute(node, attrib);
6836 break; 6839 break;
6837 } 6840 }
6838 } 6841 }
6839 else 6842 else
@@ -6854,12 +6857,12 @@ namespace WixToolset.Core
6854 { 6857 {
6855 switch (child.Name.LocalName) 6858 switch (child.Name.LocalName)
6856 { 6859 {
6857 case "DigitalCertificate": 6860 case "DigitalCertificate":
6858 certificateId = this.ParseDigitalCertificateElement(child); 6861 certificateId = this.ParseDigitalCertificateElement(child);
6859 break; 6862 break;
6860 default: 6863 default:
6861 this.Core.UnexpectedElement(node, child); 6864 this.Core.UnexpectedElement(node, child);
6862 break; 6865 break;
6863 } 6866 }
6864 } 6867 }
6865 else 6868 else
@@ -6923,42 +6926,42 @@ namespace WixToolset.Core
6923 { 6926 {
6924 switch (attrib.Name.LocalName) 6927 switch (attrib.Name.LocalName)
6925 { 6928 {
6926 case "AllowDowngrades": 6929 case "AllowDowngrades":
6927 allowDowngrades = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 6930 allowDowngrades = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
6928 break; 6931 break;
6929 case "AllowSameVersionUpgrades": 6932 case "AllowSameVersionUpgrades":
6930 allowSameVersionUpgrades = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 6933 allowSameVersionUpgrades = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
6931 break; 6934 break;
6932 case "Disallow": 6935 case "Disallow":
6933 blockUpgrades = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 6936 blockUpgrades = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
6934 break; 6937 break;
6935 case "DowngradeErrorMessage": 6938 case "DowngradeErrorMessage":
6936 downgradeErrorMessage = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6939 downgradeErrorMessage = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6937 break; 6940 break;
6938 case "DisallowUpgradeErrorMessage": 6941 case "DisallowUpgradeErrorMessage":
6939 disallowUpgradeErrorMessage = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6942 disallowUpgradeErrorMessage = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6940 break; 6943 break;
6941 case "MigrateFeatures": 6944 case "MigrateFeatures":
6942 migrateFeatures = (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)); 6945 migrateFeatures = (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib));
6943 break; 6946 break;
6944 case "IgnoreLanguage": 6947 case "IgnoreLanguage":
6945 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 6948 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
6946 { 6949 {
6947 productLanguage = null; 6950 productLanguage = null;
6948 } 6951 }
6949 break; 6952 break;
6950 case "IgnoreRemoveFailure": 6953 case "IgnoreRemoveFailure":
6951 ignoreRemoveFailure = (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)); 6954 ignoreRemoveFailure = (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib));
6952 break; 6955 break;
6953 case "RemoveFeatures": 6956 case "RemoveFeatures":
6954 removeFeatures = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6957 removeFeatures = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6955 break; 6958 break;
6956 case "Schedule": 6959 case "Schedule":
6957 schedule = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 6960 schedule = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
6958 break; 6961 break;
6959 default: 6962 default:
6960 this.Core.UnexpectedAttribute(node, attrib); 6963 this.Core.UnexpectedAttribute(node, attrib);
6961 break; 6964 break;
6962 } 6965 }
6963 } 6966 }
6964 else 6967 else
@@ -7101,34 +7104,34 @@ namespace WixToolset.Core
7101 { 7104 {
7102 switch (attrib.Name.LocalName) 7105 switch (attrib.Name.LocalName)
7103 { 7106 {
7104 case "Id": 7107 case "Id":
7105 id = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); 7108 id = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue);
7106 break; 7109 break;
7107 case "Cabinet": 7110 case "Cabinet":
7108 cabinet = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7111 cabinet = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7109 break; 7112 break;
7110 case "CompressionLevel": 7113 case "CompressionLevel":
7111 compressionLevel = this.ParseCompressionLevel(sourceLineNumbers, attrib); 7114 compressionLevel = this.ParseCompressionLevel(sourceLineNumbers, attrib);
7112 break; 7115 break;
7113 case "DiskPrompt": 7116 case "DiskPrompt":
7114 diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7117 diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7115 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Property, "DiskPrompt"); // ensure the output has a DiskPrompt Property defined 7118 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Property, "DiskPrompt"); // ensure the output has a DiskPrompt Property defined
7116 break; 7119 break;
7117 case "EmbedCab": 7120 case "EmbedCab":
7118 embedCab = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 7121 embedCab = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
7119 break; 7122 break;
7120 case "Layout": 7123 case "Layout":
7121 layout = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7124 layout = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7122 break; 7125 break;
7123 case "VolumeLabel": 7126 case "VolumeLabel":
7124 volumeLabel = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7127 volumeLabel = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7125 break; 7128 break;
7126 case "Source": 7129 case "Source":
7127 source = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7130 source = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7128 break; 7131 break;
7129 default: 7132 default:
7130 this.Core.UnexpectedAttribute(node, attrib); 7133 this.Core.UnexpectedAttribute(node, attrib);
7131 break; 7134 break;
7132 } 7135 }
7133 } 7136 }
7134 else 7137 else
@@ -7192,43 +7195,43 @@ namespace WixToolset.Core
7192 { 7195 {
7193 switch (child.Name.LocalName) 7196 switch (child.Name.LocalName)
7194 { 7197 {
7195 case "DigitalSignature": 7198 case "DigitalSignature":
7196 if (YesNoType.Yes == embedCab) 7199 if (YesNoType.Yes == embedCab)
7197 { 7200 {
7198 this.Core.Write(ErrorMessages.SignedEmbeddedCabinet(childSourceLineNumbers)); 7201 this.Core.Write(ErrorMessages.SignedEmbeddedCabinet(childSourceLineNumbers));
7199 } 7202 }
7200 else if (null == cabinet) 7203 else if (null == cabinet)
7201 { 7204 {
7202 this.Core.Write(ErrorMessages.ExpectedSignedCabinetName(childSourceLineNumbers)); 7205 this.Core.Write(ErrorMessages.ExpectedSignedCabinetName(childSourceLineNumbers));
7203 } 7206 }
7204 else 7207 else
7205 { 7208 {
7206 this.ParseDigitalSignatureElement(child, id.ToString(CultureInfo.InvariantCulture.NumberFormat)); 7209 this.ParseDigitalSignatureElement(child, id.ToString(CultureInfo.InvariantCulture.NumberFormat));
7207 } 7210 }
7208 break; 7211 break;
7209 case "PatchBaseline": 7212 case "PatchBaseline":
7210 if (patch) 7213 if (patch)
7211 { 7214 {
7212 this.ParsePatchBaselineElement(child, id); 7215 this.ParsePatchBaselineElement(child, id);
7213 } 7216 }
7214 else 7217 else
7215 { 7218 {
7219 this.Core.UnexpectedElement(node, child);
7220 }
7221 break;
7222 case "SymbolPath":
7223 if (null != symbols)
7224 {
7225 symbols += "" + this.ParseSymbolPathElement(child);
7226 }
7227 else
7228 {
7229 symbols = this.ParseSymbolPathElement(child);
7230 }
7231 break;
7232 default:
7216 this.Core.UnexpectedElement(node, child); 7233 this.Core.UnexpectedElement(node, child);
7217 } 7234 break;
7218 break;
7219 case "SymbolPath":
7220 if (null != symbols)
7221 {
7222 symbols += "" + this.ParseSymbolPathElement(child);
7223 }
7224 else
7225 {
7226 symbols = this.ParseSymbolPathElement(child);
7227 }
7228 break;
7229 default:
7230 this.Core.UnexpectedElement(node, child);
7231 break;
7232 } 7235 }
7233 } 7236 }
7234 else 7237 else
@@ -7287,53 +7290,53 @@ namespace WixToolset.Core
7287 { 7290 {
7288 switch (attrib.Name.LocalName) 7291 switch (attrib.Name.LocalName)
7289 { 7292 {
7290 case "CabinetTemplate": 7293 case "CabinetTemplate":
7291 var authoredCabinetTemplateValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); 7294 var authoredCabinetTemplateValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty);
7292 if (!String.IsNullOrEmpty(authoredCabinetTemplateValue)) 7295 if (!String.IsNullOrEmpty(authoredCabinetTemplateValue))
7293 {
7294 cabinetTemplate = authoredCabinetTemplateValue;
7295 }
7296
7297 // Create an example cabinet name using the maximum number of cabinets supported, 999.
7298 var exampleCabinetName = String.Format(cabinetTemplate, "###");
7299 if (!this.Core.IsValidLocIdentifier(exampleCabinetName))
7300 {
7301 // The example name should not match the authored template since that would nullify the
7302 // reason for having multiple cabinets. External cabinet files must also be valid file names.
7303 if (exampleCabinetName.Equals(authoredCabinetTemplateValue, StringComparison.OrdinalIgnoreCase) || !this.Core.IsValidLongFilename(exampleCabinetName, false))
7304 { 7296 {
7305 this.Core.Write(ErrorMessages.InvalidCabinetTemplate(sourceLineNumbers, cabinetTemplate)); 7297 cabinetTemplate = authoredCabinetTemplateValue;
7306 } 7298 }
7307 else if (!this.Core.IsValidLongFilename(exampleCabinetName) && !Common.ContainsValidBinderVariable(exampleCabinetName)) // ignore short names with wix variables because it rarely works out. 7299
7300 // Create an example cabinet name using the maximum number of cabinets supported, 999.
7301 var exampleCabinetName = String.Format(cabinetTemplate, "###");
7302 if (!this.Core.IsValidLocIdentifier(exampleCabinetName))
7308 { 7303 {
7309 this.Core.Write(WarningMessages.MediaExternalCabinetFilenameIllegal(sourceLineNumbers, node.Name.LocalName, "CabinetTemplate", cabinetTemplate)); 7304 // The example name should not match the authored template since that would nullify the
7305 // reason for having multiple cabinets. External cabinet files must also be valid file names.
7306 if (exampleCabinetName.Equals(authoredCabinetTemplateValue, StringComparison.OrdinalIgnoreCase) || !this.Core.IsValidLongFilename(exampleCabinetName, false))
7307 {
7308 this.Core.Write(ErrorMessages.InvalidCabinetTemplate(sourceLineNumbers, cabinetTemplate));
7309 }
7310 else if (!this.Core.IsValidLongFilename(exampleCabinetName) && !Common.ContainsValidBinderVariable(exampleCabinetName)) // ignore short names with wix variables because it rarely works out.
7311 {
7312 this.Core.Write(WarningMessages.MediaExternalCabinetFilenameIllegal(sourceLineNumbers, node.Name.LocalName, "CabinetTemplate", cabinetTemplate));
7313 }
7310 } 7314 }
7311 } 7315 break;
7312 break; 7316 case "CompressionLevel":
7313 case "CompressionLevel": 7317 compressionLevel = this.ParseCompressionLevel(sourceLineNumbers, attrib);
7314 compressionLevel = this.ParseCompressionLevel(sourceLineNumbers, attrib); 7318 break;
7315 break; 7319 case "DiskPrompt":
7316 case "DiskPrompt": 7320 diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7317 diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7321 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Property, "DiskPrompt"); // ensure the output has a DiskPrompt Property defined
7318 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Property, "DiskPrompt"); // ensure the output has a DiskPrompt Property defined 7322 this.Core.Write(WarningMessages.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName));
7319 this.Core.Write(WarningMessages.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); 7323 break;
7320 break; 7324 case "EmbedCab":
7321 case "EmbedCab": 7325 embedCab = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
7322 embedCab = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 7326 break;
7323 break; 7327 case "VolumeLabel":
7324 case "VolumeLabel": 7328 volumeLabel = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7325 volumeLabel = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7329 this.Core.Write(WarningMessages.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName));
7326 this.Core.Write(WarningMessages.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); 7330 break;
7327 break; 7331 case "MaximumUncompressedMediaSize":
7328 case "MaximumUncompressedMediaSize": 7332 maximumUncompressedMediaSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int32.MaxValue);
7329 maximumUncompressedMediaSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int32.MaxValue); 7333 break;
7330 break; 7334 case "MaximumCabinetSizeForLargeFileSplitting":
7331 case "MaximumCabinetSizeForLargeFileSplitting": 7335 maximumCabinetSizeForLargeFileSplitting = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, Compiler.MinValueOfMaxCabSizeForLargeFileSplitting, Compiler.MaxValueOfMaxCabSizeForLargeFileSplitting);
7332 maximumCabinetSizeForLargeFileSplitting = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, Compiler.MinValueOfMaxCabSizeForLargeFileSplitting, Compiler.MaxValueOfMaxCabSizeForLargeFileSplitting); 7336 break;
7333 break; 7337 default:
7334 default: 7338 this.Core.UnexpectedAttribute(node, attrib);
7335 this.Core.UnexpectedAttribute(node, attrib); 7339 break;
7336 break;
7337 } 7340 }
7338 } 7341 }
7339 else 7342 else
@@ -7397,27 +7400,27 @@ namespace WixToolset.Core
7397 { 7400 {
7398 switch (attrib.Name.LocalName) 7401 switch (attrib.Name.LocalName)
7399 { 7402 {
7400 case "Id": 7403 case "Id":
7401 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 7404 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
7402 break; 7405 break;
7403 case "DiskId": 7406 case "DiskId":
7404 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); 7407 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue);
7405 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Media, diskId.ToString(CultureInfo.InvariantCulture.NumberFormat)); 7408 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Media, diskId.ToString(CultureInfo.InvariantCulture.NumberFormat));
7406 break; 7409 break;
7407 case "FileCompression": 7410 case "FileCompression":
7408 var compress = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 7411 var compress = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
7409 attributes |= compress == YesNoType.Yes ? FileSymbolAttributes.Compressed : 0; 7412 attributes |= compress == YesNoType.Yes ? FileSymbolAttributes.Compressed : 0;
7410 attributes |= compress == YesNoType.No ? FileSymbolAttributes.Uncompressed : 0; 7413 attributes |= compress == YesNoType.No ? FileSymbolAttributes.Uncompressed : 0;
7411 break; 7414 break;
7412 case "Language": 7415 case "Language":
7413 language = this.Core.GetAttributeLocalizableIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue); 7416 language = this.Core.GetAttributeLocalizableIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
7414 break; 7417 break;
7415 case "SourceFile": 7418 case "SourceFile":
7416 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7419 sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7417 break; 7420 break;
7418 default: 7421 default:
7419 this.Core.UnexpectedAttribute(node, attrib); 7422 this.Core.UnexpectedAttribute(node, attrib);
7420 break; 7423 break;
7421 } 7424 }
7422 } 7425 }
7423 else 7426 else
@@ -7447,19 +7450,19 @@ namespace WixToolset.Core
7447 { 7450 {
7448 switch (child.Name.LocalName) 7451 switch (child.Name.LocalName)
7449 { 7452 {
7450 case "ConfigurationData": 7453 case "ConfigurationData":
7451 if (0 == configData.Length) 7454 if (0 == configData.Length)
7452 { 7455 {
7453 configData = this.ParseConfigurationDataElement(child); 7456 configData = this.ParseConfigurationDataElement(child);
7454 } 7457 }
7455 else 7458 else
7456 { 7459 {
7457 configData = String.Concat(configData, ",", this.ParseConfigurationDataElement(child)); 7460 configData = String.Concat(configData, ",", this.ParseConfigurationDataElement(child));
7458 } 7461 }
7459 break; 7462 break;
7460 default: 7463 default:
7461 this.Core.UnexpectedElement(node, child); 7464 this.Core.UnexpectedElement(node, child);
7462 break; 7465 break;
7463 } 7466 }
7464 } 7467 }
7465 else 7468 else
@@ -7577,15 +7580,15 @@ namespace WixToolset.Core
7577 { 7580 {
7578 switch (attrib.Name.LocalName) 7581 switch (attrib.Name.LocalName)
7579 { 7582 {
7580 case "Name": 7583 case "Name":
7581 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7584 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7582 break; 7585 break;
7583 case "Value": 7586 case "Value":
7584 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7587 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7585 break; 7588 break;
7586 default: 7589 default:
7587 this.Core.UnexpectedAttribute(node, attrib); 7590 this.Core.UnexpectedAttribute(node, attrib);
7588 break; 7591 break;
7589 } 7592 }
7590 } 7593 }
7591 else 7594 else
@@ -7705,16 +7708,16 @@ namespace WixToolset.Core
7705 { 7708 {
7706 switch (attrib.Name.LocalName) 7709 switch (attrib.Name.LocalName)
7707 { 7710 {
7708 case "Id": 7711 case "Id":
7709 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 7712 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
7710 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixMerge, id); 7713 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixMerge, id);
7711 break; 7714 break;
7712 case "Primary": 7715 case "Primary":
7713 primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 7716 primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
7714 break; 7717 break;
7715 default: 7718 default:
7716 this.Core.UnexpectedAttribute(node, attrib); 7719 this.Core.UnexpectedAttribute(node, attrib);
7717 break; 7720 break;
7718 } 7721 }
7719 } 7722 }
7720 else 7723 else
@@ -7755,21 +7758,21 @@ namespace WixToolset.Core
7755 { 7758 {
7756 switch (attrib.Name.LocalName) 7759 switch (attrib.Name.LocalName)
7757 { 7760 {
7758 case "Advertise": 7761 case "Advertise":
7759 advertise = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 7762 advertise = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
7760 break; 7763 break;
7761 case "Class": 7764 case "Class":
7762 classId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 7765 classId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
7763 break; 7766 break;
7764 case "ContentType": 7767 case "ContentType":
7765 contentType = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7768 contentType = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7766 break; 7769 break;
7767 case "Default": 7770 case "Default":
7768 returnContentType = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 7771 returnContentType = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
7769 break; 7772 break;
7770 default: 7773 default:
7771 this.Core.UnexpectedAttribute(node, attrib); 7774 this.Core.UnexpectedAttribute(node, attrib);
7772 break; 7775 break;
7773 } 7776 }
7774 } 7777 }
7775 else 7778 else
@@ -7843,19 +7846,19 @@ namespace WixToolset.Core
7843 { 7846 {
7844 switch (attrib.Name.LocalName) 7847 switch (attrib.Name.LocalName)
7845 { 7848 {
7846 case "Id": 7849 case "Id":
7847 case "Name": 7850 case "Name":
7848 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7851 name = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7849 break; 7852 break;
7850 case "Company": 7853 case "Company":
7851 company = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7854 company = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7852 break; 7855 break;
7853 case "Value": 7856 case "Value":
7854 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7857 value = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7855 break; 7858 break;
7856 default: 7859 default:
7857 this.Core.UnexpectedAttribute(node, attrib); 7860 this.Core.UnexpectedAttribute(node, attrib);
7858 break; 7861 break;
7859 } 7862 }
7860 } 7863 }
7861 else 7864 else
@@ -7929,16 +7932,16 @@ namespace WixToolset.Core
7929 { 7932 {
7930 switch (attrib.Name.LocalName) 7933 switch (attrib.Name.LocalName)
7931 { 7934 {
7932 case "Id": 7935 case "Id":
7933 id = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 7936 id = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
7934 if (id.Length > 0 && "*" != id) 7937 if (id.Length > 0 && "*" != id)
7935 { 7938 {
7936 id = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 7939 id = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
7937 } 7940 }
7938 break; 7941 break;
7939 default: 7942 default:
7940 this.Core.UnexpectedAttribute(node, attrib); 7943 this.Core.UnexpectedAttribute(node, attrib);
7941 break; 7944 break;
7942 } 7945 }
7943 } 7946 }
7944 else 7947 else
@@ -7973,12 +7976,12 @@ namespace WixToolset.Core
7973 { 7976 {
7974 switch (attrib.Name.LocalName) 7977 switch (attrib.Name.LocalName)
7975 { 7978 {
7976 case "Id": 7979 case "Id":
7977 id = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); 7980 id = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
7978 break; 7981 break;
7979 default: 7982 default:
7980 this.Core.UnexpectedAttribute(node, attrib); 7983 this.Core.UnexpectedAttribute(node, attrib);
7981 break; 7984 break;
7982 } 7985 }
7983 } 7986 }
7984 else 7987 else
@@ -8013,12 +8016,12 @@ namespace WixToolset.Core
8013 { 8016 {
8014 switch (attrib.Name.LocalName) 8017 switch (attrib.Name.LocalName)
8015 { 8018 {
8016 case "Path": 8019 case "Path":
8017 path = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 8020 path = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8018 break; 8021 break;
8019 default: 8022 default:
8020 this.Core.UnexpectedAttribute(node, attrib); 8023 this.Core.UnexpectedAttribute(node, attrib);
8021 break; 8024 break;
8022 } 8025 }
8023 } 8026 }
8024 else 8027 else
@@ -8057,21 +8060,21 @@ namespace WixToolset.Core
8057 { 8060 {
8058 switch (attrib.Name.LocalName) 8061 switch (attrib.Name.LocalName)
8059 { 8062 {
8060 case "Id": 8063 case "Id":
8061 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 8064 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
8062 break; 8065 break;
8063 case "DiskId": 8066 case "DiskId":
8064 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); 8067 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue);
8065 break; 8068 break;
8066 case "BaselineFile": 8069 case "BaselineFile":
8067 baselineFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 8070 baselineFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8068 break; 8071 break;
8069 case "UpdateFile": 8072 case "UpdateFile":
8070 updateFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 8073 updateFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8071 break; 8074 break;
8072 default: 8075 default:
8073 this.Core.UnexpectedAttribute(node, attrib); 8076 this.Core.UnexpectedAttribute(node, attrib);
8074 break; 8077 break;
8075 } 8078 }
8076 } 8079 }
8077 else 8080 else
@@ -8102,21 +8105,21 @@ namespace WixToolset.Core
8102 { 8105 {
8103 switch (child.Name.LocalName) 8106 switch (child.Name.LocalName)
8104 { 8107 {
8105 case "Validate": 8108 case "Validate":
8106 if (parsedValidate) 8109 if (parsedValidate)
8107 { 8110 {
8108 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); 8111 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child);
8109 this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); 8112 this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName));
8110 } 8113 }
8111 else 8114 else
8112 { 8115 {
8113 this.ParseValidateElement(child, ref validationFlags); 8116 this.ParseValidateElement(child, ref validationFlags);
8114 parsedValidate = true; 8117 parsedValidate = true;
8115 } 8118 }
8116 break; 8119 break;
8117 default: 8120 default:
8118 this.Core.UnexpectedElement(node, child); 8121 this.Core.UnexpectedElement(node, child);
8119 break; 8122 break;
8120 } 8123 }
8121 } 8124 }
8122 else 8125 else
@@ -8155,15 +8158,15 @@ namespace WixToolset.Core
8155 { 8158 {
8156 switch (attrib.Name.LocalName) 8159 switch (attrib.Name.LocalName)
8157 { 8160 {
8158 case "Length": 8161 case "Length":
8159 length = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 8162 length = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8160 break; 8163 break;
8161 case "Offset": 8164 case "Offset":
8162 offset = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 8165 offset = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8163 break; 8166 break;
8164 default: 8167 default:
8165 this.Core.UnexpectedAttribute(node, attrib); 8168 this.Core.UnexpectedAttribute(node, attrib);
8166 break; 8169 break;
8167 } 8170 }
8168 } 8171 }
8169 else 8172 else
@@ -8218,155 +8221,155 @@ namespace WixToolset.Core
8218 { 8221 {
8219 switch (attrib.Name.LocalName) 8222 switch (attrib.Name.LocalName)
8220 { 8223 {
8221 case "ProductId": 8224 case "ProductId":
8222 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 8225 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8223 { 8226 {
8224 validationFlags |= TransformFlags.ValidateProduct; 8227 validationFlags |= TransformFlags.ValidateProduct;
8225 } 8228 }
8226 else 8229 else
8227 { 8230 {
8228 validationFlags &= ~TransformFlags.ValidateProduct; 8231 validationFlags &= ~TransformFlags.ValidateProduct;
8229 } 8232 }
8230 break;
8231 case "ProductLanguage":
8232 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8233 {
8234 validationFlags |= TransformFlags.ValidateLanguage;
8235 }
8236 else
8237 {
8238 validationFlags &= ~TransformFlags.ValidateLanguage;
8239 }
8240 break;
8241 case "ProductVersion":
8242 var check = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8243 validationFlags &= ~TransformFlags.ProductVersionMask;
8244 switch (check)
8245 {
8246 case "Major":
8247 case "major":
8248 validationFlags |= TransformFlags.ValidateMajorVersion;
8249 break; 8233 break;
8250 case "Minor": 8234 case "ProductLanguage":
8251 case "minor": 8235 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8252 validationFlags |= TransformFlags.ValidateMinorVersion; 8236 {
8237 validationFlags |= TransformFlags.ValidateLanguage;
8238 }
8239 else
8240 {
8241 validationFlags &= ~TransformFlags.ValidateLanguage;
8242 }
8253 break; 8243 break;
8254 case "Update": 8244 case "ProductVersion":
8255 case "update": 8245 var check = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8256 validationFlags |= TransformFlags.ValidateUpdateVersion; 8246 validationFlags &= ~TransformFlags.ProductVersionMask;
8247 switch (check)
8248 {
8249 case "Major":
8250 case "major":
8251 validationFlags |= TransformFlags.ValidateMajorVersion;
8252 break;
8253 case "Minor":
8254 case "minor":
8255 validationFlags |= TransformFlags.ValidateMinorVersion;
8256 break;
8257 case "Update":
8258 case "update":
8259 validationFlags |= TransformFlags.ValidateUpdateVersion;
8260 break;
8261 case "":
8262 break;
8263 default:
8264 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Version", check, "Major", "Minor", "Update"));
8265 break;
8266 }
8257 break; 8267 break;
8258 case "": 8268 case "ProductVersionOperator":
8269 var op = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8270 validationFlags &= ~TransformFlags.ProductVersionOperatorMask;
8271 switch (op)
8272 {
8273 case "Lesser":
8274 case "lesser":
8275 validationFlags |= TransformFlags.ValidateNewLessBaseVersion;
8276 break;
8277 case "LesserOrEqual":
8278 case "lesserOrEqual":
8279 validationFlags |= TransformFlags.ValidateNewLessEqualBaseVersion;
8280 break;
8281 case "Equal":
8282 case "equal":
8283 validationFlags |= TransformFlags.ValidateNewEqualBaseVersion;
8284 break;
8285 case "GreaterOrEqual":
8286 case "greaterOrEqual":
8287 validationFlags |= TransformFlags.ValidateNewGreaterEqualBaseVersion;
8288 break;
8289 case "Greater":
8290 case "greater":
8291 validationFlags |= TransformFlags.ValidateNewGreaterBaseVersion;
8292 break;
8293 case "":
8294 break;
8295 default:
8296 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Operator", op, "Lesser", "LesserOrEqual", "Equal", "GreaterOrEqual", "Greater"));
8297 break;
8298 }
8259 break; 8299 break;
8260 default: 8300 case "UpgradeCode":
8261 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Version", check, "Major", "Minor", "Update")); 8301 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8302 {
8303 validationFlags |= TransformFlags.ValidateUpgradeCode;
8304 }
8305 else
8306 {
8307 validationFlags &= ~TransformFlags.ValidateUpgradeCode;
8308 }
8262 break; 8309 break;
8263 } 8310 case "IgnoreAddExistingRow":
8264 break; 8311 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8265 case "ProductVersionOperator": 8312 {
8266 var op = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 8313 validationFlags |= TransformFlags.ErrorAddExistingRow;
8267 validationFlags &= ~TransformFlags.ProductVersionOperatorMask; 8314 }
8268 switch (op) 8315 else
8269 { 8316 {
8270 case "Lesser": 8317 validationFlags &= ~TransformFlags.ErrorAddExistingRow;
8271 case "lesser": 8318 }
8272 validationFlags |= TransformFlags.ValidateNewLessBaseVersion;
8273 break; 8319 break;
8274 case "LesserOrEqual": 8320 case "IgnoreAddExistingTable":
8275 case "lesserOrEqual": 8321 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8276 validationFlags |= TransformFlags.ValidateNewLessEqualBaseVersion; 8322 {
8323 validationFlags |= TransformFlags.ErrorAddExistingTable;
8324 }
8325 else
8326 {
8327 validationFlags &= ~TransformFlags.ErrorAddExistingTable;
8328 }
8277 break; 8329 break;
8278 case "Equal": 8330 case "IgnoreDeleteMissingRow":
8279 case "equal": 8331 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8280 validationFlags |= TransformFlags.ValidateNewEqualBaseVersion; 8332 {
8333 validationFlags |= TransformFlags.ErrorDeleteMissingRow;
8334 }
8335 else
8336 {
8337 validationFlags &= ~TransformFlags.ErrorDeleteMissingRow;
8338 }
8281 break; 8339 break;
8282 case "GreaterOrEqual": 8340 case "IgnoreDeleteMissingTable":
8283 case "greaterOrEqual": 8341 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8284 validationFlags |= TransformFlags.ValidateNewGreaterEqualBaseVersion; 8342 {
8343 validationFlags |= TransformFlags.ErrorDeleteMissingTable;
8344 }
8345 else
8346 {
8347 validationFlags &= ~TransformFlags.ErrorDeleteMissingTable;
8348 }
8285 break; 8349 break;
8286 case "Greater": 8350 case "IgnoreUpdateMissingRow":
8287 case "greater": 8351 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8288 validationFlags |= TransformFlags.ValidateNewGreaterBaseVersion; 8352 {
8353 validationFlags |= TransformFlags.ErrorUpdateMissingRow;
8354 }
8355 else
8356 {
8357 validationFlags &= ~TransformFlags.ErrorUpdateMissingRow;
8358 }
8289 break; 8359 break;
8290 case "": 8360 case "IgnoreChangingCodePage":
8361 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8362 {
8363 validationFlags |= TransformFlags.ErrorChangeCodePage;
8364 }
8365 else
8366 {
8367 validationFlags &= ~TransformFlags.ErrorChangeCodePage;
8368 }
8291 break; 8369 break;
8292 default: 8370 default:
8293 this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Operator", op, "Lesser", "LesserOrEqual", "Equal", "GreaterOrEqual", "Greater")); 8371 this.Core.UnexpectedAttribute(node, attrib);
8294 break; 8372 break;
8295 }
8296 break;
8297 case "UpgradeCode":
8298 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8299 {
8300 validationFlags |= TransformFlags.ValidateUpgradeCode;
8301 }
8302 else
8303 {
8304 validationFlags &= ~TransformFlags.ValidateUpgradeCode;
8305 }
8306 break;
8307 case "IgnoreAddExistingRow":
8308 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8309 {
8310 validationFlags |= TransformFlags.ErrorAddExistingRow;
8311 }
8312 else
8313 {
8314 validationFlags &= ~TransformFlags.ErrorAddExistingRow;
8315 }
8316 break;
8317 case "IgnoreAddExistingTable":
8318 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8319 {
8320 validationFlags |= TransformFlags.ErrorAddExistingTable;
8321 }
8322 else
8323 {
8324 validationFlags &= ~TransformFlags.ErrorAddExistingTable;
8325 }
8326 break;
8327 case "IgnoreDeleteMissingRow":
8328 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8329 {
8330 validationFlags |= TransformFlags.ErrorDeleteMissingRow;
8331 }
8332 else
8333 {
8334 validationFlags &= ~TransformFlags.ErrorDeleteMissingRow;
8335 }
8336 break;
8337 case "IgnoreDeleteMissingTable":
8338 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8339 {
8340 validationFlags |= TransformFlags.ErrorDeleteMissingTable;
8341 }
8342 else
8343 {
8344 validationFlags &= ~TransformFlags.ErrorDeleteMissingTable;
8345 }
8346 break;
8347 case "IgnoreUpdateMissingRow":
8348 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8349 {
8350 validationFlags |= TransformFlags.ErrorUpdateMissingRow;
8351 }
8352 else
8353 {
8354 validationFlags &= ~TransformFlags.ErrorUpdateMissingRow;
8355 }
8356 break;
8357 case "IgnoreChangingCodePage":
8358 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
8359 {
8360 validationFlags |= TransformFlags.ErrorChangeCodePage;
8361 }
8362 else
8363 {
8364 validationFlags &= ~TransformFlags.ErrorChangeCodePage;
8365 }
8366 break;
8367 default:
8368 this.Core.UnexpectedAttribute(node, attrib);
8369 break;
8370 } 8373 }
8371 } 8374 }
8372 else 8375 else