[msitools] wixl: add InstallScope



commit e70c5e1a9dc37b0f265be4a8cb6b28b7fec543ff
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Thu Jul 11 18:25:42 2013 +0200

    wixl: add InstallScope

 tools/wixl/builder.vala |   18 ++++++++++++++++++
 tools/wixl/msi.vala     |    1 -
 tools/wixl/wix.vala     |    1 +
 3 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 9780ced..356652f 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -283,6 +283,14 @@ namespace Wixl {
             db.table_property.add ("UpgradeCode", add_braces (product.UpgradeCode));
         }
 
+        [Flags]
+        enum SourceFlags {
+            SHORT_NAMES,
+            COMPRESSED,
+            ADMIN,
+            NO_PRIVILEGES,
+        }
+
         public override void visit_package (WixPackage package) throws GLib.Error {
             if (package.Comments != null)
                 db.info.set_comments (package.Comments);
@@ -302,6 +310,16 @@ namespace Wixl {
                 db.info.set_property (Libmsi.Property.VERSION, version);
             }
 
+            int source = SourceFlags.COMPRESSED;
+            if (package.InstallScope != null) {
+                if (package.InstallScope == "perUser")
+                    source |= SourceFlags.NO_PRIVILEGES;
+                else if (package.InstallScope == "perMachine")
+                    source |= 0;
+                else
+                    error ("invalid InstallScope value: %s", package.InstallScope);
+            }
+            db.info.set_property (Libmsi.Property.SOURCE, source);
         }
 
         public override void visit_icon (WixIcon icon) throws GLib.Error {
diff --git a/tools/wixl/msi.vala b/tools/wixl/msi.vala
index 9c2e40e..7c0e570 100644
--- a/tools/wixl/msi.vala
+++ b/tools/wixl/msi.vala
@@ -811,7 +811,6 @@ namespace Wixl {
                 info.set_property (Libmsi.Property.LASTSAVED_TM,
                                    time_to_filetime (now ()));
                 info.set_property (Libmsi.Property.VERSION, get_default_version ());
-                info.set_property (Libmsi.Property.SOURCE, 2);
                 info.set_property (Libmsi.Property.APPNAME, Config.PACKAGE_STRING);
                 info.set_property (Libmsi.Property.SECURITY, 2);
             } catch (GLib.Error error) {
diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala
index 41b83d8..6566920 100644
--- a/tools/wixl/wix.vala
+++ b/tools/wixl/wix.vala
@@ -335,6 +335,7 @@ namespace Wixl {
         public string SummaryCodepage { get; set; }
         public string Comments { get; set; }
         public string Description { get; set; }
+        public string InstallScope { get; set; }
 
         public override void accept (WixNodeVisitor visitor) throws GLib.Error {
             base.accept (visitor);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]