Zebediah Figura : msi: Add support for ActionText table.
Alexandre Julliard
julliard at winehq.org
Tue Aug 8 07:36:39 CDT 2017
Module: wine
Branch: master
Commit: 52fbaeb2c44e585cacd7f0b57e902dfbcf54d09b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=52fbaeb2c44e585cacd7f0b57e902dfbcf54d09b
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Sun Jul 23 20:49:05 2017 -0500
msi: Add support for ActionText table.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msi/action.c | 15 ++++++++++++++-
dlls/msi/tests/package.c | 25 +++++++++++++++++++++++--
2 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index b521925..64e01c4 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -160,13 +160,26 @@ static const WCHAR szWriteEnvironmentStrings[] =
static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
{
- MSIRECORD *row = MSI_CreateRecord(3);
+ WCHAR query[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
+ '`','A','c','t','i','o','n','T','e','x','t','`',' ','W','H','E','R','E',' ',
+ '`','A','c','t','i','o','n','`',' ','=',' ','\'','%','s','\'',0};
+ MSIRECORD *row, *textrow;
INT rc;
+
+ textrow = MSI_QueryGetRecord(package->db, query, action);
+ if (textrow)
+ {
+ description = MSI_RecordGetString(textrow, 2);
+ template = MSI_RecordGetString(textrow, 3);
+ }
+
+ row = MSI_CreateRecord(3);
if (!row) return -1;
MSI_RecordSetStringW(row, 1, action);
MSI_RecordSetStringW(row, 2, description);
MSI_RecordSetStringW(row, 3, template);
rc = MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, row);
+ if (textrow) msiobj_release(&textrow->hdr);
msiobj_release(&row->hdr);
return rc;
}
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index c10488a..c00ed61 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -687,6 +687,16 @@ static UINT create_controlevent_table( MSIHANDLE hdb )
"PRIMARY KEY `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`)");
}
+static UINT create_actiontext_table( MSIHANDLE hdb )
+{
+ return run_query(hdb,
+ "CREATE TABLE `ActionText` ("
+ "`Action` CHAR(72) NOT NULL, "
+ "`Description` CHAR(64) LOCALIZABLE, "
+ "`Template` CHAR(128) LOCALIZABLE "
+ "PRIMARY KEY `Action`)");
+}
+
#define make_add_entry(type, qtext) \
static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
{ \
@@ -782,6 +792,10 @@ make_add_entry(controlevent,
"INSERT INTO `ControlEvent` "
"(`Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering`) VALUES( %s )");
+make_add_entry(actiontext,
+ "INSERT INTO `ActionText` "
+ "(`Action`, `Description`, `Template`) VALUES( %s )");
+
static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char *path,
const char *name, UINT type )
{
@@ -9394,14 +9408,14 @@ static const struct externalui_message processmessage_error_format_sequence[] =
};
static const struct externalui_message doaction_costinitialize_sequence[] = {
- {INSTALLMESSAGE_ACTIONSTART, 3, {"", "CostInitialize", "", ""}, {0, 1, 0, 1}},
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "CostInitialize", "cost description", "cost template"}, {0, 1, 1, 1}},
{INSTALLMESSAGE_INFO, 2, {"", "CostInitialize", ""}, {0, 1, 1}},
{INSTALLMESSAGE_INFO, 2, {"", "CostInitialize", "1"}, {0, 1, 1}},
{0}
};
static const struct externalui_message doaction_custom_sequence[] = {
- {INSTALLMESSAGE_ACTIONSTART, 3, {"", "custom", "", ""}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "custom", "description", "template"}, {0, 1, 1, 1}},
{INSTALLMESSAGE_INFO, 2, {"", "custom", "1"}, {0, 1, 1}},
{INSTALLMESSAGE_INFO, 2, {"", "custom", "0"}, {0, 1, 1}},
{0}
@@ -9540,6 +9554,13 @@ static void test_externalui_message(void)
r = run_query(hdb, "INSERT INTO `Error` (`Error`, `Message`) VALUES (5, 'internal error')");
ok(r == ERROR_SUCCESS, "Failed to insert into Error table: %u\n", r);
+ r = create_actiontext_table(hdb);
+ ok(r == ERROR_SUCCESS, "Failed to create ActionText table: %u\n", r);
+ r = add_actiontext_entry(hdb, "'custom', 'description', 'template'");
+ ok(r == ERROR_SUCCESS, "Failed to insert into ActionText table: %u\n", r);
+ r = add_actiontext_entry(hdb, "'CostInitialize', 'cost description', 'cost template'");
+ ok(r == ERROR_SUCCESS, "Failed to insert into ActionText table: %u\n", r);
+
r = MsiOpenPackageA(NULL, &hpkg);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok_sequence(empty_sequence, "MsiOpenPackage with NULL db", FALSE);
More information about the wine-cvs
mailing list