diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala index 55bb4b64ba7164d026672f356ab4052957107826..1b67e0a17247ac901dfef4ebbda0c3efb663f876 100644 --- a/tools/wixl/builder.vala +++ b/tools/wixl/builder.vala @@ -685,8 +685,9 @@ namespace Wixl { FileInfo info; file.file = find_file (source, out info); var attr = FileAttribute.VITAL; - - var rec = db.table_file.add (file.Id, comp.Id, name, (int)info.get_size (), attr); + + var rec = db.table_file.add (file.Id, comp.Id, name, (int)info.get_size (), attr, file.DefaultVersion, file.DefaultLanguage); + rec.set_data ("wixfile", file); visit_key_element (file); diff --git a/tools/wixl/msi.vala b/tools/wixl/msi.vala index 171272e47c196d8ee9445a2d88b25345853b97ac..0fafd3f0ac7f12d8f969a42becf7c3cbb6396346 100644 --- a/tools/wixl/msi.vala +++ b/tools/wixl/msi.vala @@ -265,19 +265,28 @@ namespace Wixl { static construct { name = "File"; sql_create = "CREATE TABLE `File` (`File` CHAR(72) NOT NULL, `Component_` CHAR(72) NOT NULL, `FileName` CHAR(255) NOT NULL LOCALIZABLE, `FileSize` LONG NOT NULL, `Version` CHAR(72), `Language` CHAR(20), `Attributes` INT, `Sequence` LONG NOT NULL PRIMARY KEY `File`)"; - sql_insert = "INSERT INTO `File` (`File`, `Component_`, `FileName`, `FileSize`, `Attributes`, `Sequence`) VALUES (?, ?, ?, ?, ?, ?)"; + sql_insert = "INSERT INTO `File` (`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; } - public Libmsi.Record add (string File, string Component, string FileName, int FileSize, int Attributes, int Sequence = 1) throws GLib.Error { - var rec = new Libmsi.Record (6); - - if (!rec.set_string (1, File) || - !rec.set_string (2, Component) || - !rec.set_string (3, FileName) || - !rec.set_int (4, FileSize) || - !rec.set_int (5, Attributes) || - !rec.set_int (6, Sequence)) - throw new Wixl.Error.FAILED ("failed to add record"); + public Libmsi.Record add (string File, string Component, string FileName, int FileSize, int Attributes, string Version, string Language, int Sequence = 1) throws GLib.Error { + var rec = new Libmsi.Record (8); + + if (!rec.set_string (1, File) ) + throw new Wixl.Error.FAILED ("failed to add record 1"); + if (!rec.set_string (2, Component)) + throw new Wixl.Error.FAILED ("failed to add record 2"); + if (!rec.set_string (3, FileName)) + throw new Wixl.Error.FAILED ("failed to add record 3"); + if (!rec.set_int (4, FileSize) ) + throw new Wixl.Error.FAILED ("failed to add record 4"); + if (!rec.set_string (5, Version) ) + throw new Wixl.Error.FAILED ("failed to add record 5"); + if (!rec.set_string (6, Language)) + throw new Wixl.Error.FAILED ("failed to add record 6"); + if (!rec.set_int (7, Attributes)) + throw new Wixl.Error.FAILED ("failed to add record 7"); + if (!rec.set_int (8, Sequence) ) + throw new Wixl.Error.FAILED ("failed to add record 8"); records.append (rec); @@ -285,7 +294,7 @@ namespace Wixl { } public static bool set_sequence (Libmsi.Record rec, int Sequence) { - return rec.set_int (6, Sequence); + return rec.set_int (8, Sequence); } } diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala index 12af37e2fda06f3aeb4a4b6c5d53bebb9b8c800b..d0d716517006efa4aef0953dcaf2ad0c4da8e155 100644 --- a/tools/wixl/wix.vala +++ b/tools/wixl/wix.vala @@ -416,6 +416,8 @@ namespace Wixl { public string DiskId { get; set; } public string Source { get; set; } public string Name { get; set; } + public string DefaultVersion { get; set; } + public string DefaultLanguage { get; set; } public File file;