summaryrefslogtreecommitdiffstats
path: root/tools/wixl/msi.vala
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-01-15 15:20:21 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-01-15 20:05:56 +0100
commitd34198c2c034348329af4ce183cd5db74d4e53dd (patch)
tree61202ae6d1416863978d7b54f4b2135604f3ccd1 /tools/wixl/msi.vala
parente76a29489704dcea0d003dd52a3ee6d7ae6ad257 (diff)
downloadmsitools-d34198c2c034348329af4ce183cd5db74d4e53dd.tar.gz
msitools-d34198c2c034348329af4ce183cd5db74d4e53dd.tar.xz
msitools-d34198c2c034348329af4ce183cd5db74d4e53dd.zip
wixl: improve shortcut support
To support such construction: <DirectoryRef Id="DirMenu"> <Component Id="CShortcut" Guid="*"> <Shortcut Id="ApplicationStartMenuShortcut" Name="Remote viewer" Description="A SPICE/VNC client" Target="[INSTALLDIR]\bin\remote-viewer.exe" Icon="IcoVirtViewer"/> <RemoveFolder Id="MENUDIR" On="uninstall"/> <RegistryValue Root="HKCU" Key="Software\VirtViewer\remote-viewer-shortcut" Name="installed" Type="integer" Value="1" KeyPath="yes"/> </Component> </DirectoryRef>
Diffstat (limited to 'tools/wixl/msi.vala')
-rw-r--r--tools/wixl/msi.vala19
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/wixl/msi.vala b/tools/wixl/msi.vala
index b0cf423..b847720 100644
--- a/tools/wixl/msi.vala
+++ b/tools/wixl/msi.vala
@@ -397,11 +397,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`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
+ sql_insert = "INSERT INTO `Shortcut` (`Shortcut`, `Directory_`, `Name`, `Component_`, `Target`, `Icon_`, `IconIndex`, `WkDir`, `Description`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
}
public Libmsi.Record add (string Shortcut, string Directory, string Name, string Component) throws GLib.Error {
- var rec = new Libmsi.Record (8);
+ var rec = new Libmsi.Record (9);
if (!rec.set_string (1, Shortcut) ||
!rec.set_string (2, Directory) ||
@@ -419,9 +419,13 @@ namespace Wixl {
throw new Wixl.Error.FAILED ("failed to set record");
}
- public static void set_icon (Libmsi.Record rec, string Icon, int IconIndex) throws GLib.Error {
- if (!rec.set_string (6, Icon) ||
- !rec.set_int (7, IconIndex))
+ public static void set_icon (Libmsi.Record rec, string Icon) throws GLib.Error {
+ if (!rec.set_string (6, Icon))
+ throw new Wixl.Error.FAILED ("failed to set record");
+ }
+
+ public static void set_icon_index (Libmsi.Record rec, int IconIndex) throws GLib.Error {
+ if (!rec.set_int (7, IconIndex))
throw new Wixl.Error.FAILED ("failed to set record");
}
@@ -429,6 +433,11 @@ namespace Wixl {
if (!rec.set_string (8, WkDir))
throw new Wixl.Error.FAILED ("failed to set record");
}
+
+ public static void set_description (Libmsi.Record rec, string Description) throws GLib.Error {
+ if (!rec.set_string (9, Description))
+ throw new Wixl.Error.FAILED ("failed to set record");
+ }
}
class MsiTableRemoveFile: MsiTable {