[msitools] wixl: add Action condition
- From: Marc-Andre Lureau <malureau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [msitools] wixl: add Action condition
- Date: Thu, 24 Jan 2013 22:51:14 +0000 (UTC)
commit 4866dcfc6b7ab1a28163fc4045b2b9d9c5e4b0aa
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date: Thu Jan 24 23:44:11 2013 +0100
wixl: add Action condition
tools/wixl/builder.vala | 6 ++++++
tools/wixl/msi.vala | 12 +++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 0231c60..4b100f9 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -701,6 +701,12 @@ namespace Wixl {
var before = table.get_action (action.Before);
before.add_dep (node);
}
+
+ if (action.children.length () > 0) {
+ return_if_fail (action.children.length () == 1);
+ var text = action.children.first ().data as WixText;
+ node.condition = text.Text;
+ }
}
public override void visit_progid (WixProgId progid) throws GLib.Error {
diff --git a/tools/wixl/msi.vala b/tools/wixl/msi.vala
index 3b13860..8363364 100644
--- a/tools/wixl/msi.vala
+++ b/tools/wixl/msi.vala
@@ -41,11 +41,12 @@ 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);
+ private void add (string action, string? condition, int sequence) throws GLib.Error {
+ var rec = new Libmsi.Record (3);
if (!rec.set_string (1, action) ||
- !rec.set_int (2, sequence))
+ (condition != null && !rec.set_string (2, condition)) ||
+ !rec.set_int (3, sequence))
throw new Wixl.Error.FAILED ("failed to add record");
records.append (rec);
@@ -54,11 +55,12 @@ namespace Wixl {
protected class void set_sequence_table_name (string table) {
name = table;
sql_create = "CREATE TABLE `%s` (`Action` CHAR(72) NOT NULL, `Condition` CHAR(255), `Sequence` INT PRIMARY KEY `Action`)".printf (table);
- sql_insert = "INSERT INTO `%s` (`Action`, `Sequence`) VALUES (?, ?)".printf (table);
+ sql_insert = "INSERT INTO `%s` (`Action`, `Condition`, `Sequence`) VALUES (?, ?, ?)".printf (table);
}
public class Action {
public string name;
+ public string? condition;
public int sequence = -1;
public WixAction? action;
@@ -131,7 +133,7 @@ namespace Wixl {
action.sequence = ++sequence;
sequence = action.sequence;
- add (action.name, action.sequence);
+ add (action.name, action.condition, action.sequence);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]