diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-15 16:24:20 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-15 20:05:56 +0100 |
commit | 4f2bc56ea5aa4b1f2eb1319bf1a794122d8e2570 (patch) | |
tree | 47331c2b08b59e1125248456803ae017905d483b /tools | |
parent | 58f5bf41354155490a405fcd1276e2a1ce0828f4 (diff) | |
download | msitools-4f2bc56ea5aa4b1f2eb1319bf1a794122d8e2570.tar.gz msitools-4f2bc56ea5aa4b1f2eb1319bf1a794122d8e2570.tar.xz msitools-4f2bc56ea5aa4b1f2eb1319bf1a794122d8e2570.zip |
wixl: start ProgId/Extension/Verb support
Diffstat (limited to 'tools')
-rw-r--r-- | tools/wixl/builder.vala | 51 | ||||
-rw-r--r-- | tools/wixl/wix.vala | 54 |
2 files changed, 105 insertions, 0 deletions
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala index f583d3a..5cb92c3 100644 --- a/tools/wixl/builder.vala +++ b/tools/wixl/builder.vala @@ -659,6 +659,57 @@ namespace Wixl { } } + public override void visit_progid (WixProgId progid) throws GLib.Error { + return_if_fail (!parse_yesno (progid.Advertise)); + + var comp = progid.parent as WixComponent; + var regid = generate_id ("reg", 2, + comp.Id, + progid.Id); + + db.table_registry.add (regid, 0, progid.Id, comp.Id, null, progid.Description); + } + + public override void visit_extension (WixExtension ext) throws GLib.Error { + var progid = ext.parent as WixProgId; + var comp = progid.parent as WixComponent; + var regid = generate_id ("reg", 3, + comp.Id, + ext.Id, + "Content Type"); + + db.table_registry.add (regid, 0, "." + ext.Id, comp.Id, "Content Type", ext.ContentType); + + regid = generate_id ("reg", 2, + comp.Id, + ext.Id); + + db.table_registry.add (regid, 0, "." + ext.Id, comp.Id, null, progid.Id); + } + + public override void visit_verb (WixVerb verb) throws GLib.Error { + return_if_fail (verb.Id == "open"); + + var ext = verb.parent as WixExtension; + var progid = ext.parent as WixProgId; + var comp = progid.parent as WixComponent; + + var key = progid.Id + "\\shell\\open"; + var regid = generate_id ("reg", 2, + comp.Id, + key); + + db.table_registry.add (regid, 0, key, comp.Id, null, "Open"); + + key += "\\command"; + regid = generate_id ("reg", 2, + comp.Id, + key); + + db.table_registry.add (regid, 0, key, comp.Id, null, + "\"[#%s]\" %s".printf (verb.TargetFile, verb.Argument)); + } + public override void visit_create_folder (WixCreateFolder folder) throws GLib.Error { } diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala index ce55d6f..c8cdcdf 100644 --- a/tools/wixl/wix.vala +++ b/tools/wixl/wix.vala @@ -29,6 +29,9 @@ namespace Wixl { public abstract void visit_action (WixAction action) throws GLib.Error; public abstract void visit_text (WixText text) throws GLib.Error; public abstract void visit_component_group_ref (WixComponentGroupRef ref) throws GLib.Error; + public abstract void visit_progid (WixProgId progid) throws GLib.Error; + public abstract void visit_extension (WixExtension extension) throws GLib.Error; + public abstract void visit_verb (WixVerb verb) throws GLib.Error; } public abstract class WixNode: Object { @@ -438,6 +441,56 @@ namespace Wixl { } } + public class WixVerb: WixElement { + static construct { + name = "Verb"; + } + + public string Command { get; set; } + public string TargetFile { get; set; } + public string Argument { get; set; } + + public override void accept (WixNodeVisitor visitor) throws GLib.Error { + base.accept (visitor); + visitor.visit_verb (this); + } + } + + public class WixExtension: WixElement { + static construct { + name = "Extension"; + + add_child_types (child_types, { + typeof (WixVerb), + }); + } + + public string ContentType { get; set; } + + public override void accept (WixNodeVisitor visitor) throws GLib.Error { + base.accept (visitor); + visitor.visit_extension (this); + } + } + + public class WixProgId: WixElement { + static construct { + name = "ProgId"; + + add_child_types (child_types, { + typeof (WixExtension), + }); + } + + public string Description { get; set; } + public string Advertise { get; set; } + + public override void accept (WixNodeVisitor visitor) throws GLib.Error { + base.accept (visitor); + visitor.visit_progid (this); + } + } + public class WixAction: WixElement { public new string name; @@ -745,6 +798,7 @@ namespace Wixl { typeof (WixRegistryValue), typeof (WixFile), typeof (WixShortcut), + typeof (WixProgId), typeof (WixRegistryKey), }); } |