Reference Media if DiskId is specified.
Bob Arnson committed
Jun 23, 2020 at 23:26 UTC
25602a3e613f09794599d24e0c796d3295a22197
3 files changed
+8
-8
src/WixToolset.Core/Bind/FileFacade.cs
+1
-1
@@ -56,7 +56,7 @@ namespace WixToolset.Core.Bind
56
57
public int DiskId
58
{
59
- get => this.FileRow == null ? this.FileTuple.DiskId ?? 0 : this.FileRow.DiskId;
59
+ get => this.FileRow == null ? this.FileTuple.DiskId ?? 1 : this.FileRow.DiskId;
60
set
61
{
62
if (this.FileRow == null)
src/WixToolset.Core/Compiler.cs
+5
-5
@@ -5728,11 +5728,6 @@ namespace WixToolset.Core
5728
id = this.Core.CreateIdentifier("fil", directoryId, name ?? shortName);
5729
}
5730
5731
- if (!this.compilingModule && CompilerConstants.IntegerNotSet == diskId)
5732
- {
5733
- diskId = 1; // default to first Media
5734
- }
5735
-
5731
if (null != defaultVersion && null != companionFile)
5732
{
5733
this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DefaultVersion", "CompanionFile", companionFile));
@@ -5914,6 +5909,11 @@ namespace WixToolset.Core
5909
}
5910
}
5911
5912
+ if (CompilerConstants.IntegerNotSet != diskId)
5913
+ {
5914
+ this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Media, diskId.ToString(CultureInfo.InvariantCulture.NumberFormat));
5915
+ }
5916
+
5917
// If this component does not have a companion file this file is a possible keypath.
5918
possibleKeyPath = null;
5919
if (null == companionFile)
src/test/WixToolsetTest.CoreIntegration/TestData/MultiFileCompressed/PackageComponents.wxs
+2
-2
@@ -3,10 +3,10 @@
3
<Fragment>
4
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
5
<Component>
6
- <File DiskId="1" Source="$(env.WINDIR)\Notepad.exe" />
6
+ <File Source="$(env.WINDIR)\Notepad.exe" />
7
</Component>
8
<Component>
9
- <File DiskId="2" Source="test.txt" />
9
+ <File Source="test.txt" />
10
</Component>
11
</ComponentGroup>
12
</Fragment>