private WixOutput CreateWixout(List <ITrackedFile> trackedFiles, Intermediate intermediate, string manifestPath, string baDataPath, string bextDataPath) { WixOutput wixout; if (String.IsNullOrEmpty(this.OutputPdbPath)) { wixout = WixOutput.Create(); } else { var trackPdb = this.BackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.Final); trackedFiles.Add(trackPdb); wixout = WixOutput.Create(trackPdb.Path); } intermediate.Save(wixout); wixout.ImportDataStream(BurnConstants.BurnManifestWixOutputStreamName, manifestPath); wixout.ImportDataStream(BurnConstants.BootstrapperApplicationDataWixOutputStreamName, baDataPath); wixout.ImportDataStream(BurnConstants.BundleExtensionDataWixOutputStreamName, bextDataPath); wixout.Reopen(); return(wixout); }
public void CanSaveAndLoadWindowsInstallerData() { var sln = new SourceLineNumber("test.wxs", 1); var windowsInstallerData = new Wid.WindowsInstallerData(sln) { Type = OutputType.Product, }; var fileTable = windowsInstallerData.EnsureTable(Wid.WindowsInstallerTableDefinitions.File); var fileRow = (FileRow)fileTable.CreateRow(sln); fileRow.File = "TestFile"; var path = Path.GetTempFileName(); try { using (var wixout = WixOutput.Create(path)) { windowsInstallerData.Save(wixout); } var loaded = Wid.WindowsInstallerData.Load(path); var loadedTable = Assert.Single(loaded.Tables); Assert.Equal(Wid.WindowsInstallerTableDefinitions.File.Name, loadedTable.Name); var loadedRow = Assert.Single(loadedTable.Rows); var loadedFileRow = Assert.IsType <FileRow>(loadedRow); Assert.Equal("TestFile", loadedFileRow.File); } finally { File.Delete(path); } }
private WixOutput CreateWixout(List <ITrackedFile> trackedFiles, Intermediate intermediate, WindowsInstallerData output) { WixOutput wixout; if (String.IsNullOrEmpty(this.OutputPdbPath)) { wixout = WixOutput.Create(); } else { var trackPdb = this.BackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.Final); trackedFiles.Add(trackPdb); wixout = WixOutput.Create(trackPdb.Path); } intermediate.Save(wixout); output.Save(wixout); wixout.Reopen(); return(wixout); }