diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-07-11 18:24:15 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-07-11 18:26:27 +0200 |
commit | 8d63b8cf8f59000f02cbac8077056e63678694de (patch) | |
tree | 338e5dd61f7e391d52b3efb30bb941d6a05fde78 /tools | |
parent | fe1ff88578970535ecbf179efef5e15affd54070 (diff) | |
download | msitools-8d63b8cf8f59000f02cbac8077056e63678694de.tar.gz msitools-8d63b8cf8f59000f02cbac8077056e63678694de.tar.xz msitools-8d63b8cf8f59000f02cbac8077056e63678694de.zip |
wixl: add Directory support to ComponentGroup
Diffstat (limited to 'tools')
-rw-r--r-- | tools/wixl/builder.vala | 16 | ||||
-rw-r--r-- | tools/wixl/wix.vala | 3 |
2 files changed, 16 insertions, 3 deletions
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala index f6db67d..64d3ae7 100644 --- a/tools/wixl/builder.vala +++ b/tools/wixl/builder.vala @@ -397,7 +397,7 @@ namespace Wixl { if (comp.key is WixRegistryValue) attr |= ComponentAttribute.REGISTRY_KEY_PATH; - var parent = resolve<WixDirectory> (comp.parent); + var dir = get_directory (comp); string uuid; // FIXME: stable uuid generation based on ns/dir/path @@ -409,7 +409,7 @@ namespace Wixl { if (parse_yesno (comp.Win64)) attr |= ComponentAttribute.64BIT; - db.table_component.add (comp.Id, uuid, parent.Id, attr, + db.table_component.add (comp.Id, uuid, dir.Id, attr, comp.key != null ? comp.key.Id : null); } @@ -514,10 +514,20 @@ namespace Wixl { } } + WixDirectory get_directory (WixComponent comp) throws GLib.Error { + if (comp.parent is WixComponentGroup) { + var group = comp.parent as WixComponentGroup; + return find_element<WixDirectory> (group.Directory); + } else if (comp.parent is WixDirectory || comp.parent is WixDirectoryRef) { + return resolve<WixDirectory> (comp.parent); + } else + error ("unhandled parent type %s", comp.parent.name); + } + public override void visit_remove_folder (WixRemoveFolder rm) throws GLib.Error { var on = InstallMode.from_string (rm.On); var comp = rm.parent as WixComponent; - var dir = resolve<WixDirectory> (comp.parent); + WixDirectory dir = get_directory (comp); db.table_remove_file.add (rm.Id, comp.Id, dir.Id, on); } diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala index eaf3d56..7ac3172 100644 --- a/tools/wixl/wix.vala +++ b/tools/wixl/wix.vala @@ -264,6 +264,9 @@ namespace Wixl { typeof (WixComponentGroupRef), }); } + + public string Directory { get; set; } + } public class WixFragment: WixElement { |