The Great Tuple to Symbol Rename (tm)
This commit is contained in:
Родитель
acba90f005
Коммит
0e1b04018f
|
@ -5,13 +5,13 @@ VisualStudioVersion = 15.0.26124.0
|
|||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Converters", "src\WixToolset.Converters\WixToolset.Converters.csproj", "{6FAF6385-6598-4B89-972B-C31AFCA14538}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Converters.Tupleizer", "src\WixToolset.Converters.Tupleizer\WixToolset.Converters.Tupleizer.csproj", "{F051BCAF-698C-41D5-8427-164537CE5C5C}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Converters.Symbolizer", "src\WixToolset.Converters.Symbolizer\WixToolset.Converters.Symbolizer.csproj", "{F051BCAF-698C-41D5-8427-164537CE5C5C}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{1B16A6C1-2B5D-4F9A-9DD5-FBC89B3CE31E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Converters", "src\test\WixToolsetTest.Converters\WixToolsetTest.Converters.csproj", "{485C5038-97E1-4729-A54D-848CC69569FD}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Converters.Tupleizer", "src\test\WixToolsetTest.Converters.Tupleizer\WixToolsetTest.Converters.Tupleizer.csproj", "{9DB36DB1-24A1-47A7-9E57-D48A2E33C13C}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Converters.Symbolizer", "src\test\WixToolsetTest.Converters.Symbolizer\WixToolsetTest.Converters.Symbolizer.csproj", "{9DB36DB1-24A1-47A7-9E57-D48A2E33C13C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
@set _P=%~dp0build\Release\publish
|
||||
|
||||
dotnet pack -c Release src\WixToolset.Converters || exit /b
|
||||
dotnet pack -c Release src\WixToolset.Converters.Tupleizer || exit /b
|
||||
dotnet pack -c Release src\WixToolset.Converters.Symbolizer || exit /b
|
||||
|
||||
dotnet build -c Release src\test\WixToolsetTest.Converters || exit /b
|
||||
dotnet build -c Release src\test\WixToolsetTest.Converters.Tupleizer || exit /b
|
||||
dotnet build -c Release src\test\WixToolsetTest.Converters.Symbolizer || exit /b
|
||||
|
||||
@popd
|
||||
@endlocal
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
// 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.
|
||||
|
||||
namespace WixToolset.Converters.Tupleizer
|
||||
namespace WixToolset.Converters.Symbolizer
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WixToolset.Data;
|
||||
using WixToolset.Data.Tuples;
|
||||
using WixToolset.Data.Symbols;
|
||||
using WixToolset.Data.WindowsInstaller;
|
||||
using Wix3 = Microsoft.Tools.WindowsInstallerXml;
|
||||
|
||||
public static class ConvertTuples
|
||||
public static class ConvertSymbols
|
||||
{
|
||||
public static Intermediate ConvertFile(string path)
|
||||
{
|
||||
|
@ -34,10 +34,10 @@ namespace WixToolset.Converters.Tupleizer
|
|||
{
|
||||
foreach (Wix3.Row row in table.Rows)
|
||||
{
|
||||
var tuple = GenerateTupleFromRow(row, wixMediaByDiskId, componentsById, fontsById, bindPathsById, selfRegById, wixFileById, wixDirectoryById);
|
||||
if (tuple != null)
|
||||
var symbol = GenerateSymbolFromRow(row, wixMediaByDiskId, componentsById, fontsById, bindPathsById, selfRegById, wixFileById, wixDirectoryById);
|
||||
if (symbol != null)
|
||||
{
|
||||
section.Tuples.Add(tuple);
|
||||
section.Symbols.Add(symbol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,31 +77,31 @@ namespace WixToolset.Converters.Tupleizer
|
|||
return byId;
|
||||
}
|
||||
|
||||
private static IntermediateTuple GenerateTupleFromRow(Wix3.Row row, Dictionary<int, Wix3.WixMediaRow> wixMediaByDiskId, Dictionary<string, Wix3.Row> componentsById, Dictionary<string, Wix3.Row> fontsById, Dictionary<string, Wix3.Row> bindPathsById, Dictionary<string, Wix3.Row> selfRegById, Dictionary<string, Wix3.Row> wixFileById, Dictionary<string, Wix3.Row> wixDirectoryById)
|
||||
private static IntermediateSymbol GenerateSymbolFromRow(Wix3.Row row, Dictionary<int, Wix3.WixMediaRow> wixMediaByDiskId, Dictionary<string, Wix3.Row> componentsById, Dictionary<string, Wix3.Row> fontsById, Dictionary<string, Wix3.Row> bindPathsById, Dictionary<string, Wix3.Row> selfRegById, Dictionary<string, Wix3.Row> wixFileById, Dictionary<string, Wix3.Row> wixDirectoryById)
|
||||
{
|
||||
var name = row.Table.Name;
|
||||
switch (name)
|
||||
{
|
||||
case "_SummaryInformation":
|
||||
return DefaultTupleFromRow(typeof(SummaryInformationTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(SummaryInformationSymbol), row, columnZeroIsId: false);
|
||||
case "ActionText":
|
||||
return DefaultTupleFromRow(typeof(ActionTextTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(ActionTextSymbol), row, columnZeroIsId: false);
|
||||
case "AppId":
|
||||
return DefaultTupleFromRow(typeof(AppIdTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(AppIdSymbol), row, columnZeroIsId: false);
|
||||
case "AppSearch":
|
||||
return DefaultTupleFromRow(typeof(AppSearchTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(AppSearchSymbol), row, columnZeroIsId: false);
|
||||
case "Billboard":
|
||||
return DefaultTupleFromRow(typeof(BillboardTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(BillboardSymbol), row, columnZeroIsId: true);
|
||||
case "Binary":
|
||||
return DefaultTupleFromRow(typeof(BinaryTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(BinarySymbol), row, columnZeroIsId: true);
|
||||
case "BindPath":
|
||||
return null;
|
||||
case "CCPSearch":
|
||||
return DefaultTupleFromRow(typeof(CCPSearchTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(CCPSearchSymbol), row, columnZeroIsId: true);
|
||||
case "Class":
|
||||
return DefaultTupleFromRow(typeof(ClassTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(ClassSymbol), row, columnZeroIsId: false);
|
||||
case "CompLocator":
|
||||
return DefaultTupleFromRow(typeof(CompLocatorTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(CompLocatorSymbol), row, columnZeroIsId: false);
|
||||
case "Component":
|
||||
{
|
||||
var attributes = FieldAsNullableInt(row, 3);
|
||||
|
@ -127,7 +127,7 @@ namespace WixToolset.Converters.Tupleizer
|
|||
keyPathType = ComponentKeyPathType.OdbcDataSource;
|
||||
}
|
||||
|
||||
return new ComponentTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new ComponentSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
ComponentId = FieldAsString(row, 1),
|
||||
DirectoryRef = FieldAsString(row, 2),
|
||||
|
@ -147,9 +147,9 @@ namespace WixToolset.Converters.Tupleizer
|
|||
}
|
||||
|
||||
case "Condition":
|
||||
return DefaultTupleFromRow(typeof(ConditionTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(ConditionSymbol), row, columnZeroIsId: false);
|
||||
case "CreateFolder":
|
||||
return DefaultTupleFromRow(typeof(CreateFolderTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(CreateFolderSymbol), row, columnZeroIsId: false);
|
||||
case "CustomAction":
|
||||
{
|
||||
var caType = FieldAsInt(row, 1);
|
||||
|
@ -157,7 +157,7 @@ namespace WixToolset.Converters.Tupleizer
|
|||
var sourceType = DetermineCustomActionSourceType(caType);
|
||||
var targetType = DetermineCustomActionTargetType(caType);
|
||||
|
||||
return new CustomActionTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new CustomActionSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
ExecutionType = executionType,
|
||||
SourceType = sourceType,
|
||||
|
@ -178,7 +178,7 @@ namespace WixToolset.Converters.Tupleizer
|
|||
var id = FieldAsString(row, 0);
|
||||
var splits = SplitDefaultDir(FieldAsString(row, 2));
|
||||
|
||||
var tuple = new DirectoryTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, id))
|
||||
var symbol = new DirectorySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, id))
|
||||
{
|
||||
ParentDirectoryRef = FieldAsString(row, 1),
|
||||
Name = splits[0],
|
||||
|
@ -189,19 +189,19 @@ namespace WixToolset.Converters.Tupleizer
|
|||
|
||||
if (wixDirectoryById.TryGetValue(id, out var wixDirectoryRow))
|
||||
{
|
||||
tuple.ComponentGuidGenerationSeed = FieldAsString(wixDirectoryRow, 1);
|
||||
symbol.ComponentGuidGenerationSeed = FieldAsString(wixDirectoryRow, 1);
|
||||
}
|
||||
|
||||
return tuple;
|
||||
return symbol;
|
||||
}
|
||||
case "DrLocator":
|
||||
return DefaultTupleFromRow(typeof(DrLocatorTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(DrLocatorSymbol), row, columnZeroIsId: false);
|
||||
case "DuplicateFile":
|
||||
return DefaultTupleFromRow(typeof(DuplicateFileTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(DuplicateFileSymbol), row, columnZeroIsId: true);
|
||||
case "Error":
|
||||
return DefaultTupleFromRow(typeof(ErrorTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(ErrorSymbol), row, columnZeroIsId: false);
|
||||
case "Extension":
|
||||
return DefaultTupleFromRow(typeof(ExtensionTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(ExtensionSymbol), row, columnZeroIsId: false);
|
||||
case "Feature":
|
||||
{
|
||||
var attributes = FieldAsInt(row, 7);
|
||||
|
@ -215,7 +215,7 @@ namespace WixToolset.Converters.Tupleizer
|
|||
installDefault = FeatureInstallDefault.Source;
|
||||
}
|
||||
|
||||
return new FeatureTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new FeatureSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
ParentFeatureRef = FieldAsString(row, 1),
|
||||
Title = FieldAsString(row, 2),
|
||||
|
@ -231,71 +231,71 @@ namespace WixToolset.Converters.Tupleizer
|
|||
}
|
||||
|
||||
case "FeatureComponents":
|
||||
return DefaultTupleFromRow(typeof(FeatureComponentsTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(FeatureComponentsSymbol), row, columnZeroIsId: false);
|
||||
case "File":
|
||||
{
|
||||
var attributes = FieldAsNullableInt(row, 6);
|
||||
|
||||
FileTupleAttributes tupleAttributes = 0;
|
||||
tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesReadOnly) == WindowsInstallerConstants.MsidbFileAttributesReadOnly ? FileTupleAttributes.ReadOnly : 0;
|
||||
tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesHidden) == WindowsInstallerConstants.MsidbFileAttributesHidden ? FileTupleAttributes.Hidden : 0;
|
||||
tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesSystem) == WindowsInstallerConstants.MsidbFileAttributesSystem ? FileTupleAttributes.System : 0;
|
||||
tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesVital) == WindowsInstallerConstants.MsidbFileAttributesVital ? FileTupleAttributes.Vital : 0;
|
||||
tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesChecksum) == WindowsInstallerConstants.MsidbFileAttributesChecksum ? FileTupleAttributes.Checksum : 0;
|
||||
tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesNoncompressed) == WindowsInstallerConstants.MsidbFileAttributesNoncompressed ? FileTupleAttributes.Uncompressed : 0;
|
||||
tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesCompressed) == WindowsInstallerConstants.MsidbFileAttributesCompressed ? FileTupleAttributes.Compressed : 0;
|
||||
FileSymbolAttributes symbolAttributes = 0;
|
||||
symbolAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesReadOnly) == WindowsInstallerConstants.MsidbFileAttributesReadOnly ? FileSymbolAttributes.ReadOnly : 0;
|
||||
symbolAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesHidden) == WindowsInstallerConstants.MsidbFileAttributesHidden ? FileSymbolAttributes.Hidden : 0;
|
||||
symbolAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesSystem) == WindowsInstallerConstants.MsidbFileAttributesSystem ? FileSymbolAttributes.System : 0;
|
||||
symbolAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesVital) == WindowsInstallerConstants.MsidbFileAttributesVital ? FileSymbolAttributes.Vital : 0;
|
||||
symbolAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesChecksum) == WindowsInstallerConstants.MsidbFileAttributesChecksum ? FileSymbolAttributes.Checksum : 0;
|
||||
symbolAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesNoncompressed) == WindowsInstallerConstants.MsidbFileAttributesNoncompressed ? FileSymbolAttributes.Uncompressed : 0;
|
||||
symbolAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesCompressed) == WindowsInstallerConstants.MsidbFileAttributesCompressed ? FileSymbolAttributes.Compressed : 0;
|
||||
|
||||
var id = FieldAsString(row, 0);
|
||||
|
||||
var tuple = new FileTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, id))
|
||||
var symbol = new FileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, id))
|
||||
{
|
||||
ComponentRef = FieldAsString(row, 1),
|
||||
Name = FieldAsString(row, 2),
|
||||
FileSize = FieldAsInt(row, 3),
|
||||
Version = FieldAsString(row, 4),
|
||||
Language = FieldAsString(row, 5),
|
||||
Attributes = tupleAttributes
|
||||
Attributes = symbolAttributes
|
||||
};
|
||||
|
||||
if (bindPathsById.TryGetValue(id, out var bindPathRow))
|
||||
{
|
||||
tuple.BindPath = FieldAsString(bindPathRow, 1) ?? String.Empty;
|
||||
symbol.BindPath = FieldAsString(bindPathRow, 1) ?? String.Empty;
|
||||
}
|
||||
|
||||
if (fontsById.TryGetValue(id, out var fontRow))
|
||||
{
|
||||
tuple.FontTitle = FieldAsString(fontRow, 1) ?? String.Empty;
|
||||
symbol.FontTitle = FieldAsString(fontRow, 1) ?? String.Empty;
|
||||
}
|
||||
|
||||
if (selfRegById.TryGetValue(id, out var selfRegRow))
|
||||
{
|
||||
tuple.SelfRegCost = FieldAsNullableInt(selfRegRow, 1) ?? 0;
|
||||
symbol.SelfRegCost = FieldAsNullableInt(selfRegRow, 1) ?? 0;
|
||||
}
|
||||
|
||||
if (wixFileById.TryGetValue(id, out var wixFileRow))
|
||||
{
|
||||
tuple.DirectoryRef = FieldAsString(wixFileRow, 4);
|
||||
tuple.DiskId = FieldAsNullableInt(wixFileRow, 5) ?? 0;
|
||||
tuple.Source = new IntermediateFieldPathValue { Path = FieldAsString(wixFileRow, 6) };
|
||||
tuple.PatchGroup = FieldAsInt(wixFileRow, 8);
|
||||
tuple.Attributes |= FieldAsInt(wixFileRow, 9) != 0 ? FileTupleAttributes.GeneratedShortFileName : 0;
|
||||
tuple.PatchAttributes = (PatchAttributeType)FieldAsInt(wixFileRow, 10);
|
||||
symbol.DirectoryRef = FieldAsString(wixFileRow, 4);
|
||||
symbol.DiskId = FieldAsNullableInt(wixFileRow, 5) ?? 0;
|
||||
symbol.Source = new IntermediateFieldPathValue { Path = FieldAsString(wixFileRow, 6) };
|
||||
symbol.PatchGroup = FieldAsInt(wixFileRow, 8);
|
||||
symbol.Attributes |= FieldAsInt(wixFileRow, 9) != 0 ? FileSymbolAttributes.GeneratedShortFileName : 0;
|
||||
symbol.PatchAttributes = (PatchAttributeType)FieldAsInt(wixFileRow, 10);
|
||||
}
|
||||
|
||||
return tuple;
|
||||
return symbol;
|
||||
}
|
||||
case "Font":
|
||||
return null;
|
||||
case "Icon":
|
||||
return DefaultTupleFromRow(typeof(IconTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(IconSymbol), row, columnZeroIsId: true);
|
||||
case "IniLocator":
|
||||
return DefaultTupleFromRow(typeof(IniLocatorTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(IniLocatorSymbol), row, columnZeroIsId: false);
|
||||
case "LockPermissions":
|
||||
return DefaultTupleFromRow(typeof(LockPermissionsTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(LockPermissionsSymbol), row, columnZeroIsId: false);
|
||||
case "Media":
|
||||
{
|
||||
var diskId = FieldAsInt(row, 0);
|
||||
var tuple = new MediaTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, diskId))
|
||||
var symbol = new MediaSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, diskId))
|
||||
{
|
||||
DiskId = diskId,
|
||||
LastSequence = FieldAsNullableInt(row, 1),
|
||||
|
@ -309,24 +309,24 @@ namespace WixToolset.Converters.Tupleizer
|
|||
{
|
||||
var compressionLevel = FieldAsString(wixMediaRow, 1);
|
||||
|
||||
tuple.CompressionLevel = String.IsNullOrEmpty(compressionLevel) ? null : (CompressionLevel?)Enum.Parse(typeof(CompressionLevel), compressionLevel, true);
|
||||
tuple.Layout = wixMediaRow.Layout;
|
||||
symbol.CompressionLevel = String.IsNullOrEmpty(compressionLevel) ? null : (CompressionLevel?)Enum.Parse(typeof(CompressionLevel), compressionLevel, true);
|
||||
symbol.Layout = wixMediaRow.Layout;
|
||||
}
|
||||
|
||||
return tuple;
|
||||
return symbol;
|
||||
}
|
||||
case "MIME":
|
||||
return DefaultTupleFromRow(typeof(MIMETuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(MIMESymbol), row, columnZeroIsId: false);
|
||||
case "ModuleIgnoreTable":
|
||||
return DefaultTupleFromRow(typeof(ModuleIgnoreTableTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(ModuleIgnoreTableSymbol), row, columnZeroIsId: true);
|
||||
case "MoveFile":
|
||||
return DefaultTupleFromRow(typeof(MoveFileTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(MoveFileSymbol), row, columnZeroIsId: true);
|
||||
case "MsiAssembly":
|
||||
{
|
||||
var componentId = FieldAsString(row, 0);
|
||||
if (componentsById.TryGetValue(componentId, out var componentRow))
|
||||
{
|
||||
return new AssemblyTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(componentRow, 5)))
|
||||
return new AssemblySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(componentRow, 5)))
|
||||
{
|
||||
ComponentRef = componentId,
|
||||
FeatureRef = FieldAsString(row, 1),
|
||||
|
@ -339,21 +339,21 @@ namespace WixToolset.Converters.Tupleizer
|
|||
return null;
|
||||
}
|
||||
case "MsiLockPermissionsEx":
|
||||
return DefaultTupleFromRow(typeof(MsiLockPermissionsExTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(MsiLockPermissionsExSymbol), row, columnZeroIsId: true);
|
||||
case "MsiShortcutProperty":
|
||||
return DefaultTupleFromRow(typeof(MsiShortcutPropertyTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(MsiShortcutPropertySymbol), row, columnZeroIsId: true);
|
||||
case "ODBCDataSource":
|
||||
return DefaultTupleFromRow(typeof(ODBCDataSourceTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(ODBCDataSourceSymbol), row, columnZeroIsId: true);
|
||||
case "ODBCDriver":
|
||||
return DefaultTupleFromRow(typeof(ODBCDriverTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(ODBCDriverSymbol), row, columnZeroIsId: true);
|
||||
case "ODBCTranslator":
|
||||
return DefaultTupleFromRow(typeof(ODBCTranslatorTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(ODBCTranslatorSymbol), row, columnZeroIsId: true);
|
||||
case "ProgId":
|
||||
return DefaultTupleFromRow(typeof(ProgIdTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(ProgIdSymbol), row, columnZeroIsId: false);
|
||||
case "Property":
|
||||
return DefaultTupleFromRow(typeof(PropertyTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(PropertySymbol), row, columnZeroIsId: true);
|
||||
case "PublishComponent":
|
||||
return DefaultTupleFromRow(typeof(PublishComponentTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(PublishComponentSymbol), row, columnZeroIsId: false);
|
||||
case "Registry":
|
||||
{
|
||||
var value = FieldAsString(row, 4);
|
||||
|
@ -397,7 +397,7 @@ namespace WixToolset.Converters.Tupleizer
|
|||
}
|
||||
}
|
||||
|
||||
return new RegistryTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new RegistrySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
Root = (RegistryRootType)FieldAsInt(row, 1),
|
||||
Key = FieldAsString(row, 2),
|
||||
|
@ -412,7 +412,7 @@ namespace WixToolset.Converters.Tupleizer
|
|||
{
|
||||
var type = FieldAsInt(row, 4);
|
||||
|
||||
return new RegLocatorTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new RegLocatorSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
Root = (RegistryRootType)FieldAsInt(row, 1),
|
||||
Key = FieldAsString(row, 2),
|
||||
|
@ -424,7 +424,7 @@ namespace WixToolset.Converters.Tupleizer
|
|||
case "RemoveFile":
|
||||
{
|
||||
var installMode = FieldAsInt(row, 4);
|
||||
return new RemoveFileTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new RemoveFileSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
ComponentRef = FieldAsString(row, 1),
|
||||
FileName = FieldAsString(row, 2),
|
||||
|
@ -435,7 +435,7 @@ namespace WixToolset.Converters.Tupleizer
|
|||
}
|
||||
case "RemoveRegistry":
|
||||
{
|
||||
return new RemoveRegistryTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new RemoveRegistrySymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
Action = RemoveRegistryActionType.RemoveOnInstall,
|
||||
Root = (RegistryRootType)FieldAsInt(row, 1),
|
||||
|
@ -446,14 +446,14 @@ namespace WixToolset.Converters.Tupleizer
|
|||
}
|
||||
|
||||
case "ReserveCost":
|
||||
return DefaultTupleFromRow(typeof(ReserveCostTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(ReserveCostSymbol), row, columnZeroIsId: true);
|
||||
case "SelfReg":
|
||||
return null;
|
||||
case "ServiceControl":
|
||||
{
|
||||
var events = FieldAsInt(row, 2);
|
||||
var wait = FieldAsNullableInt(row, 4);
|
||||
return new ServiceControlTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new ServiceControlSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
Name = FieldAsString(row, 1),
|
||||
Arguments = FieldAsString(row, 3),
|
||||
|
@ -469,12 +469,12 @@ namespace WixToolset.Converters.Tupleizer
|
|||
}
|
||||
|
||||
case "ServiceInstall":
|
||||
return DefaultTupleFromRow(typeof(ServiceInstallTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(ServiceInstallSymbol), row, columnZeroIsId: true);
|
||||
case "Shortcut":
|
||||
{
|
||||
var splitName = FieldAsString(row, 2).Split('|');
|
||||
|
||||
return new ShortcutTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new ShortcutSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
DirectoryRef = FieldAsString(row, 1),
|
||||
Name = splitName.Length > 1 ? splitName[1] : splitName[0],
|
||||
|
@ -495,13 +495,13 @@ namespace WixToolset.Converters.Tupleizer
|
|||
};
|
||||
}
|
||||
case "Signature":
|
||||
return DefaultTupleFromRow(typeof(SignatureTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(SignatureSymbol), row, columnZeroIsId: true);
|
||||
case "UIText":
|
||||
return DefaultTupleFromRow(typeof(UITextTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(UITextSymbol), row, columnZeroIsId: true);
|
||||
case "Upgrade":
|
||||
{
|
||||
var attributes = FieldAsInt(row, 4);
|
||||
return new UpgradeTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
return new UpgradeSymbol(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0)))
|
||||
{
|
||||
UpgradeCode = FieldAsString(row, 0),
|
||||
VersionMin = FieldAsString(row, 1),
|
||||
|
@ -518,11 +518,11 @@ namespace WixToolset.Converters.Tupleizer
|
|||
};
|
||||
}
|
||||
case "Verb":
|
||||
return DefaultTupleFromRow(typeof(VerbTuple), row, columnZeroIsId: false);
|
||||
return DefaultSymbolFromRow(typeof(VerbSymbol), row, columnZeroIsId: false);
|
||||
case "WixAction":
|
||||
{
|
||||
var sequenceTable = FieldAsString(row, 0);
|
||||
return new WixActionTuple(SourceLineNumber4(row.SourceLineNumbers))
|
||||
return new WixActionSymbol(SourceLineNumber4(row.SourceLineNumbers))
|
||||
{
|
||||
SequenceTable = (SequenceTable)Enum.Parse(typeof(SequenceTable), sequenceTable == "AdvtExecuteSequence" ? nameof(SequenceTable.AdvertiseExecuteSequence) : sequenceTable),
|
||||
Action = FieldAsString(row, 1),
|
||||
|
@ -534,31 +534,31 @@ namespace WixToolset.Converters.Tupleizer
|
|||
};
|
||||
}
|
||||
case "WixBootstrapperApplication":
|
||||
return DefaultTupleFromRow(typeof(WixBootstrapperApplicationTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixBootstrapperApplicationSymbol), row, columnZeroIsId: true);
|
||||
case "WixBundleContainer":
|
||||
return DefaultTupleFromRow(typeof(WixBundleContainerTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixBundleContainerSymbol), row, columnZeroIsId: true);
|
||||
case "WixBundleVariable":
|
||||
return DefaultTupleFromRow(typeof(WixBundleVariableTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixBundleVariableSymbol), row, columnZeroIsId: true);
|
||||
case "WixChainItem":
|
||||
return DefaultTupleFromRow(typeof(WixChainItemTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixChainItemSymbol), row, columnZeroIsId: true);
|
||||
case "WixCustomTable":
|
||||
return DefaultTupleFromRow(typeof(WixCustomTableTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixCustomTableSymbol), row, columnZeroIsId: true);
|
||||
case "WixDirectory":
|
||||
return null;
|
||||
case "WixFile":
|
||||
return null;
|
||||
case "WixInstanceTransforms":
|
||||
return DefaultTupleFromRow(typeof(WixInstanceTransformsTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixInstanceTransformsSymbol), row, columnZeroIsId: true);
|
||||
case "WixMedia":
|
||||
return null;
|
||||
case "WixMerge":
|
||||
return DefaultTupleFromRow(typeof(WixMergeTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixMergeSymbol), row, columnZeroIsId: true);
|
||||
case "WixPatchBaseline":
|
||||
return DefaultTupleFromRow(typeof(WixPatchBaselineTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixPatchBaselineSymbol), row, columnZeroIsId: true);
|
||||
case "WixProperty":
|
||||
{
|
||||
var attributes = FieldAsInt(row, 1);
|
||||
return new WixPropertyTuple(SourceLineNumber4(row.SourceLineNumbers))
|
||||
return new WixPropertySymbol(SourceLineNumber4(row.SourceLineNumbers))
|
||||
{
|
||||
PropertyRef = FieldAsString(row, 0),
|
||||
Admin = (attributes & 0x1) == 0x1,
|
||||
|
@ -567,13 +567,13 @@ namespace WixToolset.Converters.Tupleizer
|
|||
};
|
||||
}
|
||||
case "WixSuppressModularization":
|
||||
return DefaultTupleFromRow(typeof(WixSuppressModularizationTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixSuppressModularizationSymbol), row, columnZeroIsId: true);
|
||||
case "WixUI":
|
||||
return DefaultTupleFromRow(typeof(WixUITuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixUISymbol), row, columnZeroIsId: true);
|
||||
case "WixVariable":
|
||||
return DefaultTupleFromRow(typeof(WixVariableTuple), row, columnZeroIsId: true);
|
||||
return DefaultSymbolFromRow(typeof(WixVariableSymbol), row, columnZeroIsId: true);
|
||||
default:
|
||||
return GenericTupleFromCustomRow(row, columnZeroIsId: false);
|
||||
return GenericSymbolFromCustomRow(row, columnZeroIsId: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -674,35 +674,35 @@ namespace WixToolset.Converters.Tupleizer
|
|||
}
|
||||
}
|
||||
|
||||
private static IntermediateTuple DefaultTupleFromRow(Type tupleType, Wix3.Row row, bool columnZeroIsId)
|
||||
private static IntermediateSymbol DefaultSymbolFromRow(Type symbolType, Wix3.Row row, bool columnZeroIsId)
|
||||
{
|
||||
var tuple = Activator.CreateInstance(tupleType) as IntermediateTuple;
|
||||
var symbol = Activator.CreateInstance(symbolType) as IntermediateSymbol;
|
||||
|
||||
SetTupleFieldsFromRow(row, tuple, columnZeroIsId);
|
||||
SetSymbolFieldsFromRow(row, symbol, columnZeroIsId);
|
||||
|
||||
tuple.SourceLineNumbers = SourceLineNumber4(row.SourceLineNumbers);
|
||||
return tuple;
|
||||
symbol.SourceLineNumbers = SourceLineNumber4(row.SourceLineNumbers);
|
||||
return symbol;
|
||||
}
|
||||
|
||||
private static IntermediateTuple GenericTupleFromCustomRow(Wix3.Row row, bool columnZeroIsId)
|
||||
private static IntermediateSymbol GenericSymbolFromCustomRow(Wix3.Row row, bool columnZeroIsId)
|
||||
{
|
||||
var columnDefinitions = row.Table.Definition.Columns.Cast<Wix3.ColumnDefinition>();
|
||||
var fieldDefinitions = columnDefinitions.Select(columnDefinition =>
|
||||
new IntermediateFieldDefinition(columnDefinition.Name, ColumnType3ToIntermediateFieldType4(columnDefinition.Type))).ToArray();
|
||||
var tupleDefinition = new IntermediateTupleDefinition(row.Table.Name, fieldDefinitions, null);
|
||||
var tuple = new IntermediateTuple(tupleDefinition, SourceLineNumber4(row.SourceLineNumbers));
|
||||
var symbolDefinition = new IntermediateSymbolDefinition(row.Table.Name, fieldDefinitions, null);
|
||||
var symbol = new IntermediateSymbol(symbolDefinition, SourceLineNumber4(row.SourceLineNumbers));
|
||||
|
||||
SetTupleFieldsFromRow(row, tuple, columnZeroIsId);
|
||||
SetSymbolFieldsFromRow(row, symbol, columnZeroIsId);
|
||||
|
||||
return tuple;
|
||||
return symbol;
|
||||
}
|
||||
|
||||
private static void SetTupleFieldsFromRow(Wix3.Row row, IntermediateTuple tuple, bool columnZeroIsId)
|
||||
private static void SetSymbolFieldsFromRow(Wix3.Row row, IntermediateSymbol symbol, bool columnZeroIsId)
|
||||
{
|
||||
int offset = 0;
|
||||
if (columnZeroIsId)
|
||||
{
|
||||
tuple.Id = GetIdentifierForRow(row);
|
||||
symbol.Id = GetIdentifierForRow(row);
|
||||
offset = 1;
|
||||
}
|
||||
|
||||
|
@ -715,15 +715,15 @@ namespace WixToolset.Converters.Tupleizer
|
|||
case Wix3.ColumnType.Localized:
|
||||
case Wix3.ColumnType.Object:
|
||||
case Wix3.ColumnType.Preserved:
|
||||
tuple.Set(i - offset, FieldAsString(row, i));
|
||||
symbol.Set(i - offset, FieldAsString(row, i));
|
||||
break;
|
||||
case Wix3.ColumnType.Number:
|
||||
int? nullableValue = FieldAsNullableInt(row, i);
|
||||
// TODO: Consider whether null values should be coerced to their default value when
|
||||
// a column is not nullable. For now, just pass through the null.
|
||||
//int value = FieldAsInt(row, i);
|
||||
//tuple.Set(i - offset, column.IsNullable ? nullableValue : value);
|
||||
tuple.Set(i - offset, nullableValue);
|
||||
//symbol.Set(i - offset, column.IsNullable ? nullableValue : value);
|
||||
symbol.Set(i - offset, nullableValue);
|
||||
break;
|
||||
case Wix3.ColumnType.Unknown:
|
||||
break;
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net461;net472</TargetFrameworks>
|
||||
<Description>Tupleizer</Description>
|
||||
<Description>Symbolizer</Description>
|
||||
<Title>WiX Toolset Converters Tuplizer</Title>
|
||||
<DebugType>embedded</DebugType>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
|
@ -1,6 +1,6 @@
|
|||
// 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.
|
||||
|
||||
namespace WixToolsetTest.Converters.Tupleizer
|
||||
namespace WixToolsetTest.Converters.Symbolizer
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -8,13 +8,13 @@ namespace WixToolsetTest.Converters.Tupleizer
|
|||
using System.Linq;
|
||||
using WixBuildTools.TestSupport;
|
||||
using Wix3 = Microsoft.Tools.WindowsInstallerXml;
|
||||
using WixToolset.Converters.Tupleizer;
|
||||
using WixToolset.Converters.Symbolizer;
|
||||
using WixToolset.Data;
|
||||
using WixToolset.Data.WindowsInstaller;
|
||||
using WixToolset.Data.Tuples;
|
||||
using WixToolset.Data.Symbols;
|
||||
using Xunit;
|
||||
|
||||
public class ConvertTuplesFixture
|
||||
public class ConvertSymbolsFixture
|
||||
{
|
||||
[Fact]
|
||||
public void CanLoadWixoutAndConvertToIntermediate()
|
||||
|
@ -28,7 +28,7 @@ namespace WixToolsetTest.Converters.Tupleizer
|
|||
|
||||
var path = Path.Combine(dataFolder, "test.wixout");
|
||||
|
||||
var intermediate = ConvertTuples.ConvertFile(path);
|
||||
var intermediate = ConvertSymbols.ConvertFile(path);
|
||||
|
||||
Assert.NotNull(intermediate);
|
||||
Assert.Single(intermediate.Sections);
|
||||
|
@ -54,12 +54,12 @@ namespace WixToolsetTest.Converters.Tupleizer
|
|||
.OrderBy(s => s)
|
||||
.ToArray();
|
||||
|
||||
var tuples = intermediate.Sections.SelectMany(s => s.Tuples);
|
||||
var symbols = intermediate.Sections.SelectMany(s => s.Symbols);
|
||||
|
||||
var assemblyTuplesByFileId = tuples.OfType<AssemblyTuple>().ToDictionary(a => a.Id.Id);
|
||||
var assemblySymbolsByFileId = symbols.OfType<AssemblySymbol>().ToDictionary(a => a.Id.Id);
|
||||
|
||||
var wix4Dump = tuples
|
||||
.SelectMany(tuple => TupleToStrings(tuple, assemblyTuplesByFileId))
|
||||
var wix4Dump = symbols
|
||||
.SelectMany(symbol => SymbolToStrings(symbol, assemblySymbolsByFileId))
|
||||
.OrderBy(s => s)
|
||||
.ToArray();
|
||||
|
||||
|
@ -100,7 +100,7 @@ namespace WixToolsetTest.Converters.Tupleizer
|
|||
{
|
||||
string fields = null;
|
||||
|
||||
// Massage output to match WiX v3 rows and v4 tuples.
|
||||
// Massage output to match WiX v3 rows and v4 symbols.
|
||||
//
|
||||
switch (row.Table.Name)
|
||||
{
|
||||
|
@ -177,199 +177,199 @@ namespace WixToolsetTest.Converters.Tupleizer
|
|||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<string> TupleToStrings(IntermediateTuple tuple, Dictionary<string, AssemblyTuple> assemblyTuplesByFileId)
|
||||
private static IEnumerable<string> SymbolToStrings(IntermediateSymbol symbol, Dictionary<string, AssemblySymbol> assemblySymbolsByFileId)
|
||||
{
|
||||
var name = tuple.Definition.Type == TupleDefinitionType.SummaryInformation ? "_SummaryInformation" : tuple.Definition.Name;
|
||||
var id = tuple.Id?.Id ?? String.Empty;
|
||||
var name = symbol.Definition.Type == SymbolDefinitionType.SummaryInformation ? "_SummaryInformation" : symbol.Definition.Name;
|
||||
var id = symbol.Id?.Id ?? String.Empty;
|
||||
|
||||
string fields;
|
||||
switch (tuple.Definition.Name)
|
||||
switch (symbol.Definition.Name)
|
||||
{
|
||||
// Massage output to match WiX v3 rows and v4 tuples.
|
||||
// Massage output to match WiX v3 rows and v4 symbols.
|
||||
//
|
||||
case "Component":
|
||||
{
|
||||
var componentTuple = (ComponentTuple)tuple;
|
||||
var attributes = ComponentLocation.Either == componentTuple.Location ? WindowsInstallerConstants.MsidbComponentAttributesOptional : 0;
|
||||
attributes |= ComponentLocation.SourceOnly == componentTuple.Location ? WindowsInstallerConstants.MsidbComponentAttributesSourceOnly : 0;
|
||||
attributes |= ComponentKeyPathType.Registry == componentTuple.KeyPathType ? WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath : 0;
|
||||
attributes |= ComponentKeyPathType.OdbcDataSource == componentTuple.KeyPathType ? WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource : 0;
|
||||
attributes |= componentTuple.DisableRegistryReflection ? WindowsInstallerConstants.MsidbComponentAttributesDisableRegistryReflection : 0;
|
||||
attributes |= componentTuple.NeverOverwrite ? WindowsInstallerConstants.MsidbComponentAttributesNeverOverwrite : 0;
|
||||
attributes |= componentTuple.Permanent ? WindowsInstallerConstants.MsidbComponentAttributesPermanent : 0;
|
||||
attributes |= componentTuple.SharedDllRefCount ? WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount : 0;
|
||||
attributes |= componentTuple.Shared ? WindowsInstallerConstants.MsidbComponentAttributesShared : 0;
|
||||
attributes |= componentTuple.Transitive ? WindowsInstallerConstants.MsidbComponentAttributesTransitive : 0;
|
||||
attributes |= componentTuple.UninstallWhenSuperseded ? WindowsInstallerConstants.MsidbComponentAttributes64bit : 0;
|
||||
attributes |= componentTuple.Win64 ? WindowsInstallerConstants.MsidbComponentAttributes64bit : 0;
|
||||
var componentSymbol = (ComponentSymbol)symbol;
|
||||
var attributes = ComponentLocation.Either == componentSymbol.Location ? WindowsInstallerConstants.MsidbComponentAttributesOptional : 0;
|
||||
attributes |= ComponentLocation.SourceOnly == componentSymbol.Location ? WindowsInstallerConstants.MsidbComponentAttributesSourceOnly : 0;
|
||||
attributes |= ComponentKeyPathType.Registry == componentSymbol.KeyPathType ? WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath : 0;
|
||||
attributes |= ComponentKeyPathType.OdbcDataSource == componentSymbol.KeyPathType ? WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource : 0;
|
||||
attributes |= componentSymbol.DisableRegistryReflection ? WindowsInstallerConstants.MsidbComponentAttributesDisableRegistryReflection : 0;
|
||||
attributes |= componentSymbol.NeverOverwrite ? WindowsInstallerConstants.MsidbComponentAttributesNeverOverwrite : 0;
|
||||
attributes |= componentSymbol.Permanent ? WindowsInstallerConstants.MsidbComponentAttributesPermanent : 0;
|
||||
attributes |= componentSymbol.SharedDllRefCount ? WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount : 0;
|
||||
attributes |= componentSymbol.Shared ? WindowsInstallerConstants.MsidbComponentAttributesShared : 0;
|
||||
attributes |= componentSymbol.Transitive ? WindowsInstallerConstants.MsidbComponentAttributesTransitive : 0;
|
||||
attributes |= componentSymbol.UninstallWhenSuperseded ? WindowsInstallerConstants.MsidbComponentAttributes64bit : 0;
|
||||
attributes |= componentSymbol.Win64 ? WindowsInstallerConstants.MsidbComponentAttributes64bit : 0;
|
||||
|
||||
fields = String.Join(",",
|
||||
componentTuple.ComponentId,
|
||||
componentTuple.DirectoryRef,
|
||||
componentSymbol.ComponentId,
|
||||
componentSymbol.DirectoryRef,
|
||||
attributes.ToString(),
|
||||
componentTuple.Condition,
|
||||
componentTuple.KeyPath
|
||||
componentSymbol.Condition,
|
||||
componentSymbol.KeyPath
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "CustomAction":
|
||||
{
|
||||
var customActionTuple = (CustomActionTuple)tuple;
|
||||
var type = customActionTuple.Win64 ? WindowsInstallerConstants.MsidbCustomActionType64BitScript : 0;
|
||||
type |= customActionTuple.TSAware ? WindowsInstallerConstants.MsidbCustomActionTypeTSAware : 0;
|
||||
type |= customActionTuple.Impersonate ? 0 : WindowsInstallerConstants.MsidbCustomActionTypeNoImpersonate;
|
||||
type |= customActionTuple.IgnoreResult ? WindowsInstallerConstants.MsidbCustomActionTypeContinue : 0;
|
||||
type |= customActionTuple.Hidden ? WindowsInstallerConstants.MsidbCustomActionTypeHideTarget : 0;
|
||||
type |= customActionTuple.Async ? WindowsInstallerConstants.MsidbCustomActionTypeAsync : 0;
|
||||
type |= CustomActionExecutionType.FirstSequence == customActionTuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeFirstSequence : 0;
|
||||
type |= CustomActionExecutionType.OncePerProcess == customActionTuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeOncePerProcess : 0;
|
||||
type |= CustomActionExecutionType.ClientRepeat == customActionTuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeClientRepeat : 0;
|
||||
type |= CustomActionExecutionType.Deferred == customActionTuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript : 0;
|
||||
type |= CustomActionExecutionType.Rollback == customActionTuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript | WindowsInstallerConstants.MsidbCustomActionTypeRollback : 0;
|
||||
type |= CustomActionExecutionType.Commit == customActionTuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript | WindowsInstallerConstants.MsidbCustomActionTypeCommit : 0;
|
||||
type |= CustomActionSourceType.File == customActionTuple.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeSourceFile : 0;
|
||||
type |= CustomActionSourceType.Directory == customActionTuple.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeDirectory : 0;
|
||||
type |= CustomActionSourceType.Property == customActionTuple.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeProperty : 0;
|
||||
type |= CustomActionTargetType.Dll == customActionTuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeDll : 0;
|
||||
type |= CustomActionTargetType.Exe == customActionTuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeExe : 0;
|
||||
type |= CustomActionTargetType.TextData == customActionTuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeTextData : 0;
|
||||
type |= CustomActionTargetType.JScript == customActionTuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeJScript : 0;
|
||||
type |= CustomActionTargetType.VBScript == customActionTuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeVBScript : 0;
|
||||
var customActionSymbol = (CustomActionSymbol)symbol;
|
||||
var type = customActionSymbol.Win64 ? WindowsInstallerConstants.MsidbCustomActionType64BitScript : 0;
|
||||
type |= customActionSymbol.TSAware ? WindowsInstallerConstants.MsidbCustomActionTypeTSAware : 0;
|
||||
type |= customActionSymbol.Impersonate ? 0 : WindowsInstallerConstants.MsidbCustomActionTypeNoImpersonate;
|
||||
type |= customActionSymbol.IgnoreResult ? WindowsInstallerConstants.MsidbCustomActionTypeContinue : 0;
|
||||
type |= customActionSymbol.Hidden ? WindowsInstallerConstants.MsidbCustomActionTypeHideTarget : 0;
|
||||
type |= customActionSymbol.Async ? WindowsInstallerConstants.MsidbCustomActionTypeAsync : 0;
|
||||
type |= CustomActionExecutionType.FirstSequence == customActionSymbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeFirstSequence : 0;
|
||||
type |= CustomActionExecutionType.OncePerProcess == customActionSymbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeOncePerProcess : 0;
|
||||
type |= CustomActionExecutionType.ClientRepeat == customActionSymbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeClientRepeat : 0;
|
||||
type |= CustomActionExecutionType.Deferred == customActionSymbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript : 0;
|
||||
type |= CustomActionExecutionType.Rollback == customActionSymbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript | WindowsInstallerConstants.MsidbCustomActionTypeRollback : 0;
|
||||
type |= CustomActionExecutionType.Commit == customActionSymbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript | WindowsInstallerConstants.MsidbCustomActionTypeCommit : 0;
|
||||
type |= CustomActionSourceType.File == customActionSymbol.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeSourceFile : 0;
|
||||
type |= CustomActionSourceType.Directory == customActionSymbol.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeDirectory : 0;
|
||||
type |= CustomActionSourceType.Property == customActionSymbol.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeProperty : 0;
|
||||
type |= CustomActionTargetType.Dll == customActionSymbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeDll : 0;
|
||||
type |= CustomActionTargetType.Exe == customActionSymbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeExe : 0;
|
||||
type |= CustomActionTargetType.TextData == customActionSymbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeTextData : 0;
|
||||
type |= CustomActionTargetType.JScript == customActionSymbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeJScript : 0;
|
||||
type |= CustomActionTargetType.VBScript == customActionSymbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeVBScript : 0;
|
||||
|
||||
fields = String.Join(",",
|
||||
type.ToString(),
|
||||
customActionTuple.Source,
|
||||
customActionTuple.Target,
|
||||
customActionTuple.PatchUninstall ? WindowsInstallerConstants.MsidbCustomActionTypePatchUninstall.ToString() : null
|
||||
customActionSymbol.Source,
|
||||
customActionSymbol.Target,
|
||||
customActionSymbol.PatchUninstall ? WindowsInstallerConstants.MsidbCustomActionTypePatchUninstall.ToString() : null
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "Directory":
|
||||
{
|
||||
var directoryTuple = (DirectoryTuple)tuple;
|
||||
var directorySymbol = (DirectorySymbol)symbol;
|
||||
|
||||
if (!String.IsNullOrEmpty(directoryTuple.ComponentGuidGenerationSeed))
|
||||
if (!String.IsNullOrEmpty(directorySymbol.ComponentGuidGenerationSeed))
|
||||
{
|
||||
yield return $"WixDirectory:{directoryTuple.Id.Id},{directoryTuple.ComponentGuidGenerationSeed}";
|
||||
yield return $"WixDirectory:{directorySymbol.Id.Id},{directorySymbol.ComponentGuidGenerationSeed}";
|
||||
}
|
||||
|
||||
fields = String.Join(",", directoryTuple.ParentDirectoryRef, directoryTuple.Name, directoryTuple.ShortName, directoryTuple.SourceName, directoryTuple.SourceShortName);
|
||||
fields = String.Join(",", directorySymbol.ParentDirectoryRef, directorySymbol.Name, directorySymbol.ShortName, directorySymbol.SourceName, directorySymbol.SourceShortName);
|
||||
break;
|
||||
}
|
||||
case "Feature":
|
||||
{
|
||||
var featureTuple = (FeatureTuple)tuple;
|
||||
var attributes = featureTuple.DisallowAbsent ? WindowsInstallerConstants.MsidbFeatureAttributesUIDisallowAbsent : 0;
|
||||
attributes |= featureTuple.DisallowAdvertise ? WindowsInstallerConstants.MsidbFeatureAttributesDisallowAdvertise : 0;
|
||||
attributes |= FeatureInstallDefault.FollowParent == featureTuple.InstallDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFollowParent : 0;
|
||||
attributes |= FeatureInstallDefault.Source == featureTuple.InstallDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFavorSource : 0;
|
||||
attributes |= FeatureTypicalDefault.Advertise == featureTuple.TypicalDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFavorAdvertise : 0;
|
||||
var featureSymbol = (FeatureSymbol)symbol;
|
||||
var attributes = featureSymbol.DisallowAbsent ? WindowsInstallerConstants.MsidbFeatureAttributesUIDisallowAbsent : 0;
|
||||
attributes |= featureSymbol.DisallowAdvertise ? WindowsInstallerConstants.MsidbFeatureAttributesDisallowAdvertise : 0;
|
||||
attributes |= FeatureInstallDefault.FollowParent == featureSymbol.InstallDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFollowParent : 0;
|
||||
attributes |= FeatureInstallDefault.Source == featureSymbol.InstallDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFavorSource : 0;
|
||||
attributes |= FeatureTypicalDefault.Advertise == featureSymbol.TypicalDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFavorAdvertise : 0;
|
||||
|
||||
fields = String.Join(",",
|
||||
featureTuple.ParentFeatureRef,
|
||||
featureTuple.Title,
|
||||
featureTuple.Description,
|
||||
featureTuple.Display.ToString(),
|
||||
featureTuple.Level.ToString(),
|
||||
featureTuple.DirectoryRef,
|
||||
featureSymbol.ParentFeatureRef,
|
||||
featureSymbol.Title,
|
||||
featureSymbol.Description,
|
||||
featureSymbol.Display.ToString(),
|
||||
featureSymbol.Level.ToString(),
|
||||
featureSymbol.DirectoryRef,
|
||||
attributes.ToString());
|
||||
break;
|
||||
}
|
||||
case "File":
|
||||
{
|
||||
var fileTuple = (FileTuple)tuple;
|
||||
var fileSymbol = (FileSymbol)symbol;
|
||||
|
||||
if (fileTuple.BindPath != null)
|
||||
if (fileSymbol.BindPath != null)
|
||||
{
|
||||
yield return $"BindImage:{fileTuple.Id.Id},{fileTuple.BindPath}";
|
||||
yield return $"BindImage:{fileSymbol.Id.Id},{fileSymbol.BindPath}";
|
||||
}
|
||||
|
||||
if (fileTuple.FontTitle != null)
|
||||
if (fileSymbol.FontTitle != null)
|
||||
{
|
||||
yield return $"Font:{fileTuple.Id.Id},{fileTuple.FontTitle}";
|
||||
yield return $"Font:{fileSymbol.Id.Id},{fileSymbol.FontTitle}";
|
||||
}
|
||||
|
||||
if (fileTuple.SelfRegCost.HasValue)
|
||||
if (fileSymbol.SelfRegCost.HasValue)
|
||||
{
|
||||
yield return $"SelfReg:{fileTuple.Id.Id},{fileTuple.SelfRegCost}";
|
||||
yield return $"SelfReg:{fileSymbol.Id.Id},{fileSymbol.SelfRegCost}";
|
||||
}
|
||||
|
||||
int? assemblyAttributes = null;
|
||||
if (assemblyTuplesByFileId.TryGetValue(fileTuple.Id.Id, out var assemblyTuple))
|
||||
if (assemblySymbolsByFileId.TryGetValue(fileSymbol.Id.Id, out var assemblySymbol))
|
||||
{
|
||||
if (assemblyTuple.Type == AssemblyType.DotNetAssembly)
|
||||
if (assemblySymbol.Type == AssemblyType.DotNetAssembly)
|
||||
{
|
||||
assemblyAttributes = 0;
|
||||
}
|
||||
else if (assemblyTuple.Type == AssemblyType.Win32Assembly)
|
||||
else if (assemblySymbol.Type == AssemblyType.Win32Assembly)
|
||||
{
|
||||
assemblyAttributes = 1;
|
||||
}
|
||||
}
|
||||
|
||||
yield return "WixFile:" + String.Join(",",
|
||||
fileTuple.Id.Id,
|
||||
fileSymbol.Id.Id,
|
||||
assemblyAttributes,
|
||||
assemblyTuple?.ManifestFileRef,
|
||||
assemblyTuple?.ApplicationFileRef,
|
||||
fileTuple.DirectoryRef,
|
||||
fileTuple.DiskId,
|
||||
fileTuple.Source.Path,
|
||||
assemblySymbol?.ManifestFileRef,
|
||||
assemblySymbol?.ApplicationFileRef,
|
||||
fileSymbol.DirectoryRef,
|
||||
fileSymbol.DiskId,
|
||||
fileSymbol.Source.Path,
|
||||
null, // assembly processor arch
|
||||
fileTuple.PatchGroup,
|
||||
(fileTuple.Attributes & FileTupleAttributes.GeneratedShortFileName) != 0 ? 1 : 0,
|
||||
(int)fileTuple.PatchAttributes,
|
||||
fileTuple.RetainLengths,
|
||||
fileTuple.IgnoreOffsets,
|
||||
fileTuple.IgnoreLengths,
|
||||
fileTuple.RetainOffsets
|
||||
fileSymbol.PatchGroup,
|
||||
(fileSymbol.Attributes & FileSymbolAttributes.GeneratedShortFileName) != 0 ? 1 : 0,
|
||||
(int)fileSymbol.PatchAttributes,
|
||||
fileSymbol.RetainLengths,
|
||||
fileSymbol.IgnoreOffsets,
|
||||
fileSymbol.IgnoreLengths,
|
||||
fileSymbol.RetainOffsets
|
||||
);
|
||||
|
||||
var fileAttributes = 0;
|
||||
fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.ReadOnly) != 0 ? WindowsInstallerConstants.MsidbFileAttributesReadOnly : 0;
|
||||
fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Hidden) != 0 ? WindowsInstallerConstants.MsidbFileAttributesHidden : 0;
|
||||
fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.System) != 0 ? WindowsInstallerConstants.MsidbFileAttributesSystem : 0;
|
||||
fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Vital) != 0 ? WindowsInstallerConstants.MsidbFileAttributesVital : 0;
|
||||
fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Checksum) != 0 ? WindowsInstallerConstants.MsidbFileAttributesChecksum : 0;
|
||||
fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Compressed) != 0 ? WindowsInstallerConstants.MsidbFileAttributesCompressed : 0;
|
||||
fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Uncompressed) != 0 ? WindowsInstallerConstants.MsidbFileAttributesNoncompressed : 0;
|
||||
fileAttributes |= (fileSymbol.Attributes & FileSymbolAttributes.ReadOnly) != 0 ? WindowsInstallerConstants.MsidbFileAttributesReadOnly : 0;
|
||||
fileAttributes |= (fileSymbol.Attributes & FileSymbolAttributes.Hidden) != 0 ? WindowsInstallerConstants.MsidbFileAttributesHidden : 0;
|
||||
fileAttributes |= (fileSymbol.Attributes & FileSymbolAttributes.System) != 0 ? WindowsInstallerConstants.MsidbFileAttributesSystem : 0;
|
||||
fileAttributes |= (fileSymbol.Attributes & FileSymbolAttributes.Vital) != 0 ? WindowsInstallerConstants.MsidbFileAttributesVital : 0;
|
||||
fileAttributes |= (fileSymbol.Attributes & FileSymbolAttributes.Checksum) != 0 ? WindowsInstallerConstants.MsidbFileAttributesChecksum : 0;
|
||||
fileAttributes |= (fileSymbol.Attributes & FileSymbolAttributes.Compressed) != 0 ? WindowsInstallerConstants.MsidbFileAttributesCompressed : 0;
|
||||
fileAttributes |= (fileSymbol.Attributes & FileSymbolAttributes.Uncompressed) != 0 ? WindowsInstallerConstants.MsidbFileAttributesNoncompressed : 0;
|
||||
|
||||
fields = String.Join(",",
|
||||
fileTuple.ComponentRef,
|
||||
fileTuple.Name,
|
||||
fileTuple.FileSize.ToString(),
|
||||
fileTuple.Version,
|
||||
fileTuple.Language,
|
||||
fileSymbol.ComponentRef,
|
||||
fileSymbol.Name,
|
||||
fileSymbol.FileSize.ToString(),
|
||||
fileSymbol.Version,
|
||||
fileSymbol.Language,
|
||||
fileAttributes);
|
||||
break;
|
||||
}
|
||||
|
||||
case "Media":
|
||||
fields = String.Join(",", tuple.Fields.Skip(1).Select(SafeConvertField));
|
||||
fields = String.Join(",", symbol.Fields.Skip(1).Select(SafeConvertField));
|
||||
break;
|
||||
|
||||
case "Assembly":
|
||||
{
|
||||
var assemblyTuple = (AssemblyTuple)tuple;
|
||||
var assemblySymbol = (AssemblySymbol)symbol;
|
||||
|
||||
id = null;
|
||||
name = "MsiAssembly";
|
||||
fields = String.Join(",", assemblyTuple.ComponentRef, assemblyTuple.FeatureRef, assemblyTuple.ManifestFileRef, assemblyTuple.ApplicationFileRef, assemblyTuple.Type == AssemblyType.Win32Assembly ? 1 : 0);
|
||||
fields = String.Join(",", assemblySymbol.ComponentRef, assemblySymbol.FeatureRef, assemblySymbol.ManifestFileRef, assemblySymbol.ApplicationFileRef, assemblySymbol.Type == AssemblyType.Win32Assembly ? 1 : 0);
|
||||
break;
|
||||
}
|
||||
case "RegLocator":
|
||||
{
|
||||
var locatorTuple = (RegLocatorTuple)tuple;
|
||||
var locatorSymbol = (RegLocatorSymbol)symbol;
|
||||
|
||||
fields = String.Join(",", (int)locatorTuple.Root, locatorTuple.Key, locatorTuple.Name, (int)locatorTuple.Type, locatorTuple.Win64);
|
||||
fields = String.Join(",", (int)locatorSymbol.Root, locatorSymbol.Key, locatorSymbol.Name, (int)locatorSymbol.Type, locatorSymbol.Win64);
|
||||
break;
|
||||
}
|
||||
case "Registry":
|
||||
{
|
||||
var registryTuple = (RegistryTuple)tuple;
|
||||
var value = registryTuple.Value;
|
||||
var registrySymbol = (RegistrySymbol)symbol;
|
||||
var value = registrySymbol.Value;
|
||||
|
||||
switch (registryTuple.ValueType)
|
||||
switch (registrySymbol.ValueType)
|
||||
{
|
||||
case RegistryValueType.Binary:
|
||||
value = String.Concat("#x", value);
|
||||
|
@ -381,7 +381,7 @@ namespace WixToolsetTest.Converters.Tupleizer
|
|||
value = String.Concat("#", value);
|
||||
break;
|
||||
case RegistryValueType.MultiString:
|
||||
switch (registryTuple.ValueAction)
|
||||
switch (registrySymbol.ValueAction)
|
||||
{
|
||||
case RegistryValueActionType.Append:
|
||||
value = String.Concat("[~]", value);
|
||||
|
@ -408,145 +408,145 @@ namespace WixToolsetTest.Converters.Tupleizer
|
|||
}
|
||||
|
||||
fields = String.Join(",",
|
||||
((int)registryTuple.Root).ToString(),
|
||||
registryTuple.Key,
|
||||
registryTuple.Name,
|
||||
((int)registrySymbol.Root).ToString(),
|
||||
registrySymbol.Key,
|
||||
registrySymbol.Name,
|
||||
value,
|
||||
registryTuple.ComponentRef
|
||||
registrySymbol.ComponentRef
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
case "RemoveRegistry":
|
||||
{
|
||||
var removeRegistryTuple = (RemoveRegistryTuple)tuple;
|
||||
var removeRegistrySymbol = (RemoveRegistrySymbol)symbol;
|
||||
fields = String.Join(",",
|
||||
((int)removeRegistryTuple.Root).ToString(),
|
||||
removeRegistryTuple.Key,
|
||||
removeRegistryTuple.Name,
|
||||
removeRegistryTuple.ComponentRef
|
||||
((int)removeRegistrySymbol.Root).ToString(),
|
||||
removeRegistrySymbol.Key,
|
||||
removeRegistrySymbol.Name,
|
||||
removeRegistrySymbol.ComponentRef
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
case "ServiceControl":
|
||||
{
|
||||
var serviceControlTuple = (ServiceControlTuple)tuple;
|
||||
var serviceControlSymbol = (ServiceControlSymbol)symbol;
|
||||
|
||||
var events = serviceControlTuple.InstallRemove ? WindowsInstallerConstants.MsidbServiceControlEventDelete : 0;
|
||||
events |= serviceControlTuple.UninstallRemove ? WindowsInstallerConstants.MsidbServiceControlEventUninstallDelete : 0;
|
||||
events |= serviceControlTuple.InstallStart ? WindowsInstallerConstants.MsidbServiceControlEventStart : 0;
|
||||
events |= serviceControlTuple.UninstallStart ? WindowsInstallerConstants.MsidbServiceControlEventUninstallStart : 0;
|
||||
events |= serviceControlTuple.InstallStop ? WindowsInstallerConstants.MsidbServiceControlEventStop : 0;
|
||||
events |= serviceControlTuple.UninstallStop ? WindowsInstallerConstants.MsidbServiceControlEventUninstallStop : 0;
|
||||
var events = serviceControlSymbol.InstallRemove ? WindowsInstallerConstants.MsidbServiceControlEventDelete : 0;
|
||||
events |= serviceControlSymbol.UninstallRemove ? WindowsInstallerConstants.MsidbServiceControlEventUninstallDelete : 0;
|
||||
events |= serviceControlSymbol.InstallStart ? WindowsInstallerConstants.MsidbServiceControlEventStart : 0;
|
||||
events |= serviceControlSymbol.UninstallStart ? WindowsInstallerConstants.MsidbServiceControlEventUninstallStart : 0;
|
||||
events |= serviceControlSymbol.InstallStop ? WindowsInstallerConstants.MsidbServiceControlEventStop : 0;
|
||||
events |= serviceControlSymbol.UninstallStop ? WindowsInstallerConstants.MsidbServiceControlEventUninstallStop : 0;
|
||||
|
||||
fields = String.Join(",",
|
||||
serviceControlTuple.Name,
|
||||
serviceControlSymbol.Name,
|
||||
events.ToString(),
|
||||
serviceControlTuple.Arguments,
|
||||
serviceControlTuple.Wait == true ? "1" : "0",
|
||||
serviceControlTuple.ComponentRef
|
||||
serviceControlSymbol.Arguments,
|
||||
serviceControlSymbol.Wait == true ? "1" : "0",
|
||||
serviceControlSymbol.ComponentRef
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
case "ServiceInstall":
|
||||
{
|
||||
var serviceInstallTuple = (ServiceInstallTuple)tuple;
|
||||
var serviceInstallSymbol = (ServiceInstallSymbol)symbol;
|
||||
|
||||
var errorControl = (int)serviceInstallTuple.ErrorControl;
|
||||
errorControl |= serviceInstallTuple.Vital ? WindowsInstallerConstants.MsidbServiceInstallErrorControlVital : 0;
|
||||
var errorControl = (int)serviceInstallSymbol.ErrorControl;
|
||||
errorControl |= serviceInstallSymbol.Vital ? WindowsInstallerConstants.MsidbServiceInstallErrorControlVital : 0;
|
||||
|
||||
var serviceType = (int)serviceInstallTuple.ServiceType;
|
||||
serviceType |= serviceInstallTuple.Interactive ? WindowsInstallerConstants.MsidbServiceInstallInteractive : 0;
|
||||
var serviceType = (int)serviceInstallSymbol.ServiceType;
|
||||
serviceType |= serviceInstallSymbol.Interactive ? WindowsInstallerConstants.MsidbServiceInstallInteractive : 0;
|
||||
|
||||
fields = String.Join(",",
|
||||
serviceInstallTuple.Name,
|
||||
serviceInstallTuple.DisplayName,
|
||||
serviceInstallSymbol.Name,
|
||||
serviceInstallSymbol.DisplayName,
|
||||
serviceType.ToString(),
|
||||
((int)serviceInstallTuple.StartType).ToString(),
|
||||
((int)serviceInstallSymbol.StartType).ToString(),
|
||||
errorControl.ToString(),
|
||||
serviceInstallTuple.LoadOrderGroup,
|
||||
serviceInstallTuple.Dependencies,
|
||||
serviceInstallTuple.StartName,
|
||||
serviceInstallTuple.Password,
|
||||
serviceInstallTuple.Arguments,
|
||||
serviceInstallTuple.ComponentRef,
|
||||
serviceInstallTuple.Description
|
||||
serviceInstallSymbol.LoadOrderGroup,
|
||||
serviceInstallSymbol.Dependencies,
|
||||
serviceInstallSymbol.StartName,
|
||||
serviceInstallSymbol.Password,
|
||||
serviceInstallSymbol.Arguments,
|
||||
serviceInstallSymbol.ComponentRef,
|
||||
serviceInstallSymbol.Description
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
case "Upgrade":
|
||||
{
|
||||
var upgradeTuple = (UpgradeTuple)tuple;
|
||||
var upgradeSymbol = (UpgradeSymbol)symbol;
|
||||
|
||||
var attributes = upgradeTuple.MigrateFeatures ? WindowsInstallerConstants.MsidbUpgradeAttributesMigrateFeatures : 0;
|
||||
attributes |= upgradeTuple.OnlyDetect ? WindowsInstallerConstants.MsidbUpgradeAttributesOnlyDetect : 0;
|
||||
attributes |= upgradeTuple.IgnoreRemoveFailures ? WindowsInstallerConstants.MsidbUpgradeAttributesIgnoreRemoveFailure : 0;
|
||||
attributes |= upgradeTuple.VersionMinInclusive ? WindowsInstallerConstants.MsidbUpgradeAttributesVersionMinInclusive : 0;
|
||||
attributes |= upgradeTuple.VersionMaxInclusive ? WindowsInstallerConstants.MsidbUpgradeAttributesVersionMaxInclusive : 0;
|
||||
attributes |= upgradeTuple.ExcludeLanguages ? WindowsInstallerConstants.MsidbUpgradeAttributesLanguagesExclusive : 0;
|
||||
var attributes = upgradeSymbol.MigrateFeatures ? WindowsInstallerConstants.MsidbUpgradeAttributesMigrateFeatures : 0;
|
||||
attributes |= upgradeSymbol.OnlyDetect ? WindowsInstallerConstants.MsidbUpgradeAttributesOnlyDetect : 0;
|
||||
attributes |= upgradeSymbol.IgnoreRemoveFailures ? WindowsInstallerConstants.MsidbUpgradeAttributesIgnoreRemoveFailure : 0;
|
||||
attributes |= upgradeSymbol.VersionMinInclusive ? WindowsInstallerConstants.MsidbUpgradeAttributesVersionMinInclusive : 0;
|
||||
attributes |= upgradeSymbol.VersionMaxInclusive ? WindowsInstallerConstants.MsidbUpgradeAttributesVersionMaxInclusive : 0;
|
||||
attributes |= upgradeSymbol.ExcludeLanguages ? WindowsInstallerConstants.MsidbUpgradeAttributesLanguagesExclusive : 0;
|
||||
|
||||
fields = String.Join(",",
|
||||
upgradeTuple.VersionMin,
|
||||
upgradeTuple.VersionMax,
|
||||
upgradeTuple.Language,
|
||||
upgradeSymbol.VersionMin,
|
||||
upgradeSymbol.VersionMax,
|
||||
upgradeSymbol.Language,
|
||||
attributes.ToString(),
|
||||
upgradeTuple.Remove,
|
||||
upgradeTuple.ActionProperty
|
||||
upgradeSymbol.Remove,
|
||||
upgradeSymbol.ActionProperty
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
case "WixAction":
|
||||
{
|
||||
var wixActionTuple = (WixActionTuple)tuple;
|
||||
var data = wixActionTuple.Fields[(int)WixActionTupleFields.SequenceTable].AsObject();
|
||||
var sequenceTableAsInt = data is string ? (int)SequenceStringToSequenceTable(data) : (int)wixActionTuple.SequenceTable;
|
||||
var wixActionSymbol = (WixActionSymbol)symbol;
|
||||
var data = wixActionSymbol.Fields[(int)WixActionSymbolFields.SequenceTable].AsObject();
|
||||
var sequenceTableAsInt = data is string ? (int)SequenceStringToSequenceTable(data) : (int)wixActionSymbol.SequenceTable;
|
||||
|
||||
fields = String.Join(",",
|
||||
sequenceTableAsInt,
|
||||
wixActionTuple.Action,
|
||||
wixActionTuple.Condition,
|
||||
wixActionTuple.Sequence?.ToString() ?? String.Empty,
|
||||
wixActionTuple.Before,
|
||||
wixActionTuple.After,
|
||||
wixActionTuple.Overridable == true ? "1" : "0"
|
||||
wixActionSymbol.Action,
|
||||
wixActionSymbol.Condition,
|
||||
wixActionSymbol.Sequence?.ToString() ?? String.Empty,
|
||||
wixActionSymbol.Before,
|
||||
wixActionSymbol.After,
|
||||
wixActionSymbol.Overridable == true ? "1" : "0"
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
case "WixComplexReference":
|
||||
{
|
||||
var wixComplexReferenceTuple = (WixComplexReferenceTuple)tuple;
|
||||
var wixComplexReferenceSymbol = (WixComplexReferenceSymbol)symbol;
|
||||
fields = String.Join(",",
|
||||
wixComplexReferenceTuple.Parent,
|
||||
(int)wixComplexReferenceTuple.ParentType,
|
||||
wixComplexReferenceTuple.ParentLanguage,
|
||||
wixComplexReferenceTuple.Child,
|
||||
(int)wixComplexReferenceTuple.ChildType,
|
||||
wixComplexReferenceTuple.IsPrimary ? "1" : "0"
|
||||
wixComplexReferenceSymbol.Parent,
|
||||
(int)wixComplexReferenceSymbol.ParentType,
|
||||
wixComplexReferenceSymbol.ParentLanguage,
|
||||
wixComplexReferenceSymbol.Child,
|
||||
(int)wixComplexReferenceSymbol.ChildType,
|
||||
wixComplexReferenceSymbol.IsPrimary ? "1" : "0"
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
case "WixProperty":
|
||||
{
|
||||
var wixPropertyTuple = (WixPropertyTuple)tuple;
|
||||
var attributes = wixPropertyTuple.Admin ? 0x1 : 0;
|
||||
attributes |= wixPropertyTuple.Hidden ? 0x2 : 0;
|
||||
attributes |= wixPropertyTuple.Secure ? 0x4 : 0;
|
||||
var wixPropertySymbol = (WixPropertySymbol)symbol;
|
||||
var attributes = wixPropertySymbol.Admin ? 0x1 : 0;
|
||||
attributes |= wixPropertySymbol.Hidden ? 0x2 : 0;
|
||||
attributes |= wixPropertySymbol.Secure ? 0x4 : 0;
|
||||
|
||||
fields = String.Join(",",
|
||||
wixPropertyTuple.PropertyRef,
|
||||
wixPropertySymbol.PropertyRef,
|
||||
attributes.ToString()
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
fields = String.Join(",", tuple.Fields.Select(SafeConvertField));
|
||||
fields = String.Join(",", symbol.Fields.Select(SafeConvertField));
|
||||
break;
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
<ProductVersion>3.10</ProductVersion>
|
||||
<ProjectGuid>d59f1c1e-9238-49fa-bfa2-ec1d9c2dda1d</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>TupleizerWixout</OutputName>
|
||||
<OutputName>SymbolizerWixout</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Name="TupleizerWixout" Language="1033" Version="1.0.0.0" Manufacturer="FireGiant" UpgradeCode="14a02d7f-9b32-4c92-b1f1-da518bf4e32a">
|
||||
<Product Id="*" Name="SymbolizerWixout" Language="1033" Version="1.0.0.0" Manufacturer="FireGiant" UpgradeCode="14a02d7f-9b32-4c92-b1f1-da518bf4e32a">
|
||||
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
|
||||
|
||||
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" IgnoreRemoveFailure="yes" />
|
||||
<MediaTemplate />
|
||||
|
||||
<Feature Id="ProductFeature" Title="TupleizerWixout" Level="1">
|
||||
<Feature Id="ProductFeature" Title="SymbolizerWixout" Level="1">
|
||||
<Feature Id="ChildFeature">
|
||||
<ComponentGroupRef Id="ProductComponents" />
|
||||
</Feature>
|
||||
|
@ -20,7 +20,7 @@
|
|||
<Fragment>
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="ProgramFilesFolder">
|
||||
<Directory Id="INSTALLFOLDER" Name="TupleizerWixout" />
|
||||
<Directory Id="INSTALLFOLDER" Name="SymbolizerWixout" />
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Fragment>
|
|
@ -13,7 +13,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\WixToolset.Converters.Tupleizer\WixToolset.Converters.Tupleizer.csproj" />
|
||||
<ProjectReference Include="..\..\WixToolset.Converters.Symbolizer\WixToolset.Converters.Symbolizer.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
|
@ -0,0 +1,9 @@
|
|||
<ProjectConfiguration>
|
||||
<Settings>
|
||||
<IgnoredTests>
|
||||
<NamedTestSelector>
|
||||
<TestName>WixToolsetTest.Converters.Symbolizer.ConvertSymbolsFixture.CanLoadWixoutAndConvertToIntermediate</TestName>
|
||||
</NamedTestSelector>
|
||||
</IgnoredTests>
|
||||
</Settings>
|
||||
</ProjectConfiguration>
|
|
@ -1,9 +0,0 @@
|
|||
<ProjectConfiguration>
|
||||
<Settings>
|
||||
<IgnoredTests>
|
||||
<NamedTestSelector>
|
||||
<TestName>WixToolsetTest.Converters.Tupleizer.ConvertTuplesFixture.CanLoadWixoutAndConvertToIntermediate</TestName>
|
||||
</NamedTestSelector>
|
||||
</IgnoredTests>
|
||||
</Settings>
|
||||
</ProjectConfiguration>
|
Загрузка…
Ссылка в новой задаче