diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-03-14 07:38:48 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-03-14 07:47:48 -0700 |
| commit | 3ccd5e439da4296d6f2b66ce47075ab20d039676 (patch) | |
| tree | b5546552613b869367d09f444492a0bbcfadcfe0 /src/WixToolset.Core.WindowsInstaller/Decompile | |
| parent | 574785ab1421c9b67336c13ade5c2263e665ca07 (diff) | |
| download | wix-3ccd5e439da4296d6f2b66ce47075ab20d039676.tar.gz wix-3ccd5e439da4296d6f2b66ce47075ab20d039676.tar.bz2 wix-3ccd5e439da4296d6f2b66ce47075ab20d039676.zip | |
Minimize public surface area of Core
Fixes wixtoolset/issues#6374
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Decompile')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Decompile/DecompileMsiOrMsmCommand.cs | 9 | ||||
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs | 65 |
2 files changed, 39 insertions, 35 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Decompile/DecompileMsiOrMsmCommand.cs b/src/WixToolset.Core.WindowsInstaller/Decompile/DecompileMsiOrMsmCommand.cs index 45b669b9..849cb361 100644 --- a/src/WixToolset.Core.WindowsInstaller/Decompile/DecompileMsiOrMsmCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Decompile/DecompileMsiOrMsmCommand.cs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 2 | 2 | ||
| 3 | namespace WixToolset.Core.WindowsInstaller.Unbind | 3 | namespace WixToolset.Core.WindowsInstaller.Decompile |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| @@ -8,6 +8,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind | |||
| 8 | using System.IO; | 8 | using System.IO; |
| 9 | using System.Linq; | 9 | using System.Linq; |
| 10 | using WixToolset.Core.WindowsInstaller.Msi; | 10 | using WixToolset.Core.WindowsInstaller.Msi; |
| 11 | using WixToolset.Core.WindowsInstaller.Unbind; | ||
| 11 | using WixToolset.Data; | 12 | using WixToolset.Data; |
| 12 | using WixToolset.Data.WindowsInstaller; | 13 | using WixToolset.Data.WindowsInstaller; |
| 13 | using WixToolset.Extensibility; | 14 | using WixToolset.Extensibility; |
| @@ -43,11 +44,13 @@ namespace WixToolset.Core.WindowsInstaller.Unbind | |||
| 43 | Directory.Delete(this.Context.ExtractFolder, true); | 44 | Directory.Delete(this.Context.ExtractFolder, true); |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | var unbindCommand = new UnbindDatabaseCommand(this.Messaging, database, this.Context.DecompilePath, this.Context.DecompileType, this.Context.ExtractFolder, this.Context.IntermediateFolder, this.Context.IsAdminImage, suppressDemodularization: false, skipSummaryInfo: false); | 47 | var backendHelper = this.Context.ServiceProvider.GetService<IBackendHelper>(); |
| 48 | |||
| 49 | var unbindCommand = new UnbindDatabaseCommand(this.Messaging, backendHelper, database, this.Context.DecompilePath, this.Context.DecompileType, this.Context.ExtractFolder, this.Context.IntermediateFolder, this.Context.IsAdminImage, suppressDemodularization: false, skipSummaryInfo: false); | ||
| 47 | var output = unbindCommand.Execute(); | 50 | var output = unbindCommand.Execute(); |
| 48 | var extractedFilePaths = new List<string>(unbindCommand.ExportedFiles); | 51 | var extractedFilePaths = new List<string>(unbindCommand.ExportedFiles); |
| 49 | 52 | ||
| 50 | var decompiler = new Decompiler(this.Messaging, this.Extensions, this.Context.BaseSourcePath, this.Context.SuppressCustomTables, this.Context.SuppressDroppingEmptyTables, this.Context.SuppressUI, this.Context.TreatProductAsModule); | 53 | var decompiler = new Decompiler(this.Messaging, backendHelper, this.Extensions, this.Context.BaseSourcePath, this.Context.SuppressCustomTables, this.Context.SuppressDroppingEmptyTables, this.Context.SuppressUI, this.Context.TreatProductAsModule); |
| 51 | result.Document = decompiler.Decompile(output); | 54 | result.Document = decompiler.Decompile(output); |
| 52 | 55 | ||
| 53 | result.Platform = GetPlatformFromOutput(output); | 56 | result.Platform = GetPlatformFromOutput(output); |
diff --git a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs index 2cc61666..8e477dd1 100644 --- a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs +++ b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 2 | 2 | ||
| 3 | namespace WixToolset.Core.WindowsInstaller | 3 | namespace WixToolset.Core.WindowsInstaller.Decompile |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| @@ -10,8 +10,6 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 10 | using System.Text; | 10 | using System.Text; |
| 11 | using System.Text.RegularExpressions; | 11 | using System.Text.RegularExpressions; |
| 12 | using System.Xml.Linq; | 12 | using System.Xml.Linq; |
| 13 | using WixToolset.Core; | ||
| 14 | using WixToolset.Core.WindowsInstaller.Decompile; | ||
| 15 | using WixToolset.Data; | 13 | using WixToolset.Data; |
| 16 | using WixToolset.Data.Symbols; | 14 | using WixToolset.Data.Symbols; |
| 17 | using WixToolset.Data.WindowsInstaller; | 15 | using WixToolset.Data.WindowsInstaller; |
| @@ -45,9 +43,10 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 45 | /// <summary> | 43 | /// <summary> |
| 46 | /// Creates a new decompiler object with a default set of table definitions. | 44 | /// Creates a new decompiler object with a default set of table definitions. |
| 47 | /// </summary> | 45 | /// </summary> |
| 48 | public Decompiler(IMessaging messaging, IEnumerable<IWindowsInstallerBackendDecompilerExtension> extensions, string baseSourcePath, bool suppressCustomTables, bool suppressDroppingEmptyTables, bool suppressUI, bool treatProductAsModule) | 46 | public Decompiler(IMessaging messaging, IBackendHelper backendHelper, IEnumerable<IWindowsInstallerBackendDecompilerExtension> extensions, string baseSourcePath, bool suppressCustomTables, bool suppressDroppingEmptyTables, bool suppressUI, bool treatProductAsModule) |
| 49 | { | 47 | { |
| 50 | this.Messaging = messaging; | 48 | this.Messaging = messaging; |
| 49 | this.BackendHelper = backendHelper; | ||
| 51 | this.Extensions = extensions; | 50 | this.Extensions = extensions; |
| 52 | this.BaseSourcePath = baseSourcePath ?? "SourceDir"; | 51 | this.BaseSourcePath = baseSourcePath ?? "SourceDir"; |
| 53 | this.SuppressCustomTables = suppressCustomTables; | 52 | this.SuppressCustomTables = suppressCustomTables; |
| @@ -63,6 +62,8 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 63 | 62 | ||
| 64 | private IMessaging Messaging { get; } | 63 | private IMessaging Messaging { get; } |
| 65 | 64 | ||
| 65 | private IBackendHelper BackendHelper { get; } | ||
| 66 | |||
| 66 | private IEnumerable<IWindowsInstallerBackendDecompilerExtension> Extensions { get; } | 67 | private IEnumerable<IWindowsInstallerBackendDecompilerExtension> Extensions { get; } |
| 67 | 68 | ||
| 68 | private Dictionary<string, IWindowsInstallerBackendDecompilerExtension> ExtensionsByTableName { get; } | 69 | private Dictionary<string, IWindowsInstallerBackendDecompilerExtension> ExtensionsByTableName { get; } |
| @@ -2196,11 +2197,11 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 2196 | { | 2197 | { |
| 2197 | foreach (var launchRow in launchConditionTable.Rows) | 2198 | foreach (var launchRow in launchConditionTable.Rows) |
| 2198 | { | 2199 | { |
| 2199 | if (Common.DowngradePreventedCondition == Convert.ToString(launchRow[0])) | 2200 | if (WixUpgradeConstants.DowngradePreventedCondition == Convert.ToString(launchRow[0])) |
| 2200 | { | 2201 | { |
| 2201 | downgradeErrorMessage = Convert.ToString(launchRow[1]); | 2202 | downgradeErrorMessage = Convert.ToString(launchRow[1]); |
| 2202 | } | 2203 | } |
| 2203 | else if (Common.UpgradePreventedCondition == Convert.ToString(launchRow[0])) | 2204 | else if (WixUpgradeConstants.UpgradePreventedCondition == Convert.ToString(launchRow[0])) |
| 2204 | { | 2205 | { |
| 2205 | disallowUpgradeErrorMessage = Convert.ToString(launchRow[1]); | 2206 | disallowUpgradeErrorMessage = Convert.ToString(launchRow[1]); |
| 2206 | } | 2207 | } |
| @@ -2213,7 +2214,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 2213 | 2214 | ||
| 2214 | foreach (UpgradeRow upgradeRow in upgradeTable.Rows) | 2215 | foreach (UpgradeRow upgradeRow in upgradeTable.Rows) |
| 2215 | { | 2216 | { |
| 2216 | if (Common.UpgradeDetectedProperty == upgradeRow.ActionProperty) | 2217 | if (WixUpgradeConstants.UpgradeDetectedProperty == upgradeRow.ActionProperty) |
| 2217 | { | 2218 | { |
| 2218 | var attr = upgradeRow.Attributes; | 2219 | var attr = upgradeRow.Attributes; |
| 2219 | var removeFeatures = upgradeRow.Remove; | 2220 | var removeFeatures = upgradeRow.Remove; |
| @@ -2239,7 +2240,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 2239 | xMajorUpgrade.SetAttributeValue("RemoveFeatures", removeFeatures); | 2240 | xMajorUpgrade.SetAttributeValue("RemoveFeatures", removeFeatures); |
| 2240 | } | 2241 | } |
| 2241 | } | 2242 | } |
| 2242 | else if (Common.DowngradeDetectedProperty == upgradeRow.ActionProperty) | 2243 | else if (WixUpgradeConstants.DowngradeDetectedProperty == upgradeRow.ActionProperty) |
| 2243 | { | 2244 | { |
| 2244 | xMajorUpgrade = xMajorUpgrade ?? new XElement(Names.MajorUpgradeElement); | 2245 | xMajorUpgrade = xMajorUpgrade ?? new XElement(Names.MajorUpgradeElement); |
| 2245 | xMajorUpgrade.SetAttributeValue("DowngradeErrorMessage", downgradeErrorMessage); | 2246 | xMajorUpgrade.SetAttributeValue("DowngradeErrorMessage", downgradeErrorMessage); |
| @@ -4291,7 +4292,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 4291 | var xDirectory = new XElement(Names.DirectoryElement, | 4292 | var xDirectory = new XElement(Names.DirectoryElement, |
| 4292 | new XAttribute("Id", id)); | 4293 | new XAttribute("Id", id)); |
| 4293 | 4294 | ||
| 4294 | var names = Common.GetNames(row.FieldAsString(2)); | 4295 | var names = this.BackendHelper.SplitMsiFileName(row.FieldAsString(2)); |
| 4295 | 4296 | ||
| 4296 | if (String.Equals(id, "TARGETDIR", StringComparison.Ordinal) && !String.Equals(names[0], "SourceDir", StringComparison.Ordinal)) | 4297 | if (String.Equals(id, "TARGETDIR", StringComparison.Ordinal) && !String.Equals(names[0], "SourceDir", StringComparison.Ordinal)) |
| 4297 | { | 4298 | { |
| @@ -4396,7 +4397,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 4396 | 4397 | ||
| 4397 | if (!row.IsColumnNull(3)) | 4398 | if (!row.IsColumnNull(3)) |
| 4398 | { | 4399 | { |
| 4399 | var names = Common.GetNames(row.FieldAsString(3)); | 4400 | var names = this.BackendHelper.SplitMsiFileName(row.FieldAsString(3)); |
| 4400 | if (null != names[0] && null != names[1]) | 4401 | if (null != names[0] && null != names[1]) |
| 4401 | { | 4402 | { |
| 4402 | xCopyFile.SetAttributeValue("DestinationShortName", names[0]); | 4403 | xCopyFile.SetAttributeValue("DestinationShortName", names[0]); |
| @@ -4782,7 +4783,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 4782 | WindowsInstallerConstants.MsidbFileAttributesVital != (fileRow.Attributes & WindowsInstallerConstants.MsidbFileAttributesVital) ? new XAttribute("Vital", "no") : null, | 4783 | WindowsInstallerConstants.MsidbFileAttributesVital != (fileRow.Attributes & WindowsInstallerConstants.MsidbFileAttributesVital) ? new XAttribute("Vital", "no") : null, |
| 4783 | null != fileRow.Version && 0 < fileRow.Version.Length && !Char.IsDigit(fileRow.Version[0]) ? new XAttribute("CompanionFile", fileRow.Version) : null); | 4784 | null != fileRow.Version && 0 < fileRow.Version.Length && !Char.IsDigit(fileRow.Version[0]) ? new XAttribute("CompanionFile", fileRow.Version) : null); |
| 4784 | 4785 | ||
| 4785 | var names = Common.GetNames(fileRow.FileName); | 4786 | var names = this.BackendHelper.SplitMsiFileName(fileRow.FileName); |
| 4786 | if (null != names[0] && null != names[1]) | 4787 | if (null != names[0] && null != names[1]) |
| 4787 | { | 4788 | { |
| 4788 | xFile.SetAttributeValue("ShortName", names[0]); | 4789 | xFile.SetAttributeValue("ShortName", names[0]); |
| @@ -4904,7 +4905,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 4904 | new XAttribute("Value", row.FieldAsString(5)), | 4905 | new XAttribute("Value", row.FieldAsString(5)), |
| 4905 | row.IsColumnNull(2) ? null : new XAttribute("Directory", row.FieldAsString(2))); | 4906 | row.IsColumnNull(2) ? null : new XAttribute("Directory", row.FieldAsString(2))); |
| 4906 | 4907 | ||
| 4907 | var names = Common.GetNames(row.FieldAsString(1)); | 4908 | var names = this.BackendHelper.SplitMsiFileName(row.FieldAsString(1)); |
| 4908 | 4909 | ||
| 4909 | if (null != names[0]) | 4910 | if (null != names[0]) |
| 4910 | { | 4911 | { |
| @@ -4957,7 +4958,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 4957 | new XAttribute("Key", row.FieldAsString(3)), | 4958 | new XAttribute("Key", row.FieldAsString(3)), |
| 4958 | row.IsColumnNull(4) || row.FieldAsInteger(4) == 0 ? null : new XAttribute("Field", row.FieldAsInteger(4))); | 4959 | row.IsColumnNull(4) || row.FieldAsInteger(4) == 0 ? null : new XAttribute("Field", row.FieldAsInteger(4))); |
| 4959 | 4960 | ||
| 4960 | var names = Common.GetNames(row.FieldAsString(1)); | 4961 | var names = this.BackendHelper.SplitMsiFileName(row.FieldAsString(1)); |
| 4961 | if (null != names[0] && null != names[1]) | 4962 | if (null != names[0] && null != names[1]) |
| 4962 | { | 4963 | { |
| 4963 | xIniFileSearch.SetAttributeValue("ShortName", names[0]); | 4964 | xIniFileSearch.SetAttributeValue("ShortName", names[0]); |
| @@ -5014,7 +5015,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 5014 | { | 5015 | { |
| 5015 | foreach (var row in table.Rows) | 5016 | foreach (var row in table.Rows) |
| 5016 | { | 5017 | { |
| 5017 | if (Common.DowngradePreventedCondition == row.FieldAsString(0) || Common.UpgradePreventedCondition == row.FieldAsString(0)) | 5018 | if (WixUpgradeConstants.DowngradePreventedCondition == row.FieldAsString(0) || WixUpgradeConstants.UpgradePreventedCondition == row.FieldAsString(0)) |
| 5018 | { | 5019 | { |
| 5019 | continue; // MajorUpgrade rows processed in FinalizeUpgradeTable | 5020 | continue; // MajorUpgrade rows processed in FinalizeUpgradeTable |
| 5020 | } | 5021 | } |
| @@ -5101,13 +5102,13 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 5101 | switch (row.FieldAsString(1)) | 5102 | switch (row.FieldAsString(1)) |
| 5102 | { | 5103 | { |
| 5103 | case "CreateFolder": | 5104 | case "CreateFolder": |
| 5104 | specialPermissions = Common.FolderPermissions; | 5105 | specialPermissions = LockPermissionConstants.FolderPermissions; |
| 5105 | break; | 5106 | break; |
| 5106 | case "File": | 5107 | case "File": |
| 5107 | specialPermissions = Common.FilePermissions; | 5108 | specialPermissions = LockPermissionConstants.FilePermissions; |
| 5108 | break; | 5109 | break; |
| 5109 | case "Registry": | 5110 | case "Registry": |
| 5110 | specialPermissions = Common.RegistryPermissions; | 5111 | specialPermissions = LockPermissionConstants.RegistryPermissions; |
| 5111 | break; | 5112 | break; |
| 5112 | default: | 5113 | default: |
| 5113 | this.Messaging.Write(WarningMessages.IllegalColumnValue(row.SourceLineNumbers, row.Table.Name, row.Fields[1].Column.Name, row[1])); | 5114 | this.Messaging.Write(WarningMessages.IllegalColumnValue(row.SourceLineNumbers, row.Table.Name, row.Fields[1].Column.Name, row[1])); |
| @@ -5129,13 +5130,13 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 5129 | { | 5130 | { |
| 5130 | name = "SpecificRightsAll"; | 5131 | name = "SpecificRightsAll"; |
| 5131 | } | 5132 | } |
| 5132 | else if (28 > i && Common.StandardPermissions.Length > (i - 16)) | 5133 | else if (28 > i && LockPermissionConstants.StandardPermissions.Length > (i - 16)) |
| 5133 | { | 5134 | { |
| 5134 | name = Common.StandardPermissions[i - 16]; | 5135 | name = LockPermissionConstants.StandardPermissions[i - 16]; |
| 5135 | } | 5136 | } |
| 5136 | else if (0 <= (i - 28) && Common.GenericPermissions.Length > (i - 28)) | 5137 | else if (0 <= (i - 28) && LockPermissionConstants.GenericPermissions.Length > (i - 28)) |
| 5137 | { | 5138 | { |
| 5138 | name = Common.GenericPermissions[i - 28]; | 5139 | name = LockPermissionConstants.GenericPermissions[i - 28]; |
| 5139 | } | 5140 | } |
| 5140 | 5141 | ||
| 5141 | if (null == name) | 5142 | if (null == name) |
| @@ -5412,7 +5413,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 5412 | 5413 | ||
| 5413 | if (!row.IsColumnNull(3)) | 5414 | if (!row.IsColumnNull(3)) |
| 5414 | { | 5415 | { |
| 5415 | var names = Common.GetNames(row.FieldAsString(3)); | 5416 | var names = this.BackendHelper.SplitMsiFileName(row.FieldAsString(3)); |
| 5416 | if (null != names[0] && null != names[1]) | 5417 | if (null != names[0] && null != names[1]) |
| 5417 | { | 5418 | { |
| 5418 | xCopyFile.SetAttributeValue("DestinationShortName", names[0]); | 5419 | xCopyFile.SetAttributeValue("DestinationShortName", names[0]); |
| @@ -5922,17 +5923,17 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 5922 | case "OptimizeCA": | 5923 | case "OptimizeCA": |
| 5923 | var xOptimizeCustomActions = new XElement(Names.OptimizeCustomActionsElement); | 5924 | var xOptimizeCustomActions = new XElement(Names.OptimizeCustomActionsElement); |
| 5924 | var optimizeCA = Int32.Parse(value, CultureInfo.InvariantCulture); | 5925 | var optimizeCA = Int32.Parse(value, CultureInfo.InvariantCulture); |
| 5925 | if (0 != (Convert.ToInt32(OptimizeCA.SkipAssignment) & optimizeCA)) | 5926 | if (0 != (Convert.ToInt32(OptimizeCAFlags.SkipAssignment) & optimizeCA)) |
| 5926 | { | 5927 | { |
| 5927 | xOptimizeCustomActions.SetAttributeValue("SkipAssignment", "yes"); | 5928 | xOptimizeCustomActions.SetAttributeValue("SkipAssignment", "yes"); |
| 5928 | } | 5929 | } |
| 5929 | 5930 | ||
| 5930 | if (0 != (Convert.ToInt32(OptimizeCA.SkipImmediate) & optimizeCA)) | 5931 | if (0 != (Convert.ToInt32(OptimizeCAFlags.SkipImmediate) & optimizeCA)) |
| 5931 | { | 5932 | { |
| 5932 | xOptimizeCustomActions.SetAttributeValue("SkipImmediate", "yes"); | 5933 | xOptimizeCustomActions.SetAttributeValue("SkipImmediate", "yes"); |
| 5933 | } | 5934 | } |
| 5934 | 5935 | ||
| 5935 | if (0 != (Convert.ToInt32(OptimizeCA.SkipDeferred) & optimizeCA)) | 5936 | if (0 != (Convert.ToInt32(OptimizeCAFlags.SkipDeferred) & optimizeCA)) |
| 5936 | { | 5937 | { |
| 5937 | xOptimizeCustomActions.SetAttributeValue("SkipDeferred", "yes"); | 5938 | xOptimizeCustomActions.SetAttributeValue("SkipDeferred", "yes"); |
| 5938 | } | 5939 | } |
| @@ -6165,7 +6166,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 6165 | { | 6166 | { |
| 6166 | foreach (var propertyId in value.Split(';')) | 6167 | foreach (var propertyId in value.Split(';')) |
| 6167 | { | 6168 | { |
| 6168 | if (Common.DowngradeDetectedProperty == propertyId || Common.UpgradeDetectedProperty == propertyId) | 6169 | if (WixUpgradeConstants.DowngradeDetectedProperty == propertyId || WixUpgradeConstants.UpgradeDetectedProperty == propertyId) |
| 6169 | { | 6170 | { |
| 6170 | continue; | 6171 | continue; |
| 6171 | } | 6172 | } |
| @@ -6547,7 +6548,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 6547 | var xRemoveFile = new XElement(Names.RemoveFileElement, | 6548 | var xRemoveFile = new XElement(Names.RemoveFileElement, |
| 6548 | new XAttribute("Id", row.FieldAsString(0))); | 6549 | new XAttribute("Id", row.FieldAsString(0))); |
| 6549 | 6550 | ||
| 6550 | var names = Common.GetNames(row.FieldAsString(2)); | 6551 | var names = this.BackendHelper.SplitMsiFileName(row.FieldAsString(2)); |
| 6551 | if (null != names[0] && null != names[1]) | 6552 | if (null != names[0] && null != names[1]) |
| 6552 | { | 6553 | { |
| 6553 | xRemoveFile.SetAttributeValue("ShortName", names[0]); | 6554 | xRemoveFile.SetAttributeValue("ShortName", names[0]); |
| @@ -6597,7 +6598,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 6597 | new XAttribute("Key", row.FieldAsString(4)), | 6598 | new XAttribute("Key", row.FieldAsString(4)), |
| 6598 | XAttributeIfNotNull("Value", row, 5)); | 6599 | XAttributeIfNotNull("Value", row, 5)); |
| 6599 | 6600 | ||
| 6600 | var names = Common.GetNames(row.FieldAsString(1)); | 6601 | var names = this.BackendHelper.SplitMsiFileName(row.FieldAsString(1)); |
| 6601 | if (null != names[0] && null != names[1]) | 6602 | if (null != names[0] && null != names[1]) |
| 6602 | { | 6603 | { |
| 6603 | xIniFile.SetAttributeValue("ShortName", names[0]); | 6604 | xIniFile.SetAttributeValue("ShortName", names[0]); |
| @@ -6941,7 +6942,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 6941 | XAttributeIfNotNull("IconIndex", row, 9), | 6942 | XAttributeIfNotNull("IconIndex", row, 9), |
| 6942 | XAttributeIfNotNull("WorkingDirectory", row, 11)); | 6943 | XAttributeIfNotNull("WorkingDirectory", row, 11)); |
| 6943 | 6944 | ||
| 6944 | var names = Common.GetNames(row.FieldAsString(2)); | 6945 | var names = this.BackendHelper.SplitMsiFileName(row.FieldAsString(2)); |
| 6945 | if (null != names[0] && null != names[1]) | 6946 | if (null != names[0] && null != names[1]) |
| 6946 | { | 6947 | { |
| 6947 | xShortcut.SetAttributeValue("ShortName", names[0]); | 6948 | xShortcut.SetAttributeValue("ShortName", names[0]); |
| @@ -7016,11 +7017,11 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 7016 | XAttributeIfNotNull("MaxSize", row, 5), | 7017 | XAttributeIfNotNull("MaxSize", row, 5), |
| 7017 | XAttributeIfNotNull("Languages", row, 8)); | 7018 | XAttributeIfNotNull("Languages", row, 8)); |
| 7018 | 7019 | ||
| 7019 | var names = Common.GetNames(row.FieldAsString(1)); | 7020 | var names = this.BackendHelper.SplitMsiFileName(row.FieldAsString(1)); |
| 7020 | if (null != names[0]) | 7021 | if (null != names[0]) |
| 7021 | { | 7022 | { |
| 7022 | // it is permissable to just have a long name | 7023 | // it is permissable to just have a long name |
| 7023 | if (!Common.IsValidShortFilename(names[0], false) && null == names[1]) | 7024 | if (!this.BackendHelper.IsValidShortFilename(names[0], false) && null == names[1]) |
| 7024 | { | 7025 | { |
| 7025 | fileSearch.SetAttributeValue("Name", names[0]); | 7026 | fileSearch.SetAttributeValue("Name", names[0]); |
| 7026 | } | 7027 | } |
| @@ -7248,7 +7249,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 7248 | 7249 | ||
| 7249 | foreach (UpgradeRow upgradeRow in table.Rows) | 7250 | foreach (UpgradeRow upgradeRow in table.Rows) |
| 7250 | { | 7251 | { |
| 7251 | if (Common.UpgradeDetectedProperty == upgradeRow.ActionProperty || Common.DowngradeDetectedProperty == upgradeRow.ActionProperty) | 7252 | if (WixUpgradeConstants.UpgradeDetectedProperty == upgradeRow.ActionProperty || WixUpgradeConstants.DowngradeDetectedProperty == upgradeRow.ActionProperty) |
| 7252 | { | 7253 | { |
| 7253 | continue; // MajorUpgrade rows processed in FinalizeUpgradeTable | 7254 | continue; // MajorUpgrade rows processed in FinalizeUpgradeTable |
| 7254 | } | 7255 | } |
