summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-04-12 03:48:39 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-04-12 04:07:04 +0200
commit0a3d75677ffbb1164f29d22b6c4d866bb9920246 (patch)
treedc47f41504136987e1c5b62b1b0b0114ecc9da0d /tools
parent7d50947ca464d4cbad135919385cde86fd2c4d69 (diff)
downloadmsitools-0a3d75677ffbb1164f29d22b6c4d866bb9920246.zip
msitools-0a3d75677ffbb1164f29d22b6c4d866bb9920246.tar.gz
msitools-0a3d75677ffbb1164f29d22b6c4d866bb9920246.tar.xz
Set installer version depending on arch
Diffstat (limited to 'tools')
-rw-r--r--tools/wixl/builder.vala14
-rw-r--r--tools/wixl/msi.vala15
2 files changed, 22 insertions, 7 deletions
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 924672b..b3da2e9 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -239,7 +239,7 @@ namespace Wixl {
}
public MsiDatabase build () throws GLib.Error {
- db = new MsiDatabase ();
+ db = new MsiDatabase (arch);
foreach (var r in roots) {
root = r;
@@ -281,8 +281,14 @@ namespace Wixl {
if (package.Keywords != null)
db.info.set_keywords (package.Keywords);
- if (package.InstallerVersion != null)
- db.info.set_property (Libmsi.Property.VERSION, int.parse (package.InstallerVersion));
+ if (package.InstallerVersion != null) {
+ var version = int.parse (package.InstallerVersion);
+
+ if (arch != Arch.X86 && version < 200)
+ warning ("InstallerVersion >= 200 required for !x86 builds");
+
+ db.info.set_property (Libmsi.Property.VERSION, version);
+ }
}
@@ -349,7 +355,7 @@ namespace Wixl {
var cs = new Checksum (ChecksumType.SHA1);
uint8 buffer[20];
size_t buflen = buffer.length;
-
+
cs.update (uuid_namespace.data, 16);
cs.update (s.data, s.length);
cs.get_digest (buffer, ref buflen);
diff --git a/tools/wixl/msi.vala b/tools/wixl/msi.vala
index ed3c949..f1de726 100644
--- a/tools/wixl/msi.vala
+++ b/tools/wixl/msi.vala
@@ -673,6 +673,8 @@ namespace Wixl {
}
class MsiDatabase: Object {
+ public Arch arch { get; construct set; }
+
public MsiSummaryInfo info;
public MsiTableProperty table_property;
public MsiTableIcon table_icon;
@@ -701,6 +703,13 @@ namespace Wixl {
public HashTable<string, MsiTable> tables;
+ int get_default_version () {
+ if (arch == Arch.X86)
+ return 100;
+ else
+ return 200;
+ }
+
construct {
info = new MsiSummaryInfo ();
try {
@@ -713,7 +722,7 @@ namespace Wixl {
time_to_filetime (now ()));
info.set_property (Libmsi.Property.LASTSAVED_TM,
time_to_filetime (now ()));
- info.set_property (Libmsi.Property.VERSION, 100);
+ 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);
@@ -779,8 +788,8 @@ namespace Wixl {
}
}
- public MsiDatabase () {
- // empty ctor
+ public MsiDatabase (Arch arch) {
+ Object (arch: arch);
}
public void build (string filename) throws GLib.Error {