Integrate latest Data changes for FileTuple and AssemblyTuple
Rob Mensching committed
May 23, 2019 at 15:37 UTC
354f6d5b79404544cb7c0e11a0d9212b4780ce09
22 files changed
+233
-253
src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs
+15
-17
@@ -156,13 +156,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind
156
throw new WixException(ErrorMessages.MaximumUncompressedMediaSizeTooLarge(null, maxPreCabSizeInMB));
157
}
158
159
- foreach (FileFacade facade in this.FileFacades)
159
+ foreach (var facade in this.FileFacades)
160
{
161
// When building a product, if the current file is not to be compressed or if
162
// the package set not to be compressed, don't cab it.
163
- if (SectionType.Product == this.Section.Type &&
164
- ((facade.File.Compressed.HasValue && !facade.File.Compressed.Value) ||
165
- (!facade.File.Compressed.HasValue && !this.FilesCompressed)))
163
+ if (SectionType.Product == this.Section.Type && (facade.Uncompressed || !this.FilesCompressed))
164
{
165
uncompressedFiles.Add(facade);
166
continue;
@@ -171,8 +169,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
169
if (currentCabIndex == MaxCabIndex)
170
{
171
// Associate current file with last cab (irrespective of the size) and cab index is not incremented anymore.
174
- List<FileFacade> cabinetFiles = filesByCabinetMedia[currentMediaRow];
175
- facade.WixFile.DiskId = currentCabIndex;
172
+ var cabinetFiles = filesByCabinetMedia[currentMediaRow];
173
+ facade.File.DiskId = currentCabIndex;
174
cabinetFiles.Add(facade);
175
continue;
176
}
@@ -187,8 +185,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
185
mediaRows.Add(currentMediaRow.DiskId, currentMediaRow);
186
filesByCabinetMedia.Add(currentMediaRow, new List<FileFacade>());
187
190
- List<FileFacade> cabinetFileRows = filesByCabinetMedia[currentMediaRow];
191
- facade.WixFile.DiskId = currentCabIndex;
188
+ var cabinetFileRows = filesByCabinetMedia[currentMediaRow];
189
+ facade.File.DiskId = currentCabIndex;
190
cabinetFileRows.Add(facade);
191
// Now files larger than MaxUncompressedMediaSize will be the only file in its cabinet so as to respect MaxUncompressedMediaSize
192
currentPreCabSize = (ulong)facade.File.FileSize;
@@ -205,8 +203,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
203
}
204
205
// Associate current file with current cab.
208
- List<FileFacade> cabinetFiles = filesByCabinetMedia[currentMediaRow];
209
- facade.WixFile.DiskId = currentCabIndex;
206
+ var cabinetFiles = filesByCabinetMedia[currentMediaRow];
207
+ facade.File.DiskId = currentCabIndex;
208
cabinetFiles.Add(facade);
209
}
210
}
@@ -264,17 +262,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind
262
263
foreach (FileFacade facade in fileFacades)
264
{
267
- if (!mediaRows.TryGetValue(facade.WixFile.DiskId, out var mediaRow))
265
+ if (!mediaRows.TryGetValue(facade.DiskId, out var mediaRow))
266
{
269
- this.Messaging.Write(ErrorMessages.MissingMedia(facade.File.SourceLineNumbers, facade.WixFile.DiskId));
267
+ this.Messaging.Write(ErrorMessages.MissingMedia(facade.File.SourceLineNumbers, facade.DiskId));
268
continue;
269
}
270
273
- // When building a product, if the current file is not to be compressed or if
271
+ // When building a product, if the current file is to be uncompressed or if
272
// the package set not to be compressed, don't cab it.
275
- if (SectionType.Product == this.Section.Type &&
276
- ((!facade.File.Compressed.HasValue && !this.FilesCompressed) ||
277
- (facade.File.Compressed.HasValue && !facade.File.Compressed.Value)))
273
+ var compressed = (facade.File.Attributes & FileTupleAttributes.Compressed) == FileTupleAttributes.Compressed;
274
+ var uncompressed = (facade.File.Attributes & FileTupleAttributes.Uncompressed) == FileTupleAttributes.Uncompressed;
275
+ if (SectionType.Product == this.Section.Type && (uncompressed || (!compressed && !this.FilesCompressed)))
276
{
277
uncompressedFiles.Add(facade);
278
}
@@ -286,7 +284,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
284
}
285
else
286
{
289
- this.Messaging.Write(ErrorMessages.ExpectedMediaCabinet(facade.File.SourceLineNumbers, facade.File.Id.Id, facade.WixFile.DiskId));
287
+ this.Messaging.Write(ErrorMessages.ExpectedMediaCabinet(facade.File.SourceLineNumbers, facade.File.Id.Id, facade.DiskId));
288
}
289
}
290
}
src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
+1
-1
@@ -526,7 +526,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
526
527
this.FileTransfers = fileTransfers;
528
// TODO: this is not sufficient to collect all Input files (for example, it misses Binary and Icon tables).
529
- trackedFiles.AddRange(fileFacades.Select(f => this.BackendHelper.TrackFile(f.WixFile.Source.Path, TrackedFileType.Input, f.File.SourceLineNumbers)));
529
+ trackedFiles.AddRange(fileFacades.Select(f => this.BackendHelper.TrackFile(f.File.Source.Path, TrackedFileType.Input, f.File.SourceLineNumbers)));
530
this.TrackedFiles = trackedFiles;
531
532
// TODO: Eventually this gets removed
src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs
+2
-2
@@ -166,8 +166,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
166
167
var files = cabinetWorkItem.FileFacades
168
.Select(facade => facade.Hash == null ?
169
- new CabinetCompressFile(facade.WixFile.Source.Path, facade.File.Id.Id) :
170
- new CabinetCompressFile(facade.WixFile.Source.Path, facade.File.Id.Id, facade.Hash.HashPart1, facade.Hash.HashPart2, facade.Hash.HashPart3, facade.Hash.HashPart4))
169
+ new CabinetCompressFile(facade.File.Source.Path, facade.File.Id.Id) :
170
+ new CabinetCompressFile(facade.File.Source.Path, facade.File.Id.Id, facade.Hash.HashPart1, facade.Hash.HashPart2, facade.Hash.HashPart3, facade.Hash.HashPart4))
171
.ToList();
172
173
var cabinetCompressionLevel = (CabinetCompressionLevel)cabinetWorkItem.CompressionLevel;
src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs
+1
-1
@@ -113,7 +113,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
113
{
114
var result = this.ServiceProvider.GetService<IBindFileWithPath>();
115
result.Id = facade.File.Id.Id;
116
- result.Path = facade.WixFile.Source.Path;
116
+ result.Path = facade.File.Source.Path;
117
118
return result;
119
}
src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
+3
@@ -296,6 +296,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
296
/// <param name="fileToken">The file token of the first file present in the splitting cabinet</param>
297
internal void NewCabNamesCallBack([MarshalAs(UnmanagedType.LPWStr)]string firstCabName, [MarshalAs(UnmanagedType.LPWStr)]string newCabinetName, [MarshalAs(UnmanagedType.LPWStr)]string fileToken)
298
{
299
+ throw new NotImplementedException();
300
+#if TODO_CAB_SPANNING
301
// Locking Mutex here as this callback can come from Multiple Cabinet Builder Threads
302
var mutex = new Mutex(false, "WixCabinetSplitBinderCallback");
303
try
@@ -417,6 +419,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
419
// Releasing the Mutex here
420
mutex.ReleaseMutex();
421
}
422
+#endif
423
}
424
425
src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
+7
-7
@@ -424,13 +424,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind
424
row.Version = tuple.Version;
425
row.Language = tuple.Language;
426
427
- var attributes = tuple.Checksum ? WindowsInstallerConstants.MsidbFileAttributesChecksum : 0;
428
- attributes |= (tuple.Compressed.HasValue && tuple.Compressed.Value) ? WindowsInstallerConstants.MsidbFileAttributesCompressed : 0;
429
- attributes |= (tuple.Compressed.HasValue && !tuple.Compressed.Value) ? WindowsInstallerConstants.MsidbFileAttributesNoncompressed : 0;
430
- attributes |= tuple.Hidden ? WindowsInstallerConstants.MsidbFileAttributesHidden : 0;
431
- attributes |= tuple.ReadOnly ? WindowsInstallerConstants.MsidbFileAttributesReadOnly : 0;
432
- attributes |= tuple.System ? WindowsInstallerConstants.MsidbFileAttributesSystem : 0;
433
- attributes |= tuple.Vital ? WindowsInstallerConstants.MsidbFileAttributesVital : 0;
427
+ var attributes = (tuple.Attributes & FileTupleAttributes.Checksum) == FileTupleAttributes.Checksum ? WindowsInstallerConstants.MsidbFileAttributesChecksum : 0;
428
+ attributes |= (tuple.Attributes & FileTupleAttributes.Compressed) == FileTupleAttributes.Compressed ? WindowsInstallerConstants.MsidbFileAttributesCompressed : 0;
429
+ attributes |= (tuple.Attributes & FileTupleAttributes.Uncompressed) == FileTupleAttributes.Uncompressed ? WindowsInstallerConstants.MsidbFileAttributesNoncompressed : 0;
430
+ attributes |= (tuple.Attributes & FileTupleAttributes.Hidden) == FileTupleAttributes.Hidden ? WindowsInstallerConstants.MsidbFileAttributesHidden : 0;
431
+ attributes |= (tuple.Attributes & FileTupleAttributes.ReadOnly) == FileTupleAttributes.ReadOnly ? WindowsInstallerConstants.MsidbFileAttributesReadOnly : 0;
432
+ attributes |= (tuple.Attributes & FileTupleAttributes.System) == FileTupleAttributes.System ? WindowsInstallerConstants.MsidbFileAttributesSystem : 0;
433
+ attributes |= (tuple.Attributes & FileTupleAttributes.Vital) == FileTupleAttributes.Vital ? WindowsInstallerConstants.MsidbFileAttributesVital : 0;
434
row.Attributes = attributes;
435
}
436
src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs
+6
-9
@@ -101,16 +101,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind
101
// NOTE: this is very tricky - the merge module file rows are not added to the
102
// file table because they should not be created via idt import. Instead, these
103
// rows are created by merging in the actual modules.
104
- var fileRow = new FileTuple(wixMergeRow.SourceLineNumbers, new Identifier(AccessModifier.Private, record[1]));
105
- fileRow.Compressed = wixMergeRow.FileCompression;
104
+ var fileTuple = new FileTuple(wixMergeRow.SourceLineNumbers, new Identifier(AccessModifier.Private, record[1]));
105
+ fileTuple.Attributes = wixMergeRow.FileAttributes;
106
+ fileTuple.DirectoryRef = record[2];
107
+ fileTuple.DiskId = wixMergeRow.DiskId;
108
+ fileTuple.Source = new IntermediateFieldPathValue { Path = Path.Combine(this.IntermediateFolder, wixMergeRow.Id.Id, record[1]) };
109
107
- var wixFileRow = new WixFileTuple(wixMergeRow.SourceLineNumbers);
108
- wixFileRow.DirectoryRef = record[2];
109
- wixFileRow.DiskId = wixMergeRow.DiskId;
110
- wixFileRow.PatchGroup = -1;
111
- wixFileRow.Source = new IntermediateFieldPathValue { Path = Path.Combine(this.IntermediateFolder, wixMergeRow.Id.Id, record[1]) };
112
-
113
- var mergeModuleFileFacade = new FileFacade(true, fileRow, wixFileRow);
110
+ var mergeModuleFileFacade = new FileFacade(true, fileTuple);
111
112
// If case-sensitive collision with another merge module or a user-authored file identifier.
113
if (indexedFileFacades.TryGetValue(mergeModuleFileFacade.File.Id.Id, out var collidingFacade))
src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs
+15
-8
@@ -25,23 +25,29 @@ namespace WixToolset.Core.WindowsInstaller.Bind
25
{
26
var facades = new List<FileFacade>();
27
28
- var wixFiles = this.Section.Tuples.OfType<WixFileTuple>().ToDictionary(t => t.Id.Id);
29
- var deltaPatchFiles = this.Section.Tuples.OfType<WixDeltaPatchFileTuple>().ToDictionary(t => t.Id.Id);
28
+ var assemblyFile = this.Section.Tuples.OfType<AssemblyTuple>().ToDictionary(t => t.Id.Id);
29
+ //var wixFiles = this.Section.Tuples.OfType<WixFileTuple>().ToDictionary(t => t.Id.Id);
30
+ //var deltaPatchFiles = this.Section.Tuples.OfType<WixDeltaPatchFileTuple>().ToDictionary(t => t.Id.Id);
31
32
foreach (var file in this.Section.Tuples.OfType<FileTuple>())
33
{
33
- var wixFile = wixFiles[file.Id.Id];
34
+ //var wixFile = wixFiles[file.Id.Id];
35
35
- deltaPatchFiles.TryGetValue(file.Id.Id, out var deltaPatchFile);
36
+ //deltaPatchFiles.TryGetValue(file.Id.Id, out var deltaPatchFile);
37
37
- facades.Add(new FileFacade(file, wixFile, deltaPatchFile));
38
+ //facades.Add(new FileFacade(file, wixFile, deltaPatchFile));
39
+
40
+ assemblyFile.TryGetValue(file.Id.Id, out var assembly);
41
+
42
+ facades.Add(new FileFacade(file, assembly));
43
}
44
40
- this.ResolveDeltaPatchSymbolPaths(deltaPatchFiles, facades);
45
+ //this.ResolveDeltaPatchSymbolPaths(deltaPatchFiles, facades);
46
47
this.FileFacades = facades;
48
}
49
50
+#if FIX_THIS
51
/// <summary>
52
/// Merge data from the WixPatchSymbolPaths rows into the WixDeltaPatchFile rows.
53
/// </summary>
@@ -74,7 +80,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
80
case SymbolPathType.Directory:
81
if (null == filesByDirectory)
82
{
77
- filesByDirectory = facades.ToLookup(f => f.WixFile.DirectoryRef);
83
+ filesByDirectory = facades.ToLookup(f => f.File.DirectoryRef);
84
}
85
86
foreach (var facade in filesByDirectory[row.SymbolId])
@@ -86,7 +92,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
92
case SymbolPathType.Media:
93
if (null == filesByDiskId)
94
{
89
- filesByDiskId = facades.ToLookup(f => f.WixFile.DiskId.ToString(CultureInfo.InvariantCulture));
95
+ filesByDiskId = facades.ToLookup(f => f.File.DiskId.ToString(CultureInfo.InvariantCulture));
96
}
97
98
foreach (var facade in filesByDiskId[row.SymbolId])
@@ -141,5 +147,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
147
}
148
#endif
149
}
150
+#endif
151
}
152
}
src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs
+9
-10
@@ -11,6 +11,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
11
using WixToolset.Core.Bind;
12
using WixToolset.Core.WindowsInstaller.Msi;
13
using WixToolset.Data;
14
+ using WixToolset.Data.Tuples;
15
using WixToolset.Data.WindowsInstaller;
16
using WixToolset.Data.WindowsInstaller.Rows;
17
using WixToolset.Extensibility.Services;
@@ -297,8 +298,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
298
throw new InvalidOperationException("Failed to fetch a File row from the database that was merged in from a module.");
299
}
300
300
- //recordUpdate.SetInteger(1, file.File.Sequence);
301
- throw new NotImplementedException();
301
+ recordUpdate.SetInteger(1, file.File.Sequence);
302
303
// Update the file attributes to match the compression specified
304
// on the Merge element or on the Package element.
@@ -310,22 +310,21 @@ namespace WixToolset.Core.WindowsInstaller.Bind
310
attributes = recordUpdate.GetInteger(2);
311
}
312
313
- if (!file.File.Compressed.HasValue)
314
- {
315
- // Clear all compression bits.
316
- attributes &= ~WindowsInstallerConstants.MsidbFileAttributesCompressed;
317
- attributes &= ~WindowsInstallerConstants.MsidbFileAttributesNoncompressed;
318
- }
319
- else if (file.File.Compressed.Value)
313
+ if ((file.File.Attributes & FileTupleAttributes.Compressed) == FileTupleAttributes.Compressed)
314
{
315
attributes |= WindowsInstallerConstants.MsidbFileAttributesCompressed;
316
attributes &= ~WindowsInstallerConstants.MsidbFileAttributesNoncompressed;
317
}
324
- else if (!file.File.Compressed.Value)
318
+ else if ((file.File.Attributes & FileTupleAttributes.Uncompressed) == FileTupleAttributes.Uncompressed)
319
{
320
attributes |= WindowsInstallerConstants.MsidbFileAttributesNoncompressed;
321
attributes &= ~WindowsInstallerConstants.MsidbFileAttributesCompressed;
322
}
323
+ else // clear all compression bits.
324
+ {
325
+ attributes &= ~WindowsInstallerConstants.MsidbFileAttributesCompressed;
326
+ attributes &= ~WindowsInstallerConstants.MsidbFileAttributesNoncompressed;
327
+ }
328
329
recordUpdate.SetInteger(2, attributes);
330
src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs
+2
-2
@@ -81,7 +81,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
81
// for each file in the array of uncompressed files
82
foreach (FileFacade facade in this.FileFacades)
83
{
84
- var mediaTuple = mediaRows[facade.WixFile.DiskId];
84
+ var mediaTuple = mediaRows[facade.DiskId];
85
string relativeFileLayoutPath = null;
86
string mediaLayoutFolder = mediaTuple.Layout;
87
@@ -105,7 +105,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
105
// finally put together the base media layout path and the relative file layout path
106
var fileLayoutPath = Path.Combine(mediaLayoutDirectory, relativeFileLayoutPath);
107
108
- var transfer = this.BackendHelper.CreateFileTransfer(facade.WixFile.Source.Path, fileLayoutPath, false, facade.File.SourceLineNumbers);
108
+ var transfer = this.BackendHelper.CreateFileTransfer(facade.File.Source.Path, fileLayoutPath, false, facade.File.SourceLineNumbers);
109
fileTransfers.Add(transfer);
110
111
// Track the location where the cabinet will be placed. If the transfer is
src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs
+1
-1
@@ -485,7 +485,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
485
case TupleDefinitionType.MoveFile:
486
set.Add("InstallExecuteSequence/MoveFiles");
487
break;
488
- case TupleDefinitionType.MsiAssembly:
488
+ case TupleDefinitionType.Assembly:
489
set.Add("AdvtExecuteSequence/MsiPublishAssemblies");
490
set.Add("InstallExecuteSequence/MsiPublishAssemblies");
491
set.Add("InstallExecuteSequence/MsiUnpublishAssemblies");
src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs
+59
-59
@@ -48,7 +48,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
48
}
49
}
50
51
- private void UpdateFileFacade(FileFacade file)
51
+ private void UpdateFileFacade(FileFacade facade)
52
{
53
var assemblyNameTuples = new Dictionary<string, MsiAssemblyNameTuple>();
54
foreach (var assemblyTuple in this.Section.Tuples.OfType<MsiAssemblyNameTuple>())
@@ -59,27 +59,27 @@ namespace WixToolset.Core.WindowsInstaller.Bind
59
FileInfo fileInfo = null;
60
try
61
{
62
- fileInfo = new FileInfo(file.WixFile.Source.Path);
62
+ fileInfo = new FileInfo(facade.File.Source.Path);
63
}
64
catch (ArgumentException)
65
{
66
- this.Messaging.Write(ErrorMessages.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path));
66
+ this.Messaging.Write(ErrorMessages.InvalidFileName(facade.File.SourceLineNumbers, facade.File.Source.Path));
67
return;
68
}
69
catch (PathTooLongException)
70
{
71
- this.Messaging.Write(ErrorMessages.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path));
71
+ this.Messaging.Write(ErrorMessages.InvalidFileName(facade.File.SourceLineNumbers, facade.File.Source.Path));
72
return;
73
}
74
catch (NotSupportedException)
75
{
76
- this.Messaging.Write(ErrorMessages.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path));
76
+ this.Messaging.Write(ErrorMessages.InvalidFileName(facade.File.SourceLineNumbers, facade.File.Source.Path));
77
return;
78
}
79
80
if (!fileInfo.Exists)
81
{
82
- this.Messaging.Write(ErrorMessages.CannotFindFile(file.File.SourceLineNumbers, file.File.Id.Id, file.File.Name, file.WixFile.Source.Path));
82
+ this.Messaging.Write(ErrorMessages.CannotFindFile(facade.File.SourceLineNumbers, facade.File.Id.Id, facade.File.Name, facade.File.Source.Path));
83
return;
84
}
85
@@ -87,10 +87,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind
87
{
88
if (Int32.MaxValue < fileStream.Length)
89
{
90
- throw new WixException(ErrorMessages.FileTooLarge(file.File.SourceLineNumbers, file.WixFile.Source.Path));
90
+ throw new WixException(ErrorMessages.FileTooLarge(facade.File.SourceLineNumbers, facade.File.Source.Path));
91
}
92
93
- file.File.FileSize = Convert.ToInt32(fileStream.Length, CultureInfo.InvariantCulture);
93
+ facade.File.FileSize = Convert.ToInt32(fileStream.Length, CultureInfo.InvariantCulture);
94
}
95
96
string version = null;
@@ -103,7 +103,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
103
{
104
if (0x2 == e.NativeErrorCode) // ERROR_FILE_NOT_FOUND
105
{
106
- throw new WixException(ErrorMessages.FileNotFound(file.File.SourceLineNumbers, fileInfo.FullName));
106
+ throw new WixException(ErrorMessages.FileNotFound(facade.File.SourceLineNumbers, fileInfo.FullName));
107
}
108
else
109
{
@@ -118,7 +118,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
118
{
119
// not overwriting hash, so don't do the rest of these options.
120
}
121
- else if (null != file.File.Version)
121
+ else if (null != facade.File.Version)
122
{
123
// Search all of the file rows available to see if the specified version is actually a companion file. Yes, this looks
124
// very expensive and you're probably thinking it would be better to create an index of some sort to do an O(1) look up.
@@ -127,16 +127,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind
127
//
128
// Also, if we do not find a matching file identifier then the user provided a default version and is providing a version
129
// for unversioned file. That's allowed but generally a dangerous thing to do so let's point that out to the user.
130
- if (!this.FileFacades.Any(r => file.File.Version.Equals(r.File.Id.Id, StringComparison.Ordinal)))
130
+ if (!this.FileFacades.Any(r => facade.File.Version.Equals(r.File.Id.Id, StringComparison.Ordinal)))
131
{
132
- this.Messaging.Write(WarningMessages.DefaultVersionUsedForUnversionedFile(file.File.SourceLineNumbers, file.File.Version, file.File.Id.Id));
132
+ this.Messaging.Write(WarningMessages.DefaultVersionUsedForUnversionedFile(facade.File.SourceLineNumbers, facade.File.Version, facade.File.Id.Id));
133
}
134
}
135
else
136
{
137
- if (null != file.File.Language)
137
+ if (null != facade.File.Language)
138
{
139
- this.Messaging.Write(WarningMessages.DefaultLanguageUsedForUnversionedFile(file.File.SourceLineNumbers, file.File.Language, file.File.Id.Id));
139
+ this.Messaging.Write(WarningMessages.DefaultLanguageUsedForUnversionedFile(facade.File.SourceLineNumbers, facade.File.Language, facade.File.Id.Id));
140
}
141
142
int[] hash;
@@ -148,7 +148,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
148
{
149
if (0x2 == e.NativeErrorCode) // ERROR_FILE_NOT_FOUND
150
{
151
- throw new WixException(ErrorMessages.FileNotFound(file.File.SourceLineNumbers, fileInfo.FullName));
151
+ throw new WixException(ErrorMessages.FileNotFound(facade.File.SourceLineNumbers, fileInfo.FullName));
152
}
153
else
154
{
@@ -156,29 +156,29 @@ namespace WixToolset.Core.WindowsInstaller.Bind
156
}
157
}
158
159
- if (null == file.Hash)
159
+ if (null == facade.Hash)
160
{
161
- file.Hash = new MsiFileHashTuple(file.File.SourceLineNumbers, file.File.Id);
162
- this.Section.Tuples.Add(file.Hash);
161
+ facade.Hash = new MsiFileHashTuple(facade.File.SourceLineNumbers, facade.File.Id);
162
+ this.Section.Tuples.Add(facade.Hash);
163
}
164
165
- file.Hash.FileRef = file.File.Id.Id;
166
- file.Hash.Options = 0;
167
- file.Hash.HashPart1 = hash[0];
168
- file.Hash.HashPart2 = hash[1];
169
- file.Hash.HashPart3 = hash[2];
170
- file.Hash.HashPart4 = hash[3];
165
+ facade.Hash.FileRef = facade.File.Id.Id;
166
+ facade.Hash.Options = 0;
167
+ facade.Hash.HashPart1 = hash[0];
168
+ facade.Hash.HashPart2 = hash[1];
169
+ facade.Hash.HashPart3 = hash[2];
170
+ facade.Hash.HashPart4 = hash[3];
171
}
172
}
173
else // update the file row with the version and language information.
174
{
175
// If no version was provided by the user, use the version from the file itself.
176
// This is the most common case.
177
- if (String.IsNullOrEmpty(file.File.Version))
177
+ if (String.IsNullOrEmpty(facade.File.Version))
178
{
179
- file.File.Version = version;
179
+ facade.File.Version = version;
180
}
181
- else if (!this.FileFacades.Any(r => file.File.Version.Equals(r.File.Id.Id, StringComparison.Ordinal))) // this looks expensive, but see explanation below.
181
+ else if (!this.FileFacades.Any(r => facade.File.Version.Equals(r.File.Id.Id, StringComparison.Ordinal))) // this looks expensive, but see explanation below.
182
{
183
// The user provided a default version for the file row so we looked for a companion file (a file row with Id matching
184
// the version value). We didn't find it so, we will override the default version they provided with the actual
@@ -189,49 +189,49 @@ namespace WixToolset.Core.WindowsInstaller.Bind
189
//
190
// Also note this case can occur when the file is being updated using the WixBindUpdatedFiles extension mechanism.
191
// That's typically even more rare than companion files so again, no index, just search.
192
- file.File.Version = version;
192
+ facade.File.Version = version;
193
}
194
195
- if (!String.IsNullOrEmpty(file.File.Language) && String.IsNullOrEmpty(language))
195
+ if (!String.IsNullOrEmpty(facade.File.Language) && String.IsNullOrEmpty(language))
196
{
197
- this.Messaging.Write(WarningMessages.DefaultLanguageUsedForVersionedFile(file.File.SourceLineNumbers, file.File.Language, file.File.Id.Id));
197
+ this.Messaging.Write(WarningMessages.DefaultLanguageUsedForVersionedFile(facade.File.SourceLineNumbers, facade.File.Language, facade.File.Id.Id));
198
}
199
else // override the default provided by the user (usually nothing) with the actual language from the file itself.
200
{
201
- file.File.Language = language;
201
+ facade.File.Language = language;
202
}
203
204
// Populate the binder variables for this file information if requested.
205
if (null != this.VariableCache)
206
{
207
- if (!String.IsNullOrEmpty(file.File.Version))
207
+ if (!String.IsNullOrEmpty(facade.File.Version))
208
{
209
- var key = String.Format(CultureInfo.InvariantCulture, "fileversion.{0}", file.File.Id.Id);
210
- this.VariableCache[key] = file.File.Version;
209
+ var key = String.Format(CultureInfo.InvariantCulture, "fileversion.{0}", facade.File.Id.Id);
210
+ this.VariableCache[key] = facade.File.Version;
211
}
212
213
- if (!String.IsNullOrEmpty(file.File.Language))
213
+ if (!String.IsNullOrEmpty(facade.File.Language))
214
{
215
- var key = String.Format(CultureInfo.InvariantCulture, "filelanguage.{0}", file.File.Id.Id);
216
- this.VariableCache[key] = file.File.Language;
215
+ var key = String.Format(CultureInfo.InvariantCulture, "filelanguage.{0}", facade.File.Id.Id);
216
+ this.VariableCache[key] = facade.File.Language;
217
}
218
}
219
}
220
221
// If this is a CLR assembly, load the assembly and get the assembly name information
222
- if (FileAssemblyType.DotNetAssembly == file.WixFile.AssemblyType)
222
+ if (AssemblyType.DotNetAssembly == facade.Assembly?.Type)
223
{
224
try
225
{
226
- var assemblyName = AssemblyNameReader.ReadAssembly(file.File.SourceLineNumbers, fileInfo.FullName, version);
226
+ var assemblyName = AssemblyNameReader.ReadAssembly(facade.File.SourceLineNumbers, fileInfo.FullName, version);
227
228
- this.SetMsiAssemblyName(assemblyNameTuples, file, "name", assemblyName.Name);
229
- this.SetMsiAssemblyName(assemblyNameTuples, file, "culture", assemblyName.Culture);
230
- this.SetMsiAssemblyName(assemblyNameTuples, file, "version", assemblyName.Version);
228
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "name", assemblyName.Name);
229
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "culture", assemblyName.Culture);
230
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "version", assemblyName.Version);
231
232
if (!String.IsNullOrEmpty(assemblyName.Architecture))
233
{
234
- this.SetMsiAssemblyName(assemblyNameTuples, file, "processorArchitecture", assemblyName.Architecture);
234
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "processorArchitecture", assemblyName.Architecture);
235
}
236
// TODO: WiX v3 seemed to do this but not clear it should actually be done.
237
//else if (!String.IsNullOrEmpty(file.WixFile.ProcessorArchitecture))
@@ -241,22 +241,22 @@ namespace WixToolset.Core.WindowsInstaller.Bind
241
242
if (assemblyName.StrongNamedSigned)
243
{
244
- this.SetMsiAssemblyName(assemblyNameTuples, file, "publicKeyToken", assemblyName.PublicKeyToken);
244
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "publicKeyToken", assemblyName.PublicKeyToken);
245
}
246
- else if (file.WixFile.AssemblyApplicationFileRef == null)
246
+ else if (facade.Assembly.ApplicationFileRef == null)
247
{
248
- throw new WixException(ErrorMessages.GacAssemblyNoStrongName(file.File.SourceLineNumbers, fileInfo.FullName, file.File.ComponentRef));
248
+ throw new WixException(ErrorMessages.GacAssemblyNoStrongName(facade.File.SourceLineNumbers, fileInfo.FullName, facade.File.ComponentRef));
249
}
250
251
if (!String.IsNullOrEmpty(assemblyName.FileVersion))
252
{
253
- this.SetMsiAssemblyName(assemblyNameTuples, file, "fileVersion", assemblyName.FileVersion);
253
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "fileVersion", assemblyName.FileVersion);
254
}
255
256
// add the assembly name to the information cache
257
if (null != this.VariableCache)
258
{
259
- this.VariableCache[$"assemblyfullname.{file.File.Id.Id}"] = assemblyName.GetFullName();
259
+ this.VariableCache[$"assemblyfullname.{facade.File.Id.Id}"] = assemblyName.GetFullName();
260
}
261
}
262
catch (WixException e)
@@ -264,44 +264,44 @@ namespace WixToolset.Core.WindowsInstaller.Bind
264
this.Messaging.Write(e.Error);
265
}
266
}
267
- else if (FileAssemblyType.Win32Assembly == file.WixFile.AssemblyType)
267
+ else if (AssemblyType.Win32Assembly == facade.Assembly?.Type)
268
{
269
// TODO: Consider passing in the this.FileFacades as an indexed collection instead of searching through
270
// all files like this. Even though this is a rare case it looks like we might be able to index the
271
// file earlier.
272
- var fileManifest = this.FileFacades.FirstOrDefault(r => r.File.Id.Id.Equals(file.WixFile.AssemblyManifestFileRef, StringComparison.Ordinal));
272
+ var fileManifest = this.FileFacades.FirstOrDefault(r => r.File.Id.Id.Equals(facade.Assembly.ManifestFileRef, StringComparison.Ordinal));
273
if (null == fileManifest)
274
{
275
- this.Messaging.Write(ErrorMessages.MissingManifestForWin32Assembly(file.File.SourceLineNumbers, file.File.Id.Id, file.WixFile.AssemblyManifestFileRef));
275
+ this.Messaging.Write(ErrorMessages.MissingManifestForWin32Assembly(facade.File.SourceLineNumbers, facade.File.Id.Id, facade.Assembly.ManifestFileRef));
276
}
277
278
try
279
{
280
- var assemblyName = AssemblyNameReader.ReadAssemblyManifest(file.File.SourceLineNumbers, fileManifest.WixFile.Source.Path);
280
+ var assemblyName = AssemblyNameReader.ReadAssemblyManifest(facade.File.SourceLineNumbers, fileManifest.File.Source.Path);
281
282
if (!String.IsNullOrEmpty(assemblyName.Name))
283
{
284
- this.SetMsiAssemblyName(assemblyNameTuples, file, "name", assemblyName.Name);
284
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "name", assemblyName.Name);
285
}
286
287
if (!String.IsNullOrEmpty(assemblyName.Version))
288
{
289
- this.SetMsiAssemblyName(assemblyNameTuples, file, "version", assemblyName.Version);
289
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "version", assemblyName.Version);
290
}
291
292
if (!String.IsNullOrEmpty(assemblyName.Type))
293
{
294
- this.SetMsiAssemblyName(assemblyNameTuples, file, "type", assemblyName.Type);
294
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "type", assemblyName.Type);
295
}
296
297
if (!String.IsNullOrEmpty(assemblyName.Architecture))
298
{
299
- this.SetMsiAssemblyName(assemblyNameTuples, file, "processorArchitecture", assemblyName.Architecture);
299
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "processorArchitecture", assemblyName.Architecture);
300
}
301
302
if (!String.IsNullOrEmpty(assemblyName.PublicKeyToken))
303
{
304
- this.SetMsiAssemblyName(assemblyNameTuples, file, "publicKeyToken", assemblyName.PublicKeyToken);
304
+ this.SetMsiAssemblyName(assemblyNameTuples, facade, "publicKeyToken", assemblyName.PublicKeyToken);
305
}
306
}
307
catch (WixException e)
@@ -329,8 +329,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
329
else
330
{
331
// if the assembly will be GAC'd and the name in the file table doesn't match the name in the MsiAssemblyName table, error because the install will fail.
332
- if ("name" == name && FileAssemblyType.DotNetAssembly == file.WixFile.AssemblyType &&
333
- String.IsNullOrEmpty(file.WixFile.AssemblyApplicationFileRef) &&
332
+ if ("name" == name && AssemblyType.DotNetAssembly == file.Assembly.Type &&
333
+ String.IsNullOrEmpty(file.Assembly.ApplicationFileRef) &&
334
!String.Equals(Path.GetFileNameWithoutExtension(file.File.Name), value, StringComparison.OrdinalIgnoreCase))
335
{
336
this.Messaging.Write(ErrorMessages.GACAssemblyIdentityWarning(file.File.SourceLineNumbers, Path.GetFileNameWithoutExtension(file.File.Name), value));
src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs
+9
-9
@@ -51,25 +51,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind
51
{
52
if (null == mediaRow)
53
{
54
- mediaRow = mediaRows.Get(facade.WixFile.DiskId);
54
+ mediaRow = mediaRows.Get(facade.DiskId);
55
if (OutputType.Patch == this.Output.Type)
56
{
57
// patch Media cannot start at zero
58
lastSequence = mediaRow.LastSequence;
59
}
60
}
61
- else if (mediaRow.DiskId != facade.WixFile.DiskId)
61
+ else if (mediaRow.DiskId != facade.DiskId)
62
{
63
mediaRow.LastSequence = lastSequence;
64
- mediaRow = mediaRows.Get(facade.WixFile.DiskId);
64
+ mediaRow = mediaRows.Get(facade.DiskId);
65
}
66
67
- if (0 < facade.WixFile.PatchGroup)
67
+ if (facade.File.PatchGroup.HasValue)
68
{
69
- if (patchGroups.TryGetValue(facade.WixFile.PatchGroup, out var patchGroup))
69
+ if (patchGroups.TryGetValue(facade.File.PatchGroup.Value, out var patchGroup))
70
{
71
patchGroup = new List<FileFacade>();
72
- patchGroups.Add(facade.WixFile.PatchGroup, patchGroup);
72
+ patchGroups.Add(facade.File.PatchGroup.Value, patchGroup);
73
}
74
75
patchGroup.Add(facade);
@@ -94,12 +94,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind
94
{
95
if (null == mediaRow)
96
{
97
- mediaRow = mediaRows.Get(facade.WixFile.DiskId);
97
+ mediaRow = mediaRows.Get(facade.DiskId);
98
}
99
- else if (mediaRow.DiskId != facade.WixFile.DiskId)
99
+ else if (mediaRow.DiskId != facade.DiskId)
100
{
101
mediaRow.LastSequence = lastSequence;
102
- mediaRow = mediaRows.Get(facade.WixFile.DiskId);
102
+ mediaRow = mediaRows.Get(facade.DiskId);
103
}
104
105
var fileRow = fileRows.Get(facade.File.Id.Id);
src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs
+3
@@ -444,6 +444,8 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
444
/// <param name="output">The Output that represents the msi database.</param>
445
private void GenerateWixFileTable(string databaseFile, Output output)
446
{
447
+ throw new NotImplementedException();
448
+#if TODO_FIX_UNBINDING_FILES
449
var adminRootPath = Path.GetDirectoryName(databaseFile);
450
451
var componentDirectoryIndex = new Hashtable();
@@ -495,6 +497,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
497
498
wixFileTable.Rows.Add(wixFileRow);
499
}
500
+#endif
501
}
502
503
/// <summary>
src/WixToolset.Core/Bind/FileFacade.cs
+7
-7
@@ -7,27 +7,27 @@ namespace WixToolset.Core.Bind
7
8
public class FileFacade
9
{
10
- public FileFacade(FileTuple file, WixFileTuple wixFile, WixDeltaPatchFileTuple deltaPatchFile)
10
+ public FileFacade(FileTuple file, AssemblyTuple assembly)
11
{
12
this.File = file;
13
- this.WixFile = wixFile;
14
- this.DeltaPatchFile = deltaPatchFile;
13
+ this.Assembly = assembly;
14
}
15
17
- public FileFacade(bool fromModule, FileTuple file, WixFileTuple wixFile)
16
+ public FileFacade(bool fromModule, FileTuple file)
17
{
18
this.FromModule = fromModule;
19
this.File = file;
21
- this.WixFile = wixFile;
20
}
21
22
public bool FromModule { get; }
23
24
public FileTuple File { get; }
25
28
- public WixFileTuple WixFile { get; }
26
+ public AssemblyTuple Assembly { get; }
27
30
- public WixDeltaPatchFileTuple DeltaPatchFile { get; }
28
+ public int DiskId => this.File.DiskId ?? 0;
29
+
30
+ public bool Uncompressed => (this.File.Attributes & FileTupleAttributes.Uncompressed) == FileTupleAttributes.Uncompressed;
31
32
/// <summary>
33
/// Gets the set of MsiAssemblyName rows created for this file.
src/WixToolset.Core/Compiler.cs
+51
-77
@@ -32,7 +32,6 @@ namespace WixToolset.Core
32
private bool compilingModule;
33
private bool compilingProduct;
34
35
- private bool useShortFileNames;
35
private string activeName;
36
private string activeLanguage;
37
@@ -4184,16 +4183,7 @@ namespace WixToolset.Core
4183
}
4184
else // add the appropriate part of this directory element to the file source.
4185
{
4187
- string append = null;
4188
- if (this.useShortFileNames)
4189
- {
4190
- append = !String.IsNullOrEmpty(shortSourceName) ? shortSourceName : shortName;
4191
- }
4192
-
4193
- if (String.IsNullOrEmpty(append))
4194
- {
4195
- append = !String.IsNullOrEmpty(sourceName) ? sourceName : name;
4196
- }
4186
+ string append = String.IsNullOrEmpty(sourceName) ? name : sourceName;
4187
4188
if (!String.IsNullOrEmpty(append))
4189
{
@@ -5486,7 +5476,7 @@ namespace WixToolset.Core
5476
{
5477
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
5478
Identifier id = null;
5489
- var assemblyType = FileAssemblyType.NotAnAssembly;
5479
+ var assemblyType = AssemblyType.NotAnAssembly;
5480
string assemblyApplication = null;
5481
string assemblyManifest = null;
5482
string bindPath = null;
@@ -5538,13 +5528,13 @@ namespace WixToolset.Core
5528
switch (assemblyValue)
5529
{
5530
case ".net":
5541
- assemblyType = FileAssemblyType.DotNetAssembly;
5531
+ assemblyType = AssemblyType.DotNetAssembly;
5532
break;
5533
case "no":
5544
- assemblyType = FileAssemblyType.NotAnAssembly;
5534
+ assemblyType = AssemblyType.NotAnAssembly;
5535
break;
5536
case "win32":
5547
- assemblyType = FileAssemblyType.Win32Assembly;
5537
+ assemblyType = AssemblyType.Win32Assembly;
5538
break;
5539
default:
5540
this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, "File", "Assembly", assemblyValue, "no", "win32", ".net"));
@@ -5743,7 +5733,7 @@ namespace WixToolset.Core
5733
this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DefaultVersion", "CompanionFile", companionFile));
5734
}
5735
5746
- if (FileAssemblyType.NotAnAssembly == assemblyType)
5736
+ if (AssemblyType.NotAnAssembly == assemblyType)
5737
{
5738
if (null != assemblyManifest)
5739
{
@@ -5757,7 +5747,7 @@ namespace WixToolset.Core
5747
}
5748
else
5749
{
5760
- if (FileAssemblyType.Win32Assembly == assemblyType && null == assemblyManifest)
5750
+ if (AssemblyType.Win32Assembly == assemblyType && null == assemblyManifest)
5751
{
5752
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "AssemblyManifest", "Assembly", "win32"));
5753
}
@@ -5765,7 +5755,7 @@ namespace WixToolset.Core
5755
// allow "*" guid components to omit explicit KeyPath as they can have only one file and therefore this file is the keypath
5756
if (YesNoType.Yes != keyPath && "*" != componentGuid)
5757
{
5768
- this.Core.Write(ErrorMessages.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Assembly", (FileAssemblyType.DotNetAssembly == assemblyType ? ".net" : "win32"), "KeyPath", "yes"));
5758
+ this.Core.Write(ErrorMessages.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Assembly", (AssemblyType.DotNetAssembly == assemblyType ? ".net" : "win32"), "KeyPath", "yes"));
5759
}
5760
}
5761
@@ -5852,90 +5842,72 @@ namespace WixToolset.Core
5842
5843
if (String.IsNullOrEmpty(source))
5844
{
5855
- if (!this.useShortFileNames && null != name)
5856
- {
5857
- source = name;
5858
- }
5859
- else
5860
- {
5861
- source = shortName;
5862
- }
5845
+ source = name ?? shortName;
5846
}
5847
else if (source.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) // if source relies on parent directories, append the file name
5848
{
5866
- if (!this.useShortFileNames && null != name)
5867
- {
5868
- source = Path.Combine(source, name);
5869
- }
5870
- else
5871
- {
5872
- source = Path.Combine(source, shortName);
5873
- }
5849
+ source = null == name ? Path.Combine(source, shortName) : Path.Combine(source, name);
5850
}
5851
5852
+ var attributes = FileTupleAttributes.None;
5853
+ attributes |= readOnly ? FileTupleAttributes.ReadOnly : 0;
5854
+ attributes |= hidden ? FileTupleAttributes.Hidden : 0;
5855
+ attributes |= system ? FileTupleAttributes.System : 0;
5856
+ attributes |= vital ? FileTupleAttributes.Vital : 0;
5857
+ attributes |= checksum ? FileTupleAttributes.Checksum : 0;
5858
+ attributes |= compressed.HasValue && compressed == true ? FileTupleAttributes.Compressed : 0;
5859
+ attributes |= compressed.HasValue && compressed == false ? FileTupleAttributes.Uncompressed : 0;
5860
+ attributes |= generatedShortFileName ? FileTupleAttributes.GeneratedShortFileName : 0;
5861
+
5862
var tuple = new FileTuple(sourceLineNumbers, id)
5863
{
5864
ComponentRef = componentId,
5879
- ShortName = shortName,
5865
Name = name,
5866
+ ShortName = shortName,
5867
FileSize = defaultSize,
5868
Version = companionFile ?? defaultVersion,
5869
Language = defaultLanguage,
5884
- ReadOnly = readOnly,
5885
- Hidden = hidden,
5886
- System = system,
5887
- Vital = vital,
5888
- Checksum = checksum,
5889
- Compressed = compressed,
5870
+ Attributes = attributes,
5871
+
5872
+ //ReadOnly = readOnly,
5873
+ //Hidden = hidden,
5874
+ //System = system,
5875
+ //Vital = vital,
5876
+ //Checksum = checksum,
5877
+ //Compressed = compressed,
5878
+ //GeneratedShortFileName = generatedShortFileName,
5879
+
5880
+ DirectoryRef = directoryId,
5881
+ DiskId = (CompilerConstants.IntegerNotSet == diskId) ? null : (int?)diskId,
5882
+ Source = new IntermediateFieldPathValue { Path = source },
5883
+
5884
FontTitle = fontTitle,
5885
SelfRegCost = selfRegCost,
5886
BindPath = bindPath,
5893
- };
5887
5895
- this.Core.AddTuple(tuple);
5888
+ PatchGroup = (CompilerConstants.IntegerNotSet == patchGroup) ? null : (int?)patchGroup,
5889
+ PatchAttributes = patchAttributes,
5890
5897
- // TODO: Remove all this.
5898
- var wixFileRow = (WixFileTuple)this.Core.CreateTuple(sourceLineNumbers, TupleDefinitionType.WixFile, id);
5899
- wixFileRow.AssemblyType = assemblyType;
5900
- wixFileRow.AssemblyManifestFileRef = assemblyManifest;
5901
- wixFileRow.AssemblyApplicationFileRef = assemblyApplication;
5902
- wixFileRow.DirectoryRef = directoryId;
5903
- wixFileRow.DiskId = (CompilerConstants.IntegerNotSet == diskId) ? 0 : diskId;
5904
- wixFileRow.Source = new IntermediateFieldPathValue { Path = source };
5905
- wixFileRow.ProcessorArchitecture = procArch;
5906
- wixFileRow.PatchGroup = (CompilerConstants.IntegerNotSet != patchGroup ? patchGroup : -1);
5907
- wixFileRow.Attributes = (generatedShortFileName ? 0x1 : 0x0);
5908
- wixFileRow.PatchAttributes = patchAttributes;
5909
-
5910
- // Always create a delta patch row for this file since other elements (like Component and Media) may
5911
- // want to add symbol paths to it.
5912
- this.Core.AddTuple(new WixDeltaPatchFileTuple(sourceLineNumbers, id)
5913
- {
5891
+ // Delta patching information
5892
RetainLengths = protectLengths,
5893
IgnoreOffsets = ignoreOffsets,
5894
IgnoreLengths = ignoreLengths,
5917
- RetainOffsets = protectOffsets
5918
- });
5895
+ RetainOffsets = protectOffsets,
5896
+ SymbolPaths = symbols
5897
+ };
5898
5920
- if (null != symbols)
5921
- {
5922
- this.Core.AddTuple(new WixDeltaPatchSymbolPathsTuple(sourceLineNumbers)
5923
- {
5924
- SymbolType = SymbolPathType.File,
5925
- SymbolId = id.Id,
5926
- SymbolPaths = symbols
5927
- });
5928
- }
5899
+ this.Core.AddTuple(tuple);
5900
5930
- if (FileAssemblyType.NotAnAssembly != assemblyType)
5901
+ if (AssemblyType.NotAnAssembly != assemblyType)
5902
{
5932
- this.Core.AddTuple(new MsiAssemblyTuple(sourceLineNumbers)
5903
+ this.Core.AddTuple(new AssemblyTuple(sourceLineNumbers, id)
5904
{
5905
ComponentRef = componentId,
5906
FeatureRef = Guid.Empty.ToString("B"),
5907
ManifestFileRef = assemblyManifest,
5908
ApplicationFileRef = assemblyApplication,
5938
- Type = assemblyType
5909
+ Type = assemblyType,
5910
+ ProcessorArchitecture = procArch,
5911
});
5912
}
5913
}
@@ -7599,7 +7571,7 @@ namespace WixToolset.Core
7571
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
7572
Identifier id = null;
7573
var configData = String.Empty;
7602
- bool? fileCompression = null;
7574
+ FileTupleAttributes attributes = 0;
7575
string language = null;
7576
string sourceFile = null;
7577
@@ -7617,7 +7589,9 @@ namespace WixToolset.Core
7589
this.Core.CreateSimpleReference(sourceLineNumbers, "Media", diskId.ToString(CultureInfo.InvariantCulture.NumberFormat));
7590
break;
7591
case "FileCompression":
7620
- fileCompression = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
7592
+ var compress = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
7593
+ attributes |= compress == YesNoType.Yes ? FileTupleAttributes.Compressed : 0;
7594
+ attributes |= compress == YesNoType.No ? FileTupleAttributes.Uncompressed : 0;
7595
break;
7596
case "Language":
7597
language = this.Core.GetAttributeLocalizableIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue);
@@ -7692,7 +7666,7 @@ namespace WixToolset.Core
7666
SourceFile = sourceFile,
7667
DiskId = diskId,
7668
ConfigurationData = configData,
7695
- FileCompression = fileCompression,
7669
+ FileAttributes = attributes,
7670
FeatureRef = Guid.Empty.ToString("B")
7671
};
7672
src/WixToolset.Core/Compiler_2.cs
-1
@@ -760,7 +760,6 @@ namespace WixToolset.Core
760
if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
761
{
762
sourceBits |= 1;
763
- this.useShortFileNames = true;
763
}
764
break;
765
case "SummaryCodepage":
src/WixToolset.Core/Linker.cs
+1
-1
@@ -320,7 +320,7 @@ namespace WixToolset.Core
320
break;
321
#endif
322
323
- case TupleDefinitionType.MsiAssembly:
323
+ case TupleDefinitionType.Assembly:
324
if (SectionType.Product == resolvedSection.Type)
325
{
326
this.ResolveFeatures(tuple, 0, 1, componentsToFeatures, multipleFeatureComponents);
src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs
+3
-3
@@ -58,9 +58,9 @@ namespace WixToolsetTest.CoreIntegration
58
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"extest.wir"));
59
var section = intermediate.Sections.Single();
60
61
- var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
62
- Assert.Equal(Path.Combine(folder, @"data\example.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
63
- Assert.Equal(@"example.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
61
+ var fileTuple = section.Tuples.OfType<FileTuple>().Single();
62
+ Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
63
+ Assert.Equal(@"example.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
64
65
var example = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).Single();
66
Assert.Equal("Foo", example.Id.Id);
src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs
+18
-18
@@ -43,9 +43,9 @@ namespace WixToolsetTest.CoreIntegration
43
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
44
var section = intermediate.Sections.Single();
45
46
- var wixFile = section.Tuples.OfType<WixFileTuple>().First();
47
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
48
- Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
46
+ var fileTuple = section.Tuples.OfType<FileTuple>().First();
47
+ Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
48
+ Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
49
}
50
}
51
@@ -78,9 +78,9 @@ namespace WixToolsetTest.CoreIntegration
78
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
79
var section = intermediate.Sections.Single();
80
81
- var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
82
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
83
- Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
81
+ var fileTuple = section.Tuples.OfType<FileTuple>().Single();
82
+ Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
83
+ Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
84
}
85
}
86
@@ -309,9 +309,9 @@ namespace WixToolsetTest.CoreIntegration
309
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
310
var section = intermediate.Sections.Single();
311
312
- var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
313
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
314
- Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
312
+ var fileTuple = section.Tuples.OfType<FileTuple>().Single();
313
+ Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
314
+ Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
315
}
316
}
317
@@ -344,9 +344,9 @@ namespace WixToolsetTest.CoreIntegration
344
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
345
var section = intermediate.Sections.Single();
346
347
- var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
348
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
349
- Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
347
+ var fileTuple = section.Tuples.OfType<FileTuple>().Single();
348
+ Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
349
+ Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
350
}
351
}
352
@@ -444,9 +444,9 @@ namespace WixToolsetTest.CoreIntegration
444
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
445
var section = intermediate.Sections.Single();
446
447
- var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
448
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
449
- Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
447
+ var fileTuple = section.Tuples.OfType<FileTuple>().Single();
448
+ Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
449
+ Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
450
}
451
}
452
@@ -480,9 +480,9 @@ namespace WixToolsetTest.CoreIntegration
480
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
481
var section = intermediate.Sections.Single();
482
483
- var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
484
- Assert.Equal(Path.Combine(folder, @"data\candle.exe"), wixFile[WixFileTupleFields.Source].AsPath().Path);
485
- Assert.Equal(@"candle.exe", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
483
+ var fileTuple = section.Tuples.OfType<FileTuple>().Single();
484
+ Assert.Equal(Path.Combine(folder, @"data\candle.exe"), fileTuple[FileTupleFields.Source].AsPath().Path);
485
+ Assert.Equal(@"candle.exe", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
486
487
var msiAssemblyNameTuples = section.Tuples.OfType<MsiAssemblyNameTuple>();
488
Assert.Equal(new[]
src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs
+9
-9
@@ -50,9 +50,9 @@ namespace WixToolsetTest.CoreIntegration
50
var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"obj\test.wir"));
51
var section = intermediate.Sections.Single();
52
53
- var wixFile = section.Tuples.OfType<WixFileTuple>().First();
54
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
55
- Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
53
+ var fileTuple = section.Tuples.OfType<FileTuple>().First();
54
+ Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
55
+ Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
56
}
57
}
58
@@ -120,9 +120,9 @@ namespace WixToolsetTest.CoreIntegration
120
var section = intermediate.Sections.Single();
121
122
{
123
- var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
124
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
125
- Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
123
+ var fileTuple = section.Tuples.OfType<FileTuple>().Single();
124
+ Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
125
+ Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
126
}
127
128
{
@@ -175,9 +175,9 @@ namespace WixToolsetTest.CoreIntegration
175
var section = intermediate.Sections.Single();
176
177
{
178
- var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
179
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
180
- Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
178
+ var fileTuple = section.Tuples.OfType<FileTuple>().Single();
179
+ Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
180
+ Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
181
}
182
183
{
src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs
+11
-11
@@ -50,9 +50,9 @@ namespace WixToolsetTest.CoreIntegration
50
var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"obj\test.wir"));
51
var section = intermediate.Sections.Single();
52
53
- var wixFile = section.Tuples.OfType<WixFileTuple>().First();
54
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
55
- Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
53
+ var wixFile = section.Tuples.OfType<FileTuple>().First();
54
+ Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[FileTupleFields.Source].AsPath().Path);
55
+ Assert.Equal(@"test.txt", wixFile[FileTupleFields.Source].PreviousValue.AsPath().Path);
56
}
57
}
58
@@ -95,9 +95,9 @@ namespace WixToolsetTest.CoreIntegration
95
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
96
var section = intermediate.Sections.Single();
97
98
- var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
99
- Assert.Equal(Path.Combine(folder, @"data\example.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
100
- Assert.Equal(@"example.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
98
+ var fileTuple = section.Tuples.OfType<FileTuple>().Single();
99
+ Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileTuple[FileTupleFields.Source].AsPath().Path);
100
+ Assert.Equal(@"example.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path);
101
102
var example = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).Single();
103
Assert.Equal("Foo", example.Id.Id);
@@ -157,11 +157,11 @@ namespace WixToolsetTest.CoreIntegration
157
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
158
var section = intermediate.Sections.Single();
159
160
- var wixFiles = section.Tuples.OfType<WixFileTuple>().OrderBy(t => Path.GetFileName(t.Source.Path)).ToArray();
161
- Assert.Equal(Path.Combine(folder, @"data\example.txt"), wixFiles[0][WixFileTupleFields.Source].AsPath().Path);
162
- Assert.Equal(@"example.txt", wixFiles[0][WixFileTupleFields.Source].PreviousValue.AsPath().Path);
163
- Assert.Equal(Path.Combine(folder, @"data\other.txt"), wixFiles[1][WixFileTupleFields.Source].AsPath().Path);
164
- Assert.Equal(@"other.txt", wixFiles[1][WixFileTupleFields.Source].PreviousValue.AsPath().Path);
160
+ var fileTuples = section.Tuples.OfType<FileTuple>().OrderBy(t => Path.GetFileName(t.Source.Path)).ToArray();
161
+ Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileTuples[0][FileTupleFields.Source].AsPath().Path);
162
+ Assert.Equal(@"example.txt", fileTuples[0][FileTupleFields.Source].PreviousValue.AsPath().Path);
163
+ Assert.Equal(Path.Combine(folder, @"data\other.txt"), fileTuples[1][FileTupleFields.Source].AsPath().Path);
164
+ Assert.Equal(@"other.txt", fileTuples[1][FileTupleFields.Source].PreviousValue.AsPath().Path);
165
166
var examples = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).ToArray();
167
Assert.Equal(new[] { "Foo", "Other" }, examples.Select(t => t.Id.Id).ToArray());