diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-10 02:48:32 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-10 02:48:32 +0100 |
commit | 48b09d7fd654b6d2211f7583d13966f020e0146d (patch) | |
tree | d1c7deb8730b261f5bfafeb7ec52c1d0613fed46 /tools/wixl/msi.vala | |
parent | a11c1fa04389339b262081de70245221bdf6ca7a (diff) | |
download | msitools-48b09d7fd654b6d2211f7583d13966f020e0146d.tar.gz msitools-48b09d7fd654b6d2211f7583d13966f020e0146d.tar.xz msitools-48b09d7fd654b6d2211f7583d13966f020e0146d.zip |
wixl: simplify default actions insertion
Diffstat (limited to 'tools/wixl/msi.vala')
-rw-r--r-- | tools/wixl/msi.vala | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tools/wixl/msi.vala b/tools/wixl/msi.vala index c7fed7a..54428a8 100644 --- a/tools/wixl/msi.vala +++ b/tools/wixl/msi.vala @@ -39,6 +39,8 @@ namespace Wixl { } public abstract class MsiTableSequence: MsiTable { + public class MSIDefault.ActionFlags flags; + private void add (string action, int sequence) throws GLib.Error { var rec = new Libmsi.Record (2); @@ -74,7 +76,6 @@ namespace Wixl { HashTable<string, Action> actions = new HashTable<string, Action> (str_hash, str_equal); - void sort_topological_visit (Action action, ref List<Action> sorted) { if (action.visited) return; @@ -145,35 +146,55 @@ namespace Wixl { return action; } + + public void add_default_action (MSIDefault.Action action) { + var default = MSIDefault.get_action (action); + if (!(flags in default.flags)) + critical ("Action %s shouldn't be added in %s", default.name, name); + + var seq = actions.lookup (default.name); + if (seq != null) + return; + + seq = new Action (); + actions.insert (default.name, seq); + seq.name = default.name; + seq.sequence = default.sequence; + } } class MsiTableAdminExecuteSequence: MsiTableSequence { static construct { set_sequence_table_name ("AdminExecuteSequence"); + flags = MSIDefault.ActionFlags.ADMIN_EXECUTE_SEQUENCE; } } class MsiTableAdminUISequence: MsiTableSequence { static construct { set_sequence_table_name ("AdminUISequence"); + flags = MSIDefault.ActionFlags.ADMIN_UI_SEQUENCE; } } class MsiTableAdvtExecuteSequence: MsiTableSequence { static construct { set_sequence_table_name ("AdvtExecuteSequence"); + flags = MSIDefault.ActionFlags.ADVT_EXECUTE_SEQUENCE; } } class MsiTableInstallExecuteSequence: MsiTableSequence { static construct { set_sequence_table_name ("InstallExecuteSequence"); + flags = MSIDefault.ActionFlags.INSTALL_EXECUTE_SEQUENCE; } } class MsiTableInstallUISequence: MsiTableSequence { static construct { set_sequence_table_name ("InstallUISequence"); + flags = MSIDefault.ActionFlags.INSTALL_UI_SEQUENCE; } } |