aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-03-02 02:49:28 -0800
committerRob Mensching <rob@firegiant.com>2021-03-02 02:57:06 -0800
commit7d43a882fe2554c6f424c687ca2c564a83e64c81 (patch)
tree735d89e3d5005848d0552a8d8de6128ecd3af563
parentc8711decea5eeb7121eca485d099c9f3b60fea05 (diff)
downloadwix-7d43a882fe2554c6f424c687ca2c564a83e64c81.tar.gz
wix-7d43a882fe2554c6f424c687ca2c564a83e64c81.tar.bz2
wix-7d43a882fe2554c6f424c687ca2c564a83e64c81.zip
Fix Win64 to Bitness, even in v4 .wxs code
Also updated AccessModifiers and decide not to change v3 Bundle .wxs code.
-rw-r--r--src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs38
-rw-r--r--src/WixToolset.Converters/WixConverter.cs46
2 files changed, 37 insertions, 47 deletions
diff --git a/src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs b/src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs
index b8badf2c..c2bc8d29 100644
--- a/src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs
+++ b/src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs
@@ -129,7 +129,7 @@ namespace WixToolset.Converters.Symbolizer
129 keyPathType = ComponentKeyPathType.OdbcDataSource; 129 keyPathType = ComponentKeyPathType.OdbcDataSource;
130 } 130 }
131 131
132 return new ComponentSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 132 return new ComponentSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
133 { 133 {
134 ComponentId = FieldAsString(row, 1), 134 ComponentId = FieldAsString(row, 1),
135 DirectoryRef = FieldAsString(row, 2), 135 DirectoryRef = FieldAsString(row, 2),
@@ -159,7 +159,7 @@ namespace WixToolset.Converters.Symbolizer
159 var sourceType = DetermineCustomActionSourceType(caType); 159 var sourceType = DetermineCustomActionSourceType(caType);
160 var targetType = DetermineCustomActionTargetType(caType); 160 var targetType = DetermineCustomActionTargetType(caType);
161 161
162 return new CustomActionSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 162 return new CustomActionSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
163 { 163 {
164 ExecutionType = executionType, 164 ExecutionType = executionType,
165 SourceType = sourceType, 165 SourceType = sourceType,
@@ -180,7 +180,7 @@ namespace WixToolset.Converters.Symbolizer
180 var id = FieldAsString(row, 0); 180 var id = FieldAsString(row, 0);
181 var splits = SplitDefaultDir(FieldAsString(row, 2)); 181 var splits = SplitDefaultDir(FieldAsString(row, 2));
182 182
183 var symbol = new DirectorySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, id)) 183 var symbol = new DirectorySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, id))
184 { 184 {
185 ParentDirectoryRef = FieldAsString(row, 1), 185 ParentDirectoryRef = FieldAsString(row, 1),
186 Name = splits[0], 186 Name = splits[0],
@@ -202,7 +202,7 @@ namespace WixToolset.Converters.Symbolizer
202 { 202 {
203 var splitName = FieldAsString(row, 3)?.Split('|'); 203 var splitName = FieldAsString(row, 3)?.Split('|');
204 204
205 var symbol = new DuplicateFileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 205 var symbol = new DuplicateFileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
206 { 206 {
207 ComponentRef = FieldAsString(row, 1), 207 ComponentRef = FieldAsString(row, 1),
208 FileRef = FieldAsString(row, 2), 208 FileRef = FieldAsString(row, 2),
@@ -230,7 +230,7 @@ namespace WixToolset.Converters.Symbolizer
230 installDefault = FeatureInstallDefault.Source; 230 installDefault = FeatureInstallDefault.Source;
231 } 231 }
232 232
233 return new FeatureSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 233 return new FeatureSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
234 { 234 {
235 ParentFeatureRef = FieldAsString(row, 1), 235 ParentFeatureRef = FieldAsString(row, 1),
236 Title = FieldAsString(row, 2), 236 Title = FieldAsString(row, 2),
@@ -263,7 +263,7 @@ namespace WixToolset.Converters.Symbolizer
263 var id = FieldAsString(row, 0); 263 var id = FieldAsString(row, 0);
264 var splitName = FieldAsString(row, 2).Split('|'); 264 var splitName = FieldAsString(row, 2).Split('|');
265 265
266 var symbol = new FileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, id)) 266 var symbol = new FileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, id))
267 { 267 {
268 ComponentRef = FieldAsString(row, 1), 268 ComponentRef = FieldAsString(row, 1),
269 Name = splitName.Length > 1 ? splitName[1] : splitName[0], 269 Name = splitName.Length > 1 ? splitName[1] : splitName[0],
@@ -309,7 +309,7 @@ namespace WixToolset.Converters.Symbolizer
309 var splitName = FieldAsString(row, 1).Split('|'); 309 var splitName = FieldAsString(row, 1).Split('|');
310 var action = FieldAsInt(row, 6); 310 var action = FieldAsInt(row, 6);
311 311
312 var symbol = new IniFileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 312 var symbol = new IniFileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
313 { 313 {
314 FileName = splitName.Length > 1 ? splitName[1] : splitName[0], 314 FileName = splitName.Length > 1 ? splitName[1] : splitName[0],
315 ShortFileName = splitName.Length > 1 ? splitName[0] : null, 315 ShortFileName = splitName.Length > 1 ? splitName[0] : null,
@@ -327,7 +327,7 @@ namespace WixToolset.Converters.Symbolizer
327 { 327 {
328 var splitName = FieldAsString(row, 1).Split('|'); 328 var splitName = FieldAsString(row, 1).Split('|');
329 329
330 var symbol = new IniLocatorSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 330 var symbol = new IniLocatorSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
331 { 331 {
332 FileName = splitName.Length > 1 ? splitName[1] : splitName[0], 332 FileName = splitName.Length > 1 ? splitName[1] : splitName[0],
333 ShortFileName = splitName.Length > 1 ? splitName[0] : null, 333 ShortFileName = splitName.Length > 1 ? splitName[0] : null,
@@ -344,7 +344,7 @@ namespace WixToolset.Converters.Symbolizer
344 case "Media": 344 case "Media":
345 { 345 {
346 var diskId = FieldAsInt(row, 0); 346 var diskId = FieldAsInt(row, 0);
347 var symbol = new MediaSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, diskId)) 347 var symbol = new MediaSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, diskId))
348 { 348 {
349 DiskId = diskId, 349 DiskId = diskId,
350 LastSequence = FieldAsNullableInt(row, 1), 350 LastSequence = FieldAsNullableInt(row, 1),
@@ -375,7 +375,7 @@ namespace WixToolset.Converters.Symbolizer
375 var componentId = FieldAsString(row, 0); 375 var componentId = FieldAsString(row, 0);
376 if (componentsById.TryGetValue(componentId, out var componentRow)) 376 if (componentsById.TryGetValue(componentId, out var componentRow))
377 { 377 {
378 return new AssemblySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(componentRow, 5))) 378 return new AssemblySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(componentRow, 5)))
379 { 379 {
380 ComponentRef = componentId, 380 ComponentRef = componentId,
381 FeatureRef = FieldAsString(row, 1), 381 FeatureRef = FieldAsString(row, 1),
@@ -446,7 +446,7 @@ namespace WixToolset.Converters.Symbolizer
446 } 446 }
447 } 447 }
448 448
449 return new RegistrySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 449 return new RegistrySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
450 { 450 {
451 Root = (RegistryRootType)FieldAsInt(row, 1), 451 Root = (RegistryRootType)FieldAsInt(row, 1),
452 Key = FieldAsString(row, 2), 452 Key = FieldAsString(row, 2),
@@ -461,7 +461,7 @@ namespace WixToolset.Converters.Symbolizer
461 { 461 {
462 var type = FieldAsInt(row, 4); 462 var type = FieldAsInt(row, 4);
463 463
464 return new RegLocatorSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 464 return new RegLocatorSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
465 { 465 {
466 Root = (RegistryRootType)FieldAsInt(row, 1), 466 Root = (RegistryRootType)FieldAsInt(row, 1),
467 Key = FieldAsString(row, 2), 467 Key = FieldAsString(row, 2),
@@ -475,7 +475,7 @@ namespace WixToolset.Converters.Symbolizer
475 var splitName = FieldAsString(row, 2).Split('|'); 475 var splitName = FieldAsString(row, 2).Split('|');
476 var installMode = FieldAsInt(row, 4); 476 var installMode = FieldAsInt(row, 4);
477 477
478 return new RemoveFileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 478 return new RemoveFileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
479 { 479 {
480 ComponentRef = FieldAsString(row, 1), 480 ComponentRef = FieldAsString(row, 1),
481 FileName = splitName.Length > 1 ? splitName[1] : splitName[0], 481 FileName = splitName.Length > 1 ? splitName[1] : splitName[0],
@@ -487,7 +487,7 @@ namespace WixToolset.Converters.Symbolizer
487 } 487 }
488 case "RemoveRegistry": 488 case "RemoveRegistry":
489 { 489 {
490 return new RemoveRegistrySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 490 return new RemoveRegistrySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
491 { 491 {
492 Action = RemoveRegistryActionType.RemoveOnInstall, 492 Action = RemoveRegistryActionType.RemoveOnInstall,
493 Root = (RegistryRootType)FieldAsInt(row, 1), 493 Root = (RegistryRootType)FieldAsInt(row, 1),
@@ -505,7 +505,7 @@ namespace WixToolset.Converters.Symbolizer
505 { 505 {
506 var events = FieldAsInt(row, 2); 506 var events = FieldAsInt(row, 2);
507 var wait = FieldAsNullableInt(row, 4); 507 var wait = FieldAsNullableInt(row, 4);
508 return new ServiceControlSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 508 return new ServiceControlSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
509 { 509 {
510 Name = FieldAsString(row, 1), 510 Name = FieldAsString(row, 1),
511 Arguments = FieldAsString(row, 3), 511 Arguments = FieldAsString(row, 3),
@@ -526,7 +526,7 @@ namespace WixToolset.Converters.Symbolizer
526 { 526 {
527 var splitName = FieldAsString(row, 2).Split('|'); 527 var splitName = FieldAsString(row, 2).Split('|');
528 528
529 return new ShortcutSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 529 return new ShortcutSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
530 { 530 {
531 DirectoryRef = FieldAsString(row, 1), 531 DirectoryRef = FieldAsString(row, 1),
532 Name = splitName.Length > 1 ? splitName[1] : splitName[0], 532 Name = splitName.Length > 1 ? splitName[1] : splitName[0],
@@ -553,7 +553,7 @@ namespace WixToolset.Converters.Symbolizer
553 case "Upgrade": 553 case "Upgrade":
554 { 554 {
555 var attributes = FieldAsInt(row, 4); 555 var attributes = FieldAsInt(row, 4);
556 return new UpgradeSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) 556 return new UpgradeSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Global, FieldAsString(row, 0)))
557 { 557 {
558 UpgradeCode = FieldAsString(row, 0), 558 UpgradeCode = FieldAsString(row, 0),
559 VersionMin = FieldAsString(row, 1), 559 VersionMin = FieldAsString(row, 1),
@@ -797,9 +797,9 @@ namespace WixToolset.Converters.Symbolizer
797 case Wix3.ColumnType.Localized: 797 case Wix3.ColumnType.Localized:
798 case Wix3.ColumnType.Object: 798 case Wix3.ColumnType.Object:
799 case Wix3.ColumnType.Preserved: 799 case Wix3.ColumnType.Preserved:
800 return new Identifier(AccessModifier.Public, (string)row.Fields[0].Data); 800 return new Identifier(AccessModifier.Global, (string)row.Fields[0].Data);
801 case Wix3.ColumnType.Number: 801 case Wix3.ColumnType.Number:
802 return new Identifier(AccessModifier.Public, FieldAsInt(row, 0)); 802 return new Identifier(AccessModifier.Global, FieldAsInt(row, 0));
803 default: 803 default:
804 return null; 804 return null;
805 } 805 }
diff --git a/src/WixToolset.Converters/WixConverter.cs b/src/WixToolset.Converters/WixConverter.cs
index c30a40ac..83a333f0 100644
--- a/src/WixToolset.Converters/WixConverter.cs
+++ b/src/WixToolset.Converters/WixConverter.cs
@@ -649,15 +649,12 @@ namespace WixToolset.Converters
649 649
650 private void ConvertApprovedExeForElevationElement(XElement element) 650 private void ConvertApprovedExeForElevationElement(XElement element)
651 { 651 {
652 if (this.SourceVersion < 4) 652 var win64 = element.Attribute("Win64");
653 if (win64 != null && this.OnError(ConverterTestType.Win64AttributeRenamed, element, "The Win64 attribute has been renamed. Use the Bitness attribute instead."))
653 { 654 {
654 var win64 = element.Attribute("Win64"); 655 var value = this.UpdateWin64ValueToBitnessValue(win64);
655 if (win64 != null && this.OnError(ConverterTestType.Win64AttributeRenamed, element, "The Win64 attribute has been renamed. Use the Bitness attribute instead.")) 656 element.Add(new XAttribute("Bitness", value));
656 { 657 win64.Remove();
657 var value = this.UpdateWin64ValueToBitnessValue(win64);
658 element.Add(new XAttribute("Bitness", value));
659 win64.Remove();
660 }
661 } 658 }
662 } 659 }
663 660
@@ -1117,15 +1114,12 @@ namespace WixToolset.Converters
1117 1114
1118 private void ConvertRegistrySearchElement(XElement element) 1115 private void ConvertRegistrySearchElement(XElement element)
1119 { 1116 {
1120 if (this.SourceVersion < 4) 1117 var win64 = element.Attribute("Win64");
1118 if (win64 != null && this.OnError(ConverterTestType.Win64AttributeRenamed, element, "The Win64 attribute has been renamed. Use the Bitness attribute instead."))
1121 { 1119 {
1122 var win64 = element.Attribute("Win64"); 1120 var value = this.UpdateWin64ValueToBitnessValue(win64);
1123 if (win64 != null && this.OnError(ConverterTestType.Win64AttributeRenamed, element, "The Win64 attribute has been renamed. Use the Bitness attribute instead.")) 1121 element.Add(new XAttribute("Bitness", value));
1124 { 1122 win64.Remove();
1125 var value = this.UpdateWin64ValueToBitnessValue(win64);
1126 element.Add(new XAttribute("Bitness", value));
1127 win64.Remove();
1128 }
1129 } 1123 }
1130 } 1124 }
1131 1125
@@ -1361,20 +1355,16 @@ namespace WixToolset.Converters
1361 1355
1362 private void ConvertUtilRegistrySearchElement(XElement element) 1356 private void ConvertUtilRegistrySearchElement(XElement element)
1363 { 1357 {
1364 if (this.SourceVersion < 4) 1358 var win64 = element.Attribute("Win64");
1359 if (win64 != null && this.OnError(ConverterTestType.Win64AttributeRenamed, element, "The Win64 attribute has been renamed. Use the Bitness attribute instead."))
1365 { 1360 {
1366 var win64 = element.Attribute("Win64"); 1361 var value = this.UpdateWin64ValueToBitnessValue(win64);
1367 if (win64 != null && this.OnError(ConverterTestType.Win64AttributeRenamed, element, "The Win64 attribute has been renamed. Use the Bitness attribute instead.")) 1362 element.Add(new XAttribute("Bitness", value));
1368 { 1363 win64.Remove();
1369 var value = this.UpdateWin64ValueToBitnessValue(win64); 1364 }
1370 element.Add(new XAttribute("Bitness", value));
1371 win64.Remove();
1372 }
1373 //else if (this.OnError(ConverterTestType.BitnessAttributeRequired, element, "Use the Bitness attribute instead."))
1374 //{
1375 // element.Add(new XAttribute("Bitness", "always32"));
1376 //}
1377 1365
1366 if (this.SourceVersion < 4)
1367 {
1378 var result = element.Attribute("Result")?.Value; 1368 var result = element.Attribute("Result")?.Value;
1379 if (result == null || result == "value") 1369 if (result == null || result == "value")
1380 { 1370 {