[msitools] wixl: start MediaTemplate



commit ab926e5224dafc3d9f79283e6207930357dc2cae
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Thu Jul 11 18:21:22 2013 +0200

    wixl: start MediaTemplate

 tools/wixl/builder.vala |   10 +++++++++-
 tools/wixl/wix.vala     |   14 ++++++++++++++
 2 files changed, 23 insertions(+), 1 deletions(-)
---
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<WixMedia> medias;
         private void build_cabinet () throws GLib.Error {
             var sequence = 0;
-            var medias = get_elements<WixMedia> ();
 
             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),
             });
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]