/// <summary> /// Emits WiX XML. /// </summary> /// <returns></returns> public override XContainer[] ToXml() { var root = new XElement("MsiPackage"); root.SetAttribute("Name", Name); //will respect null if (this.IsIdSet()) { root.SetAttribute("Id", Id); } root.AddAttributes(this.Attributes) .Add(this.MapToXmlAttributes()); if (Payloads.Any()) { Payloads.ForEach(p => root.Add(new XElement("Payload", new XAttribute("SourceFile", p)))); } string props = MsiProperties + ";" + DefaultMsiProperties; props.ToDictionary().ForEach(p => { root.Add(new XElement("MsiProperty").AddAttributes("Name={0};Value={1}".FormatWith(p.Key, p.Value))); }); return(new[] { root }); }
/// <summary> /// Emits WiX XML. /// </summary> /// <returns></returns> public override XContainer[] ToXml() { string winInstaller = typeof(Session).Assembly.Location; var root = new XElement("BootstrapperApplicationRef"); root.SetAttribute("Id", "ManagedBootstrapperApplicationHost"); var files = new List <Payload> { rawAppAssembly.ToPayload(), bootstrapperCoreConfig.ToPayload() }; files.AddRange(Payloads.DistinctBy(x => x.SourceFile)); //note %this% it already resolved at this stage into an absolute path if (!Payloads.Any(x => Path.GetFileName(x.SourceFile).SameAs(Path.GetFileName(winInstaller)))) { files.Add(winInstaller.ToPayload()); } if (files.Any()) { files.DistinctBy(x => x.SourceFile).ForEach(p => root.Add(p.ToXElement("Payload"))); } return(new[] { root }); }
/// <summary> /// Emits WiX XML. /// </summary> /// <returns></returns> public override XContainer[] ToXml() { var root = new XElement("ExePackage"); root.SetAttribute("Name", Name); //will respect null if (this.IsIdSet()) { root.SetAttribute("Id", Id); } root.AddAttributes(this.Attributes) .Add(this.MapToXmlAttributes()); if (Payloads.Any()) { Payloads.ForEach(p => root.Add(new XElement("Payload", new XAttribute("SourceFile", p)))); } foreach (var exitCode in ExitCodes) { root.Add(exitCode.ToXElement()); } return(new[] { root }); }
/// <summary> /// Emits WiX XML. /// </summary> /// <returns></returns> public override XContainer[] ToXml() { var root = new XElement("MsuPackage"); root.SetAttribute("Name", Name); //will respect null if (this.IsIdSet()) { root.SetAttribute("Id", Id); } root.AddAttributes(this.Attributes) .Add(this.MapToXmlAttributes()); if (Payloads.Any()) { Payloads.ForEach(p => root.Add(p.ToXElement("Payload"))); } if (RemotePayloads.Any()) { RemotePayloads.ForEach(p => root.Add(p.ToXElement("RemotePayload"))); } return(new[] { root }); }