https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f860a7802ce55e530a3d9…
commit f860a7802ce55e530a3d9e4ea0cba7ea30440f1b
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sat Jan 20 12:30:30 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sat Jan 20 12:30:30 2018 +0100
[MSI_WINETEST] Sync with Wine 3.0. CORE-14225
---
modules/rostests/winetests/msi/db.c | 173 +-
modules/rostests/winetests/msi/format.c | 511 ------
modules/rostests/winetests/msi/install.c | 281 +--
modules/rostests/winetests/msi/package.c | 2883 ++++++++++++++----------------
modules/rostests/winetests/msi/record.c | 10 +-
5 files changed, 1528 insertions(+), 2330 deletions(-)
diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c
index 5f0738d845..15fb93c82e 100644
--- a/modules/rostests/winetests/msi/db.c
+++ b/modules/rostests/winetests/msi/db.c
@@ -193,7 +193,7 @@ static UINT run_queryW( MSIHANDLE hdb, MSIHANDLE hrec, const WCHAR
*query )
static UINT create_component_table( MSIHANDLE hdb )
{
- return run_query( hdb, 0,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `Component` ( "
"`Component` CHAR(72) NOT NULL, "
"`ComponentId` CHAR(38), "
@@ -202,87 +202,99 @@ static UINT create_component_table( MSIHANDLE hdb )
"`Condition` CHAR(255), "
"`KeyPath` CHAR(72) "
"PRIMARY KEY `Component`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create Component table: %u\n", r);
+ return r;
}
static UINT create_custom_action_table( MSIHANDLE hdb )
{
- return run_query( hdb, 0,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `CustomAction` ( "
"`Action` CHAR(72) NOT NULL, "
"`Type` SHORT NOT NULL, "
"`Source` CHAR(72), "
"`Target` CHAR(255) "
"PRIMARY KEY `Action`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create CustomAction table: %u\n", r);
+ return r;
}
static UINT create_directory_table( MSIHANDLE hdb )
{
- return run_query( hdb, 0,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `Directory` ( "
"`Directory` CHAR(255) NOT NULL, "
"`Directory_Parent` CHAR(255), "
"`DefaultDir` CHAR(255) NOT NULL "
"PRIMARY KEY `Directory`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create Directory table: %u\n", r);
+ return r;
}
static UINT create_feature_components_table( MSIHANDLE hdb )
{
- return run_query( hdb, 0,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `FeatureComponents` ( "
"`Feature_` CHAR(38) NOT NULL, "
"`Component_` CHAR(72) NOT NULL "
"PRIMARY KEY `Feature_`, `Component_` )" );
+ ok(r == ERROR_SUCCESS, "Failed to create FeatureComponents table: %u\n",
r);
+ return r;
}
static UINT create_std_dlls_table( MSIHANDLE hdb )
{
- return run_query( hdb, 0,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `StdDlls` ( "
"`File` CHAR(255) NOT NULL, "
"`Binary_` CHAR(72) NOT NULL "
"PRIMARY KEY `File` )" );
+ ok(r == ERROR_SUCCESS, "Failed to create StdDlls table: %u\n", r);
+ return r;
}
static UINT create_binary_table( MSIHANDLE hdb )
{
- return run_query( hdb, 0,
- "CREATE TABLE `Binary` ( "
+ UINT r = run_query( hdb, 0,
+ "CREATE TABLE `Binary` ( "
"`Name` CHAR(72) NOT NULL, "
"`Data` CHAR(72) NOT NULL "
"PRIMARY KEY `Name` )" );
+ ok(r == ERROR_SUCCESS, "Failed to create Binary table: %u\n", r);
+ return r;
}
-#define make_add_entry(type, qtext) \
- static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
- { \
- char insert[] = qtext; \
- char *query; \
- UINT sz, r; \
- sz = strlen(values) + sizeof insert; \
- query = HeapAlloc(GetProcessHeap(),0,sz); \
- sprintf(query,insert,values); \
- r = run_query( hdb, 0, query ); \
- HeapFree(GetProcessHeap(), 0, query); \
- return r; \
- }
+static inline UINT add_entry(const char *file, int line, const char *type, MSIHANDLE hdb,
const char *values, const char *insert)
+{
+ char *query;
+ UINT sz, r;
+
+ sz = strlen(values) + strlen(insert) + 1;
+ query = HeapAlloc(GetProcessHeap(), 0, sz);
+ sprintf(query, insert, values);
+ r = run_query(hdb, 0, query);
+ HeapFree(GetProcessHeap(), 0, query);
+ ok_(file, line)(r == ERROR_SUCCESS, "failed to insert into %s table: %u\n",
type, r);
+ return r;
+}
-make_add_entry(component,
- "INSERT INTO `Component` "
- "(`Component`, `ComponentId`, `Directory_`, "
+#define add_component_entry(hdb, values) add_entry(__FILE__, __LINE__,
"Component", hdb, values, \
+ "INSERT INTO `Component` " \
+ "(`Component`, `ComponentId`, `Directory_`, " \
"`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
-make_add_entry(custom_action,
- "INSERT INTO `CustomAction` "
+#define add_custom_action_entry(hdb, values) add_entry(__FILE__, __LINE__,
"CustomAction", hdb, values, \
+ "INSERT INTO `CustomAction` " \
"(`Action`, `Type`, `Source`, `Target`) VALUES( %s )")
-make_add_entry(feature_components,
- "INSERT INTO `FeatureComponents` "
+#define add_feature_components_entry(hdb, values) add_entry(__FILE__, __LINE__,
"FeatureComponents", hdb, values, \
+ "INSERT INTO `FeatureComponents` " \
"(`Feature_`, `Component_`) VALUES( %s )")
-make_add_entry(std_dlls,
+#define add_std_dlls_entry(hdb, values) add_entry(__FILE__, __LINE__,
"StdDlls", hdb, values, \
"INSERT INTO `StdDlls` (`File`, `Binary_`) VALUES( %s )")
-make_add_entry(binary,
+#define add_binary_entry(hdb, values) add_entry(__FILE__, __LINE__, "Binary",
hdb, values, \
"INSERT INTO `Binary` (`Name`, `Data`) VALUES( %s )")
static void test_msiinsert(void)
@@ -3117,8 +3129,7 @@ static MSIHANDLE create_package_db(const WCHAR *filename)
res = set_summary_info(hdb);
ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
- res = create_directory_table(hdb);
- ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
+ create_directory_table(hdb);
return hdb;
}
@@ -3447,62 +3458,28 @@ static void test_join(void)
hdb = create_db();
ok( hdb, "failed to create db\n");
- r = create_component_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
-
- r = add_component_entry( hdb, "'zygomatic', 'malar',
'INSTALLDIR', 0, '', ''" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = add_component_entry( hdb, "'maxilla', 'alveolar',
'INSTALLDIR', 0, '', ''" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = add_component_entry( hdb, "'nasal', 'septum',
'INSTALLDIR', 0, '', ''" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = add_component_entry( hdb, "'mandible', 'ramus',
'INSTALLDIR', 0, '', ''" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = create_feature_components_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r
);
-
- r = add_feature_components_entry( hdb, "'procerus',
'maxilla'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'procerus',
'nasal'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'nasalis', 'nasal'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'nasalis',
'mandible'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'nasalis',
'notacomponent'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'mentalis',
'zygomatic'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = create_std_dlls_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create StdDlls table: %d\n", r );
-
- r = add_std_dlls_entry( hdb, "'msvcp.dll',
'msvcp.dll.01234'" );
- ok( r == ERROR_SUCCESS, "cannot add std dlls: %d\n", r );
-
- r = add_std_dlls_entry( hdb, "'msvcr.dll',
'msvcr.dll.56789'" );
- ok( r == ERROR_SUCCESS, "cannot add std dlls: %d\n", r );
-
- r = create_binary_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Binary table: %d\n", r );
-
- r = add_binary_entry( hdb, "'msvcp.dll.01234', 'abcdefgh'"
);
- ok( r == ERROR_SUCCESS, "cannot add binary: %d\n", r );
-
- r = add_binary_entry( hdb, "'msvcr.dll.56789', 'ijklmnop'"
);
- ok( r == ERROR_SUCCESS, "cannot add binary: %d\n", r );
-
- r = add_binary_entry( hdb, "'single.dll.31415',
'msvcp.dll'" );
- ok( r == ERROR_SUCCESS, "cannot add binary: %d\n", r );
+ create_component_table( hdb );
+ add_component_entry( hdb, "'zygomatic', 'malar',
'INSTALLDIR', 0, '', ''" );
+ add_component_entry( hdb, "'maxilla', 'alveolar',
'INSTALLDIR', 0, '', ''" );
+ add_component_entry( hdb, "'nasal', 'septum',
'INSTALLDIR', 0, '', ''" );
+ add_component_entry( hdb, "'mandible', 'ramus',
'INSTALLDIR', 0, '', ''" );
+
+ create_feature_components_table( hdb );
+ add_feature_components_entry( hdb, "'procerus', 'maxilla'"
);
+ add_feature_components_entry( hdb, "'procerus', 'nasal'"
);
+ add_feature_components_entry( hdb, "'nasalis', 'nasal'" );
+ add_feature_components_entry( hdb, "'nasalis', 'mandible'"
);
+ add_feature_components_entry( hdb, "'nasalis',
'notacomponent'" );
+ add_feature_components_entry( hdb, "'mentalis',
'zygomatic'" );
+
+ create_std_dlls_table( hdb );
+ add_std_dlls_entry( hdb, "'msvcp.dll', 'msvcp.dll.01234'"
);
+ add_std_dlls_entry( hdb, "'msvcr.dll', 'msvcr.dll.56789'"
);
+
+ create_binary_table( hdb );
+ add_binary_entry( hdb, "'msvcp.dll.01234', 'abcdefgh'" );
+ add_binary_entry( hdb, "'msvcr.dll.56789', 'ijklmnop'" );
+ add_binary_entry( hdb, "'single.dll.31415', 'msvcp.dll'"
);
query = "CREATE TABLE `One` (`A` SHORT, `B` SHORT PRIMARY KEY `A`)";
r = run_query( hdb, 0, query);
@@ -4790,7 +4767,7 @@ static void test_update(void)
MsiCloseHandle(rec);
r = MsiViewFetch(view, &rec);
- ok(r == ERROR_NO_MORE_ITEMS, "Expectd ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
MsiViewClose(view);
MsiCloseHandle(view);
@@ -7657,14 +7634,10 @@ static void test_dbtopackage(void)
set_summary_info(hdb);
- r = create_directory_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_directory_table(hdb);
- r = create_custom_action_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_custom_action_entry(hdb, "'SetProp', 51, 'MYPROP',
'grape'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_custom_action_table(hdb);
+ add_custom_action_entry(hdb, "'SetProp', 51, 'MYPROP',
'grape'");
sprintf(package, "#%u", hdb);
r = MsiOpenPackageA(package, &hpkg);
@@ -7721,14 +7694,10 @@ static void test_dbtopackage(void)
set_summary_info(hdb);
- r = create_directory_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_custom_action_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_directory_table(hdb);
- r = add_custom_action_entry(hdb, "'SetProp', 51, 'MYPROP',
'grape'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_custom_action_table(hdb);
+ add_custom_action_entry(hdb, "'SetProp', 51, 'MYPROP',
'grape'");
sprintf(package, "#%u", hdb);
r = MsiOpenPackageA(package, &hpkg);
diff --git a/modules/rostests/winetests/msi/format.c
b/modules/rostests/winetests/msi/format.c
index a8bd290069..cc00af063f 100644
--- a/modules/rostests/winetests/msi/format.c
+++ b/modules/rostests/winetests/msi/format.c
@@ -22,206 +22,6 @@
#include "precomp.h"
static const char msifile[] = "winetest-format.msi";
-static const WCHAR msifileW[] =
-
{'w','i','n','e','t','e','s','t','-','f','o','r','m','a','t','.','m','s','i',0};
-
-static UINT run_query( MSIHANDLE hdb, const char *query )
-{
- MSIHANDLE hview = 0;
- UINT r;
-
- r = MsiDatabaseOpenViewA(hdb, query, &hview);
- if( r != ERROR_SUCCESS )
- return r;
-
- r = MsiViewExecute(hview, 0);
- if( r == ERROR_SUCCESS )
- r = MsiViewClose(hview);
- MsiCloseHandle(hview);
- return r;
-}
-
-static UINT create_feature_table( MSIHANDLE hdb )
-{
- return run_query( hdb,
- "CREATE TABLE `Feature` ( "
- "`Feature` CHAR(38) NOT NULL, "
- "`Feature_Parent` CHAR(38), "
- "`Title` CHAR(64), "
- "`Description` CHAR(255), "
- "`Display` SHORT NOT NULL, "
- "`Level` SHORT NOT NULL, "
- "`Directory_` CHAR(72), "
- "`Attributes` SHORT NOT NULL "
- "PRIMARY KEY `Feature`)" );
-}
-
-static UINT create_component_table( MSIHANDLE hdb )
-{
- return run_query( hdb,
- "CREATE TABLE `Component` ( "
- "`Component` CHAR(72) NOT NULL, "
- "`ComponentId` CHAR(38), "
- "`Directory_` CHAR(72) NOT NULL, "
- "`Attributes` SHORT NOT NULL, "
- "`Condition` CHAR(255), "
- "`KeyPath` CHAR(72) "
- "PRIMARY KEY `Component`)" );
-}
-
-static UINT create_feature_components_table( MSIHANDLE hdb )
-{
- return run_query( hdb,
- "CREATE TABLE `FeatureComponents` ( "
- "`Feature_` CHAR(38) NOT NULL, "
- "`Component_` CHAR(72) NOT NULL "
- "PRIMARY KEY `Feature_`, `Component_` )" );
-}
-
-static UINT create_file_table( MSIHANDLE hdb )
-{
- return run_query( hdb,
- "CREATE TABLE `File` ("
- "`File` CHAR(72) NOT NULL, "
- "`Component_` CHAR(72) NOT NULL, "
- "`FileName` CHAR(255) NOT NULL, "
- "`FileSize` LONG NOT NULL, "
- "`Version` CHAR(72), "
- "`Language` CHAR(20), "
- "`Attributes` SHORT, "
- "`Sequence` SHORT NOT NULL "
- "PRIMARY KEY `File`)" );
-}
-
-static UINT create_custom_action_table( MSIHANDLE hdb )
-{
- return run_query( hdb,
- "CREATE TABLE `CustomAction` ("
- "`Action` CHAR(72) NOT NULL, "
- "`Type` SHORT NOT NULL, "
- "`Source` CHAR(75), "
- "`Target` CHAR(255) "
- "PRIMARY KEY `Action`)" );
-}
-
-#define make_add_entry(type, qtext) \
- static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
- { \
- char insert[] = qtext; \
- char *query; \
- UINT sz, r; \
- sz = strlen(values) + sizeof insert; \
- query = HeapAlloc(GetProcessHeap(),0,sz); \
- sprintf(query,insert,values); \
- r = run_query( hdb, query ); \
- HeapFree(GetProcessHeap(), 0, query); \
- return r; \
- }
-
-make_add_entry(feature,
- "INSERT INTO `Feature` "
- "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
- "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
-
-make_add_entry(component,
- "INSERT INTO `Component` "
- "(`Component`, `ComponentId`, `Directory_`, "
- "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
-
-make_add_entry(feature_components,
- "INSERT INTO `FeatureComponents` "
- "(`Feature_`, `Component_`) VALUES( %s )")
-
-make_add_entry(file,
- "INSERT INTO `File` "
- "(`File`, `Component_`, `FileName`, `FileSize`, "
- "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s
)")
-
-make_add_entry(directory,
- "INSERT INTO `Directory` "
- "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
-
-make_add_entry(custom_action,
- "INSERT INTO `CustomAction` "
- "(`Action`, `Type`, `Source`, `Target`) VALUES( %s )")
-
-static UINT set_summary_info(MSIHANDLE hdb)
-{
- UINT res;
- MSIHANDLE suminfo;
-
- /* build summary info */
- res = MsiGetSummaryInformationA(hdb, NULL, 7, &suminfo);
- ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
-
- res = MsiSummaryInfoSetPropertyA(suminfo,2, VT_LPSTR, 0,NULL,
- "Installation Database");
- ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
-
- res = MsiSummaryInfoSetPropertyA(suminfo,3, VT_LPSTR, 0,NULL,
- "Installation Database");
- ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
-
- res = MsiSummaryInfoSetPropertyA(suminfo,4, VT_LPSTR, 0,NULL,
- "Wine Hackers");
- ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
-
- res = MsiSummaryInfoSetPropertyA(suminfo,7, VT_LPSTR, 0,NULL,
- ";1033");
- ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
-
- res = MsiSummaryInfoSetPropertyA(suminfo,9, VT_LPSTR, 0,NULL,
- "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
- ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
-
- res = MsiSummaryInfoSetPropertyA(suminfo, 14, VT_I4, 100, NULL, NULL);
- ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
-
- res = MsiSummaryInfoSetPropertyA(suminfo, 15, VT_I4, 0, NULL, NULL);
- ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
-
- res = MsiSummaryInfoPersist(suminfo);
- ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
-
- res = MsiCloseHandle( suminfo);
- ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
-
- return res;
-}
-
-static MSIHANDLE create_package_db(void)
-{
- MSIHANDLE hdb = 0;
- UINT res;
-
- DeleteFileW(msifileW);
-
- /* create an empty database */
- res = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATEDIRECT, &hdb );
- ok( res == ERROR_SUCCESS , "Failed to create database %u\n", res );
- if( res != ERROR_SUCCESS )
- return 0;
-
- res = MsiDatabaseCommit( hdb );
- ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
- if( res != ERROR_SUCCESS )
- return 0;
-
- res = set_summary_info(hdb);
- ok( res == ERROR_SUCCESS , "Failed to set summary info %u\n", res );
- if( res != ERROR_SUCCESS )
- return 0;
-
- res = run_query( hdb,
- "CREATE TABLE `Directory` ( "
- "`Directory` CHAR(255) NOT NULL, "
- "`Directory_Parent` CHAR(255), "
- "`DefaultDir` CHAR(255) NOT NULL "
- "PRIMARY KEY `Directory`)" );
- ok( res == ERROR_SUCCESS , "Failed to create directory table %u\n", res );
-
- return hdb;
-}
static UINT package_from_db(MSIHANDLE hdb, MSIHANDLE *handle)
{
@@ -245,18 +45,6 @@ static UINT package_from_db(MSIHANDLE hdb, MSIHANDLE *handle)
return ERROR_SUCCESS;
}
-static void create_test_file(const CHAR *name)
-{
- HANDLE file;
- DWORD written;
-
- file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
- WriteFile(file, name, strlen(name), &written, NULL);
- WriteFile(file, "\n", strlen("\n"), &written, NULL);
- CloseHandle(file);
-}
-
static UINT helper_createpackage( const char *szName, MSIHANDLE *handle )
{
MSIHANDLE hPackage, suminfo, hdb = 0;
@@ -2476,304 +2264,6 @@ static void test_formatrecord_package(void)
DeleteFileA( msifile );
}
-static void test_formatrecord_tables(void)
-{
- MSIHANDLE hdb, hrec, hpkg = 0;
- CHAR buf[MAX_PATH];
- CHAR curr_dir[MAX_PATH];
- CHAR expected[MAX_PATH];
- CHAR root[MAX_PATH];
- DWORD size;
- UINT r;
-
- GetCurrentDirectoryA( MAX_PATH, curr_dir );
-
- hdb = create_package_db();
- ok ( hdb, "failed to create package database\n");
-
- r = add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'" );
- ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r);
-
- r = add_directory_entry( hdb, "'ReallyLongDir', 'TARGETDIR',
"
- "'I am a really long directory'" );
- ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r);
-
- r = create_feature_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r);
-
- r = add_feature_entry( hdb, "'occipitofrontalis', '',
'', '', 2, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
-
- r = create_component_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r);
-
- r = add_component_entry( hdb, "'frontal', '',
'TARGETDIR', 0, '', 'frontal_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r);
-
- r = add_component_entry( hdb, "'parietal', '',
'TARGETDIR', 1, '', 'parietal_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r);
-
- r = add_component_entry( hdb, "'temporal', '',
'ReallyLongDir', 0, '', 'temporal_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r);
-
- r = create_feature_components_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r);
-
- r = add_feature_components_entry( hdb, "'occipitofrontalis',
'frontal'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r);
-
- r = add_feature_components_entry( hdb, "'occipitofrontalis',
'parietal'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r);
-
- r = add_feature_components_entry( hdb, "'occipitofrontalis',
'temporal'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r);
-
- r = create_file_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r);
-
- r = add_file_entry( hdb, "'frontal_file', 'frontal',
'frontal.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'parietal_file', 'parietal',
'parietal.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'temporal_file', 'temporal',
'temporal.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = create_custom_action_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create CustomAction table: %d\n", r);
-
- r = add_custom_action_entry( hdb, "'MyCustom', 51, 'prop',
'[!temporal_file]'" );
- ok( r == ERROR_SUCCESS, "cannot add custom action: %d\n", r);
-
- r = add_custom_action_entry( hdb, "'EscapeIt1', 51, 'prop',
'[\\[]Bracket Text[\\]]'" );
- ok( r == ERROR_SUCCESS, "cannot add custom action: %d\n", r);
-
- r = add_custom_action_entry( hdb, "'EscapeIt2', 51, 'prop',
'[\\xabcd]'" );
- ok( r == ERROR_SUCCESS, "cannot add custom action: %d\n", r);
-
- r = add_custom_action_entry( hdb, "'EscapeIt3', 51, 'prop',
'[abcd\\xefgh]'" );
- ok( r == ERROR_SUCCESS, "cannot add custom action: %d\n", r);
-
- r = add_custom_action_entry( hdb, "'EmbedNull', 51, 'prop',
'[~]np'" );
- ok( r == ERROR_SUCCESS, "cannot add custom action: %d\n", r);
-
- r = package_from_db( hdb, &hpkg );
- if (r == ERROR_INSTALL_PACKAGE_REJECTED)
- {
- skip("Not enough rights to perform tests\n");
- MsiCloseHandle( hdb );
- DeleteFileA( msifile );
- return;
- }
- ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
-
- MsiCloseHandle( hdb );
-
- r = MsiSetPropertyA( hpkg, "imaprop", "ringer" );
- ok( r == ERROR_SUCCESS, "cannot set property: %d\n", r);
-
- hrec = MsiCreateRecord( 1 );
-
- /* property doesn't exist */
- size = MAX_PATH;
- /*MsiRecordSetStringA( hrec, 0, "[1]" ); */
- MsiRecordSetStringA( hrec, 1, "[idontexist]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, "1: " ), "Expected '1: ', got
%s\n", buf );
-
- /* property exists */
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 1, "[imaprop]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, "1: ringer " ), "Expected '1: ringer ',
got %s\n", buf );
-
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 0, "1: [1] " );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, "1: ringer " ), "Expected '1: ringer ',
got %s\n", buf );
-
- /* environment variable doesn't exist */
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 1, "[%idontexist]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, "1: " ), "Expected '1: ', got
%s\n", buf );
-
- /* environment variable exists */
- size = MAX_PATH;
- SetEnvironmentVariableA( "crazyvar", "crazyval" );
- MsiRecordSetStringA( hrec, 1, "[%crazyvar]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, "1: crazyval " ), "Expected '1: crazyval
', got %s\n", buf );
-
- /* file key before CostInitialize */
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 1, "[#frontal_file]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, "1: " ), "Expected '1: ', got
%s\n", buf );
-
- MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
-
- r = MsiDoActionA(hpkg, "CostInitialize");
- ok( r == ERROR_SUCCESS, "CostInitialize failed: %d\n", r);
-
- r = MsiDoActionA(hpkg, "FileCost");
- ok( r == ERROR_SUCCESS, "FileCost failed: %d\n", r);
-
- r = MsiDoActionA(hpkg, "CostFinalize");
- ok( r == ERROR_SUCCESS, "CostFinalize failed: %d\n", r);
-
- size = MAX_PATH;
- MsiGetPropertyA( hpkg, "ROOTDRIVE", root, &size );
-
- sprintf( expected, "1: %sfrontal.txt ", root);
-
- /* frontal full file key */
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 1, "[#frontal_file]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
-
- /* frontal short file key */
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 1, "[!frontal_file]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
-
- sprintf( expected, "1: %sI am a really long directory\\temporal.txt ",
root);
-
- /* temporal full file key */
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 1, "[#temporal_file]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
-
- /* temporal short file key */
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 1, "[!temporal_file]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
-
- /* custom action 51, files don't exist */
- r = MsiDoActionA( hpkg, "MyCustom" );
- ok( r == ERROR_SUCCESS, "MyCustom failed: %d\n", r);
-
- sprintf( expected, "%sI am a really long directory\\temporal.txt", root);
-
- size = MAX_PATH;
- r = MsiGetPropertyA( hpkg, "prop", buf, &size );
- ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
- ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
-
- sprintf( buf, "%sI am a really long directory", root );
- CreateDirectoryA( buf, NULL );
-
- lstrcatA( buf, "\\temporal.txt" );
- create_test_file( buf );
-
- /* custom action 51, files exist */
- r = MsiDoActionA( hpkg, "MyCustom" );
- ok( r == ERROR_SUCCESS, "MyCustom failed: %d\n", r);
-
- size = MAX_PATH;
- r = MsiGetPropertyA( hpkg, "prop", buf, &size );
- ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
- todo_wine
- {
- ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
- }
-
- /* custom action 51, escaped text 1 */
- r = MsiDoActionA( hpkg, "EscapeIt1" );
- ok( r == ERROR_SUCCESS, "EscapeIt1 failed: %d\n", r);
-
- size = MAX_PATH;
- r = MsiGetPropertyA( hpkg, "prop", buf, &size );
- ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
- ok( !lstrcmpA( buf, "[Bracket Text]" ), "Expected '[Bracket
Text]', got %s\n", buf);
-
- /* custom action 51, escaped text 2 */
- r = MsiDoActionA( hpkg, "EscapeIt2" );
- ok( r == ERROR_SUCCESS, "EscapeIt2 failed: %d\n", r);
-
- size = MAX_PATH;
- r = MsiGetPropertyA( hpkg, "prop", buf, &size );
- ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
- ok( !lstrcmpA( buf, "x" ), "Expected 'x', got %s\n",
buf);
-
- /* custom action 51, escaped text 3 */
- r = MsiDoActionA( hpkg, "EscapeIt3" );
- ok( r == ERROR_SUCCESS, "EscapeIt3 failed: %d\n", r);
-
- size = MAX_PATH;
- r = MsiGetPropertyA( hpkg, "prop", buf, &size );
- ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
- ok( !lstrcmpA( buf, "" ), "Expected '', got %s\n", buf);
-
- /* custom action 51, embedded null */
- r = MsiDoActionA( hpkg, "EmbedNull" );
- ok( r == ERROR_SUCCESS, "EmbedNull failed: %d\n", r);
-
- size = MAX_PATH;
- memset( buf, 'a', sizeof(buf) );
- r = MsiGetPropertyA( hpkg, "prop", buf, &size );
- ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
- ok( !memcmp( buf, "\0np", sizeof("\0np") ), "wrong
value\n");
- ok( size == sizeof("\0np") - 1, "got %u\n", size );
-
- r = MsiSetPropertyA( hpkg, "prop", "[~]np" );
- ok( r == ERROR_SUCCESS, "cannot set property: %d\n", r);
-
- size = MAX_PATH;
- memset( buf, 'a', sizeof(buf) );
- r = MsiGetPropertyA( hpkg, "prop", buf, &size );
- ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
- ok( !lstrcmpA( buf, "[~]np" ), "Expected '[~]np', got
%s\n", buf);
-
- sprintf( expected, "1: %sI am a really long directory\\ ", root);
-
- /* component with INSTALLSTATE_LOCAL */
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 1, "[$temporal]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
-
- r = MsiSetComponentStateA( hpkg, "temporal", INSTALLSTATE_SOURCE );
- ok( r == ERROR_SUCCESS, "failed to set install state: %d\n", r);
-
- /* component with INSTALLSTATE_SOURCE */
- lstrcpyA( expected, "1: " );
- lstrcatA( expected, curr_dir );
- if (strlen(curr_dir) > 3) lstrcatA( expected, "\\" );
- lstrcatA( expected, " " );
- size = MAX_PATH;
- MsiRecordSetStringA( hrec, 1, "[$parietal]" );
- r = MsiFormatRecordA( hpkg, hrec, buf, &size );
- ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
- ok( !lstrcmpA( buf, expected ), "Expected '%s', got
'%s'\n", expected, buf);
-
- sprintf( buf, "%sI am a really long directory\\temporal.txt", root );
- DeleteFileA( buf );
-
- sprintf( buf, "%sI am a really long directory", root );
- RemoveDirectoryA( buf );
-
- MsiCloseHandle( hrec );
- MsiCloseHandle( hpkg );
- DeleteFileA( msifile );
-}
-
static void test_processmessage(void)
{
MSIHANDLE hrec, package;
@@ -2845,6 +2335,5 @@ START_TEST(format)
test_createpackage();
test_formatrecord();
test_formatrecord_package();
- test_formatrecord_tables();
test_processmessage();
}
diff --git a/modules/rostests/winetests/msi/install.c
b/modules/rostests/winetests/msi/install.c
index 21ef1b2e79..2e08918b9e 100644
--- a/modules/rostests/winetests/msi/install.c
+++ b/modules/rostests/winetests/msi/install.c
@@ -1269,6 +1269,27 @@ static const char ft_install_exec_seq_dat[] =
"PublishProduct\t\t1400\n"
"InstallFinalize\t\t1500\n";
+static const char da_custom_action_dat[] =
+ "Action\tType\tSource\tTarget\tISComments\n"
+ "s72\ti2\tS64\tS0\tS255\n"
+ "CustomAction\tAction\n"
+ "deferred\t1074\tCMDEXE\t/c if exist msitest (exit 0) else (exit 1)\t\n"
+ "immediate\t50\tCMDEXE\t/c mkdir msitest\t\n"
+ "cleanup\t50\tCMDEXE\t/c rmdir msitest\t\n";
+
+static const char da_install_exec_seq_dat[] =
+ "Action\tCondition\tSequence\n"
+ "s72\tS255\tI2\n"
+ "InstallExecuteSequence\tAction\n"
+ "CostInitialize\t\t200\n"
+ "FileCost\t\t300\n"
+ "CostFinalize\t\t400\n"
+ "InstallInitialize\t\t500\n"
+ "deferred\t\t600\n"
+ "immediate\t\t700\n"
+ "InstallFinalize\t\t1100\n"
+ "cleanup\t\t1200\n";
+
typedef struct _msi_table
{
const CHAR *filename;
@@ -1923,6 +1944,19 @@ static const msi_table ft_tables[] =
ADD_TABLE(property)
};
+static const msi_table da_tables[] =
+{
+ ADD_TABLE(media),
+ ADD_TABLE(directory),
+ ADD_TABLE(file),
+ ADD_TABLE(component),
+ ADD_TABLE(feature),
+ ADD_TABLE(feature_comp),
+ ADD_TABLE(property),
+ ADD_TABLE(da_install_exec_seq),
+ ADD_TABLE(da_custom_action),
+};
+
/* cabinet definitions */
/* make the max size large so there is only one cab file */
@@ -2390,6 +2424,22 @@ static void delete_test_files(void)
RemoveDirectoryA("msitest");
}
+static void delete_pf_files(void)
+{
+ ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
+ ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
+ ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
+ ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
+ ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
+ ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest", FALSE), "Directory not created\n");
+}
+
static void write_file(const CHAR *filename, const char *data, int data_size)
{
DWORD size;
@@ -2570,18 +2620,7 @@ static void test_MsiInstallProduct(void)
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", 0,
access, &hkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
@@ -2617,18 +2656,7 @@ static void test_MsiInstallProduct(void)
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest",
&hkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
@@ -2640,18 +2668,7 @@ static void test_MsiInstallProduct(void)
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest",
&hkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
@@ -2663,18 +2680,7 @@ static void test_MsiInstallProduct(void)
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest",
&hkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
@@ -2686,18 +2692,7 @@ static void test_MsiInstallProduct(void)
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest",
&hkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
@@ -2709,18 +2704,7 @@ static void test_MsiInstallProduct(void)
r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest",
&hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n",
res);
@@ -2731,18 +2715,7 @@ static void test_MsiInstallProduct(void)
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest",
&hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n",
res);
@@ -2753,18 +2726,7 @@ static void test_MsiInstallProduct(void)
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest",
&hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n",
res);
@@ -2775,18 +2737,7 @@ static void test_MsiInstallProduct(void)
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest",
&hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n",
res);
@@ -2797,18 +2748,7 @@ static void test_MsiInstallProduct(void)
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest",
&hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n",
res);
@@ -3844,6 +3784,7 @@ static void test_admin(void)
ok(!RemoveDirectoryA("c:\\msitest"), "File installed\n");
r = MsiInstallProductA(msifile, "ACTION=ADMIN");
+ todo_wine
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
ok(!delete_pf("msitest", FALSE), "Directory created\n");
@@ -4721,18 +4662,7 @@ static void test_adminimage(void)
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
error:
DeleteFileA("msifile");
@@ -4900,19 +4830,8 @@ static void test_shortcut(void)
CoUninitialize();
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
while (!delete_pf("msitest\\Shortcut.lnk", TRUE) && GetLastError()
== ERROR_SHARING_VIOLATION) Sleep(1000);
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
error:
delete_test_files();
@@ -5006,18 +4925,7 @@ static void test_installed_prop(void)
r = MsiConfigureProductExA(prodcode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
"FULL=1");
ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n",
r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5051,18 +4959,7 @@ static void test_allusers_prop(void)
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5076,18 +4973,7 @@ static void test_allusers_prop(void)
r = MsiInstallProductA(msifile, "FULL=1");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5101,18 +4987,7 @@ static void test_allusers_prop(void)
r = MsiInstallProductA(msifile, "FULL=1");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\cabout", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\changed", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\first", FALSE), "Directory not
created\n");
- ok(delete_pf("msitest\\filename", TRUE), "File not
installed\n");
- ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
- ok(delete_pf("msitest\\service.exe", TRUE), "File not
installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
+ delete_pf_files();
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -6029,6 +5904,27 @@ static void test_feature_tree(void)
DeleteFileA( msifile );
}
+static void test_deferred_action(void)
+{
+ UINT r;
+
+ create_database(msifile, da_tables, sizeof(da_tables) / sizeof(da_tables[0]));
+
+ MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
+
+ r = MsiInstallProductA(msifile, "CMDEXE=\"cmd.exe\"");
+ if (r == ERROR_INSTALL_PACKAGE_REJECTED)
+ {
+ skip("Not enough rights to perform tests\n");
+ goto error;
+ }
+todo_wine
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
+
+error:
+ DeleteFileA(msifile);
+}
+
START_TEST(install)
{
DWORD len;
@@ -6117,6 +6013,7 @@ START_TEST(install)
test_shared_component();
test_remove_upgrade_code();
test_feature_tree();
+ test_deferred_action();
DeleteFileA(log_file);
diff --git a/modules/rostests/winetests/msi/package.c
b/modules/rostests/winetests/msi/package.c
index 6834bec6af..f29baa9d25 100644
--- a/modules/rostests/winetests/msi/package.c
+++ b/modules/rostests/winetests/msi/package.c
@@ -437,7 +437,7 @@ static UINT run_query( MSIHANDLE hdb, const char *query )
static UINT create_component_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `Component` ( "
"`Component` CHAR(72) NOT NULL, "
"`ComponentId` CHAR(38), "
@@ -446,11 +446,13 @@ static UINT create_component_table( MSIHANDLE hdb )
"`Condition` CHAR(255), "
"`KeyPath` CHAR(72) "
"PRIMARY KEY `Component`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create Component table: %u\n", r);
+ return r;
}
static UINT create_feature_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `Feature` ( "
"`Feature` CHAR(38) NOT NULL, "
"`Feature_Parent` CHAR(38), "
@@ -461,20 +463,24 @@ static UINT create_feature_table( MSIHANDLE hdb )
"`Directory_` CHAR(72), "
"`Attributes` SHORT NOT NULL "
"PRIMARY KEY `Feature`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create Feature table: %u\n", r);
+ return r;
}
static UINT create_feature_components_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `FeatureComponents` ( "
"`Feature_` CHAR(38) NOT NULL, "
"`Component_` CHAR(72) NOT NULL "
"PRIMARY KEY `Feature_`, `Component_` )" );
+ ok(r == ERROR_SUCCESS, "Failed to create FeatureComponents table: %u\n",
r);
+ return r;
}
static UINT create_file_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `File` ("
"`File` CHAR(72) NOT NULL, "
"`Component_` CHAR(72) NOT NULL, "
@@ -485,11 +491,13 @@ static UINT create_file_table( MSIHANDLE hdb )
"`Attributes` SHORT, "
"`Sequence` SHORT NOT NULL "
"PRIMARY KEY `File`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create File table: %u\n", r);
+ return r;
}
static UINT create_remove_file_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `RemoveFile` ("
"`FileKey` CHAR(72) NOT NULL, "
"`Component_` CHAR(72) NOT NULL, "
@@ -497,20 +505,24 @@ static UINT create_remove_file_table( MSIHANDLE hdb )
"`DirProperty` CHAR(72) NOT NULL, "
"`InstallMode` SHORT NOT NULL "
"PRIMARY KEY `FileKey`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create RemoveFile table: %u\n", r);
+ return r;
}
static UINT create_appsearch_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `AppSearch` ("
"`Property` CHAR(72) NOT NULL, "
"`Signature_` CHAR(72) NOT NULL "
"PRIMARY KEY `Property`, `Signature_`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create AppSearch table: %u\n", r);
+ return r;
}
static UINT create_reglocator_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `RegLocator` ("
"`Signature_` CHAR(72) NOT NULL, "
"`Root` SHORT NOT NULL, "
@@ -518,11 +530,13 @@ static UINT create_reglocator_table( MSIHANDLE hdb )
"`Name` CHAR(255), "
"`Type` SHORT "
"PRIMARY KEY `Signature_`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create RegLocator table: %u\n", r);
+ return r;
}
static UINT create_signature_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `Signature` ("
"`Signature` CHAR(72) NOT NULL, "
"`FileName` CHAR(255) NOT NULL, "
@@ -534,39 +548,59 @@ static UINT create_signature_table( MSIHANDLE hdb )
"`MaxDate` LONG, "
"`Languages` CHAR(255) "
"PRIMARY KEY `Signature`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create Signature table: %u\n", r);
+ return r;
}
static UINT create_launchcondition_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `LaunchCondition` ("
"`Condition` CHAR(255) NOT NULL, "
"`Description` CHAR(255) NOT NULL "
"PRIMARY KEY `Condition`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create LaunchCondition table: %u\n", r);
+ return r;
}
static UINT create_property_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `Property` ("
"`Property` CHAR(72) NOT NULL, "
"`Value` CHAR(0) "
"PRIMARY KEY `Property`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create Property table: %u\n", r);
+ return r;
}
static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `InstallExecuteSequence` ("
"`Action` CHAR(72) NOT NULL, "
"`Condition` CHAR(255), "
"`Sequence` SHORT "
"PRIMARY KEY `Action`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create InstallExecuteSequence table:
%u\n", r);
+ return r;
+}
+
+static UINT create_install_ui_sequence_table( MSIHANDLE hdb )
+{
+ UINT r = run_query( hdb,
+ "CREATE TABLE `InstallUISequence` ("
+ "`Action` CHAR(72) NOT NULL, "
+ "`Condition` CHAR(255), "
+ "`Sequence` SHORT "
+ "PRIMARY KEY `Action`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create InstallUISequence table: %u\n",
r);
+ return r;
}
static UINT create_media_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `Media` ("
"`DiskId` SHORT NOT NULL, "
"`LastSequence` SHORT NOT NULL, "
@@ -575,40 +609,48 @@ static UINT create_media_table( MSIHANDLE hdb )
"`VolumeLabel` CHAR(32), "
"`Source` CHAR(72) "
"PRIMARY KEY `DiskId`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create Media table: %u\n", r);
+ return r;
}
static UINT create_ccpsearch_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `CCPSearch` ("
"`Signature_` CHAR(72) NOT NULL "
"PRIMARY KEY `Signature_`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create CCPSearch table: %u\n", r);
+ return r;
}
static UINT create_drlocator_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `DrLocator` ("
"`Signature_` CHAR(72) NOT NULL, "
"`Parent` CHAR(72), "
"`Path` CHAR(255), "
"`Depth` SHORT "
"PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create DrLocator table: %u\n", r);
+ return r;
}
static UINT create_complocator_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `CompLocator` ("
"`Signature_` CHAR(72) NOT NULL, "
"`ComponentId` CHAR(38) NOT NULL, "
"`Type` SHORT "
"PRIMARY KEY `Signature_`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create CompLocator table: %u\n", r);
+ return r;
}
static UINT create_inilocator_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `IniLocator` ("
"`Signature_` CHAR(72) NOT NULL, "
"`FileName` CHAR(255) NOT NULL, "
@@ -617,22 +659,26 @@ static UINT create_inilocator_table( MSIHANDLE hdb )
"`Field` SHORT, "
"`Type` SHORT "
"PRIMARY KEY `Signature_`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create IniLocator table: %u\n", r);
+ return r;
}
static UINT create_custom_action_table( MSIHANDLE hdb )
{
- return run_query( hdb,
+ UINT r = run_query( hdb,
"CREATE TABLE `CustomAction` ("
"`Action` CHAR(72) NOT NULL, "
"`Type` SHORT NOT NULL, "
"`Source` CHAR(75), "
"`Target` CHAR(255) "
"PRIMARY KEY `Action`)" );
+ ok(r == ERROR_SUCCESS, "Failed to create CustomAction table: %u\n", r);
+ return r;
}
static UINT create_dialog_table( MSIHANDLE hdb )
{
- return run_query(hdb,
+ UINT r = run_query(hdb,
"CREATE TABLE `Dialog` ("
"`Dialog` CHAR(72) NOT NULL, "
"`HCentering` SHORT NOT NULL, "
@@ -645,11 +691,13 @@ static UINT create_dialog_table( MSIHANDLE hdb )
"`Control_Default` CHAR(50), "
"`Control_Cancel` CHAR(50) "
"PRIMARY KEY `Dialog`)");
+ ok(r == ERROR_SUCCESS, "Failed to create Dialog table: %u\n", r);
+ return r;
}
static UINT create_control_table( MSIHANDLE hdb )
{
- return run_query(hdb,
+ UINT r = run_query(hdb,
"CREATE TABLE `Control` ("
"`Dialog_` CHAR(72) NOT NULL, "
"`Control` CHAR(50) NOT NULL, "
@@ -664,11 +712,13 @@ static UINT create_control_table( MSIHANDLE hdb )
"`Control_Next` CHAR(50), "
"`Help` CHAR(255) LOCALIZABLE "
"PRIMARY KEY `Dialog_`, `Control`)");
+ ok(r == ERROR_SUCCESS, "Failed to create Control table: %u\n", r);
+ return r;
}
static UINT create_controlevent_table( MSIHANDLE hdb )
{
- return run_query(hdb,
+ UINT r = run_query(hdb,
"CREATE TABLE `ControlEvent` ("
"`Dialog_` CHAR(72) NOT NULL, "
"`Control_` CHAR(50) NOT NULL, "
@@ -677,115 +727,123 @@ static UINT create_controlevent_table( MSIHANDLE hdb )
"`Condition` CHAR(255), "
"`Ordering` SHORT "
"PRIMARY KEY `Dialog_`, `Control_`, `Event`, `Argument`,
`Condition`)");
+ ok(r == ERROR_SUCCESS, "Failed to create ControlEvent table: %u\n", r);
+ return r;
}
static UINT create_actiontext_table( MSIHANDLE hdb )
{
- return run_query(hdb,
+ UINT r = run_query(hdb,
"CREATE TABLE `ActionText` ("
"`Action` CHAR(72) NOT NULL, "
"`Description` CHAR(64) LOCALIZABLE, "
"`Template` CHAR(128) LOCALIZABLE "
"PRIMARY KEY `Action`)");
+ ok(r == ERROR_SUCCESS, "Failed to create ActionText table: %u\n", r);
+ return r;
}
-#define make_add_entry(type, qtext) \
- static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
- { \
- char insert[] = qtext; \
- char *query; \
- UINT sz, r; \
- sz = strlen(values) + sizeof insert; \
- query = HeapAlloc(GetProcessHeap(),0,sz); \
- sprintf(query,insert,values); \
- r = run_query( hdb, query ); \
- HeapFree(GetProcessHeap(), 0, query); \
- return r; \
- }
+static inline UINT add_entry(const char *file, int line, const char *type, MSIHANDLE hdb,
const char *values, const char *insert)
+{
+ char *query;
+ UINT sz, r;
+
+ sz = strlen(values) + strlen(insert) + 1;
+ query = HeapAlloc(GetProcessHeap(), 0, sz);
+ sprintf(query, insert, values);
+ r = run_query(hdb, query);
+ HeapFree(GetProcessHeap(), 0, query);
+ ok_(file, line)(r == ERROR_SUCCESS, "failed to insert into %s table: %u\n",
type, r);
+ return r;
+}
-make_add_entry(component,
- "INSERT INTO `Component` "
- "(`Component`, `ComponentId`, `Directory_`, "
+#define add_component_entry(hdb, values) add_entry(__FILE__, __LINE__,
"Component", hdb, values, \
+ "INSERT INTO `Component` " \
+ "(`Component`, `ComponentId`, `Directory_`, " \
"`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
-make_add_entry(directory,
- "INSERT INTO `Directory` "
+#define add_directory_entry(hdb, values) add_entry(__FILE__, __LINE__,
"Directory", hdb, values, \
+ "INSERT INTO `Directory` " \
"(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
-make_add_entry(feature,
- "INSERT INTO `Feature` "
- "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
+#define add_feature_entry(hdb, values) add_entry(__FILE__, __LINE__, "Feature",
hdb, values, \
+ "INSERT INTO `Feature` " \
+ "(`Feature`, `Feature_Parent`, `Title`, `Description`, " \
"`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
-make_add_entry(feature_components,
- "INSERT INTO `FeatureComponents` "
+#define add_feature_components_entry(hdb, values) add_entry(__FILE__, __LINE__,
"FeatureComponents", hdb, values, \
+ "INSERT INTO `FeatureComponents` " \
"(`Feature_`, `Component_`) VALUES( %s )")
-make_add_entry(file,
- "INSERT INTO `File` "
- "(`File`, `Component_`, `FileName`, `FileSize`, "
+#define add_file_entry(hdb, values) add_entry(__FILE__, __LINE__, "File", hdb,
values, \
+ "INSERT INTO `File` " \
+ "(`File`, `Component_`, `FileName`, `FileSize`, " \
"`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s
)")
-make_add_entry(appsearch,
- "INSERT INTO `AppSearch` "
+#define add_appsearch_entry(hdb, values) add_entry(__FILE__, __LINE__,
"AppSearch", hdb, values, \
+ "INSERT INTO `AppSearch` " \
"(`Property`, `Signature_`) VALUES( %s )")
-make_add_entry(signature,
- "INSERT INTO `Signature` "
- "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
- " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
+#define add_signature_entry(hdb, values) add_entry(__FILE__, __LINE__,
"Signature", hdb, values, \
+ "INSERT INTO `Signature` " \
+ "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`," \
+ " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) " \
"VALUES( %s )")
-make_add_entry(launchcondition,
- "INSERT INTO `LaunchCondition` "
+#define add_launchcondition_entry(hdb, values) add_entry(__FILE__, __LINE__,
"LaunchCondition", hdb, values, \
+ "INSERT INTO `LaunchCondition` " \
"(`Condition`, `Description`) VALUES( %s )")
-make_add_entry(property,
+#define add_property_entry(hdb, values) add_entry(__FILE__, __LINE__,
"Property", hdb, values, \
"INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
-make_add_entry(install_execute_sequence,
- "INSERT INTO `InstallExecuteSequence` "
+#define add_install_execute_sequence_entry(hdb, values) add_entry(__FILE__, __LINE__,
"InstallExecuteSequence", hdb, values, \
+ "INSERT INTO `InstallExecuteSequence` " \
+ "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
+
+#define add_install_ui_sequence_entry(hdb, values) add_entry(__FILE__, __LINE__,
"InstallUISequence", hdb, values, \
+ "INSERT INTO `InstallUISequence` " \
"(`Action`, `Condition`, `Sequence`) VALUES( %s )")
-make_add_entry(media,
- "INSERT INTO `Media` "
- "(`DiskId`, `LastSequence`, `DiskPrompt`, "
+#define add_media_entry(hdb, values) add_entry(__FILE__, __LINE__, "Media",
hdb, values, \
+ "INSERT INTO `Media` " \
+ "(`DiskId`, `LastSequence`, `DiskPrompt`, " \
"`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
-make_add_entry(ccpsearch,
+#define add_ccpsearch_entry(hdb, values) add_entry(__FILE__, __LINE__,
"CCPSearch", hdb, values, \
"INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
-make_add_entry(drlocator,
- "INSERT INTO `DrLocator` "
+#define add_drlocator_entry(hdb, values) add_entry(__FILE__, __LINE__,
"DrLocator", hdb, values, \
+ "INSERT INTO `DrLocator` " \
"(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
-make_add_entry(complocator,
- "INSERT INTO `CompLocator` "
+#define add_complocator_entry(hdb, values) add_entry(__FILE__, __LINE__,
"CompLocator", hdb, values, \
+ "INSERT INTO `CompLocator` " \
"(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
-make_add_entry(inilocator,
- "INSERT INTO `IniLocator` "
- "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`)
"
+#define add_inilocator_entry(hdb, values) add_entry(__FILE__, __LINE__,
"IniLocator", hdb, values, \
+ "INSERT INTO `IniLocator` " \
+ "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
\
"VALUES( %s )")
-make_add_entry(custom_action,
- "INSERT INTO `CustomAction` "
+#define add_custom_action_entry(hdb, values) add_entry(__FILE__, __LINE__,
"CustomAction", hdb, values, \
+ "INSERT INTO `CustomAction` " \
"(`Action`, `Type`, `Source`, `Target`) VALUES( %s )")
-make_add_entry(dialog,
- "INSERT INTO `Dialog` "
+#define add_dialog_entry(hdb, values) add_entry(__FILE__, __LINE__, "Dialog",
hdb, values, \
+ "INSERT INTO `Dialog` " \
"(`Dialog`, `HCentering`, `VCentering`, `Width`, `Height`,
`Attributes`, `Control_First`) VALUES ( %s )")
-make_add_entry(control,
- "INSERT INTO `Control` "
+#define add_control_entry(hdb, values) add_entry(__FILE__, __LINE__, "Control",
hdb, values, \
+ "INSERT INTO `Control` " \
"(`Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
`Attributes`, `Text`) VALUES( %s )");
-make_add_entry(controlevent,
- "INSERT INTO `ControlEvent` "
+#define add_controlevent_entry(hdb, values) add_entry(__FILE__, __LINE__,
"ControlEvent", hdb, values, \
+ "INSERT INTO `ControlEvent` " \
"(`Dialog_`, `Control_`, `Event`, `Argument`, `Condition`,
`Ordering`) VALUES( %s )");
-make_add_entry(actiontext,
- "INSERT INTO `ActionText` "
+#define add_actiontext_entry(hdb, values) add_entry(__FILE__, __LINE__,
"ActionText", hdb, values, \
+ "INSERT INTO `ActionText` " \
"(`Action`, `Description`, `Template`) VALUES( %s )");
static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char
*path,
@@ -802,6 +860,7 @@ static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT
root, con
sprintf( query, insert, sig, root, path, name, type );
r = run_query( hdb, query );
HeapFree( GetProcessHeap(), 0, query );
+ ok(r == ERROR_SUCCESS, "failed to insert into reglocator table: %u\n", r);
\
return r;
}
@@ -1161,44 +1220,25 @@ static void test_settargetpath(void)
hdb = create_package_db();
ok ( hdb, "failed to create package database\n" );
- r = add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'" );
- ok( r == S_OK, "failed to add directory entry: %d\n" , r );
+ add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'" );
- r = create_component_table( hdb );
- ok( r == S_OK, "cannot create Component table: %d\n", r );
+ create_component_table( hdb );
+ add_component_entry( hdb, "'RootComp',
'{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '',
'RootFile'" );
+ add_component_entry( hdb, "'TestComp',
'{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '',
'TestFile'" );
- r = add_component_entry( hdb, "'RootComp',
'{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '',
'RootFile'" );
- ok( r == S_OK, "cannot add dummy component: %d\n", r );
+ create_feature_table( hdb );
+ add_feature_entry( hdb, "'TestFeature', '', '',
'', 0, 1, '', 0" );
- r = add_component_entry( hdb, "'TestComp',
'{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '',
'TestFile'" );
- ok( r == S_OK, "cannot add test component: %d\n", r );
-
- r = create_feature_table( hdb );
- ok( r == S_OK, "cannot create Feature table: %d\n", r );
-
- r = add_feature_entry( hdb, "'TestFeature', '', '',
'', 0, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r
);
-
- r = create_feature_components_table( hdb );
- ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'TestFeature',
'RootComp'" );
- ok( r == S_OK, "cannot insert component into FeatureComponents table:
%d\n", r );
-
- r = add_feature_components_entry( hdb, "'TestFeature',
'TestComp'" );
- ok( r == S_OK, "cannot insert component into FeatureComponents table:
%d\n", r );
+ create_feature_components_table( hdb );
+ add_feature_components_entry( hdb, "'TestFeature',
'RootComp'" );
+ add_feature_components_entry( hdb, "'TestFeature',
'TestComp'" );
add_directory_entry( hdb, "'TestParent', 'TARGETDIR',
'TestParent'" );
add_directory_entry( hdb, "'TestDir', 'TestParent',
'TestDir'" );
- r = create_file_table( hdb );
- ok( r == S_OK, "cannot create File table: %d\n", r );
-
- r = add_file_entry( hdb, "'RootFile', 'RootComp',
'rootfile.txt', 0, '', '1033', 8192, 1" );
- ok( r == S_OK, "cannot add file to the File table: %d\n", r );
-
- r = add_file_entry( hdb, "'TestFile', 'TestComp',
'testfile.txt', 0, '', '1033', 8192, 1" );
- ok( r == S_OK, "cannot add file to the File table: %d\n", r );
+ create_file_table( hdb );
+ add_file_entry( hdb, "'RootFile', 'RootComp',
'rootfile.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'TestFile', 'TestComp',
'testfile.txt', 0, '', '1033', 8192, 1" );
r = package_from_db( hdb, &hpkg );
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -2021,6 +2061,14 @@ static void test_condition(void)
/* feature doesn't exist */
r = MsiEvaluateConditionA(hpkg, "&nofeature");
ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
+ r = MsiEvaluateConditionA(hpkg, "&nofeature=\"\"");
+ ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
+ r = MsiEvaluateConditionA(hpkg, "!nofeature=\"\"");
+ ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
+ MsiEvaluateConditionA(hpkg, "$nocomponent=\"\"");
+ ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
+ MsiEvaluateConditionA(hpkg, "?nocomponent=\"\"");
+ ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
MsiSetPropertyA(hpkg, "A", "2");
MsiSetPropertyA(hpkg, "X", "50");
@@ -2102,18 +2150,9 @@ static void test_props(void)
char buffer[0x100];
hdb = create_package_db();
- r = run_query( hdb,
- "CREATE TABLE `Property` ( "
- "`Property` CHAR(255) NOT NULL, "
- "`Value` CHAR(255) "
- "PRIMARY KEY `Property`)" );
- ok( r == ERROR_SUCCESS , "Failed\n" );
- r = run_query(hdb,
- "INSERT INTO `Property` "
- "(`Property`, `Value`) "
- "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
- ok( r == ERROR_SUCCESS , "Failed\n" );
+ create_property_table(hdb);
+ add_property_entry(hdb, "'MetadataCompName',
'Photoshop.dll'");
r = package_from_db( hdb, &hpkg );
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -2381,17 +2420,11 @@ static void test_property_table(void)
hdb = create_package_db();
ok (hdb, "failed to create package database\n");
- r = create_property_table(hdb);
- ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
-
- r = add_property_entry(hdb, "'prop', 'val'");
- ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
+ create_property_table(hdb);
+ add_property_entry(hdb, "'prop', 'val'");
- r = create_custom_action_table(hdb);
- ok(r == ERROR_SUCCESS, "cannot create CustomAction table: %d\n", r);
-
- r = add_custom_action_entry( hdb, "'EmbedNull', 51, 'prop2',
'[~]np'" );
- ok( r == ERROR_SUCCESS, "cannot add custom action: %d\n", r);
+ create_custom_action_table(hdb);
+ add_custom_action_entry( hdb, "'EmbedNull', 51, 'prop2',
'[~]np'" );
r = package_from_db(hdb, &hpkg);
ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
@@ -2408,8 +2441,7 @@ static void test_property_table(void)
found = find_prop_in_property(hdb, "prop", "val", -1);
ok(found, "prop should be in the _Property table\n");
- r = add_property_entry(hdb, "'dantes', 'mercedes'");
- ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
+ add_property_entry(hdb, "'dantes', 'mercedes'");
query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
r = do_query(hdb, query, &hrec);
@@ -2700,6 +2732,266 @@ static void test_formatrecord2(void)
DeleteFileA(msifile);
}
+static void test_formatrecord_tables(void)
+{
+ MSIHANDLE hdb, hrec, hpkg = 0;
+ CHAR buf[MAX_PATH];
+ CHAR curr_dir[MAX_PATH];
+ CHAR expected[MAX_PATH];
+ CHAR root[MAX_PATH];
+ DWORD size;
+ UINT r;
+
+ GetCurrentDirectoryA( MAX_PATH, curr_dir );
+
+ hdb = create_package_db();
+ ok ( hdb, "failed to create package database\n");
+
+ add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'" );
+ add_directory_entry( hdb, "'ReallyLongDir', 'TARGETDIR', "
+ "'I am a really long directory'" );
+
+ create_feature_table( hdb );
+ add_feature_entry( hdb, "'occipitofrontalis', '', '',
'', 2, 1, '', 0" );
+
+ create_component_table( hdb );
+ add_component_entry( hdb, "'frontal', '', 'TARGETDIR',
0, '', 'frontal_file'" );
+ add_component_entry( hdb, "'parietal', '', 'TARGETDIR',
1, '', 'parietal_file'" );
+ add_component_entry( hdb, "'temporal', '',
'ReallyLongDir', 0, '', 'temporal_file'" );
+
+ create_feature_components_table( hdb );
+ add_feature_components_entry( hdb, "'occipitofrontalis',
'frontal'" );
+ add_feature_components_entry( hdb, "'occipitofrontalis',
'parietal'" );
+ add_feature_components_entry( hdb, "'occipitofrontalis',
'temporal'" );
+
+ create_file_table( hdb );
+ add_file_entry( hdb, "'frontal_file', 'frontal',
'frontal.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'parietal_file', 'parietal',
'parietal.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'temporal_file', 'temporal',
'temporal.txt', 0, '', '1033', 8192, 1" );
+
+ create_custom_action_table( hdb );
+ add_custom_action_entry( hdb, "'MyCustom', 51, 'prop',
'[!temporal_file]'" );
+ add_custom_action_entry( hdb, "'EscapeIt1', 51, 'prop',
'[\\[]Bracket Text[\\]]'" );
+ add_custom_action_entry( hdb, "'EscapeIt2', 51, 'prop',
'[\\xabcd]'" );
+ add_custom_action_entry( hdb, "'EscapeIt3', 51, 'prop',
'[abcd\\xefgh]'" );
+ add_custom_action_entry( hdb, "'EmbedNull', 51, 'prop',
'[~]np'" );
+
+ r = package_from_db( hdb, &hpkg );
+ if (r == ERROR_INSTALL_PACKAGE_REJECTED)
+ {
+ skip("Not enough rights to perform tests\n");
+ MsiCloseHandle( hdb );
+ DeleteFileA( msifile );
+ return;
+ }
+ ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
+
+ MsiCloseHandle( hdb );
+
+ r = MsiSetPropertyA( hpkg, "imaprop", "ringer" );
+ ok( r == ERROR_SUCCESS, "cannot set property: %d\n", r);
+
+ hrec = MsiCreateRecord( 1 );
+
+ /* property doesn't exist */
+ size = MAX_PATH;
+ /*MsiRecordSetStringA( hrec, 0, "[1]" ); */
+ MsiRecordSetStringA( hrec, 1, "[idontexist]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, "1: " ), "Expected '1: ', got
%s\n", buf );
+
+ /* property exists */
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 1, "[imaprop]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, "1: ringer " ), "Expected '1: ringer ',
got %s\n", buf );
+
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 0, "1: [1] " );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, "1: ringer " ), "Expected '1: ringer ',
got %s\n", buf );
+
+ /* environment variable doesn't exist */
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 1, "[%idontexist]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, "1: " ), "Expected '1: ', got
%s\n", buf );
+
+ /* environment variable exists */
+ size = MAX_PATH;
+ SetEnvironmentVariableA( "crazyvar", "crazyval" );
+ MsiRecordSetStringA( hrec, 1, "[%crazyvar]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, "1: crazyval " ), "Expected '1: crazyval
', got %s\n", buf );
+
+ /* file key before CostInitialize */
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 1, "[#frontal_file]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, "1: " ), "Expected '1: ', got
%s\n", buf );
+
+ MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
+
+ r = MsiDoActionA(hpkg, "CostInitialize");
+ ok( r == ERROR_SUCCESS, "CostInitialize failed: %d\n", r);
+
+ r = MsiDoActionA(hpkg, "FileCost");
+ ok( r == ERROR_SUCCESS, "FileCost failed: %d\n", r);
+
+ r = MsiDoActionA(hpkg, "CostFinalize");
+ ok( r == ERROR_SUCCESS, "CostFinalize failed: %d\n", r);
+
+ size = MAX_PATH;
+ MsiGetPropertyA( hpkg, "ROOTDRIVE", root, &size );
+
+ sprintf( expected, "1: %sfrontal.txt ", root);
+
+ /* frontal full file key */
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 1, "[#frontal_file]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
+
+ /* frontal short file key */
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 1, "[!frontal_file]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
+
+ sprintf( expected, "1: %sI am a really long directory\\temporal.txt ",
root);
+
+ /* temporal full file key */
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 1, "[#temporal_file]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
+
+ /* temporal short file key */
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 1, "[!temporal_file]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
+
+ /* custom action 51, files don't exist */
+ r = MsiDoActionA( hpkg, "MyCustom" );
+ ok( r == ERROR_SUCCESS, "MyCustom failed: %d\n", r);
+
+ sprintf( expected, "%sI am a really long directory\\temporal.txt", root);
+
+ size = MAX_PATH;
+ r = MsiGetPropertyA( hpkg, "prop", buf, &size );
+ ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
+ ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
+
+ sprintf( buf, "%sI am a really long directory", root );
+ CreateDirectoryA( buf, NULL );
+
+ lstrcatA( buf, "\\temporal.txt" );
+ create_test_file( buf );
+
+ /* custom action 51, files exist */
+ r = MsiDoActionA( hpkg, "MyCustom" );
+ ok( r == ERROR_SUCCESS, "MyCustom failed: %d\n", r);
+
+ size = MAX_PATH;
+ r = MsiGetPropertyA( hpkg, "prop", buf, &size );
+ ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
+ todo_wine
+ {
+ ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
+ }
+
+ /* custom action 51, escaped text 1 */
+ r = MsiDoActionA( hpkg, "EscapeIt1" );
+ ok( r == ERROR_SUCCESS, "EscapeIt1 failed: %d\n", r);
+
+ size = MAX_PATH;
+ r = MsiGetPropertyA( hpkg, "prop", buf, &size );
+ ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
+ ok( !lstrcmpA( buf, "[Bracket Text]" ), "Expected '[Bracket
Text]', got %s\n", buf);
+
+ /* custom action 51, escaped text 2 */
+ r = MsiDoActionA( hpkg, "EscapeIt2" );
+ ok( r == ERROR_SUCCESS, "EscapeIt2 failed: %d\n", r);
+
+ size = MAX_PATH;
+ r = MsiGetPropertyA( hpkg, "prop", buf, &size );
+ ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
+ ok( !lstrcmpA( buf, "x" ), "Expected 'x', got %s\n",
buf);
+
+ /* custom action 51, escaped text 3 */
+ r = MsiDoActionA( hpkg, "EscapeIt3" );
+ ok( r == ERROR_SUCCESS, "EscapeIt3 failed: %d\n", r);
+
+ size = MAX_PATH;
+ r = MsiGetPropertyA( hpkg, "prop", buf, &size );
+ ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
+ ok( !lstrcmpA( buf, "" ), "Expected '', got %s\n", buf);
+
+ /* custom action 51, embedded null */
+ r = MsiDoActionA( hpkg, "EmbedNull" );
+ ok( r == ERROR_SUCCESS, "EmbedNull failed: %d\n", r);
+
+ size = MAX_PATH;
+ memset( buf, 'a', sizeof(buf) );
+ r = MsiGetPropertyA( hpkg, "prop", buf, &size );
+ ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
+ ok( !memcmp( buf, "\0np", sizeof("\0np") ), "wrong
value\n");
+ ok( size == sizeof("\0np") - 1, "got %u\n", size );
+
+ r = MsiSetPropertyA( hpkg, "prop", "[~]np" );
+ ok( r == ERROR_SUCCESS, "cannot set property: %d\n", r);
+
+ size = MAX_PATH;
+ memset( buf, 'a', sizeof(buf) );
+ r = MsiGetPropertyA( hpkg, "prop", buf, &size );
+ ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
+ ok( !lstrcmpA( buf, "[~]np" ), "Expected '[~]np', got
%s\n", buf);
+
+ sprintf( expected, "1: %sI am a really long directory\\ ", root);
+
+ /* component with INSTALLSTATE_LOCAL */
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 1, "[$temporal]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, expected ), "Expected \"%s\", got
\"%s\"\n", expected, buf);
+
+ r = MsiSetComponentStateA( hpkg, "temporal", INSTALLSTATE_SOURCE );
+ ok( r == ERROR_SUCCESS, "failed to set install state: %d\n", r);
+
+ /* component with INSTALLSTATE_SOURCE */
+ lstrcpyA( expected, "1: " );
+ lstrcatA( expected, curr_dir );
+ if (strlen(curr_dir) > 3) lstrcatA( expected, "\\" );
+ lstrcatA( expected, " " );
+ size = MAX_PATH;
+ MsiRecordSetStringA( hrec, 1, "[$parietal]" );
+ r = MsiFormatRecordA( hpkg, hrec, buf, &size );
+ ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ ok( !lstrcmpA( buf, expected ), "Expected '%s', got
'%s'\n", expected, buf);
+
+ sprintf( buf, "%sI am a really long directory\\temporal.txt", root );
+ DeleteFileA( buf );
+
+ sprintf( buf, "%sI am a really long directory", root );
+ RemoveDirectoryA( buf );
+
+ MsiCloseHandle( hrec );
+ MsiCloseHandle( hpkg );
+ DeleteFileA( msifile );
+}
+
static void test_feature_states( UINT line, MSIHANDLE package, const char *feature, UINT
error,
INSTALLSTATE expected_state, INSTALLSTATE
expected_action, BOOL todo )
{
@@ -2764,10 +3056,13 @@ static void test_states(void)
{'w','i','n','e','t','e','s','t','3','-','p','a','c','k','a','g','e','.','m','s','i',0};
static const WCHAR msifile4W[] =
{'w','i','n','e','t','e','s','t','4','-','p','a','c','k','a','g','e','.','m','s','i',0};
+ char msi_cache_file[MAX_PATH];
+ DWORD cache_file_name_len;
INSTALLSTATE state;
MSIHANDLE hpkg;
UINT r;
MSIHANDLE hdb;
+ BOOL is_broken;
if (is_process_limited())
{
@@ -2778,382 +3073,202 @@ static void test_states(void)
hdb = create_package_db();
ok ( hdb, "failed to create package database\n" );
- r = add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'");
- ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
-
- r = create_property_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
-
- r = add_property_entry( hdb, "'ProductCode',
'{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
- ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
-
- r = add_property_entry( hdb, "'ProductLanguage', '1033'"
);
- ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
-
- r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
- ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
-
- r = add_property_entry( hdb, "'ProductVersion', '1.1.1'"
);
- ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
-
- r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
- ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
-
- r = create_install_execute_sequence_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n",
r );
-
- r = add_install_execute_sequence_entry( hdb, "'CostInitialize',
'', '800'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
-
- r = add_install_execute_sequence_entry( hdb, "'FileCost', '',
'900'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
-
- r = add_install_execute_sequence_entry( hdb, "'CostFinalize',
'', '1000'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
-
- r = add_install_execute_sequence_entry( hdb, "'InstallValidate',
'', '1400'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
-
- r = add_install_execute_sequence_entry( hdb, "'InstallInitialize',
'', '1500'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
-
- r = add_install_execute_sequence_entry( hdb, "'ProcessComponents',
'', '1600'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
+ add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'");
- r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures',
'', '1800'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
+ create_property_table( hdb );
+ add_property_entry( hdb, "'ProductCode',
'{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
+ add_property_entry( hdb, "'ProductLanguage', '1033'" );
+ add_property_entry( hdb, "'ProductName', 'MSITEST'" );
+ add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
+ add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
- r = add_install_execute_sequence_entry( hdb, "'RegisterProduct',
'', '6100'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
+ create_install_execute_sequence_table( hdb );
+ add_install_execute_sequence_entry( hdb, "'CostInitialize', '',
'800'" );
+ add_install_execute_sequence_entry( hdb, "'FileCost', '',
'900'" );
+ add_install_execute_sequence_entry( hdb, "'CostFinalize', '',
'1000'" );
+ add_install_execute_sequence_entry( hdb, "'InstallValidate', '',
'1400'" );
+ add_install_execute_sequence_entry( hdb, "'InstallInitialize',
'', '1500'" );
+ add_install_execute_sequence_entry( hdb, "'ProcessComponents',
'', '1600'" );
+ add_install_execute_sequence_entry( hdb, "'UnpublishFeatures',
'', '1800'" );
+ add_install_execute_sequence_entry( hdb, "'RegisterProduct', '',
'6100'" );
+ add_install_execute_sequence_entry( hdb, "'PublishFeatures', '',
'6300'" );
+ add_install_execute_sequence_entry( hdb, "'PublishProduct', '',
'6400'" );
+ add_install_execute_sequence_entry( hdb, "'InstallFinalize', '',
'6600'" );
- r = add_install_execute_sequence_entry( hdb, "'PublishFeatures',
'', '6300'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
+ create_media_table( hdb );
+ add_media_entry( hdb, "'1', '3', '', '',
'DISK1', ''");
- r = add_install_execute_sequence_entry( hdb, "'PublishProduct',
'', '6400'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
+ create_feature_table( hdb );
- r = add_install_execute_sequence_entry( hdb, "'InstallFinalize',
'', '6600'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n",
r );
-
- r = create_media_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
-
- r = add_media_entry( hdb, "'1', '3', '', '',
'DISK1', ''");
- ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
-
- r = create_feature_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
-
- r = create_component_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
+ create_component_table( hdb );
/* msidbFeatureAttributesFavorLocal */
- r = add_feature_entry( hdb, "'one', '', '', '',
2, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'one', '', '', '', 2,
1, '', 0" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
- r = add_component_entry( hdb, "'alpha',
'{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '',
'alpha_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'alpha',
'{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '',
'alpha_file'" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
- r = add_component_entry( hdb, "'beta',
'{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '',
'beta_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'beta',
'{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '',
'beta_file'" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
- r = add_component_entry( hdb, "'gamma',
'{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '',
'gamma_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'gamma',
'{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '',
'gamma_file'" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
- r = add_component_entry( hdb, "'theta',
'{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '',
'theta_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'theta',
'{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '',
'theta_file'" );
/* msidbFeatureAttributesFavorSource */
- r = add_feature_entry( hdb, "'two', '', '', '',
2, 1, '', 1" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'two', '', '', '', 2,
1, '', 1" );
/* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
- r = add_component_entry( hdb, "'delta',
'{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '',
'delta_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'delta',
'{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '',
'delta_file'" );
/* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
- r = add_component_entry( hdb, "'epsilon',
'{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '',
'epsilon_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'epsilon',
'{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '',
'epsilon_file'" );
/* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
- r = add_component_entry( hdb, "'zeta',
'{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '',
'zeta_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'zeta',
'{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '',
'zeta_file'" );
/* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
- r = add_component_entry( hdb, "'iota',
'{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '',
'iota_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'iota',
'{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '',
'iota_file'" );
/* msidbFeatureAttributesFavorSource */
- r = add_feature_entry( hdb, "'three', '', '',
'', 2, 1, '', 1" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'three', '', '', '', 2,
1, '', 1" );
/* msidbFeatureAttributesFavorLocal */
- r = add_feature_entry( hdb, "'four', '', '', '',
2, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'four', '', '', '', 2,
1, '', 0" );
/* disabled */
- r = add_feature_entry( hdb, "'five', '', '', '',
2, 0, '', 1" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'five', '', '', '', 2,
0, '', 1" );
/* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
- r = add_component_entry( hdb, "'eta',
'{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '',
'eta_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'eta',
'{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '',
'eta_file'" );
/* no feature parent:msidbComponentAttributesLocalOnly */
- r = add_component_entry( hdb, "'kappa',
'{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '',
'kappa_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'kappa',
'{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '',
'kappa_file'" );
/* msidbFeatureAttributesFavorLocal:removed */
- r = add_feature_entry( hdb, "'six', '', '', '',
2, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'six', '', '', '', 2,
1, '', 0" );
/* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
- r = add_component_entry( hdb, "'lambda',
'{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '',
'lambda_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'lambda',
'{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '',
'lambda_file'" );
/* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
- r = add_component_entry( hdb, "'mu',
'{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '',
'mu_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'mu',
'{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '',
'mu_file'" );
/* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
- r = add_component_entry( hdb, "'nu',
'{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '',
'nu_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'nu',
'{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '',
'nu_file'" );
/* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount
*/
- r = add_component_entry( hdb, "'xi',
'{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '',
'xi_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'xi',
'{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '',
'xi_file'" );
/* msidbFeatureAttributesFavorSource:removed */
- r = add_feature_entry( hdb, "'seven', '', '',
'', 2, 1, '', 1" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'seven', '', '', '', 2,
1, '', 1" );
/* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
- r = add_component_entry( hdb, "'omicron',
'{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '',
'omicron_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'omicron',
'{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '',
'omicron_file'" );
/* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
- r = add_component_entry( hdb, "'pi',
'{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '',
'pi_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'pi',
'{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '',
'pi_file'" );
/* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
- r = add_component_entry( hdb, "'rho',
'{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '',
'rho_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'rho',
'{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '',
'rho_file'" );
/*
msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
- r = add_component_entry( hdb, "'sigma',
'{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '',
'sigma_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'sigma',
'{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '',
'sigma_file'" );
/* msidbFeatureAttributesFavorLocal */
- r = add_feature_entry( hdb, "'eight', '', '',
'', 2, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'eight', '', '', '', 2,
1, '', 0" );
- r = add_component_entry( hdb, "'tau',
'{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '',
'tau_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'tau',
'{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '',
'tau_file'" );
/* msidbFeatureAttributesFavorSource */
- r = add_feature_entry( hdb, "'nine', '', '', '',
2, 1, '', 1" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'nine', '', '', '', 2,
1, '', 1" );
- r = add_component_entry( hdb, "'phi',
'{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '',
'phi_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'phi',
'{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '',
'phi_file'" );
/* msidbFeatureAttributesFavorAdvertise */
- r = add_feature_entry( hdb, "'ten', '', '', '',
2, 1, '', 4" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'ten', '', '', '', 2,
1, '', 4" );
- r = add_component_entry( hdb, "'chi',
'{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '',
'chi_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'chi',
'{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '',
'chi_file'" );
/* msidbFeatureAttributesUIDisallowAbsent */
- r = add_feature_entry( hdb, "'eleven', '', '',
'', 2, 1, '', 16" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'eleven', '', '', '',
2, 1, '', 16" );
- r = add_component_entry( hdb, "'psi',
'{A06B23B5-746B-427A-8A6E-FD6AC8F46A95}', 'TARGETDIR', 1, '',
'psi_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'psi',
'{A06B23B5-746B-427A-8A6E-FD6AC8F46A95}', 'TARGETDIR', 1, '',
'psi_file'" );
/* high install level */
- r = add_feature_entry( hdb, "'twelve', '', '',
'', 2, 2, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'twelve', '', '', '',
2, 2, '', 0" );
- r = add_component_entry( hdb, "'upsilon',
'{557e0c04-ceba-4c58-86a9-4a73352e8cf6}', 'TARGETDIR', 1, '',
'upsilon_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'upsilon',
'{557e0c04-ceba-4c58-86a9-4a73352e8cf6}', 'TARGETDIR', 1, '',
'upsilon_file'" );
/* msidbFeatureAttributesFollowParent */
- r = add_feature_entry( hdb, "'thirteen', '', '',
'', 2, 2, '', 2" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
-
- r = create_feature_components_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r
);
-
- r = add_feature_components_entry( hdb, "'one', 'alpha'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'beta'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'gamma'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'theta'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'two', 'delta'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'two', 'epsilon'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'two', 'zeta'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'two', 'iota'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'three', 'eta'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'four', 'eta'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'five', 'eta'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'six', 'lambda'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'six', 'mu'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'six', 'nu'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'six', 'xi'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'seven', 'omicron'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'seven', 'pi'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'seven', 'rho'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'seven', 'sigma'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'eight', 'tau'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'nine', 'phi'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'ten', 'chi'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'eleven', 'psi'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'twelve',
'upsilon'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'thirteen',
'upsilon'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = create_file_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
-
- r = add_file_entry( hdb, "'alpha_file', 'alpha',
'alpha.txt', 100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'beta_file', 'beta',
'beta.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'gamma_file', 'gamma',
'gamma.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'theta_file', 'theta',
'theta.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'delta_file', 'delta',
'delta.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'epsilon_file', 'epsilon',
'epsilon.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'zeta_file', 'zeta',
'zeta.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'iota_file', 'iota',
'iota.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
+ add_feature_entry( hdb, "'thirteen', '', '', '',
2, 2, '', 2" );
+
+ create_feature_components_table( hdb );
+ add_feature_components_entry( hdb, "'one', 'alpha'" );
+ add_feature_components_entry( hdb, "'one', 'beta'" );
+ add_feature_components_entry( hdb, "'one', 'gamma'" );
+ add_feature_components_entry( hdb, "'one', 'theta'" );
+ add_feature_components_entry( hdb, "'two', 'delta'" );
+ add_feature_components_entry( hdb, "'two', 'epsilon'" );
+ add_feature_components_entry( hdb, "'two', 'zeta'" );
+ add_feature_components_entry( hdb, "'two', 'iota'" );
+ add_feature_components_entry( hdb, "'three', 'eta'" );
+ add_feature_components_entry( hdb, "'four', 'eta'" );
+ add_feature_components_entry( hdb, "'five', 'eta'" );
+ add_feature_components_entry( hdb, "'six', 'lambda'" );
+ add_feature_components_entry( hdb, "'six', 'mu'" );
+ add_feature_components_entry( hdb, "'six', 'nu'" );
+ add_feature_components_entry( hdb, "'six', 'xi'" );
+ add_feature_components_entry( hdb, "'seven', 'omicron'" );
+ add_feature_components_entry( hdb, "'seven', 'pi'" );
+ add_feature_components_entry( hdb, "'seven', 'rho'" );
+ add_feature_components_entry( hdb, "'seven', 'sigma'" );
+ add_feature_components_entry( hdb, "'eight', 'tau'" );
+ add_feature_components_entry( hdb, "'nine', 'phi'" );
+ add_feature_components_entry( hdb, "'ten', 'chi'" );
+ add_feature_components_entry( hdb, "'eleven', 'psi'" );
+ add_feature_components_entry( hdb, "'twelve', 'upsilon'"
);
+ add_feature_components_entry( hdb, "'thirteen', 'upsilon'"
);
+
+ create_file_table( hdb );
+ add_file_entry( hdb, "'alpha_file', 'alpha',
'alpha.txt', 100, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt',
0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'gamma_file', 'gamma',
'gamma.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'theta_file', 'theta',
'theta.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'delta_file', 'delta',
'delta.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'epsilon_file', 'epsilon',
'epsilon.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt',
0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt',
0, '', '1033', 8192, 1" );
/* compressed file */
- r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt',
0, '', '1033', 16384, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'kappa_file', 'kappa',
'kappa.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'lambda_file', 'lambda',
'lambda.txt', 100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'omicron_file', 'omicron',
'omicron.txt', 100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'sigma_file', 'sigma',
'sigma.txt', 100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
+ add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0,
'', '1033', 16384, 1" );
+
+ add_file_entry( hdb, "'kappa_file', 'kappa',
'kappa.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'lambda_file', 'lambda',
'lambda.txt', 100, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'omicron_file', 'omicron',
'omicron.txt', 100, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'sigma_file', 'sigma',
'sigma.txt', 100, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'psi_file', 'psi', 'psi.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'upsilon_file', 'upsilon',
'upsilon.txt', 0, '', '1033', 16384, 1" );
- r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'psi_file', 'psi', 'psi.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'upsilon_file', 'upsilon',
'upsilon.txt', 0, '', '1033', 16384, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- MsiDatabaseCommit(hdb);
+ r = MsiDatabaseCommit(hdb);
+ ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
/* these properties must not be in the saved msi file */
- r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
-
- r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
-
- r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
-
- r = add_property_entry( hdb, "'REINSTALL',
'eight,nine,ten'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
-
- r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
+ add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
+ add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
+ add_property_entry( hdb, "'REMOVE', 'six,seven'");
+ add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
+ add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
r = package_from_db( hdb, &hpkg );
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -3240,17 +3355,10 @@ static void test_states(void)
ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
/* these properties must not be in the saved msi file */
- r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
-
- r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
-
- r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
-
- r = add_property_entry( hdb, "'REINSTALL',
'eight,nine,ten'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
+ add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
+ add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
+ add_property_entry( hdb, "'REMOVE', 'six,seven'");
+ add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
r = package_from_db( hdb, &hpkg );
ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
@@ -3337,8 +3445,7 @@ static void test_states(void)
ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
/* these properties must not be in the saved msi file */
- r = add_property_entry( hdb, "'ADDLOCAL',
'one,two,three,four,five,six,seven,eight,nine,ten,twelve'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
+ add_property_entry( hdb, "'ADDLOCAL',
'one,two,three,four,five,six,seven,eight,nine,ten,twelve'");
r = package_from_db( hdb, &hpkg );
ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
@@ -3412,8 +3519,7 @@ static void test_states(void)
ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
/* this property must not be in the saved msi file */
- r = add_property_entry( hdb, "'ADDSOURCE',
'one,two,three,four,five,six,seven,eight,nine,ten'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
+ add_property_entry( hdb, "'ADDSOURCE',
'one,two,three,four,five,six,seven,eight,nine,ten'");
r = package_from_db( hdb, &hpkg );
ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
@@ -3472,13 +3578,14 @@ static void test_states(void)
test_component_states( __LINE__, hpkg, "phi", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
test_component_states( __LINE__, hpkg, "chi", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
test_component_states( __LINE__, hpkg, "psi", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
- test_component_states( __LINE__, hpkg, "upsilon", ERROR_SUCCESS,
INSTALLSTATE_LOCAL, INSTALLSTATE_LOCAL, TRUE );
+ test_component_states( __LINE__, hpkg, "upsilon", ERROR_SUCCESS,
INSTALLSTATE_LOCAL, INSTALLSTATE_LOCAL, FALSE );
MsiCloseHandle(hpkg);
/* reinstall the product */
r = MsiInstallProductA(msifile3, "REINSTALL=ALL");
- ok(r == ERROR_SUCCESS || broken(r == ERROR_INSTALL_FAILURE) /* win2k3 */,
"Expected ERROR_SUCCESS, got %d\n", r);
+ is_broken = (r == ERROR_INSTALL_FAILURE);
+ ok(r == ERROR_SUCCESS || broken(is_broken) /* win2k3 */, "Expected
ERROR_SUCCESS, got %d\n", r);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}",
"five");
ok(state == INSTALLSTATE_UNKNOWN, "state = %d\n", state);
@@ -3489,8 +3596,7 @@ static void test_states(void)
ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
/* this property must not be in the saved msi file */
- r = add_property_entry( hdb, "'ADDSOURCE',
'one,two,three,four,five,six,seven,eight,nine,ten'");
- ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
+ add_property_entry( hdb, "'ADDSOURCE',
'one,two,three,four,five,six,seven,eight,nine,ten'");
r = package_from_db( hdb, &hpkg );
ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
@@ -3549,25 +3655,127 @@ static void test_states(void)
test_component_states( __LINE__, hpkg, "phi", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
test_component_states( __LINE__, hpkg, "chi", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
test_component_states( __LINE__, hpkg, "psi", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
- test_component_states( __LINE__, hpkg, "upsilon", ERROR_SUCCESS,
INSTALLSTATE_LOCAL, INSTALLSTATE_LOCAL, TRUE );
+ test_component_states( __LINE__, hpkg, "upsilon", ERROR_SUCCESS,
INSTALLSTATE_LOCAL, INSTALLSTATE_LOCAL, FALSE );
MsiCloseHandle(hpkg);
- /* uninstall the product */
- r = MsiInstallProductA(msifile4, "REMOVE=ALL");
+ /* test source only install */
+ r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}",
"one");
+ ok(state == INSTALLSTATE_UNKNOWN, "state = %d\n", state);
+ state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}",
"two");
+ ok(state == INSTALLSTATE_UNKNOWN, "state = %d\n", state);
- DeleteFileA(msifile);
- DeleteFileA(msifile2);
- DeleteFileA(msifile3);
- DeleteFileA(msifile4);
-}
+ r = MsiInstallProductA(msifile, "ADDSOURCE=one");
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}",
"one");
+ ok(state == INSTALLSTATE_SOURCE, "state = %d\n", state);
+ state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}",
"two");
+ ok(state == INSTALLSTATE_ABSENT, "state = %d\n", state);
-static void test_getproperty(void)
-{
- MSIHANDLE hPackage = 0;
- char prop[100];
- static CHAR empty[] = "";
+ /* no arguments test */
+ cache_file_name_len = sizeof(msi_cache_file);
+ r = MsiGetProductInfoA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}",
+ INSTALLPROPERTY_LOCALPACKAGEA, msi_cache_file, &cache_file_name_len);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ r = MsiOpenDatabaseA(msi_cache_file, (const char*)MSIDBOPEN_DIRECT, &hdb);
+ ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
+
+ create_custom_action_table( hdb );
+ add_custom_action_entry( hdb, "'ConditionCheck1', 19, '',
'Condition check failed (1)'" );
+ add_custom_action_entry( hdb, "'ConditionCheck2', 19, '',
'Condition check failed (2)'" );
+ add_custom_action_entry( hdb, "'ConditionCheck3', 19, '',
'Condition check failed (3)'" );
+ add_custom_action_entry( hdb, "'ConditionCheck4', 19, '',
'Condition check failed (4)'" );
+ add_custom_action_entry( hdb, "'ConditionCheck5', 19, '',
'Condition check failed (5)'" );
+ add_custom_action_entry( hdb, "'ConditionCheck6', 19, '',
'Condition check failed (6)'" );
+ add_custom_action_entry( hdb, "'ConditionCheck7', 19, '',
'Condition check failed (7)'" );
+ add_custom_action_entry( hdb, "'ConditionCheck8', 19, '',
'Condition check failed (8)'" );
+
+ add_install_execute_sequence_entry( hdb, "'ConditionCheck1',
'REINSTALL', '798'" );
+ add_install_execute_sequence_entry( hdb, "'ConditionCheck2', 'NOT
REMOVE AND Preselected', '799'" );
+ add_install_execute_sequence_entry( hdb, "'ConditionCheck3',
'REINSTALL', '6598'" );
+ add_install_execute_sequence_entry( hdb, "'ConditionCheck4', 'NOT
REMOVE AND Preselected', '6599'" );
+ add_install_execute_sequence_entry( hdb, "'ConditionCheck5',
'REINSTALL', '6601'" );
+ add_install_execute_sequence_entry( hdb, "'ConditionCheck6', 'NOT
REMOVE AND Preselected', '6601'" );
+ /* Add "one" feature action tests */
+ add_install_execute_sequence_entry( hdb, "'ConditionCheck7', 'NOT
REMOVE AND NOT(&one=-1)', '1501'" );
+ add_install_execute_sequence_entry( hdb, "'ConditionCheck8', 'NOT
REMOVE AND NOT(&one=-1)', '6602'" );
+ r = MsiDatabaseCommit(hdb);
+ ok(r == ERROR_SUCCESS, "MsiDatabaseCommit failed: %d\n", r);
+ r = package_from_db( hdb, &hpkg );
+ ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
+ MsiCloseHandle(hdb);
+
+ test_feature_states( __LINE__, hpkg, "one", ERROR_UNKNOWN_FEATURE, 0, 0,
FALSE );
+ test_feature_states( __LINE__, hpkg, "two", ERROR_UNKNOWN_FEATURE, 0, 0,
FALSE );
+ r = MsiDoActionA( hpkg, "CostInitialize");
+ ok( r == ERROR_SUCCESS, "CostInitialize failed\n");
+ test_feature_states( __LINE__, hpkg, "one", ERROR_SUCCESS,
INSTALLSTATE_UNKNOWN, INSTALLSTATE_UNKNOWN, FALSE );
+ test_feature_states( __LINE__, hpkg, "two", ERROR_SUCCESS,
INSTALLSTATE_UNKNOWN, INSTALLSTATE_UNKNOWN, FALSE );
+
+ r = MsiDoActionA( hpkg, "FileCost");
+ ok( r == ERROR_SUCCESS, "FileCost failed\n");
+ test_feature_states( __LINE__, hpkg, "one", ERROR_SUCCESS,
INSTALLSTATE_UNKNOWN, INSTALLSTATE_UNKNOWN, FALSE );
+ test_feature_states( __LINE__, hpkg, "two", ERROR_SUCCESS,
INSTALLSTATE_UNKNOWN, INSTALLSTATE_UNKNOWN, FALSE );
+
+ r = MsiDoActionA( hpkg, "CostFinalize");
+ ok( r == ERROR_SUCCESS, "CostFinalize failed\n");
+ test_feature_states( __LINE__, hpkg, "one", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
+ test_feature_states( __LINE__, hpkg, "two", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "alpha", ERROR_SUCCESS,
INSTALLSTATE_LOCAL, INSTALLSTATE_LOCAL, FALSE );
+ test_component_states( __LINE__, hpkg, "beta", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "gamma", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "theta", ERROR_SUCCESS,
INSTALLSTATE_LOCAL, INSTALLSTATE_LOCAL, FALSE );
+ test_component_states( __LINE__, hpkg, "delta", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "epsilon", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "zeta", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "iota", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "eta", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "kappa", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "lambda", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "mu", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "nu", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "xi", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "omicron", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "pi", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "rho", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "sigma", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "tau", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "phi", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "chi", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "psi", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ test_component_states( __LINE__, hpkg, "upsilon", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+
+ r = MsiDoActionA( hpkg, "InstallValidate");
+ ok( r == ERROR_SUCCESS, "InstallValidate failed %d\n", r);
+ test_feature_states( __LINE__, hpkg, "one", ERROR_SUCCESS,
INSTALLSTATE_SOURCE, INSTALLSTATE_UNKNOWN, FALSE );
+ test_feature_states( __LINE__, hpkg, "two", ERROR_SUCCESS,
INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE );
+ MsiCloseHandle( hpkg );
+
+ r = MsiInstallProductA(msifile, "");
+ ok(r == ERROR_SUCCESS || (is_broken && r == ERROR_INSTALL_FAILURE) /* win2k3
*/,
+ "Expected ERROR_SUCCESS, got %d\n", r);
+ state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}",
"one");
+ ok(state == INSTALLSTATE_SOURCE, "state = %d\n", state);
+ state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}",
"two");
+ ok(state == INSTALLSTATE_ABSENT, "state = %d\n", state);
+
+ /* uninstall the product */
+ r = MsiInstallProductA(msifile4, "REMOVE=ALL");
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+
+ DeleteFileA(msifile);
+ DeleteFileA(msifile2);
+ DeleteFileA(msifile3);
+ DeleteFileA(msifile4);
+}
+
+static void test_getproperty(void)
+{
+ MSIHANDLE hPackage = 0;
+ char prop[100];
+ static CHAR empty[] = "";
DWORD size;
UINT r;
@@ -3624,89 +3832,39 @@ static void test_removefiles(void)
hdb = create_package_db();
ok ( hdb, "failed to create package database\n" );
- r = add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'");
- ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
-
- r = create_feature_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
-
- r = create_component_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
-
- r = add_feature_entry( hdb, "'one', '', '', '',
2, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
-
- r = add_component_entry( hdb, "'hydrogen', '',
'TARGETDIR', 0, '', 'hydrogen_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = add_component_entry( hdb, "'helium', '',
'TARGETDIR', 0, '', 'helium_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = add_component_entry( hdb, "'lithium', '',
'TARGETDIR', 0, '', 'lithium_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = add_component_entry( hdb, "'beryllium', '',
'TARGETDIR', 0, '', 'beryllium_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = add_component_entry( hdb, "'boron', '', 'TARGETDIR',
0, '', 'boron_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = add_component_entry( hdb, "'carbon', '',
'TARGETDIR', 0, '', 'carbon_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = add_component_entry( hdb, "'oxygen', '',
'TARGETDIR', 0, '0', 'oxygen_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
-
- r = create_feature_components_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r
);
-
- r = add_feature_components_entry( hdb, "'one', 'hydrogen'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'helium'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'lithium'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'beryllium'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'boron'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'carbon'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'oxygen'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = create_file_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
-
- r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen',
'hydrogen.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'helium_file', 'helium',
'helium.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'lithium_file', 'lithium',
'lithium.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'beryllium_file', 'beryllium',
'beryllium.txt', 0, '', '1033', 16384, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'boron_file', 'boron',
'boron.txt', 0, '', '1033', 16384, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'carbon_file', 'carbon',
'carbon.txt', 0, '', '1033', 16384, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'oxygen_file', 'oxygen',
'oxygen.txt', 0, '', '1033', 16384, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = create_remove_file_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
+ add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'");
+
+ create_feature_table( hdb );
+ add_feature_entry( hdb, "'one', '', '', '', 2,
1, '', 0" );
+
+ create_component_table( hdb );
+ add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR',
0, '', 'hydrogen_file'" );
+ add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0,
'', 'helium_file'" );
+ add_component_entry( hdb, "'lithium', '', 'TARGETDIR',
0, '', 'lithium_file'" );
+ add_component_entry( hdb, "'beryllium', '', 'TARGETDIR',
0, '', 'beryllium_file'" );
+ add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0,
'', 'boron_file'" );
+ add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0,
'', 'carbon_file'" );
+ add_component_entry( hdb, "'oxygen', '', 'TARGETDIR', 0,
'0', 'oxygen_file'" );
+
+ create_feature_components_table( hdb );
+ add_feature_components_entry( hdb, "'one', 'hydrogen'" );
+ add_feature_components_entry( hdb, "'one', 'helium'" );
+ add_feature_components_entry( hdb, "'one', 'lithium'" );
+ add_feature_components_entry( hdb, "'one', 'beryllium'" );
+ add_feature_components_entry( hdb, "'one', 'boron'" );
+ add_feature_components_entry( hdb, "'one', 'carbon'" );
+ add_feature_components_entry( hdb, "'one', 'oxygen'" );
+
+ create_file_table( hdb );
+ add_file_entry( hdb, "'hydrogen_file', 'hydrogen',
'hydrogen.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'helium_file', 'helium',
'helium.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'lithium_file', 'lithium',
'lithium.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'beryllium_file', 'beryllium',
'beryllium.txt', 0, '', '1033', 16384, 1" );
+ add_file_entry( hdb, "'boron_file', 'boron',
'boron.txt', 0, '', '1033', 16384, 1" );
+ add_file_entry( hdb, "'carbon_file', 'carbon',
'carbon.txt', 0, '', '1033', 16384, 1" );
+ add_file_entry( hdb, "'oxygen_file', 'oxygen',
'oxygen.txt', 0, '', '1033', 16384, 1" );
+
+ create_remove_file_table( hdb );
r = package_from_db( hdb, &hpkg );
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -3826,49 +3984,28 @@ static void test_appsearch(void)
hdb = create_package_db();
ok ( hdb, "failed to create package database\n" );
- r = create_appsearch_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
-
- r = add_appsearch_entry( hdb, "'WEBBROWSERPROG',
'NewSignature1'" );
- ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
-
- r = add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'"
);
- ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
-
- r = add_appsearch_entry( hdb, "'REGEXPANDVAL',
'NewSignature3'" );
- ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
-
- r = create_reglocator_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
+ create_appsearch_table( hdb );
+ add_appsearch_entry( hdb, "'WEBBROWSERPROG',
'NewSignature1'" );
+ add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" );
+ add_appsearch_entry( hdb, "'REGEXPANDVAL', 'NewSignature3'"
);
- r = add_reglocator_entry( hdb, "NewSignature1", 0,
"htmlfile\\shell\\open\\command", "", 1 );
- ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
+ create_reglocator_table( hdb );
+ add_reglocator_entry( hdb, "NewSignature1", 0,
"htmlfile\\shell\\open\\command", "", 1 );
r = RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Winetest_msi", 0, NULL,
0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
ok( r == ERROR_SUCCESS, "Could not create key: %d.\n", r );
r = RegSetValueExA(hkey, NULL, 0, REG_EXPAND_SZ, (const BYTE*)reg_expand_value,
strlen(reg_expand_value) + 1);
ok( r == ERROR_SUCCESS, "Could not set key value: %d.\n", r);
RegCloseKey(hkey);
- r = add_reglocator_entry( hdb, "NewSignature3", 1,
"Software\\Winetest_msi", "", 1 );
- ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
+ add_reglocator_entry( hdb, "NewSignature3", 1,
"Software\\Winetest_msi", "", 1 );
- r = create_drlocator_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create DrLocator table: %d\n", r );
+ create_drlocator_table( hdb );
+ add_drlocator_entry( hdb, "'NewSignature2', 0,
'c:\\windows\\system32', 0" );
- r = add_drlocator_entry( hdb, "'NewSignature2', 0,
'c:\\windows\\system32', 0" );
- ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
-
- r = create_signature_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
-
- r = add_signature_entry( hdb, "'NewSignature1', 'FileName',
'', '', '', '', '', '', ''"
);
- ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
-
- r = add_signature_entry( hdb, "'NewSignature2',
'NOTEPAD.EXE|notepad.exe', '', '', '', '',
'', '', ''" );
- ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
-
- r = add_signature_entry( hdb, "'NewSignature3',
'NOTEPAD.EXE|notepad.exe', '', '', '', '',
'', '', ''" );
- ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
+ create_signature_table( hdb );
+ add_signature_entry( hdb, "'NewSignature1', 'FileName',
'', '', '', '', '', '', ''"
);
+ add_signature_entry( hdb, "'NewSignature2',
'NOTEPAD.EXE|notepad.exe', '', '', '', '',
'', '', ''" );
+ add_signature_entry( hdb, "'NewSignature3',
'NOTEPAD.EXE|notepad.exe', '', '', '', '',
'', '', ''" );
r = package_from_db( hdb, &hpkg );
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -3968,122 +4105,67 @@ static void test_appsearch_complocator(void)
hdb = create_package_db();
ok(hdb, "Expected a valid database handle\n");
- r = create_appsearch_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP1',
'NewSignature1'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP2',
'NewSignature2'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP3',
'NewSignature3'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP4',
'NewSignature4'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP5',
'NewSignature5'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP6',
'NewSignature6'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP7',
'NewSignature7'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP8',
'NewSignature8'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP9',
'NewSignature9'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP10',
'NewSignature10'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP11',
'NewSignature11'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP12',
'NewSignature12'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_complocator_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_appsearch_table(hdb);
+ add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
+ add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
+ add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
+ add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
+ add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
+ add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
+ add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
+ add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
+ add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
+ add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
+ add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
+ add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
+
+ create_complocator_table(hdb);
/* published component, machine, file, signature, misdbLocatorTypeFile */
- r = add_complocator_entry(hdb, "'NewSignature1',
'{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature1',
'{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
/* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
- r = add_complocator_entry(hdb, "'NewSignature2',
'{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature2',
'{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
/* published component, user-managed, file, signature, misdbLocatorTypeFile */
- r = add_complocator_entry(hdb, "'NewSignature3',
'{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature3',
'{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
/* published component, machine, file, signature, misdbLocatorTypeDirectory */
- r = add_complocator_entry(hdb, "'NewSignature4',
'{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature4',
'{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
/* published component, machine, dir, signature, misdbLocatorTypeDirectory */
- r = add_complocator_entry(hdb, "'NewSignature5',
'{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature5',
'{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
/* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
- r = add_complocator_entry(hdb, "'NewSignature6',
'{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature6',
'{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
/* published component, machine, file, no signature, misdbLocatorTypeFile */
- r = add_complocator_entry(hdb, "'NewSignature7',
'{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature7',
'{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
/* unpublished component, no signature, misdbLocatorTypeDir */
- r = add_complocator_entry(hdb, "'NewSignature8',
'{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature8',
'{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
/* published component, no signature, dir does not exist misdbLocatorTypeDir */
- r = add_complocator_entry(hdb, "'NewSignature9',
'{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature9',
'{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
/* published component, signature w/ ver, misdbLocatorTypeFile */
- r = add_complocator_entry(hdb, "'NewSignature10',
'{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature10',
'{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
/* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
- r = add_complocator_entry(hdb, "'NewSignature11',
'{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature11',
'{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
/* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile
*/
- r = add_complocator_entry(hdb, "'NewSignature12',
'{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_signature_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature1', 'FileName1',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature2', 'FileName2',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature3', 'FileName3',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature4', 'FileName4',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature5', 'FileName5',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature12', 'ignored',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_complocator_entry(hdb, "'NewSignature12',
'{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
+
+ create_signature_table(hdb);
+ add_signature_entry(hdb, "'NewSignature1', 'FileName1',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature2', 'FileName2',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature3', 'FileName3',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature4', 'FileName4',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature5', 'FileName5',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature12', 'ignored',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
r = package_from_db(hdb, &hpkg);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -4219,7 +4301,6 @@ static void test_appsearch_reglocator(void)
BOOL space, version, is_64bit = sizeof(void *) > sizeof(int);
HKEY hklm, classes, hkcu, users;
LPSTR pathdata, pathvar, ptr;
- LPCSTR str;
LONG res;
UINT r, type = 0;
SYSTEM_INFO si;
@@ -4359,295 +4440,175 @@ static void test_appsearch_reglocator(void)
hdb = create_package_db();
ok(hdb, "Expected a valid database handle\n");
- r = create_appsearch_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP1',
'NewSignature1'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP2',
'NewSignature2'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP3',
'NewSignature3'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP4',
'NewSignature4'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP5',
'NewSignature5'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP6',
'NewSignature6'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP7',
'NewSignature7'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP8',
'NewSignature8'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP9',
'NewSignature9'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP10',
'NewSignature10'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP11',
'NewSignature11'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP12',
'NewSignature12'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP13',
'NewSignature13'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP14',
'NewSignature14'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP15',
'NewSignature15'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP16',
'NewSignature16'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP17',
'NewSignature17'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP18',
'NewSignature18'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP19',
'NewSignature19'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP20',
'NewSignature20'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP21',
'NewSignature21'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP22',
'NewSignature22'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP23',
'NewSignature23'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP24',
'NewSignature24'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP25',
'NewSignature25'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP26',
'NewSignature26'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP27',
'NewSignature27'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP28',
'NewSignature28'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP29',
'NewSignature29'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP30',
'NewSignature30'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_reglocator_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_appsearch_table(hdb);
+ add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
+ add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
+ add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
+ add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
+ add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
+ add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
+ add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
+ add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
+ add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
+ add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
+ add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
+ add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
+ add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
+ add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
+ add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
+ add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
+ add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
+ add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
+ add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
+ add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
+ add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
+ add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
+ add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
+ add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
+ add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
+ add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
+ add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
+ add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
+ add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
+ add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
+
+ create_reglocator_table(hdb);
type = msidbLocatorTypeRawValue;
if (is_64bit)
type |= msidbLocatorType64bit;
/* HKLM, msidbLocatorTypeRawValue, REG_SZ */
- r = add_reglocator_entry(hdb, "NewSignature1", 2,
"Software\\Wine", "Value1", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature1", 2, "Software\\Wine",
"Value1", type);
/* HKLM, msidbLocatorTypeRawValue, positive DWORD */
- r = add_reglocator_entry(hdb, "NewSignature2", 2,
"Software\\Wine", "Value2", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature2", 2, "Software\\Wine",
"Value2", type);
/* HKLM, msidbLocatorTypeRawValue, negative DWORD */
- r = add_reglocator_entry(hdb, "NewSignature3", 2,
"Software\\Wine", "Value3", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature3", 2, "Software\\Wine",
"Value3", type);
/* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
- r = add_reglocator_entry(hdb, "NewSignature4", 2,
"Software\\Wine", "Value4", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature4", 2, "Software\\Wine",
"Value4", type);
/* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
- r = add_reglocator_entry(hdb, "NewSignature5", 2,
"Software\\Wine", "Value5", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature5", 2, "Software\\Wine",
"Value5", type);
/* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
- r = add_reglocator_entry(hdb, "NewSignature6", 2,
"Software\\Wine", "Value6", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature6", 2, "Software\\Wine",
"Value6", type);
/* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
- r = add_reglocator_entry(hdb, "NewSignature7", 2,
"Software\\Wine", "Value7", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature7", 2, "Software\\Wine",
"Value7", type);
/* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
- r = add_reglocator_entry(hdb, "NewSignature8", 2,
"Software\\Wine", "Value8", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature8", 2, "Software\\Wine",
"Value8", type);
type = msidbLocatorTypeFileName;
if (is_64bit)
type |= msidbLocatorType64bit;
/* HKLM, msidbLocatorTypeFileName, signature, file exists */
- r = add_reglocator_entry(hdb, "NewSignature9", 2,
"Software\\Wine", "Value9", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature9", 2, "Software\\Wine",
"Value9", type);
/* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
- r = add_reglocator_entry(hdb, "NewSignature10", 2,
"Software\\Wine", "Value10", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature10", 2, "Software\\Wine",
"Value10", type);
/* HKLM, msidbLocatorTypeFileName, no signature */
- r = add_reglocator_entry(hdb, "NewSignature11", 2,
"Software\\Wine", "Value9", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature11", 2, "Software\\Wine",
"Value9", type);
type = msidbLocatorTypeDirectory;
if (is_64bit)
type |= msidbLocatorType64bit;
/* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
- r = add_reglocator_entry(hdb, "NewSignature12", 2,
"Software\\Wine", "Value9", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature12", 2, "Software\\Wine",
"Value9", type);
/* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
- r = add_reglocator_entry(hdb, "NewSignature13", 2,
"Software\\Wine", "Value11", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature13", 2, "Software\\Wine",
"Value11", type);
/* HKLM, msidbLocatorTypeDirectory, signature, file exists */
- r = add_reglocator_entry(hdb, "NewSignature14", 2,
"Software\\Wine", "Value9", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature14", 2, "Software\\Wine",
"Value9", type);
type = msidbLocatorTypeRawValue;
if (is_64bit)
type |= msidbLocatorType64bit;
/* HKCR, msidbLocatorTypeRawValue, REG_SZ */
- r = add_reglocator_entry(hdb, "NewSignature15", 0,
"Software\\Wine", "Value1", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature15", 0, "Software\\Wine",
"Value1", type);
/* HKCU, msidbLocatorTypeRawValue, REG_SZ */
- r = add_reglocator_entry(hdb, "NewSignature16", 1,
"Software\\Wine", "Value1", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature16", 1, "Software\\Wine",
"Value1", type);
/* HKU, msidbLocatorTypeRawValue, REG_SZ */
- r = add_reglocator_entry(hdb, "NewSignature17", 3,
"S-1-5-18\\Software\\Wine", "Value1", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature17", 3,
"S-1-5-18\\Software\\Wine", "Value1", type);
/* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
- r = add_reglocator_entry(hdb, "NewSignature18", 2,
"Software\\Wine", "", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature18", 2, "Software\\Wine",
"", type);
/* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
- r = add_reglocator_entry(hdb, "NewSignature19", 2,
"Software\\IDontExist", "", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature19", 2,
"Software\\IDontExist", "", type);
/* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
- r = add_reglocator_entry(hdb, "NewSignature20", 2,
"Software\\Wine", "Value12", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature20", 2, "Software\\Wine",
"Value12", type);
type = msidbLocatorTypeFileName;
if (is_64bit)
type |= msidbLocatorType64bit;
/* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
- r = add_reglocator_entry(hdb, "NewSignature21", 2,
"Software\\Wine", "Value13", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature21", 2, "Software\\Wine",
"Value13", type);
/* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
- r = add_reglocator_entry(hdb, "NewSignature22", 2,
"Software\\Wine", "Value14", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature22", 2, "Software\\Wine",
"Value14", type);
/* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
- r = add_reglocator_entry(hdb, "NewSignature23", 2,
"Software\\Wine", "Value15", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature23", 2, "Software\\Wine",
"Value15", type);
/* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
- r = add_reglocator_entry(hdb, "NewSignature24", 2,
"Software\\Wine", "Value11", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature24", 2, "Software\\Wine",
"Value11", type);
/* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
- r = add_reglocator_entry(hdb, "NewSignature25", 2,
"Software\\Wine", "Value10", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature25", 2, "Software\\Wine",
"Value10", type);
type = msidbLocatorTypeDirectory;
if (is_64bit)
type |= msidbLocatorType64bit;
/* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
- r = add_reglocator_entry(hdb, "NewSignature26", 2,
"Software\\Wine", "Value11", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature26", 2, "Software\\Wine",
"Value11", type);
/* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
- r = add_reglocator_entry(hdb, "NewSignature27", 2,
"Software\\Wine", "Value10", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature27", 2, "Software\\Wine",
"Value10", type);
/* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
- r = add_reglocator_entry(hdb, "NewSignature28", 2,
"Software\\Wine", "Value10", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature28", 2, "Software\\Wine",
"Value10", type);
type = msidbLocatorTypeFileName;
if (is_64bit)
type |= msidbLocatorType64bit;
/* HKLM, msidbLocatorTypeFile, file exists, in quotes */
- r = add_reglocator_entry(hdb, "NewSignature29", 2,
"Software\\Wine", "Value16", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature29", 2, "Software\\Wine",
"Value16", type);
/* HKLM, msidbLocatorTypeFile, file exists, no quotes */
- r = add_reglocator_entry(hdb, "NewSignature30", 2,
"Software\\Wine", "Value17", type);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_signature_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature9', 'FileName1', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature10', 'FileName2', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature14', 'FileName1', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature30", 2, "Software\\Wine",
"Value17", type);
- str = "'NewSignature21', 'FileName3.dll', '1.1.1.1',
'2.1.1.1', '', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature22', 'FileName4.dll', '1.1.1.1',
'2.1.1.1', '', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature23', 'ignored', '1.1.1.1',
'2.1.1.1', '', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_signature_table(hdb);
+ add_signature_entry(hdb, "'NewSignature9', 'FileName1',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature10', 'FileName2',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature14', 'FileName1',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature21', 'FileName3.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature22', 'FileName4.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature23', 'ignored',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
if (!is_root(CURR_DIR))
{
ptr = strrchr(expected, '\\') + 1;
sprintf(path, "'NewSignature26', '%s', '',
'', '', '', '', '', ''", ptr);
- r = add_signature_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_signature_entry(hdb, path);
}
- str = "'NewSignature27', 'FileName2', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature29', 'FileName1', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature30', 'FileName1', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_signature_entry(hdb, "'NewSignature27', 'FileName2',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature29', 'FileName1',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature30', 'FileName1',
'', '', '', '', '', '',
''");
r = package_from_db(hdb, &hpkg);
ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
@@ -4919,7 +4880,6 @@ static void test_appsearch_inilocator(void)
MSIHANDLE hpkg, hdb;
char path[MAX_PATH], expected[MAX_PATH], prop[MAX_PATH];
BOOL version;
- LPCSTR str;
LPSTR ptr;
DWORD size;
UINT r;
@@ -4959,125 +4919,64 @@ static void test_appsearch_inilocator(void)
hdb = create_package_db();
ok(hdb, "Expected a valid database handle\n");
- r = create_appsearch_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP1',
'NewSignature1'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP2',
'NewSignature2'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP3',
'NewSignature3'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP4',
'NewSignature4'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP5',
'NewSignature5'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP6',
'NewSignature6'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP7',
'NewSignature7'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP8',
'NewSignature8'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP9',
'NewSignature9'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP10',
'NewSignature10'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP11',
'NewSignature11'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP12',
'NewSignature12'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_inilocator_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_appsearch_table(hdb);
+ add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
+ add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
+ add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
+ add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
+ add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
+ add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
+ add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
+ add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
+ add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
+ add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
+ add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
+ add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
+
+ create_inilocator_table(hdb);
/* msidbLocatorTypeRawValue, field 1 */
- str = "'NewSignature1', 'IniFile.ini', 'Section',
'Key', 1, 2";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature1', 'IniFile.ini',
'Section', 'Key', 1, 2");
/* msidbLocatorTypeRawValue, field 2 */
- str = "'NewSignature2', 'IniFile.ini', 'Section',
'Key', 2, 2";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature2', 'IniFile.ini',
'Section', 'Key', 2, 2");
/* msidbLocatorTypeRawValue, entire field */
- str = "'NewSignature3', 'IniFile.ini', 'Section',
'Key', 0, 2";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature3', 'IniFile.ini',
'Section', 'Key', 0, 2");
/* msidbLocatorTypeFile */
- str = "'NewSignature4', 'IniFile.ini', 'Section',
'Key2', 1, 1";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature4', 'IniFile.ini',
'Section', 'Key2', 1, 1");
/* msidbLocatorTypeDirectory, file */
- str = "'NewSignature5', 'IniFile.ini', 'Section',
'Key2', 1, 0";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature5', 'IniFile.ini',
'Section', 'Key2', 1, 0");
/* msidbLocatorTypeDirectory, directory */
- str = "'NewSignature6', 'IniFile.ini', 'Section',
'Key3', 1, 0";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature6', 'IniFile.ini',
'Section', 'Key3', 1, 0");
/* msidbLocatorTypeFile, file, no signature */
- str = "'NewSignature7', 'IniFile.ini', 'Section',
'Key2', 1, 1";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature7', 'IniFile.ini',
'Section', 'Key2', 1, 1");
/* msidbLocatorTypeFile, dir, no signature */
- str = "'NewSignature8', 'IniFile.ini', 'Section',
'Key3', 1, 1";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature8', 'IniFile.ini',
'Section', 'Key3', 1, 1");
/* msidbLocatorTypeFile, file does not exist */
- str = "'NewSignature9', 'IniFile.ini', 'Section',
'Key4', 1, 1";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature9', 'IniFile.ini',
'Section', 'Key4', 1, 1");
/* msidbLocatorTypeFile, signature with version */
- str = "'NewSignature10', 'IniFile.ini', 'Section',
'Key5', 1, 1";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature10', 'IniFile.ini',
'Section', 'Key5', 1, 1");
/* msidbLocatorTypeFile, signature with version, ver > max */
- str = "'NewSignature11', 'IniFile.ini', 'Section',
'Key6', 1, 1";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature11', 'IniFile.ini',
'Section', 'Key6', 1, 1");
/* msidbLocatorTypeFile, signature with version, sig->name ignored */
- str = "'NewSignature12', 'IniFile.ini', 'Section',
'Key7', 1, 1";
- r = add_inilocator_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_signature_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature4', 'FileName1',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_inilocator_entry(hdb, "'NewSignature12', 'IniFile.ini',
'Section', 'Key7', 1, 1");
- r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'NewSignature12', 'ignored',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_signature_table(hdb);
+ add_signature_entry(hdb, "'NewSignature4', 'FileName1',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature9', 'IDontExist',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature12', 'ignored',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
r = package_from_db(hdb, &hpkg);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -5218,7 +5117,6 @@ static void test_appsearch_drlocator(void)
MSIHANDLE hpkg, hdb;
char path[MAX_PATH], expected[MAX_PATH], prop[MAX_PATH];
BOOL version;
- LPCSTR str;
DWORD size;
UINT r;
@@ -5241,152 +5139,87 @@ static void test_appsearch_drlocator(void)
hdb = create_package_db();
ok(hdb, "Expected a valid database handle\n");
- r = create_appsearch_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP1',
'NewSignature1'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP2',
'NewSignature2'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP3',
'NewSignature3'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP4',
'NewSignature4'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP5',
'NewSignature5'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP6',
'NewSignature6'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP7',
'NewSignature7'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP8',
'NewSignature8'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP9',
'NewSignature9'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP10',
'NewSignature10'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP11',
'NewSignature11'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'SIGPROP13',
'NewSignature13'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_drlocator_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_appsearch_table(hdb);
+ add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
+ add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
+ add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
+ add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
+ add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
+ add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
+ add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
+ add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
+ add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
+ add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
+ add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
+ add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
+
+ create_drlocator_table(hdb);
strcpy(expected, CURR_DIR);
if (is_root(CURR_DIR)) expected[2] = 0;
/* no parent, full path, depth 0, signature */
sprintf(path, "'NewSignature1', '', '%s', 0",
expected);
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* no parent, full path, depth 0, no signature */
sprintf(path, "'NewSignature2', '', '%s', 0",
expected);
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* no parent, relative path, depth 0, no signature */
sprintf(path, "'NewSignature3', '', '%s', 0",
expected + 3);
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* no parent, full path, depth 2, signature */
sprintf(path, "'NewSignature4', '', '%s', 2",
expected);
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* no parent, full path, depth 3, signature */
sprintf(path, "'NewSignature5', '', '%s', 3",
expected);
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* no parent, full path, depth 1, signature is dir */
sprintf(path, "'NewSignature6', '', '%s', 1",
expected);
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* parent is in DrLocator, relative path, depth 0, signature */
sprintf(path, "'NewSignature7', 'NewSignature1',
'one\\two\\three', 1");
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* no parent, full path, depth 0, signature w/ version */
sprintf(path, "'NewSignature8', '', '%s', 0",
expected);
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* no parent, full path, depth 0, signature w/ version, ver > max */
sprintf(path, "'NewSignature9', '', '%s', 0",
expected);
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
sprintf(path, "'NewSignature10', '', '%s', 0",
expected);
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
/* no parent, relative empty path, depth 0, no signature */
sprintf(path, "'NewSignature11', '', '', 0");
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
- r = create_reglocator_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_reglocator_table(hdb);
/* parent */
- r = add_reglocator_entry(hdb, "NewSignature12", 2,
"htmlfile\\shell\\open\\nonexistent", "", 1);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_reglocator_entry(hdb, "NewSignature12", 2,
"htmlfile\\shell\\open\\nonexistent", "", 1);
/* parent is in RegLocator, no path, depth 0, no signature */
sprintf(path, "'NewSignature13', 'NewSignature12', '',
0");
- r = add_drlocator_entry(hdb, path);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_signature_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature1', 'FileName1', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature4', 'FileName2', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature5', 'FileName2', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature6', 'another', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature7', 'FileName2', '', '',
'', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature8', 'FileName3.dll', '1.1.1.1',
'2.1.1.1', '', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature9', 'FileName4.dll', '1.1.1.1',
'2.1.1.1', '', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- str = "'NewSignature10', 'necessary', '1.1.1.1',
'2.1.1.1', '', '', '', '', ''";
- r = add_signature_entry(hdb, str);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ add_drlocator_entry(hdb, path);
+
+ create_signature_table(hdb);
+ add_signature_entry(hdb, "'NewSignature1', 'FileName1',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature4', 'FileName2',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature5', 'FileName2',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature6', 'another',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature7', 'FileName2',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature8', 'FileName3.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature9', 'FileName4.dll',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
+ add_signature_entry(hdb, "'NewSignature10', 'necessary',
'1.1.1.1', '2.1.1.1', '', '', '', '',
''");
r = package_from_db(hdb, &hpkg);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -5496,172 +5329,93 @@ static void test_featureparents(void)
hdb = create_package_db();
ok ( hdb, "failed to create package database\n" );
- r = add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'");
- ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
-
- r = create_feature_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
-
- r = create_component_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
+ add_directory_entry(hdb, "'TARGETDIR', '',
'SourceDir'");
- r = create_feature_components_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r
);
-
- r = create_file_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
+ create_feature_table( hdb );
+ create_component_table( hdb );
+ create_feature_components_table( hdb );
+ create_file_table( hdb );
/* msidbFeatureAttributesFavorLocal */
- r = add_feature_entry( hdb, "'zodiac', '', '',
'', 2, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'zodiac', '', '', '',
2, 1, '', 0" );
/* msidbFeatureAttributesFavorSource */
- r = add_feature_entry( hdb, "'perseus', '', '',
'', 2, 1, '', 1" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'perseus', '', '', '',
2, 1, '', 1" );
/* msidbFeatureAttributesFavorLocal */
- r = add_feature_entry( hdb, "'orion', '', '',
'', 2, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'orion', '', '', '', 2,
1, '', 0" );
/* msidbFeatureAttributesUIDisallowAbsent */
- r = add_feature_entry( hdb, "'lyra', '', '', '',
2, 1, '', 16" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'lyra', '', '', '', 2,
1, '', 16" );
/* disabled because of install level */
- r = add_feature_entry( hdb, "'waters', '', '',
'', 15, 101, '', 9" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'waters', '', '', '',
15, 101, '', 9" );
/* child feature of disabled feature */
- r = add_feature_entry( hdb, "'bayer', 'waters', '',
'', 14, 1, '', 9" );
- ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
+ add_feature_entry( hdb, "'bayer', 'waters', '',
'', 14, 1, '', 9" );
/* component of disabled feature (install level) */
- r = add_component_entry( hdb, "'delphinus', '',
'TARGETDIR', 0, '', 'delphinus_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'delphinus', '', 'TARGETDIR',
0, '', 'delphinus_file'" );
/* component of disabled child feature (install level) */
- r = add_component_entry( hdb, "'hydrus', '',
'TARGETDIR', 0, '', 'hydrus_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0,
'', 'hydrus_file'" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
- r = add_component_entry( hdb, "'leo', '', 'TARGETDIR',
0, '', 'leo_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0,
'', 'leo_file'" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
- r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR',
1, '', 'virgo_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1,
'', 'virgo_file'" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
- r = add_component_entry( hdb, "'libra', '', 'TARGETDIR',
2, '', 'libra_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2,
'', 'libra_file'" );
/* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
- r = add_component_entry( hdb, "'cassiopeia', '',
'TARGETDIR', 0, '', 'cassiopeia_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'cassiopeia', '',
'TARGETDIR', 0, '', 'cassiopeia_file'" );
/* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
- r = add_component_entry( hdb, "'cepheus', '',
'TARGETDIR', 1, '', 'cepheus_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'cepheus', '', 'TARGETDIR',
1, '', 'cepheus_file'" );
/* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
- r = add_component_entry( hdb, "'andromeda', '',
'TARGETDIR', 2, '', 'andromeda_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'andromeda', '', 'TARGETDIR',
2, '', 'andromeda_file'" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
- r = add_component_entry( hdb, "'canis', '', 'TARGETDIR',
0, '', 'canis_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0,
'', 'canis_file'" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
- r = add_component_entry( hdb, "'monoceros', '',
'TARGETDIR', 1, '', 'monoceros_file'" );
- ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+ add_component_entry( hdb, "'monoceros', '', 'TARGETDIR',
1, '', 'monoceros_file'" );
/* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
- r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR',
2, '', 'lepus_file'" );
- ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS got %d\n", r);
-
- r = add_feature_components_entry( hdb, "'zodiac', 'leo'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'zodiac', 'virgo'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'zodiac', 'libra'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'perseus',
'cassiopeia'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'perseus',
'cepheus'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'perseus',
'andromeda'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'orion', 'leo'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'orion', 'virgo'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'orion', 'libra'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'orion',
'cassiopeia'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'orion', 'cepheus'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'orion',
'andromeda'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'orion', 'canis'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'orion',
'monoceros'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'orion', 'lepus'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'waters',
'delphinus'" );
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_feature_components_entry( hdb, "'bayer', 'hydrus'"
);
- ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
-
- r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt',
100, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'virgo_file', 'virgo',
'virgo.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'libra_file', 'libra',
'libra.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia',
'cassiopeia.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'cepheus_file', 'cepheus',
'cepheus.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'andromeda_file', 'andromeda',
'andromeda.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'canis_file', 'canis',
'canis.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'monoceros_file', 'monoceros',
'monoceros.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'lepus_file', 'lepus',
'lepus.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'delphinus_file', 'delphinus',
'delphinus.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
-
- r = add_file_entry( hdb, "'hydrus_file', 'hydrus',
'hydrus.txt', 0, '', '1033', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
+ add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2,
'', 'lepus_file'" );
+
+ add_feature_components_entry( hdb, "'zodiac', 'leo'" );
+ add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
+ add_feature_components_entry( hdb, "'zodiac', 'libra'" );
+ add_feature_components_entry( hdb, "'perseus',
'cassiopeia'" );
+ add_feature_components_entry( hdb, "'perseus', 'cepheus'"
);
+ add_feature_components_entry( hdb, "'perseus', 'andromeda'"
);
+ add_feature_components_entry( hdb, "'orion', 'leo'" );
+ add_feature_components_entry( hdb, "'orion', 'virgo'" );
+ add_feature_components_entry( hdb, "'orion', 'libra'" );
+ add_feature_components_entry( hdb, "'orion', 'cassiopeia'"
);
+ add_feature_components_entry( hdb, "'orion', 'cepheus'" );
+ add_feature_components_entry( hdb, "'orion', 'andromeda'"
);
+ add_feature_components_entry( hdb, "'orion', 'canis'" );
+ add_feature_components_entry( hdb, "'orion', 'monoceros'"
);
+ add_feature_components_entry( hdb, "'orion', 'lepus'" );
+ add_feature_components_entry( hdb, "'waters', 'delphinus'"
);
+ add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
+
+ add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100,
'', '1033', 8192, 1" );
+ add_file_entry( hdb, "'virgo_file', 'virgo',
'virgo.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'libra_file', 'libra',
'libra.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia',
'cassiopeia.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'cepheus_file', 'cepheus',
'cepheus.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'andromeda_file', 'andromeda',
'andromeda.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'canis_file', 'canis',
'canis.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'monoceros_file', 'monoceros',
'monoceros.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'lepus_file', 'lepus',
'lepus.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'delphinus_file', 'delphinus',
'delphinus.txt', 0, '', '1033', 8192, 1" );
+ add_file_entry( hdb, "'hydrus_file', 'hydrus',
'hydrus.txt', 0, '', '1033', 8192, 1" );
r = package_from_db( hdb, &hpkg );
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -6128,15 +5882,12 @@ static void test_launchconditions(void)
hdb = create_package_db();
ok( hdb, "failed to create package database\n" );
- r = create_launchcondition_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
+ create_launchcondition_table( hdb );
- r = add_launchcondition_entry( hdb, "'X = \"1\"',
'one'" );
- ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
+ add_launchcondition_entry( hdb, "'X = \"1\"',
'one'" );
/* invalid condition */
- r = add_launchcondition_entry( hdb, "'X != \"1\"',
'one'" );
- ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
+ add_launchcondition_entry( hdb, "'X != \"1\"',
'one'" );
r = package_from_db( hdb, &hpkg );
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -6179,29 +5930,17 @@ static void test_ccpsearch(void)
hdb = create_package_db();
ok(hdb, "failed to create package database\n");
- r = create_ccpsearch_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_ccpsearch_entry(hdb, "'CCP_random'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_reglocator_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_reglocator_entry(hdb, "CCP_random", 0,
"htmlfile\\shell\\open\\nonexistent", "", 1);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_ccpsearch_table(hdb);
+ add_ccpsearch_entry(hdb, "'CCP_random'");
+ add_ccpsearch_entry(hdb, "'RMCCP_random'");
- r = create_drlocator_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_reglocator_table(hdb);
+ add_reglocator_entry(hdb, "CCP_random", 0,
"htmlfile\\shell\\open\\nonexistent", "", 1);
- r = add_drlocator_entry(hdb, "'RMCCP_random', '',
'C:\\', '0'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_drlocator_table(hdb);
+ add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\',
'0'");
- r = create_signature_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_signature_table(hdb);
r = package_from_db(hdb, &hpkg);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -6238,134 +5977,51 @@ static void test_complocator(void)
hdb = create_package_db();
ok(hdb, "failed to create package database\n");
- r = create_appsearch_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'ABELISAURUS',
'abelisaurus'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'BACTROSAURUS',
'bactrosaurus'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'GALLIMIMUS',
'gallimimus'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'MEGARAPTOR',
'megaraptor'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'OLOROTITAN',
'olorotitan'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_appsearch_entry(hdb, "'PANTYDRACO',
'pantydraco'");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_complocator_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'abelisaurus',
'{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'bactrosaurus',
'{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'camelotia',
'{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'diclonius',
'{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'echinodon',
'{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'falcarius',
'{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'gallimimus',
'{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'hagrphus',
'{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'iguanodon',
'{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'jobaria',
'{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'kakuru',
'{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'labocania',
'{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'megaraptor',
'{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'neosodon',
'{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'olorotitan',
'{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_complocator_entry(hdb, "'pantydraco',
'{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = create_signature_table(hdb);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'camelotia', 'camelotia',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'diclonius', 'diclonius',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'iguanodon', 'iguanodon',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'jobaria', 'jobaria', '',
'', '', '', '', '', ''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'kakuru', 'kakuru', '',
'', '', '', '', '', ''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-
- r = add_signature_entry(hdb, "'labocania', 'labocania',
'', '', '', '', '', '',
''");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_appsearch_table(hdb);
+ add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
+ add_appsearch_entry(hdb, "'BACTROSAURUS',
'bactrosaurus'");
+ add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
+ add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
+ add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
+ add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
+ add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
+ add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
+ add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
+ add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
+ add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
+ add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
+ add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
+ add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
+ add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
+ add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
+
+ create_complocator_table(hdb);
+ add_complocator_entry(hdb, "'abelisaurus',
'{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
+ add_complocator_entry(hdb, "'bactrosaurus',
'{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
+ add_complocator_entry(hdb, "'camelotia',
'{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
+ add_complocator_entry(hdb, "'diclonius',
'{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
+ add_complocator_entry(hdb, "'echinodon',
'{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
+ add_complocator_entry(hdb, "'falcarius',
'{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
+ add_complocator_entry(hdb, "'gallimimus',
'{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
+ add_complocator_entry(hdb, "'hagrphus',
'{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
+ add_complocator_entry(hdb, "'iguanodon',
'{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
+ add_complocator_entry(hdb, "'jobaria',
'{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
+ add_complocator_entry(hdb, "'kakuru',
'{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
+ add_complocator_entry(hdb, "'labocania',
'{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
+ add_complocator_entry(hdb, "'megaraptor',
'{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
+ add_complocator_entry(hdb, "'neosodon',
'{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
+ add_complocator_entry(hdb, "'olorotitan',
'{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
+ add_complocator_entry(hdb, "'pantydraco',
'{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
+
+ create_signature_table(hdb);
+ add_signature_entry(hdb, "'abelisaurus', 'abelisaurus',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus',
'', '', '', '', '', '',
''");
+ add_signature_entry(hdb, "'camelotia', 'camelotia', '',
'', '', '', '', '', ''");
+ add_signature_entry(hdb, "'diclonius', 'diclonius', '',
'', '', '', '', '', ''");
+ add_signature_entry(hdb, "'iguanodon', 'iguanodon', '',
'', '', '', '', '', ''");
+ add_signature_entry(hdb, "'jobaria', 'jobaria', '',
'', '', '', '', '', ''");
+ add_signature_entry(hdb, "'kakuru', 'kakuru', '',
'', '', '', '', '', ''");
+ add_signature_entry(hdb, "'labocania', 'labocania', '',
'', '', '', '', '', ''");
r = package_from_db(hdb, &hpkg);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -6596,14 +6252,9 @@ static void test_MsiGetSourcePath(void)
set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
- r = add_directory_entry(hdb, "'TARGETDIR', '',
'SourceDir'");
- ok(r == S_OK, "failed\n");
-
- r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR',
'subtarget:subsource'");
- ok(r == S_OK, "failed\n");
-
- r = add_directory_entry(hdb, "'SubDir2', 'SubDir',
'sub2'");
- ok(r == S_OK, "failed\n");
+ add_directory_entry(hdb, "'TARGETDIR', '',
'SourceDir'");
+ add_directory_entry(hdb, "'SubDir', 'TARGETDIR',
'subtarget:subsource'");
+ add_directory_entry(hdb, "'SubDir2', 'SubDir',
'sub2'");
r = MsiDatabaseCommit(hdb);
ok(r == ERROR_SUCCESS , "Failed to commit database\n");
@@ -7377,37 +7028,29 @@ static void test_shortlongsource(void)
set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
- r = add_directory_entry(hdb, "'TARGETDIR', '',
'SourceDir'");
- ok(r == S_OK, "failed\n");
-
- r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR',
'short|long'");
- ok(r == S_OK, "failed\n");
+ add_directory_entry(hdb, "'TARGETDIR', '',
'SourceDir'");
+ add_directory_entry(hdb, "'SubDir', 'TARGETDIR',
'short|long'");
/* CostInitialize:short */
- r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR',
'one|two'");
- ok(r == S_OK, "failed\n");
+ add_directory_entry(hdb, "'SubDir2', 'TARGETDIR',
'one|two'");
/* CostInitialize:long */
- r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR',
'three|four'");
- ok(r == S_OK, "failed\n");
+ add_directory_entry(hdb, "'SubDir3', 'TARGETDIR',
'three|four'");
/* FileCost:short */
- r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR',
'five|six'");
- ok(r == S_OK, "failed\n");
+ add_directory_entry(hdb, "'SubDir4', 'TARGETDIR',
'five|six'");
/* FileCost:long */
- r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR',
'seven|eight'");
- ok(r == S_OK, "failed\n");
+ add_directory_entry(hdb, "'SubDir5', 'TARGETDIR',
'seven|eight'");
/* CostFinalize:short */
- r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR',
'nine|ten'");
- ok(r == S_OK, "failed\n");
+ add_directory_entry(hdb, "'SubDir6', 'TARGETDIR',
'nine|ten'");
/* CostFinalize:long */
- r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR',
'eleven|twelve'");
- ok(r == S_OK, "failed\n");
+ add_directory_entry(hdb, "'SubDir7', 'TARGETDIR',
'eleven|twelve'");
- MsiDatabaseCommit(hdb);
+ r = MsiDatabaseCommit(hdb);
+ ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
r = package_from_db(hdb, &hpkg);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -7716,8 +7359,7 @@ static void test_sourcedir(void)
hdb = create_package_db();
ok( hdb, "failed to create database\n");
- r = add_directory_entry(hdb, "'TARGETDIR', '',
'SourceDir'");
- ok(r == S_OK, "failed\n");
+ add_directory_entry(hdb, "'TARGETDIR', '',
'SourceDir'");
sprintf(package, "#%u", hdb);
r = MsiOpenPackageA(package, &hpkg);
@@ -8416,18 +8058,10 @@ static void test_MsiGetProductProperty(void)
"PRIMARY KEY `Directory`)");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- r = run_query(hdb,
- "CREATE TABLE `Property` ( "
- "`Property` CHAR(72) NOT NULL, "
- "`Value` CHAR(255) "
- "PRIMARY KEY `Property`)");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ create_property_table(hdb);
- sprintf(query, "INSERT INTO `Property` "
- "(`Property`, `Value`) "
- "VALUES( 'ProductCode', '%s' )", prodcode);
- r = run_query(hdb, query);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ sprintf(query, "'ProductCode', '%s'", prodcode);
+ r = add_property_entry(hdb, query);
r = MsiDatabaseCommit(hdb);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
@@ -8884,73 +8518,37 @@ static void test_MsiEnumComponentCosts(void)
hdb = create_package_db();
ok( hdb, "failed to create database\n" );
- r = create_property_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Property table %u\n", r );
-
- r = add_property_entry( hdb, "'ProductCode',
'{379B1C47-40C1-42FA-A9BB-BEBB6F1B0172}'" );
- ok( r == ERROR_SUCCESS, "cannot add property entry %u\n", r );
-
- r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
- ok( r == ERROR_SUCCESS, "cannot add property entry %u\n", r );
-
- r = add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'" );
- ok( r == ERROR_SUCCESS, "failed to add directory entry %u\n" , r );
-
- r = create_media_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Media table %u\n", r );
-
- r = add_media_entry( hdb, "'1', '2', 'cabinet',
'', '', ''");
- ok( r == ERROR_SUCCESS, "cannot add media entry %u\n", r );
-
- r = create_file_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create File table %u\n", r );
-
- r = add_file_entry( hdb, "'one.txt', 'one', 'one.txt',
4096, '', '', 8192, 1" );
- ok( r == ERROR_SUCCESS, "cannot add file %u\n", r );
-
- r = create_component_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Component table %u\n", r );
-
- r = add_component_entry( hdb, "'one',
'{B2F86B9D-8447-4BC5-8883-750C45AA31CA}', 'TARGETDIR', 0, '',
'one.txt'" );
- ok( r == ERROR_SUCCESS, "cannot add component %u\n", r );
-
- r = add_component_entry( hdb, "'two',
'{62A09F6E-0B74-4829-BDB7-CAB66F42CCE8}', 'TARGETDIR', 0, '',
''" );
- ok( r == ERROR_SUCCESS, "cannot add component %u\n", r );
-
- r = create_feature_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create Feature table %u\n", r );
-
- r = add_feature_entry( hdb, "'one', '', '', '',
0, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature %u\n", r );
-
- r = add_feature_entry( hdb, "'two', '', '', '',
0, 1, '', 0" );
- ok( r == ERROR_SUCCESS, "cannot add feature %u\n", r );
-
- r = create_feature_components_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table %u\n", r );
-
- r = add_feature_components_entry( hdb, "'one', 'one'" );
- ok( r == ERROR_SUCCESS, "cannot add feature/component pair %u\n", r );
+ create_property_table( hdb );
+ add_property_entry( hdb, "'ProductCode',
'{379B1C47-40C1-42FA-A9BB-BEBB6F1B0172}'" );
+ add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
+ add_directory_entry( hdb, "'TARGETDIR', '',
'SourceDir'" );
- r = add_feature_components_entry( hdb, "'two', 'two'" );
- ok( r == ERROR_SUCCESS, "cannot add feature/component pair %u\n", r );
+ create_media_table( hdb );
+ add_media_entry( hdb, "'1', '2', 'cabinet', '',
'', ''");
- r = create_install_execute_sequence_table( hdb );
- ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table %u\n",
r );
+ create_file_table( hdb );
+ add_file_entry( hdb, "'one.txt', 'one', 'one.txt', 4096,
'', '', 8192, 1" );
- r = add_install_execute_sequence_entry( hdb, "'CostInitialize',
'', '800'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r
);
+ create_component_table( hdb );
+ add_component_entry( hdb, "'one',
'{B2F86B9D-8447-4BC5-8883-750C45AA31CA}', 'TARGETDIR', 0, '',
'one.txt'" );
+ add_component_entry( hdb, "'two',
'{62A09F6E-0B74-4829-BDB7-CAB66F42CCE8}', 'TARGETDIR', 0, '',
''" );
- r = add_install_execute_sequence_entry( hdb, "'FileCost', '',
'900'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r
);
+ create_feature_table( hdb );
+ add_feature_entry( hdb, "'one', '', '', '', 0,
1, '', 0" );
+ add_feature_entry( hdb, "'two', '', '', '', 0,
1, '', 0" );
- r = add_install_execute_sequence_entry( hdb, "'CostFinalize',
'', '1000'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r
);
+ create_feature_components_table( hdb );
+ add_feature_components_entry( hdb, "'one', 'one'" );
+ add_feature_components_entry( hdb, "'two', 'two'" );
- r = add_install_execute_sequence_entry( hdb, "'InstallValidate',
'', '1100'" );
- ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r
);
+ create_install_execute_sequence_table( hdb );
+ add_install_execute_sequence_entry( hdb, "'CostInitialize', '',
'800'" );
+ add_install_execute_sequence_entry( hdb, "'FileCost', '',
'900'" );
+ add_install_execute_sequence_entry( hdb, "'CostFinalize', '',
'1000'" );
+ add_install_execute_sequence_entry( hdb, "'InstallValidate', '',
'1100'" );
- MsiDatabaseCommit( hdb );
+ r = MsiDatabaseCommit( hdb );
+ ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
sprintf( package, "#%u", hdb );
r = MsiOpenPackageA( package, &hpkg );
@@ -9108,8 +8706,7 @@ static void test_MsiDatabaseCommit(void)
hdb = create_package_db();
ok( hdb, "failed to create database\n" );
- r = create_property_table( hdb );
- ok( r == ERROR_SUCCESS, "can't create Property table %u\n", r );
+ create_property_table( hdb );
sprintf( package, "#%u", hdb );
r = MsiOpenPackageA( package, &hpkg );
@@ -9293,7 +8890,7 @@ static void ok_sequence_(const struct externalui_message *expected,
const char *
{
if (expected->message == actual->message)
{
- if (expected->field_count != actual->field_count)
+ if (expected->field_count < actual->field_count)
{
todo_wine_if (todo)
ok_(file, line) (FALSE, "%s: in msg 0x%08x expecting field count
%d got %d\n",
@@ -9315,6 +8912,10 @@ static void ok_sequence_(const struct externalui_message *expected,
const char *
expected++;
actual++;
}
+ else if (expected->optional)
+ {
+ expected++;
+ }
else
{
todo_wine_if (todo)
@@ -9349,6 +8950,26 @@ done:
#define ok_sequence(exp, contx, todo) \
ok_sequence_((exp), (contx), (todo), __FILE__, __LINE__)
+/* don't use PROGRESS, which is timing-dependent,
+ * or SHOWDIALOG, which due to a bug causes a hang on XP */
+static const INSTALLLOGMODE MSITEST_INSTALLLOGMODE =
+ INSTALLLOGMODE_FATALEXIT |
+ INSTALLLOGMODE_ERROR |
+ INSTALLLOGMODE_WARNING |
+ INSTALLLOGMODE_USER |
+ INSTALLLOGMODE_INFO |
+ INSTALLLOGMODE_FILESINUSE |
+ INSTALLLOGMODE_RESOLVESOURCE |
+ INSTALLLOGMODE_OUTOFDISKSPACE |
+ INSTALLLOGMODE_ACTIONSTART |
+ INSTALLLOGMODE_ACTIONDATA |
+ INSTALLLOGMODE_COMMONDATA |
+ INSTALLLOGMODE_INITIALIZE |
+ INSTALLLOGMODE_TERMINATE |
+ INSTALLLOGMODE_RMFILESINUSE |
+ INSTALLLOGMODE_INSTALLSTART |
+ INSTALLLOGMODE_INSTALLEND;
+
static const struct externalui_message empty_sequence[] = {
{0}
};
@@ -9490,8 +9111,9 @@ static INT CALLBACK externalui_message_callback(void *context, UINT
message, MSI
{
INT retval = context ? *((INT *)context) : 0;
struct externalui_message msg;
- char buffer[100];
- DWORD length = 100;
+ char buffer[256];
+ DWORD length;
+ UINT r;
int i;
msg.message = message;
@@ -9505,11 +9127,16 @@ static INT CALLBACK externalui_message_callback(void *context,
UINT message, MSI
msg.field_count = MsiRecordGetFieldCount(hrecord);
for (i = 0; i <= msg.field_count; i++)
{
- length = 100;
- MsiRecordGetStringA(hrecord, i, buffer, &length);
+ length = sizeof(buffer);
+ r = MsiRecordGetStringA(hrecord, i, buffer, &length);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
memcpy(msg.field[i], buffer, min(100, length+1));
}
+ /* top-level actions dump a list of all set properties; skip them since they're
inconsistent */
+ if (message == (INSTALLMESSAGE_INFO|MB_ICONHAND) && msg.field_count > 0
&& !strncmp(msg.field[0], "Property", 8))
+ return retval;
+
add_message(&msg);
return retval;
@@ -9526,9 +9153,8 @@ static void test_externalui_message(void)
MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
- /* processing SHOWDIALOG with a record handler causes a crash on XP */
MsiSetExternalUIA(externalui_message_string_callback, INSTALLLOGMODE_SHOWDIALOG,
&retval);
- r = MsiSetExternalUIRecord(externalui_message_callback, 0xffffffff ^
INSTALLLOGMODE_PROGRESS ^ INSTALLLOGMODE_SHOWDIALOG, &retval, &prev);
+ r = MsiSetExternalUIRecord(externalui_message_callback, MSITEST_INSTALLLOGMODE,
&retval, &prev);
flush_sequence();
@@ -9546,12 +9172,9 @@ 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);
+ create_actiontext_table(hdb);
+ add_actiontext_entry(hdb, "'custom', 'description',
'template'");
+ add_actiontext_entry(hdb, "'CostInitialize', 'cost description',
'cost template'");
r = MsiOpenPackageA(NULL, &hpkg);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got
%d\n", r);
@@ -9639,15 +9262,11 @@ static void test_externalui_message(void)
r = MsiDatabaseImportA(hdb, CURR_DIR, "forcecodepage.idt");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- r = create_dialog_table(hdb);
- ok(r == ERROR_SUCCESS, "failed to create dialog table %u\n", r);
- r = add_dialog_entry(hdb, "'dialog', 50, 50, 100, 100, 0,
'dummy'");
- ok(r == ERROR_SUCCESS, "failed to insert into dialog table %u\n", r);
+ create_dialog_table(hdb);
+ add_dialog_entry(hdb, "'dialog', 50, 50, 100, 100, 0,
'dummy'");
- r = create_control_table(hdb);
- ok(r == ERROR_SUCCESS, "failed to create control table %u\n", r);
- r = add_control_entry(hdb, "'dialog', 'dummy', 'Text',
5, 5, 5, 5, 3, 'dummy'");
- ok(r == ERROR_SUCCESS, "failed to insert into control table %u\n", r);
+ create_control_table(hdb);
+ add_control_entry(hdb, "'dialog', 'dummy', 'Text', 5, 5,
5, 5, 3, 'dummy'");
r = package_from_db(hdb, &hpkg);
ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
@@ -9751,9 +9370,8 @@ static void test_controlevent(void)
MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
- /* processing SHOWDIALOG with a record handler causes a crash on XP */
MsiSetExternalUIA(externalui_message_string_callback, INSTALLLOGMODE_SHOWDIALOG,
NULL);
- r = MsiSetExternalUIRecord(externalui_message_callback, 0xffffffff ^
INSTALLLOGMODE_PROGRESS ^ INSTALLLOGMODE_SHOWDIALOG, NULL, &prev);
+ r = MsiSetExternalUIRecord(externalui_message_callback, MSITEST_INSTALLLOGMODE, NULL,
&prev);
flush_sequence();
@@ -9766,53 +9384,33 @@ static void test_controlevent(void)
r = MsiDatabaseImportA(hdb, CURR_DIR, "forcecodepage.idt");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- r = create_dialog_table(hdb);
- ok(r == ERROR_SUCCESS, "failed to create Dialog table: %u\n", r);
- r = add_dialog_entry(hdb, "'spawn', 50, 50, 100, 100, 3,
'button'");
- ok(r == ERROR_SUCCESS, "failed to insert into Dialog table: %u\n", r);
- r = add_dialog_entry(hdb, "'spawn2', 50, 50, 100, 100, 3,
'button'");
- ok(r == ERROR_SUCCESS, "failed to insert into Dialog table: %u\n", r);
- r = add_dialog_entry(hdb, "'child1', 50, 50, 80, 40, 3,
'exit'");
- ok(r == ERROR_SUCCESS, "failed to insert into Dialog table: %u\n", r);
- r = add_dialog_entry(hdb, "'child2', 50, 50, 80, 40, 3,
'exit'");
- ok(r == ERROR_SUCCESS, "failed to insert into Dialog table: %u\n", r);
-
- r = create_control_table(hdb);
- ok(r == ERROR_SUCCESS, "failed to create Control table: %u\n", r);
- r = add_control_entry(hdb, "'spawn', 'button',
'PushButton', 10, 10, 66, 17, 3, 'Click me'");
- ok(r == ERROR_SUCCESS, "failed to insert into Control table: %u\n", r);
- r = add_control_entry(hdb, "'spawn2', 'button',
'PushButton', 10, 10, 66, 17, 3, 'Click me'");
- ok(r == ERROR_SUCCESS, "failed to insert into Control table: %u\n", r);
- r = add_control_entry(hdb, "'child1', 'exit',
'PushButton', 10, 10, 66, 17, 3, 'Click me'");
- ok(r == ERROR_SUCCESS, "failed to insert into Control table: %u\n", r);
- r = add_control_entry(hdb, "'child2', 'exit',
'PushButton', 10, 10, 66, 17, 3, 'Click me'");
- ok(r == ERROR_SUCCESS, "failed to insert into Control table: %u\n", r);
-
- r = create_controlevent_table(hdb);
- ok(r == ERROR_SUCCESS, "failed to create ControlEvent table: %u\n", r);
- r = add_controlevent_entry(hdb, "'child1', 'exit',
'EndDialog', 'Exit', 1, 1");
- ok(r == ERROR_SUCCESS, "failed to insert into ControlEvent table: %u\n",
r);
- r = add_controlevent_entry(hdb, "'child2', 'exit',
'EndDialog', 'Exit', 1, 1");
- ok(r == ERROR_SUCCESS, "failed to insert into ControlEvent table: %u\n",
r);
-
- r = create_custom_action_table(hdb);
- ok(r == ERROR_SUCCESS, "failed to create CustomAction table: %u\n", r);
- r = add_custom_action_entry(hdb, "'custom', 51, 'dummy',
'dummy value'");
- ok(r == ERROR_SUCCESS, "failed to insert into CustomAction table: %u\n",
r);
+ create_dialog_table(hdb);
+ add_dialog_entry(hdb, "'spawn', 50, 50, 100, 100, 3,
'button'");
+ add_dialog_entry(hdb, "'spawn2', 50, 50, 100, 100, 3,
'button'");
+ add_dialog_entry(hdb, "'child1', 50, 50, 80, 40, 3,
'exit'");
+ add_dialog_entry(hdb, "'child2', 50, 50, 80, 40, 3,
'exit'");
+
+ create_control_table(hdb);
+ add_control_entry(hdb, "'spawn', 'button', 'PushButton',
10, 10, 66, 17, 3, 'Click me'");
+ add_control_entry(hdb, "'spawn2', 'button',
'PushButton', 10, 10, 66, 17, 3, 'Click me'");
+ add_control_entry(hdb, "'child1', 'exit', 'PushButton',
10, 10, 66, 17, 3, 'Click me'");
+ add_control_entry(hdb, "'child2', 'exit', 'PushButton',
10, 10, 66, 17, 3, 'Click me'");
+
+ create_controlevent_table(hdb);
+ add_controlevent_entry(hdb, "'child1', 'exit',
'EndDialog', 'Exit', 1, 1");
+ add_controlevent_entry(hdb, "'child2', 'exit',
'EndDialog', 'Exit', 1, 1");
+
+ create_custom_action_table(hdb);
+ add_custom_action_entry(hdb, "'custom', 51, 'dummy', 'dummy
value'");
/* SpawnDialog and EndDialog should trigger after all other events */
- r = add_controlevent_entry(hdb, "'spawn', 'button',
'SpawnDialog', 'child1', 1, 1");
- ok(r == ERROR_SUCCESS, "failed to insert into ControlEvent table: %u\n",
r);
- r = add_controlevent_entry(hdb, "'spawn', 'button',
'DoAction', 'custom', 1, 2");
- ok(r == ERROR_SUCCESS, "failed to insert into ControlEvent table: %u\n",
r);
+ add_controlevent_entry(hdb, "'spawn', 'button',
'SpawnDialog', 'child1', 1, 1");
+ add_controlevent_entry(hdb, "'spawn', 'button',
'DoAction', 'custom', 1, 2");
/* Multiple dialog events cause only the last one to be triggered */
- r = add_controlevent_entry(hdb, "'spawn2', 'button',
'SpawnDialog', 'child1', 1, 1");
- ok(r == ERROR_SUCCESS, "failed to insert into ControlEvent table: %u\n",
r);
- r = add_controlevent_entry(hdb, "'spawn2', 'button',
'SpawnDialog', 'child2', 1, 2");
- ok(r == ERROR_SUCCESS, "failed to insert into ControlEvent table: %u\n",
r);
- r = add_controlevent_entry(hdb, "'spawn2', 'button',
'DoAction', 'custom', 1, 3");
- ok(r == ERROR_SUCCESS, "failed to insert into ControlEvent table: %u\n",
r);
+ add_controlevent_entry(hdb, "'spawn2', 'button',
'SpawnDialog', 'child1', 1, 1");
+ add_controlevent_entry(hdb, "'spawn2', 'button',
'SpawnDialog', 'child2', 1, 2");
+ add_controlevent_entry(hdb, "'spawn2', 'button',
'DoAction', 'custom', 1, 3");
r = package_from_db(hdb, &hpkg);
ok(r == ERROR_SUCCESS, "failed to create package: %u\n", r);
@@ -9834,6 +9432,249 @@ static void test_controlevent(void)
DeleteFileA("forcecodepage.idt");
}
+static const struct externalui_message toplevel_install_sequence[] = {
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "INSTALL", "",
""}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", ""}, {0, 1,
1}},
+
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO|MB_ICONHAND, 0, {""}, {0}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "1", "",
""}, {0, 1, 0, 0}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "INSTALL", "",
""}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", ""}, {0, 1,
1}},
+ {INSTALLMESSAGE_INSTALLSTART, 2, {"", "",
"{7262AC98-EEBD-4364-8CE3-D654F6A425B9}"}, {1, 1, 1}, 1},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "CostInitialize",
"", ""}, {0, 1, 0, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostInitialize", ""},
{0, 1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostInitialize", "1"},
{0, 1, 1}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "FileCost", "",
""}, {0, 1, 0, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "FileCost", "1"}, {0, 1,
1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "FileCost", "1"}, {0, 1,
1}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "CostFinalize",
"", ""}, {0, 1, 0, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostFinalize", "1"}, {0,
1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostFinalize", "1"}, {0,
1, 1}},
+
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", "1"}, {0, 1,
1}},
+ {INSTALLMESSAGE_INSTALLEND, 3, {"", "",
"{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "1"}, {1, 1, 1, 1}, 1},
+
+ /* property dump */
+
+ {INSTALLMESSAGE_COMMONDATA, 2, {"", "2", "0"}, {0, 1,
1}, 1},
+ {INSTALLMESSAGE_COMMONDATA, 2, {"", "2", "1"}, {0, 1,
1}, 1},
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", "1"}, {0, 1,
1}},
+ {0}
+};
+
+static const struct externalui_message toplevel_install_ui_sequence[] = {
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "INSTALL", "",
""}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", ""}, {0, 1,
1}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "AppSearch", "",
""}, {0, 1, 0, 0}},
+ {INSTALLMESSAGE_INFO, 2, {"", "AppSearch", ""}, {0, 1,
1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "AppSearch", "0"}, {0, 1,
1}},
+
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", "1"}, {0, 1,
1}},
+ {0}
+};
+
+static const struct externalui_message toplevel_executeaction_install_sequence[] = {
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "ExecuteAction",
"", ""}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "ExecuteAction", "1"},
{0, 1, 1}},
+
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "1", "",
""}, {0, 1, 0, 0}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "INSTALL", "",
""}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", ""}, {0, 1,
1}},
+ {INSTALLMESSAGE_INSTALLSTART, 2, {"", "",
"{7262AC98-EEBD-4364-8CE3-D654F6A425B9}"}, {1, 1, 1}, 1},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "CostInitialize",
"", ""}, {0, 1, 0, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostInitialize"}, {0, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostInitialize", "1"},
{0, 1, 1}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "FileCost", "",
""}, {0, 1, 0, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "FileCost", "1"}, {0, 1,
1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "FileCost", "1"}, {0, 1,
1}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "CostFinalize",
"", ""}, {0, 1, 0, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostFinalize", "1"}, {0,
1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostFinalize", "1"}, {0,
1, 1}},
+
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", "1"}, {0, 1,
1}},
+ {INSTALLMESSAGE_INSTALLEND, 3, {"", "",
"{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "1"}, {1, 1, 1, 1}, 1},
+
+ /* property dump */
+
+ {INSTALLMESSAGE_COMMONDATA, 2, {"", "2", "0"}, {0, 1,
1}, 1},
+ {INSTALLMESSAGE_COMMONDATA, 2, {"", "2", "1"}, {0, 1,
1}, 1},
+ {INSTALLMESSAGE_INFO, 2, {"", "ExecuteAction", "1"},
{0, 1, 1}},
+ {0}
+};
+
+static const struct externalui_message toplevel_executeaction_costinitialize_sequence[] =
{
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "ExecuteAction",
"", ""}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "ExecuteAction", "1"},
{0, 1, 1}},
+
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "1", "",
""}, {0, 1, 0, 0}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "CostInitialize",
"", ""}, {0, 1, 0, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostInitialize", ""},
{0, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CostInitialize", "1"},
{0, 1, 1}},
+
+ /* property dump */
+
+ {INSTALLMESSAGE_COMMONDATA, 2, {"", "2", "0"}, {0, 1,
1}, 1},
+ {INSTALLMESSAGE_COMMONDATA, 2, {"", "2", "1"}, {0, 1,
1}, 1},
+ {INSTALLMESSAGE_INFO, 2, {"", "ExecuteAction", "1"},
{0, 1, 1}},
+ {0}
+};
+
+static const struct externalui_message toplevel_msiinstallproduct_sequence[] = {
+ {INSTALLMESSAGE_INITIALIZE, -1},
+
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO|MB_ICONHAND, 0, {""}, {0}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "1", "",
""}, {0, 1, 0, 0}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "INSTALL", "",
""}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", ""}, {0, 1,
1}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "AppSearch", "",
""}, {0, 1, 0, 0}},
+ {INSTALLMESSAGE_INFO, 2, {"", "AppSearch", ""}, {0, 1,
1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "AppSearch", "0"}, {0, 1,
1}},
+
+ {INSTALLMESSAGE_INFO, 2, {"", "INSTALL", "1"}, {0, 1,
1}},
+
+ /* property dump */
+
+ {INSTALLMESSAGE_INFO|MB_ICONHAND, 0, {""}, {0}},
+ {INSTALLMESSAGE_TERMINATE, -1},
+ {0}
+};
+
+static const struct externalui_message toplevel_msiinstallproduct_custom_sequence[] = {
+ {INSTALLMESSAGE_INITIALIZE, -1},
+
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {1, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO|MB_ICONHAND, 0, {""}, {0}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "0", "1033",
"1252"}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_COMMONDATA, 3, {"", "1", "",
""}, {0, 1, 0, 0}},
+
+ {INSTALLMESSAGE_ACTIONSTART, 3, {"", "CUSTOM", "",
""}, {0, 1, 1, 1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CUSTOM", ""}, {0, 1,
1}},
+ {INSTALLMESSAGE_INFO, 2, {"", "CUSTOM", "0"}, {0, 1,
1}},
+
+ /* property dump */
+
+ {INSTALLMESSAGE_INFO|MB_ICONHAND, 0, {""}, {0}},
+ {INSTALLMESSAGE_TERMINATE, -1},
+ {0}
... 162 lines suppressed ...