summaryrefslogtreecommitdiffstats
path: root/tools/wixl
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-01-10 02:39:05 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-01-10 02:39:05 +0100
commitd7fc1eb0a03338c620aaf2efe8d8ad4c2e03f400 (patch)
tree6be129885d8a059b7cdec4155056c7b75004479e /tools/wixl
parent8c4d52f2d2d1325d1991107eb6d34e0589d47561 (diff)
downloadmsitools-d7fc1eb0a03338c620aaf2efe8d8ad4c2e03f400.tar.gz
msitools-d7fc1eb0a03338c620aaf2efe8d8ad4c2e03f400.tar.xz
msitools-d7fc1eb0a03338c620aaf2efe8d8ad4c2e03f400.zip
wixl: use MSIDefault.actions in builder sequence_actions()
Diffstat (limited to 'tools/wixl')
-rw-r--r--tools/wixl/builder.vala115
-rw-r--r--tools/wixl/msi.vala4
2 files changed, 65 insertions, 54 deletions
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 80c2ff6..c274927 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -71,91 +71,102 @@ namespace Wixl {
return elems;
}
- delegate void AddSequence (string action, int sequence) throws GLib.Error;
+ delegate void AddDefaultAction (MSIDefault.Action action) throws GLib.Error;
private void sequence_actions () throws GLib.Error {
MsiTableSequence? table = null;
- AddSequence add = (action, sequence) => {
- var seq = table.get_action (action);
- seq.sequence = sequence;
+ var flags = 0;
+ AddDefaultAction add = (action) => {
+ var default = MSIDefault.get_action (action);
+ if (!(flags in default.flags))
+ critical ("Action %s shouldn't be added in this sequence", default.name);
+ var seq = table.get_action (default.name);
+ seq.sequence = default.sequence;
};
// AdminExecuteSequence
table = db.table_admin_execute_sequence;
- add ("CostInitialize", 800);
- add ("FileCost", 900);
- add ("CostFinalize", 1000);
- add ("InstallValidate", 1400);
- add ("InstallInitialize", 1500);
- add ("InstallAdminPackage", 3900);
- add ("InstallFiles", 4000);
- add ("InstallFinalize", 6600);
+ flags = MSIDefault.ActionFlags.ADMIN_EXECUTE_SEQUENCE;
+ add (MSIDefault.Action.CostInitialize);
+ add (MSIDefault.Action.FileCost);
+ add (MSIDefault.Action.CostFinalize);
+ add (MSIDefault.Action.InstallValidate);
+ add (MSIDefault.Action.InstallInitialize);
+ add (MSIDefault.Action.InstallAdminPackage);
+ add (MSIDefault.Action.InstallFiles);
+ add (MSIDefault.Action.InstallFinalize);
table.add_sorted_actions ();
// AdminUISequence
table = db.table_admin_ui_sequence;
- add ("CostInitialize", 800);
- add ("FileCost", 900);
- add ("CostFinalize", 1000);
- add ("ExecuteAction", 1300);
+ flags = MSIDefault.ActionFlags.ADMIN_UI_SEQUENCE;
+ add (MSIDefault.Action.CostInitialize);
+ add (MSIDefault.Action.FileCost);
+ add (MSIDefault.Action.CostFinalize);
+ add (MSIDefault.Action.ExecuteAction);
table.add_sorted_actions ();
+ // AdvtExecuteSequence
table = db.table_advt_execute_sequence;
- add ("CostInitialize", 800);
- add ("CostFinalize", 1000);
- add ("InstallValidate", 1400);
- add ("InstallInitialize", 1500);
+ flags = MSIDefault.ActionFlags.ADVT_EXECUTE_SEQUENCE;
+ add (MSIDefault.Action.CostInitialize);
+ add (MSIDefault.Action.CostFinalize);
+ add (MSIDefault.Action.InstallValidate);
+ add (MSIDefault.Action.InstallInitialize);
if (db.table_shortcut.records.length () > 0)
- add ("CreateShortcuts", 4500);
- add ("PublishFeatures", 6300);
- add ("PublishProduct", 6400);
- add ("InstallFinalize", 6600);
+ add (MSIDefault.Action.CreateShortcuts);
+ add (MSIDefault.Action.PublishFeatures);
+ add (MSIDefault.Action.PublishProduct);
+ add (MSIDefault.Action.InstallFinalize);
table.add_sorted_actions ();
// InstallExecuteSequence
table = db.table_install_execute_sequence;
+ flags = MSIDefault.ActionFlags.INSTALL_EXECUTE_SEQUENCE;
if (db.table_upgrade.records.length () > 0)
- add ("FindRelatedProducts", 25);
+ add (MSIDefault.Action.FindRelatedProducts);
if (db.table_launch_condition.records.length () > 0)
- add ("LaunchConditions", 100);
- add ("ValidateProductID", 700);
- add ("CostInitialize", 800);
- add ("FileCost", 900);
- add ("CostFinalize", 1000);
- add ("InstallValidate", 1400);
- add ("InstallInitialize", 1500);
- add ("ProcessComponents", 1600);
- add ("UnpublishFeatures", 1800);
+ add (MSIDefault.Action.LaunchConditions);
+ add (MSIDefault.Action.ValidateProductID);
+ add (MSIDefault.Action.CostInitialize);
+ add (MSIDefault.Action.FileCost);
+ add (MSIDefault.Action.CostFinalize);
+ add (MSIDefault.Action.InstallValidate);
+ add (MSIDefault.Action.InstallInitialize);
+ add (MSIDefault.Action.ProcessComponents);
+ add (MSIDefault.Action.UnpublishFeatures);
if (db.table_registry.records.length () > 0)
- add ("RemoveRegistryValues", 2600);
+ add (MSIDefault.Action.RemoveRegistryValues);
if (db.table_shortcut.records.length () > 0)
- add ("RemoveShortcuts", 3200);
+ add (MSIDefault.Action.RemoveShortcuts);
if (db.table_file.records.length () > 0 ||
db.table_remove_file.records.length () > 0)
- add ("RemoveFiles", 3500);
+ add (MSIDefault.Action.RemoveFiles);
if (db.table_file.records.length () > 0)
- add ("InstallFiles", 4000);
+ add (MSIDefault.Action.InstallFiles);
if (db.table_shortcut.records.length () > 0)
- add ("CreateShortcuts", 4500);
+ add (MSIDefault.Action.CreateShortcuts);
if (db.table_registry.records.length () > 0)
- add ("WriteRegistryValues", 5000);
- add ("RegisterUser", 6000);
- add ("RegisterProduct", 6100);
- add ("PublishFeatures", 6300);
- add ("PublishProduct", 6400);
- add ("InstallFinalize", 6600);
+ add (MSIDefault.Action.WriteRegistryValues);
+ add (MSIDefault.Action.RegisterUser);
+ add (MSIDefault.Action.RegisterProduct);
+ add (MSIDefault.Action.PublishFeatures);
+ add (MSIDefault.Action.PublishProduct);
+ add (MSIDefault.Action.InstallFinalize);
table.add_sorted_actions ();
+ // InstallUISequence
table = db.table_install_ui_sequence;
+ flags = MSIDefault.ActionFlags.INSTALL_UI_SEQUENCE;
if (db.table_upgrade.records.length () > 0)
- add ("FindRelatedProducts", 25);
+ add (MSIDefault.Action.FindRelatedProducts);
if (db.table_launch_condition.records.length () > 0)
- add ("LaunchConditions", 100);
- add ("ValidateProductID", 700);
- add ("CostInitialize", 800);
- add ("FileCost", 900);
- add ("CostFinalize", 1000);
- add ("ExecuteAction", 1300);
+ add (MSIDefault.Action.LaunchConditions);
+ add (MSIDefault.Action.ValidateProductID);
+ add (MSIDefault.Action.CostInitialize);
+ add (MSIDefault.Action.FileCost);
+ add (MSIDefault.Action.CostFinalize);
+ add (MSIDefault.Action.ExecuteAction);
table.add_sorted_actions ();
}
diff --git a/tools/wixl/msi.vala b/tools/wixl/msi.vala
index b8700b0..c7fed7a 100644
--- a/tools/wixl/msi.vala
+++ b/tools/wixl/msi.vala
@@ -1,6 +1,6 @@
namespace Wixl {
- abstract class MsiTable: Object {
+ public abstract class MsiTable: Object {
public class string name;
public List<Libmsi.Record> records;
@@ -38,7 +38,7 @@ namespace Wixl {
}
}
- abstract class MsiTableSequence: MsiTable {
+ public abstract class MsiTableSequence: MsiTable {
private void add (string action, int sequence) throws GLib.Error {
var rec = new Libmsi.Record (2);