From ab926e5224dafc3d9f79283e6207930357dc2cae Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Thu, 11 Jul 2013 18:21:22 +0200 Subject: wixl: start MediaTemplate --- tools/wixl/builder.vala | 10 +++++++++- tools/wixl/wix.vala | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala index 368b6c2..9c0bc59 100644 --- a/tools/wixl/builder.vala +++ b/tools/wixl/builder.vala @@ -194,9 +194,9 @@ namespace Wixl { table.add_sorted_actions (); } + List medias; private void build_cabinet () throws GLib.Error { var sequence = 0; - var medias = get_elements (); foreach (var m in medias) { var folder = new GCab.Folder (GCab.Compression.MSZIP); @@ -324,6 +324,7 @@ namespace Wixl { var rec = db.table_media.add (media.Id, media.DiskPrompt, cabinet); media.record = rec; + medias.append (media); } public override void visit_directory (WixDirectory dir) throws GLib.Error { @@ -1089,6 +1090,13 @@ namespace Wixl { node.add_dep (table.get_action ("InstallValidate")); } + public override void visit_media_template (WixMediaTemplate tmpl) throws GLib.Error { + var media = new WixMedia (); + media.EmbedCab = tmpl.EmbedCab; + media.Cabinet = "cab1.cab"; + media.Id = "1"; + visit_media (media); + } } } // Wixl diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala index 3120be7..eaf3d56 100644 --- a/tools/wixl/wix.vala +++ b/tools/wixl/wix.vala @@ -65,6 +65,7 @@ namespace Wixl { public abstract void visit_custom_action (WixCustomAction action) throws GLib.Error; public abstract void visit_binary (WixBinary binary) throws GLib.Error; public abstract void visit_major_upgrade (WixMajorUpgrade major) throws GLib.Error; + public abstract void visit_media_template (WixMediaTemplate media) throws GLib.Error; } public abstract class WixNode: Object { @@ -950,6 +951,18 @@ namespace Wixl { } } + public class WixMediaTemplate: WixElement { + static construct { + name = "MediaTemplate"; + } + + public string EmbedCab { get; set; } + + public override void accept (WixNodeVisitor visitor) throws GLib.Error { + visitor.visit_media_template (this); + } + } + public class WixProduct: WixElement { static construct { name = "Product"; @@ -972,6 +985,7 @@ namespace Wixl { typeof (WixCustomAction), typeof (WixBinary), typeof (WixMajorUpgrade), + typeof (WixMediaTemplate), }); } -- cgit