private static XmlNodeList GetPatchTargetCodes(WixTest.BundleBuilder bundle) { string path = Path.Combine(bundle.Disassemble(), @"UX\manifest.xml"); XmlDocument doc = new XmlDocument(); doc.Load(path); XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable); nsmgr.AddNamespace("w", "http://schemas.microsoft.com/wix/2008/Burn"); return doc.SelectNodes("/w:BurnManifest/w:PatchTargetCode", nsmgr); }
/// <summary> /// Adds a Payload to an existing package /// </summary> /// <param name="packageToAddTo">package to add the payload to</param> /// <param name="file">full path to the file to be added</param> /// <param name="newFileName">new filename, null if you don't want it renamed</param> /// <param name="url">Url for the file if it is to be downloaded at install time</param> /// <param name="includeInLayout">true of the file should be included in an attached container or as external file, false if it should not exist.</param> public void AddSubFile(WixTest.Burn.OM.WixAuthoringOM.Bundle.Chain.Package packageToAddTo, string file, string newFileName, string url, bool includeInLayout) { WixTest.Burn.OM.WixAuthoringOM.Bundle.PayloadElement payload = new OM.WixAuthoringOM.Bundle.PayloadElement(); payload.SourceFile = file; payload.SourceFilePathT = file; payload.Name = System.IO.Path.GetFileName(file); if (!String.IsNullOrEmpty(newFileName)) { payload.Name = newFileName; } if (!String.IsNullOrEmpty(url) && !includeInLayout) // BUGBUG: if a URL is provided, WiX will not put the file in the attached container. { payload.DownloadUrl = url; } packageToAddTo.Payloads.Add(payload); CopyPayloadToLayout(file, newFileName, true); }