/// <summary> /// Appends a UX or Attached container to the exe and updates the ".wixburn" section data to point to it. /// </summary> /// <param name="containerStream">File stream to append to the current exe.</param> /// <param name="containerSize">Size of container to append.</param> /// <param name="container">Container section represented by the fileContainer.</param> /// <returns>true if the container data is successfully appended; false otherwise</returns> public bool AppendContainer(Stream containerStream, long containerSize, BurnCommon.Container container) { UInt32 burnSectionCount = 0; UInt32 burnSectionOffsetSize = 0; switch (container) { case Container.UX: burnSectionCount = 1; burnSectionOffsetSize = BURN_SECTION_OFFSET_UXSIZE; // TODO: verify that the size in the section data is 0 or the same size. this.EngineSize += (uint)containerSize; this.UXSize = (uint)containerSize; break; case Container.Attached: burnSectionCount = 2; burnSectionOffsetSize = BURN_SECTION_OFFSET_ATTACHEDCONTAINERSIZE; // TODO: verify that the size in the section data is 0 or the same size. this.AttachedContainerSize = (uint)containerSize; break; default: Debug.Assert(false); return(false); } return(AppendContainer(containerStream, (UInt32)containerSize, burnSectionOffsetSize, burnSectionCount)); }
/// <summary> /// Appends a UX or Attached container to the exe and updates the ".wixburn" section data to point to it. /// </summary> /// <param name="fileContainer">File path to append to the current exe.</param> /// <param name="container">Container section represented by the fileContainer.</param> /// <returns>true if the container data is successfully appended; false otherwise</returns> public bool AppendContainer(string fileContainer, BurnCommon.Container container) { using (FileStream reader = File.OpenRead(fileContainer)) { return(this.AppendContainer(reader, reader.Length, container)); } }