From 461350c09839f1e59fb3dafe1a67e74bf152f803 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 22 Jun 2020 19:35:34 -0400 Subject: If no Media or MediaTemplate is present, default to a MediaTemplate. --- .../Bind/AssignMediaCommand.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/WixToolset.Core.WindowsInstaller') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs index b75956b4..773b3225 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs @@ -59,6 +59,18 @@ namespace WixToolset.Core.WindowsInstaller.Bind throw new WixException(ErrorMessages.MediaTableCollision(null)); } + // If neither tuple is authored, default to a media template. + if (SectionType.Product == this.Section.Type && mediaTemplateTuples.Count == 0 && mediaTuples.Count == 0) + { + var mediaTemplate = new WixMediaTemplateTuple() + { + CabinetTemplate = "cab{0}.cab", + }; + + this.Section.AddTuple(mediaTemplate); + mediaTemplateTuples.Add(mediaTemplate); + } + // When building merge module, all the files go to "#MergeModule.CABinet". if (SectionType.Module == this.Section.Type) { -- cgit v1.2.3-55-g6feb