Author: cwittich
Date: Tue Dec 22 10:14:17 2009
New Revision: 44692
URL:
http://svn.reactos.org/svn/reactos?rev=44692&view=rev
Log:
sync msi_winetest with wine 1.1.35
Modified:
trunk/rostests/winetests/msi/automation.c
trunk/rostests/winetests/msi/db.c
trunk/rostests/winetests/msi/format.c
trunk/rostests/winetests/msi/install.c
trunk/rostests/winetests/msi/msi.c
trunk/rostests/winetests/msi/package.c
trunk/rostests/winetests/msi/record.c
trunk/rostests/winetests/msi/suminfo.c
Modified: trunk/rostests/winetests/msi/automation.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/automation.…
==============================================================================
--- trunk/rostests/winetests/msi/automation.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/automation.c [iso-8859-1] Tue Dec 22 10:14:17 2009
@@ -34,8 +34,8 @@
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
-static const char *msifile = "winetest.msi";
-static const WCHAR szMsifile[] =
{'w','i','n','e','t','e','s','t','.','m','s','i',0};
+static const char *msifile = "winetest-automation.msi";
+static const WCHAR szMsifile[] =
{'w','i','n','e','t','e','s','t','-','a','u','t','o','m','a','t','i','o','n','.','m','s','i',0};
static const WCHAR szMSITEST[] = {
'M','S','I','T','E','S','T',0 };
static const WCHAR szProductCode[] = {
'{','F','1','C','3','A','F','5','0','-','8','B','5','6','-','4','A','6','9','-','A','0','0','C','-','0','0','7','7','3','F','E','4','2','F','3','0','}',0
};
static const WCHAR szUpgradeCode[] = {
'{','C','E','0','6','7','E','8','D','-','2','E','1','A','-','4','3','6','7','-','B','7','3','4','-','4','E','B','2','B','D','A','D','6','5','6','5','}',0
};
@@ -271,6 +271,27 @@
MsiCloseHandle(db);
}
+static BOOL create_package(LPWSTR path)
+{
+ DWORD len;
+
+ /* Prepare package */
+ create_database(msifile, tables,
+ sizeof(tables) / sizeof(msi_table), summary_info,
+ sizeof(summary_info) / sizeof(msi_summary_info));
+
+ len = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
+ CURR_DIR, -1, path, MAX_PATH);
+ ok(len, "MultiByteToWideChar returned error %d\n", GetLastError());
+ if (!len)
+ return FALSE;
+
+ /* lstrcatW does not work on win95 */
+ path[len - 1] = '\\';
+ memcpy(&path[len], szMsifile, sizeof(szMsifile));
+ return TRUE;
+}
+
/*
* Installation helpers
*/
@@ -456,35 +477,32 @@
ok(dispid == 1, "Expected 1, got %d\n", dispid);
dispid = get_dispid(pInstaller, "OpenPackage");
ok(dispid == 2, "Expected 2, got %d\n", dispid);
+ dispid = get_dispid(pInstaller, "OpenProduct");
+ ok(dispid == 3, "Expected 3, got %d\n", dispid);
dispid = get_dispid(pInstaller, "OpenDatabase");
ok(dispid == 4, "Expected 4, got %d\n", dispid);
+ dispid = get_dispid(pInstaller, "SummaryInformation");
+ ok(dispid == 5, "Expected 5, got %d\n", dispid);
dispid = get_dispid( pInstaller, "UILevel" );
ok(dispid == 6, "Expected 6, got %d\n", dispid);
+ dispid = get_dispid(pInstaller, "EnableLog");
+ ok(dispid == 7, "Expected 7, got %d\n", dispid);
dispid = get_dispid(pInstaller, "InstallProduct");
ok(dispid == 8, "Expected 8, got %d\n", dispid);
dispid = get_dispid(pInstaller, "Version");
ok(dispid == 9, "Expected 9, got %d\n", dispid);
+ dispid = get_dispid(pInstaller, "LastErrorRecord");
+ ok(dispid == 10, "Expected 10, got %d\n", dispid);
dispid = get_dispid(pInstaller, "RegistryValue");
ok(dispid == 11, "Expected 11, got %d\n", dispid);
- todo_wine
- {
- dispid = get_dispid(pInstaller, "OpenProduct");
- ok(dispid == 3, "Expected 3, got %d\n", dispid);
- dispid = get_dispid(pInstaller, "SummaryInformation");
- ok(dispid == 5, "Expected 5, got %d\n", dispid);
- dispid = get_dispid(pInstaller, "EnableLog");
- ok(dispid == 7, "Expected 7, got %d\n", dispid);
- dispid = get_dispid(pInstaller, "LastErrorRecord");
- ok(dispid == 10, "Expected 10, got %d\n", dispid);
- dispid = get_dispid(pInstaller, "Environment");
- ok(dispid == 12, "Expected 12, got %d\n", dispid);
- dispid = get_dispid(pInstaller, "FileAttributes");
- ok(dispid == 13, "Expected 13, got %d\n", dispid);
- dispid = get_dispid(pInstaller, "FileSize");
- ok(dispid == 15, "Expected 15, got %d\n", dispid);
- dispid = get_dispid(pInstaller, "FileVersion");
- ok(dispid == 16, "Expected 16, got %d\n", dispid);
- }
+ dispid = get_dispid(pInstaller, "Environment");
+ ok(dispid == 12, "Expected 12, got %d\n", dispid);
+ dispid = get_dispid(pInstaller, "FileAttributes");
+ ok(dispid == 13, "Expected 13, got %d\n", dispid);
+ dispid = get_dispid(pInstaller, "FileSize");
+ ok(dispid == 15, "Expected 15, got %d\n", dispid);
+ dispid = get_dispid(pInstaller, "FileVersion");
+ ok(dispid == 16, "Expected 16, got %d\n", dispid);
dispid = get_dispid(pInstaller, "ProductState");
ok(dispid == 17, "Expected 17, got %d\n", dispid);
dispid = get_dispid(pInstaller, "ProductInfo");
@@ -592,7 +610,8 @@
DISPID dispid;
OLECHAR *name;
VARIANT varresult;
- VARIANTARG vararg[2];
+ VARIANTARG vararg[3];
+ WCHAR path[MAX_PATH];
DISPPARAMS dispparams = {NULL, NULL, 0, 0};
/* Test getting ID of a function name that does not exist */
@@ -620,24 +639,159 @@
/* Try with NULL params */
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
- todo_wine ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned
0x%08x\n", hr);
+ ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
/* Try one empty parameter */
dispparams.rgvarg = vararg;
dispparams.cArgs = 1;
VariantInit(&vararg[0]);
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
- todo_wine ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned
0x%08x\n", hr);
-
- /* Try one parameter, function requires two */
+ ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
+
+ /* Try two empty parameters */
+ dispparams.cArgs = 2;
+ VariantInit(&vararg[0]);
+ VariantInit(&vararg[1]);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
+
+ /* Try one parameter, the required BSTR. Second parameter is optional.
+ * NOTE: The specified package does not exist, which is why the call fails.
+ */
+ dispparams.cArgs = 1;
VariantInit(&vararg[0]);
V_VT(&vararg[0]) = VT_BSTR;
V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
- VariantClear(&vararg[0]);
-
ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
ok_exception(hr, szOpenPackageException);
+ VariantClear(&vararg[0]);
+
+ /* Provide the required BSTR and an empty second parameter.
+ * NOTE: The specified package does not exist, which is why the call fails.
+ */
+ dispparams.cArgs = 2;
+ VariantInit(&vararg[1]);
+ V_VT(&vararg[1]) = VT_BSTR;
+ V_BSTR(&vararg[1]) = SysAllocString(szMsifile);
+ VariantInit(&vararg[0]);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
+ ok_exception(hr, szOpenPackageException);
+ VariantClear(&vararg[1]);
+
+ /* Provide the required BSTR and two empty parameters.
+ * NOTE: The specified package does not exist, which is why the call fails.
+ */
+ dispparams.cArgs = 3;
+ VariantInit(&vararg[2]);
+ V_VT(&vararg[2]) = VT_BSTR;
+ V_BSTR(&vararg[2]) = SysAllocString(szMsifile);
+ VariantInit(&vararg[1]);
+ VariantInit(&vararg[0]);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
+ ok_exception(hr, szOpenPackageException);
+ VariantClear(&vararg[2]);
+
+ /* Provide the required BSTR and a second parameter with the wrong type. */
+ dispparams.cArgs = 2;
+ VariantInit(&vararg[1]);
+ V_VT(&vararg[1]) = VT_BSTR;
+ V_BSTR(&vararg[1]) = SysAllocString(szMsifile);
+ VariantInit(&vararg[0]);
+ V_VT(&vararg[0]) = VT_BSTR;
+ V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
+ VariantClear(&vararg[0]);
+ VariantClear(&vararg[1]);
+
+ /* Create a proper installer package. */
+ create_package(path);
+
+ /* Try one parameter, the required BSTR. Second parameter is optional.
+ * Proper installer package exists. Path to the package is relative.
+ */
+ dispparams.cArgs = 1;
+ VariantInit(&vararg[0]);
+ V_VT(&vararg[0]) = VT_BSTR;
+ V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ todo_wine ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n",
hr);
+ ok_exception(hr, szOpenPackageException);
+ VariantClear(&vararg[0]);
+ if (hr != DISP_E_EXCEPTION)
+ VariantClear(&varresult);
+
+ /* Try one parameter, the required BSTR. Second parameter is optional.
+ * Proper installer package exists. Path to the package is absolute.
+ */
+ dispparams.cArgs = 1;
+ VariantInit(&vararg[0]);
+ V_VT(&vararg[0]) = VT_BSTR;
+ V_BSTR(&vararg[0]) = SysAllocString(path);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
+ VariantClear(&vararg[0]);
+ VariantClear(&varresult);
+
+ /* Provide the required BSTR and an empty second parameter. Proper
+ * installation package exists.
+ */
+ dispparams.cArgs = 2;
+ VariantInit(&vararg[1]);
+ V_VT(&vararg[1]) = VT_BSTR;
+ V_BSTR(&vararg[1]) = SysAllocString(path);
+ VariantInit(&vararg[0]);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
+ VariantClear(&vararg[1]);
+ VariantClear(&varresult);
+
+ /* Provide the required BSTR and two empty parameters. Proper
+ * installation package exists.
+ */
+ dispparams.cArgs = 3;
+ VariantInit(&vararg[2]);
+ V_VT(&vararg[2]) = VT_BSTR;
+ V_BSTR(&vararg[2]) = SysAllocString(path);
+ VariantInit(&vararg[1]);
+ VariantInit(&vararg[0]);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
+ VariantClear(&vararg[2]);
+ VariantClear(&varresult);
+
+ /* Provide the required BSTR and a second parameter with the wrong type. */
+ dispparams.cArgs = 2;
+ VariantInit(&vararg[1]);
+ V_VT(&vararg[1]) = VT_BSTR;
+ V_BSTR(&vararg[1]) = SysAllocString(path);
+ VariantInit(&vararg[0]);
+ V_VT(&vararg[0]) = VT_BSTR;
+ V_BSTR(&vararg[0]) = SysAllocString(path);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
+ VariantClear(&vararg[0]);
+ VariantClear(&vararg[1]);
+
+ /* Provide the required BSTR and a second parameter that can be coerced to
+ * VT_I4.
+ */
+ dispparams.cArgs = 2;
+ VariantInit(&vararg[1]);
+ V_VT(&vararg[1]) = VT_BSTR;
+ V_BSTR(&vararg[1]) = SysAllocString(path);
+ VariantInit(&vararg[0]);
+ V_VT(&vararg[0]) = VT_I2;
+ V_BSTR(&vararg[0]) = 0;
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL,
DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
+ VariantClear(&vararg[1]);
+ VariantClear(&varresult);
+
+ DeleteFileW(path);
/* Test invoking a method as a DISPATCH_PROPERTYGET or DISPATCH_PROPERTYPUT */
VariantInit(&vararg[0]);
@@ -2353,7 +2507,6 @@
static WCHAR szIntegerDataException[] = {
'I','n','t','e','g','e','r','D','a','t','a',',','F','i','e','l','d',0
};
WCHAR szPath[MAX_PATH];
HRESULT hr;
- UINT len;
IDispatch *pSession = NULL, *pDatabase = NULL, *pRecord = NULL, *pStringList = NULL;
int iValue, iCount;
@@ -2404,17 +2557,7 @@
IDispatch_Release(pRecord);
}
- /* Prepare package */
- create_database(msifile, tables, sizeof(tables) / sizeof(msi_table),
- summary_info, sizeof(summary_info) / sizeof(msi_summary_info));
-
- len = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, CURR_DIR, -1, szPath, MAX_PATH);
- ok(len, "MultiByteToWideChar returned error %d\n", GetLastError());
- if (!len) return;
-
- /* lstrcatW does not work on win95 */
- szPath[len - 1] = '\\';
- memcpy(&szPath[len], szMsifile, sizeof(szMsifile));
+ create_package(szPath);
/* Installer::OpenPackage */
hr = Installer_OpenPackage(szPath, 0, &pSession);
Modified: trunk/rostests/winetests/msi/db.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/db.c?rev=44…
==============================================================================
--- trunk/rostests/winetests/msi/db.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/db.c [iso-8859-1] Tue Dec 22 10:14:17 2009
@@ -31,9 +31,10 @@
#include "wine/test.h"
-static const char *msifile = "winetest.msi";
-static const char *msifile2 = "winetst2.msi";
-static const char *mstfile = "winetst.mst";
+static const char *msifile = "winetest-db.msi";
+static const char *msifile2 = "winetst2-db.msi";
+static const char *mstfile = "winetst-db.mst";
+static const WCHAR msifileW[] =
{'w','i','n','e','t','e','s','t','-','d','b','.','m','s','i',0};
static void test_msidatabase(void)
{
@@ -921,6 +922,8 @@
r = MsiViewModify(hview, MSIMODIFY_INSERT_TEMPORARY, hrec );
ok(r == ERROR_SUCCESS, "MsiViewModify failed\n");
+ r = MsiCloseHandle(hrec);
+ ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
r = MsiViewClose(hview);
ok(r == ERROR_SUCCESS, "MsiViewClose failed\n");
r = MsiCloseHandle(hview);
@@ -1758,6 +1761,30 @@
query = "SELECT * FROM `Media` WHERE `DiskPrompt` IS NULL";
r = do_query(hdb, query, &rec);
ok( r == ERROR_SUCCESS, "query failed: %d\n", r );
+ MsiCloseHandle( rec );
+
+ rec = 0;
+ query = "SELECT * FROM `Media` WHERE `DiskPrompt` < 'Cabinet'";
+ r = do_query(hdb, query, &rec);
+ ok( r == ERROR_BAD_QUERY_SYNTAX, "query failed: %d\n", r );
+ MsiCloseHandle( rec );
+
+ rec = 0;
+ query = "SELECT * FROM `Media` WHERE `DiskPrompt` > 'Cabinet'";
+ r = do_query(hdb, query, &rec);
+ ok( r == ERROR_BAD_QUERY_SYNTAX, "query failed: %d\n", r );
+ MsiCloseHandle( rec );
+
+ rec = 0;
+ query = "SELECT * FROM `Media` WHERE `DiskPrompt` <>
'Cabinet'";
+ r = do_query(hdb, query, &rec);
+ todo_wine ok( r == ERROR_SUCCESS, "query failed: %d\n", r );
+ MsiCloseHandle( rec );
+
+ rec = 0;
+ query = "SELECT * FROM `Media` WHERE `DiskPrompt` = 'Cabinet'";
+ r = do_query(hdb, query, &rec);
+ ok( r == ERROR_NO_MORE_ITEMS, "query failed: %d\n", r );
MsiCloseHandle( rec );
rec = MsiCreateRecord(1);
@@ -5539,6 +5566,8 @@
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(stm != NULL, "Expected non-NULL stream\n");
+ CoTaskMemFree(stat.pwcsName);
+
sz = MAX_PATH;
memset(data, 'a', MAX_PATH);
hr = IStream_Read(stm, data, sz, &count);
@@ -5568,8 +5597,6 @@
HRESULT hr;
MSIHANDLE hdb;
IStorage *stg = NULL;
-
- static const WCHAR msifileW[] =
{'w','i','n','e','t','e','s','t','.','m','s','i',0};
DeleteFile(msifile);
Modified: trunk/rostests/winetests/msi/format.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/format.c?re…
==============================================================================
--- trunk/rostests/winetests/msi/format.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/format.c [iso-8859-1] Tue Dec 22 10:14:17 2009
@@ -27,7 +27,7 @@
#include "wine/test.h"
-static const char msifile[] = "winetest.msi";
+static const char msifile[] = "winetest-format.msi";
static UINT run_query( MSIHANDLE hdb, const char *query )
{
@@ -315,17 +315,16 @@
static void test_createpackage(void)
{
- static const CHAR filename[] = "winetest.msi";
MSIHANDLE hPackage = 0;
UINT res;
- hPackage = helper_createpackage( filename );
+ hPackage = helper_createpackage( msifile );
ok ( hPackage != 0, " Failed to create package\n");
res = MsiCloseHandle( hPackage);
ok( res == ERROR_SUCCESS , "Failed to close package\n" );
- DeleteFile( filename );
+ DeleteFile( msifile );
}
static void test_formatrecord(void)
@@ -1620,14 +1619,13 @@
static void test_formatrecord_package(void)
{
- static const CHAR filename[] = "winetest.msi";
char buffer[100];
MSIHANDLE hrec;
MSIHANDLE package;
UINT r;
DWORD sz=100;
- package = helper_createpackage( filename );
+ package = helper_createpackage( msifile );
ok(package!=0, "Unable to create package\n");
hrec = MsiCreateRecord(12);
@@ -2117,7 +2115,7 @@
r = MsiCloseHandle(package);
ok(r==ERROR_SUCCESS, "Unable to close package\n");
- DeleteFile( filename );
+ DeleteFile( msifile );
}
static void test_formatrecord_tables(void)
@@ -2383,12 +2381,11 @@
static void test_processmessage(void)
{
- static const CHAR filename[] = "winetest.msi";
MSIHANDLE hrec;
MSIHANDLE package;
int r;
- package = helper_createpackage( filename );
+ package = helper_createpackage( msifile );
ok(package!=0, "Unable to create package\n");
hrec = MsiCreateRecord(3);
@@ -2403,7 +2400,7 @@
MsiCloseHandle(hrec);
MsiCloseHandle(package);
- DeleteFile(filename);
+ DeleteFile(msifile);
}
START_TEST(format)
Modified: trunk/rostests/winetests/msi/install.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/install.c?r…
==============================================================================
--- trunk/rostests/winetests/msi/install.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/install.c [iso-8859-1] Tue Dec 22 10:14:17 2009
@@ -162,6 +162,52 @@
"ROOTDRIVE\tC:\\\n"
"SERVNAME\tTestService\n"
"SERVDISP\tTestServiceDisp\n";
+
+static const CHAR aup_property_dat[] = "Property\tValue\n"
+ "s72\tl0\n"
+ "Property\tProperty\n"
+ "DefaultUIFont\tDlgFont8\n"
+ "HASUIRUN\t0\n"
+ "ALLUSERS\t1\n"
+ "INSTALLLEVEL\t3\n"
+ "InstallMode\tTypical\n"
+ "Manufacturer\tWine\n"
+
"PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
+
"ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
+ "ProductID\tnone\n"
+ "ProductLanguage\t1033\n"
+ "ProductName\tMSITEST\n"
+ "ProductVersion\t1.1.1\n"
+ "PROMPTROLLBACKCOST\tP\n"
+ "Setup\tSetup\n"
+
"UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
+ "AdminProperties\tPOSTADMIN\n"
+ "ROOTDRIVE\tC:\\\n"
+ "SERVNAME\tTestService\n"
+ "SERVDISP\tTestServiceDisp\n";
+
+static const CHAR aup2_property_dat[] = "Property\tValue\n"
+ "s72\tl0\n"
+ "Property\tProperty\n"
+ "DefaultUIFont\tDlgFont8\n"
+ "HASUIRUN\t0\n"
+ "ALLUSERS\t2\n"
+ "INSTALLLEVEL\t3\n"
+ "InstallMode\tTypical\n"
+ "Manufacturer\tWine\n"
+
"PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
+
"ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
+ "ProductID\tnone\n"
+ "ProductLanguage\t1033\n"
+ "ProductName\tMSITEST\n"
+ "ProductVersion\t1.1.1\n"
+ "PROMPTROLLBACKCOST\tP\n"
+ "Setup\tSetup\n"
+
"UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
+ "AdminProperties\tPOSTADMIN\n"
+ "ROOTDRIVE\tC:\\\n"
+ "SERVNAME\tTestService\n"
+ "SERVDISP\tTestServiceDisp\n";
static const CHAR shortcut_dat[] =
"Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
"s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
@@ -941,6 +987,48 @@
"LaunchConditions\t\t100\n"
"TestAllUsersProp\tALLUSERS AND NOT
REMOVE\t50\n";
+static const CHAR aup2_install_exec_seq_dat[] =
"Action\tCondition\tSequence\n"
+ "s72\tS255\tI2\n"
+
"InstallExecuteSequence\tAction\n"
+ "CostFinalize\t\t1000\n"
+ "ValidateProductID\t\t700\n"
+ "CostInitialize\t\t800\n"
+ "FileCost\t\t900\n"
+ "RemoveFiles\t\t3500\n"
+ "InstallFiles\t\t4000\n"
+ "RegisterUser\t\t6000\n"
+ "RegisterProduct\t\t6100\n"
+ "PublishFeatures\t\t6300\n"
+ "PublishProduct\t\t6400\n"
+ "InstallFinalize\t\t6600\n"
+ "InstallInitialize\t\t1500\n"
+ "ProcessComponents\t\t1600\n"
+ "UnpublishFeatures\t\t1800\n"
+ "InstallValidate\t\t1400\n"
+ "LaunchConditions\t\t100\n"
+ "TestAllUsersProp\tALLUSERS=2 AND
NOT REMOVE\t50\n";
+
+static const CHAR aup3_install_exec_seq_dat[] =
"Action\tCondition\tSequence\n"
+ "s72\tS255\tI2\n"
+
"InstallExecuteSequence\tAction\n"
+ "CostFinalize\t\t1000\n"
+ "ValidateProductID\t\t700\n"
+ "CostInitialize\t\t800\n"
+ "FileCost\t\t900\n"
+ "RemoveFiles\t\t3500\n"
+ "InstallFiles\t\t4000\n"
+ "RegisterUser\t\t6000\n"
+ "RegisterProduct\t\t6100\n"
+ "PublishFeatures\t\t6300\n"
+ "PublishProduct\t\t6400\n"
+ "InstallFinalize\t\t6600\n"
+ "InstallInitialize\t\t1500\n"
+ "ProcessComponents\t\t1600\n"
+ "UnpublishFeatures\t\t1800\n"
+ "InstallValidate\t\t1400\n"
+ "LaunchConditions\t\t100\n"
+ "TestAllUsersProp\tALLUSERS=1 AND
NOT REMOVE\t50\n";
+
static const CHAR aup_custom_action_dat[] =
"Action\tType\tSource\tTarget\tISComments\n"
"s72\ti2\tS64\tS0\tS255\n"
"CustomAction\tAction\n"
@@ -1584,6 +1672,45 @@
ADD_TABLE(aup_custom_action),
ADD_TABLE(media),
ADD_TABLE(property)
+};
+
+static const msi_table aup2_tables[] =
+{
+ ADD_TABLE(component),
+ ADD_TABLE(directory),
+ ADD_TABLE(feature),
+ ADD_TABLE(feature_comp),
+ ADD_TABLE(file),
+ ADD_TABLE(aup2_install_exec_seq),
+ ADD_TABLE(aup_custom_action),
+ ADD_TABLE(media),
+ ADD_TABLE(aup_property)
+};
+
+static const msi_table aup3_tables[] =
+{
+ ADD_TABLE(component),
+ ADD_TABLE(directory),
+ ADD_TABLE(feature),
+ ADD_TABLE(feature_comp),
+ ADD_TABLE(file),
+ ADD_TABLE(aup2_install_exec_seq),
+ ADD_TABLE(aup_custom_action),
+ ADD_TABLE(media),
+ ADD_TABLE(aup2_property)
+};
+
+static const msi_table aup4_tables[] =
+{
+ ADD_TABLE(component),
+ ADD_TABLE(directory),
+ ADD_TABLE(feature),
+ ADD_TABLE(feature_comp),
+ ADD_TABLE(file),
+ ADD_TABLE(aup3_install_exec_seq),
+ ADD_TABLE(aup_custom_action),
+ ADD_TABLE(media),
+ ADD_TABLE(aup2_property)
};
static const msi_table fiu_tables[] =
@@ -6778,6 +6905,7 @@
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
+ /* ALLUSERS property unset */
r = MsiInstallProductA(msifile, "FULL=1");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -6798,6 +6926,69 @@
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
delete_test_files();
+
+ create_test_files();
+ create_database(msifile, aup2_tables, sizeof(aup2_tables) / sizeof(msi_table));
+
+ MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
+
+ /* ALLUSERS property set to 1 */
+ 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), "File not
installed\n");
+ ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
+ ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\changed", FALSE), "File not
installed\n");
+ ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\first", FALSE), "File not installed\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), "File not installed\n");
+
+ r = MsiInstallProductA(msifile, "REMOVE=ALL");
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
+
+ delete_test_files();
+
+ create_test_files();
+ create_database(msifile, aup3_tables, sizeof(aup3_tables) / sizeof(msi_table));
+
+ MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
+
+ /* ALLUSERS property set to 2 */
+ 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), "File not
installed\n");
+ ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
+ ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\changed", FALSE), "File not
installed\n");
+ ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not
installed\n");
+ ok(delete_pf("msitest\\first", FALSE), "File not installed\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), "File not installed\n");
+
+ r = MsiInstallProductA(msifile, "REMOVE=ALL");
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
+
+ delete_test_files();
+
+ create_test_files();
+ create_database(msifile, aup4_tables, sizeof(aup4_tables) / sizeof(msi_table));
+
+ MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
+
+ /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
+ r = MsiInstallProductA(msifile, "FULL=1");
+ ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n",
r);
}
static char session_manager[] = "System\\CurrentControlSet\\Control\\Session
Manager";
Modified: trunk/rostests/winetests/msi/msi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/msi.c?rev=4…
==============================================================================
--- trunk/rostests/winetests/msi/msi.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/msi.c [iso-8859-1] Tue Dec 22 10:14:17 2009
@@ -2517,8 +2517,7 @@
r = MsiGetFileVersionA(path, version, &versz, lang, &langsz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz);
- ok(!lstrcmpA(lang, langcheck), "Expected %s, got %s\n", langcheck, lang);
- ok(langsz == langchecksz, "Expected %d, got %d\n", langchecksz, langsz);
+ ok(strstr(lang, langcheck) != NULL, "Expected %s in %s\n", langcheck,
lang);
ok(!lstrcmpA(version, vercheck),
"Expected %s, got %s\n", vercheck, version);
@@ -2536,8 +2535,7 @@
lstrcpyA(lang, "lang");
r = MsiGetFileVersionA(path, NULL, NULL, lang, &langsz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(lang, langcheck), "Expected %s, got %s\n", langcheck, lang);
- ok(langsz == langchecksz, "Expected %d, got %d\n", langchecksz, langsz);
+ ok(strstr(lang, langcheck) != NULL, "Expected %s in %s\n", langcheck,
lang);
/* check neither version nor language */
r = MsiGetFileVersionA(path, NULL, NULL, NULL, NULL);
@@ -2553,7 +2551,7 @@
langsz = MAX_PATH;
r = MsiGetFileVersionA(path, NULL, NULL, NULL, &langsz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(langsz == langchecksz, "Expected %d, got %d\n", langchecksz, langsz);
+ ok(langsz >= langchecksz, "Expected %d >= %d\n", langsz,
langchecksz);
/* pcchVersionBuf not big enough */
versz = 5;
@@ -2571,7 +2569,7 @@
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(!strncmp(lang, langcheck, 2),
"Expected first character of %s, got %s\n", langcheck, lang);
- ok(langsz == langchecksz, "Expected %d, got %d\n", langchecksz, langsz);
+ ok(langsz >= langchecksz, "Expected %d >= %d\n", langsz,
langchecksz);
HeapFree(GetProcessHeap(), 0, vercheck);
HeapFree(GetProcessHeap(), 0, langcheck);
@@ -2781,7 +2779,7 @@
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(sz == 4, "Expected 4, got %d\n", sz);
- /* lpValueBuf is NULL, pcchValueBuf is too small */
+ /* lpValueBuf is non-NULL, pcchValueBuf is too small */
sz = 2;
lstrcpyA(buf, "apple");
r = MsiGetProductInfoA(prodcode, INSTALLPROPERTY_HELPLINK, buf, &sz);
@@ -2789,7 +2787,7 @@
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(sz == 4, "Expected 4, got %d\n", sz);
- /* lpValueBuf is NULL, pcchValueBuf is exactly 4 */
+ /* lpValueBuf is non-NULL, pcchValueBuf is exactly 4 */
sz = 4;
lstrcpyA(buf, "apple");
r = MsiGetProductInfoA(prodcode, INSTALLPROPERTY_HELPLINK, buf, &sz);
Modified: trunk/rostests/winetests/msi/package.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/package.c?r…
==============================================================================
--- trunk/rostests/winetests/msi/package.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/package.c [iso-8859-1] Tue Dec 22 10:14:17 2009
@@ -30,7 +30,7 @@
#include "wine/test.h"
-static const char msifile[] = "winetest.msi";
+static const char msifile[] = "winetest-package.msi";
char CURR_DIR[MAX_PATH];
static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
@@ -2341,9 +2341,9 @@
MSIHANDLE hdb;
INSTALLSTATE state, action;
- static const CHAR msifile2[] = "winetest2.msi";
- static const CHAR msifile3[] = "winetest3.msi";
- static const CHAR msifile4[] = "winetest4.msi";
+ static const CHAR msifile2[] = "winetest2-package.msi";
+ static const CHAR msifile3[] = "winetest3-package.msi";
+ static const CHAR msifile4[] = "winetest4-package.msi";
hdb = create_package_db();
ok ( hdb, "failed to create package database\n" );
@@ -11601,7 +11601,8 @@
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
lstrcpyA(val, path);
- lstrcatA(val, "\\winetest.msi");
+ lstrcatA(val, "\\");
+ lstrcatA(val, msifile);
res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
(const BYTE *)val, lstrlenA(val) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
Modified: trunk/rostests/winetests/msi/record.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/record.c?re…
==============================================================================
--- trunk/rostests/winetests/msi/record.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/record.c [iso-8859-1] Tue Dec 22 10:14:17 2009
@@ -24,7 +24,7 @@
#include "wine/test.h"
-static const char *msifile = "winetest.msi";
+static const char *msifile = "winetest-record.msi";
static BOOL create_temp_file(char *name)
{
@@ -604,6 +604,9 @@
r = MsiRecordIsNull(rec, 0);
ok(r == FALSE, "Expected FALSE, got %d\n", r);
+ r = MsiCloseHandle(hview);
+ ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
+ MsiCloseHandle(rec);
MsiCloseHandle(hdb);
DeleteFileA(msifile);
}
Modified: trunk/rostests/winetests/msi/suminfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/suminfo.c?r…
==============================================================================
--- trunk/rostests/winetests/msi/suminfo.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/suminfo.c [iso-8859-1] Tue Dec 22 10:14:17 2009
@@ -63,9 +63,12 @@
#define PID_MSISOURCE PID_WORDCOUNT
#define PID_MSIRESTRICT PID_CHARCOUNT
+const char *msifile = "winetest-suminfo.msi";
+static const WCHAR msifileW[] = {
+
'w','i','n','e','t','e','s','t','-','s','u','m','i','n','f','o','.','m','s','i',0
};
+
static void test_suminfo(void)
{
- const char *msifile = "winetest.msi";
MSIHANDLE hdb = 0, hsuminfo;
UINT r, count, type;
DWORD sz;
@@ -284,8 +287,6 @@
static const CLSID FMTID_SummaryInformation =
{ 0xf29f85e0, 0x4ff9, 0x1068, {0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9}};
DWORD mode = STGM_CREATE | STGM_READWRITE | STGM_DIRECT | STGM_SHARE_EXCLUSIVE;
- static const WCHAR msifile[] = {
-
'w','i','n','e','t','e','s','t','.','m','s','i',0
};
IPropertySetStorage *pss = NULL;
IPropertyStorage *ps = NULL;
IStorage *stg = NULL;
@@ -295,7 +296,7 @@
PROPVARIANT propvar[10];
USHORT data[2] = { 0, 0 };
- r = StgCreateDocfile( msifile, mode, 0, &stg );
+ r = StgCreateDocfile( msifileW, mode, 0, &stg );
ok( r == S_OK, "failed to create database\n");
r = IStorage_SetClass( stg, &CLSID_MsiDatabase );
@@ -386,7 +387,6 @@
static void test_summary_binary(void)
{
- const char *msifile = "winetest.msi";
MSIHANDLE hdb = 0, hsuminfo = 0;
UINT r, type, count;
INT ival;