[msitools: 1/2] wxi: support Arguments attribute in shortcuts
- From: Marc-André Lureau <malureau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [msitools: 1/2] wxi: support Arguments attribute in shortcuts
- Date: Mon, 4 Mar 2019 11:07:55 +0000 (UTC)
commit 202ad7ccda2cbe158fbfab5392dfb0ccdb5791dd
Author: Alberto Mardegan <mardy users sourceforge net>
Date: Thu Oct 26 23:07:12 2017 +0300
wxi: support Arguments attribute in shortcuts
Add support for the "Arguments" attribute in shortcuts. This can be used
to specify additional parameters to the command being launched.
Signed-off-by: Alberto Mardegan <mardy users sourceforge net>
tools/wixl/builder.vala | 2 ++
tools/wixl/msi.vala | 9 +++++++--
tools/wixl/wix.vala | 1 +
3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 566a73a..3ad7fab 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -715,6 +715,8 @@ namespace Wixl {
MsiTableShortcut.set_target (rec, shortcut.Target);
if (shortcut.Description != null)
MsiTableShortcut.set_description (rec, shortcut.Description);
+ if (shortcut.Arguments != null)
+ MsiTableShortcut.set_arguments (rec, shortcut.Arguments);
}
public override void visit_sequence (WixSequence sequence) throws GLib.Error {
diff --git a/tools/wixl/msi.vala b/tools/wixl/msi.vala
index f1d45bf..d3ba1a5 100644
--- a/tools/wixl/msi.vala
+++ b/tools/wixl/msi.vala
@@ -451,11 +451,11 @@ namespace Wixl {
static construct {
name = "Shortcut";
sql_create = "CREATE TABLE `Shortcut` (`Shortcut` CHAR(72) NOT NULL, `Directory_` CHAR(72) NOT
NULL, `Name` CHAR(128) NOT NULL LOCALIZABLE, `Component_` CHAR(72) NOT NULL, `Target` CHAR(72) NOT NULL,
`Arguments` CHAR(255), `Description` CHAR(255) LOCALIZABLE, `Hotkey` INT, `Icon_` CHAR(72), `IconIndex` INT,
`ShowCmd` INT, `WkDir` CHAR(72), `DisplayResourceDLL` CHAR(255), `DisplayResourceId` INT,
`DescriptionResourceDLL` CHAR(255), `DescriptionResourceId` INT PRIMARY KEY `Shortcut`)";
- sql_insert = "INSERT INTO `Shortcut` (`Shortcut`, `Directory_`, `Name`, `Component_`, `Target`,
`Icon_`, `IconIndex`, `WkDir`, `Description`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ sql_insert = "INSERT INTO `Shortcut` (`Shortcut`, `Directory_`, `Name`, `Component_`, `Target`,
`Icon_`, `IconIndex`, `WkDir`, `Description`, `Arguments`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
}
public Libmsi.Record add (string Shortcut, string Directory, string Name, string Component) throws
GLib.Error {
- var rec = new Libmsi.Record (9);
+ var rec = new Libmsi.Record (10);
if (!rec.set_string (1, Shortcut) ||
!rec.set_string (2, Directory) ||
@@ -492,6 +492,11 @@ namespace Wixl {
if (!rec.set_string (9, Description))
throw new Wixl.Error.FAILED ("failed to set record");
}
+
+ public static void set_arguments (Libmsi.Record rec, string Arguments) throws GLib.Error {
+ if (!rec.set_string (10, Arguments))
+ throw new Wixl.Error.FAILED ("failed to set record");
+ }
}
class MsiTableCreateFolder: MsiTable {
diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala
index 6ccccf1..f522793 100644
--- a/tools/wixl/wix.vala
+++ b/tools/wixl/wix.vala
@@ -380,6 +380,7 @@ namespace Wixl {
public string WorkingDirectory { get; set; }
public string Icon { get; set; }
public string Advertise { get; set; }
+ public string Arguments { get; set; }
public string Description { get; set; }
public string Target { get; set; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]