summaryrefslogtreecommitdiffstats
path: root/src/builder.vala
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-01-03 00:31:56 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-01-06 16:38:25 +0100
commit4f504716710736eab4c68e8b1fb2ece5f2373794 (patch)
tree51884083ff4b08664e88126bafe88687d8501eb6 /src/builder.vala
parentdd9db8647a05b2ba46fbd4df85f496f9de176741 (diff)
downloadmsitools-4f504716710736eab4c68e8b1fb2ece5f2373794.tar.gz
msitools-4f504716710736eab4c68e8b1fb2ece5f2373794.tar.xz
msitools-4f504716710736eab4c68e8b1fb2ece5f2373794.zip
Split ẅixl.vala in various files
Diffstat (limited to 'src/builder.vala')
-rw-r--r--src/builder.vala44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/builder.vala b/src/builder.vala
new file mode 100644
index 0000000..439447b
--- /dev/null
+++ b/src/builder.vala
@@ -0,0 +1,44 @@
+namespace Wixl {
+
+ class WixBuilder: WixElementVisitor {
+ WixRoot root;
+ MsiDatabase db;
+
+ public WixBuilder (WixRoot root) {
+ this.root = root;
+ }
+
+ public MsiDatabase build () throws GLib.Error {
+ db = new MsiDatabase ();
+ root.accept (this);
+ return db;
+ }
+
+ public override void visit_product (WixProduct product) throws GLib.Error {
+ db.info.set_codepage (int.parse (product.Codepage));
+ db.info.set_author (product.Manufacturer);
+
+ db.table_property.add ("Manufacturer", product.Manufacturer);
+ db.table_property.add ("ProductLanguage", product.Codepage);
+ db.table_property.add ("ProductCode", add_braces (product.Id));
+ db.table_property.add ("ProductName", product.Name);
+ db.table_property.add ("ProductVersion", product.Version);
+ db.table_property.add ("UpgradeCode", add_braces (product.UpgradeCode));
+ }
+
+ public override void visit_package (WixPackage package) throws GLib.Error {
+ db.info.set_keywords (package.Keywords);
+ db.info.set_subject (package.Description);
+ db.info.set_comments (package.Comments);
+ }
+
+ public override void visit_icon (WixIcon icon) throws GLib.Error {
+ db.table_icon.add (icon.Id, icon.SourceFile);
+ }
+
+ public override void visit_property (WixProperty prop) throws GLib.Error {
+ db.table_property.add (prop.Id, prop.Value);
+ }
+ }
+
+} // Wixl