diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-01-24 15:27:20 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-02-05 16:15:47 -0800 |
| commit | 6ff680e386b1543ad1a58d1b1d465ce8aa20bc7d (patch) | |
| tree | c717333cd10d5592e59dfb898b391275bba1f389 /src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs | |
| parent | 6e2e67ab55c75f4655397588c0dcc64f50d22f92 (diff) | |
| download | wix-6ff680e386b1543ad1a58d1b1d465ce8aa20bc7d.tar.gz wix-6ff680e386b1543ad1a58d1b1d465ce8aa20bc7d.tar.bz2 wix-6ff680e386b1543ad1a58d1b1d465ce8aa20bc7d.zip | |
Start on new patch infrastructure
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs index f9e3bd5a..ae872f45 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs | |||
| @@ -33,7 +33,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 33 | 33 | ||
| 34 | // Order by Component to group the files by directory. | 34 | // Order by Component to group the files by directory. |
| 35 | var optimized = this.OptimizedFileFacades(); | 35 | var optimized = this.OptimizedFileFacades(); |
| 36 | foreach (var fileId in optimized.Select(f => f.File.Id.Id)) | 36 | foreach (var fileId in optimized.Select(f => f.Id)) |
| 37 | { | 37 | { |
| 38 | var fileRow = fileRows.Get(fileId); | 38 | var fileRow = fileRows.Get(fileId); |
| 39 | fileRow.Sequence = ++lastSequence; | 39 | fileRow.Sequence = ++lastSequence; |
| @@ -41,13 +41,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 41 | } | 41 | } |
| 42 | else | 42 | else |
| 43 | { | 43 | { |
| 44 | int lastSequence = 0; | 44 | var lastSequence = 0; |
| 45 | MediaRow mediaRow = null; | 45 | MediaRow mediaRow = null; |
| 46 | Dictionary<int, List<FileFacade>> patchGroups = new Dictionary<int, List<FileFacade>>(); | 46 | var patchGroups = new Dictionary<int, List<FileFacade>>(); |
| 47 | 47 | ||
| 48 | // sequence the non-patch-added files | 48 | // sequence the non-patch-added files |
| 49 | var optimized = this.OptimizedFileFacades(); | 49 | var optimized = this.OptimizedFileFacades(); |
| 50 | foreach (FileFacade facade in optimized) | 50 | foreach (var facade in optimized) |
| 51 | { | 51 | { |
| 52 | if (null == mediaRow) | 52 | if (null == mediaRow) |
| 53 | { | 53 | { |
| @@ -64,19 +64,19 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 64 | mediaRow = mediaRows.Get(facade.DiskId); | 64 | mediaRow = mediaRows.Get(facade.DiskId); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | if (facade.File.PatchGroup.HasValue) | 67 | if (facade.PatchGroup.HasValue) |
| 68 | { | 68 | { |
| 69 | if (patchGroups.TryGetValue(facade.File.PatchGroup.Value, out var patchGroup)) | 69 | if (patchGroups.TryGetValue(facade.PatchGroup.Value, out var patchGroup)) |
| 70 | { | 70 | { |
| 71 | patchGroup = new List<FileFacade>(); | 71 | patchGroup = new List<FileFacade>(); |
| 72 | patchGroups.Add(facade.File.PatchGroup.Value, patchGroup); | 72 | patchGroups.Add(facade.PatchGroup.Value, patchGroup); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | patchGroup.Add(facade); | 75 | patchGroup.Add(facade); |
| 76 | } | 76 | } |
| 77 | else | 77 | else |
| 78 | { | 78 | { |
| 79 | var fileRow = fileRows.Get(facade.File.Id.Id); | 79 | var fileRow = fileRows.Get(facade.Id); |
| 80 | fileRow.Sequence = ++lastSequence; | 80 | fileRow.Sequence = ++lastSequence; |
| 81 | } | 81 | } |
| 82 | } | 82 | } |
| @@ -102,7 +102,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 102 | mediaRow = mediaRows.Get(facade.DiskId); | 102 | mediaRow = mediaRows.Get(facade.DiskId); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | var fileRow = fileRows.Get(facade.File.Id.Id); | 105 | var fileRow = fileRows.Get(facade.Id); |
| 106 | fileRow.Sequence = ++lastSequence; | 106 | fileRow.Sequence = ++lastSequence; |
| 107 | } | 107 | } |
| 108 | } | 108 | } |
| @@ -119,7 +119,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 119 | // TODO: Sort these facades even smarter by directory path and component id | 119 | // TODO: Sort these facades even smarter by directory path and component id |
| 120 | // and maybe file size or file extension and other creative ideas to | 120 | // and maybe file size or file extension and other creative ideas to |
| 121 | // get optimal install speed out of MSI. | 121 | // get optimal install speed out of MSI. |
| 122 | return this.FileFacades.OrderBy(f => f.File.ComponentRef); | 122 | return this.FileFacades.OrderBy(f => f.ComponentRef); |
| 123 | } | 123 | } |
| 124 | } | 124 | } |
| 125 | } | 125 | } |
