2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wine/test.h"
32 static const char msifile[] = "winetest.msi";
33 char CURR_DIR[MAX_PATH];
35 static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
37 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
39 static void init_functionpointers(void)
41 HMODULE hmsi = GetModuleHandleA("msi.dll");
42 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
44 #define GET_PROC(mod, func) \
45 p ## func = (void*)GetProcAddress(mod, #func);
47 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
49 GET_PROC(hadvapi32, ConvertSidToStringSidA);
55 static LPSTR get_user_sid(LPSTR *usersid)
62 if (!pConvertSidToStringSidA)
64 win_skip("ConvertSidToStringSidA is not available\n");
69 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
71 GetTokenInformation(token, TokenUser, buf, size, &size);
72 user = (PTOKEN_USER)buf;
73 pConvertSidToStringSidA(user->User.Sid, usersid);
74 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
79 /* RegDeleteTreeW from dlls/advapi32/registry.c */
80 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
83 DWORD dwMaxSubkeyLen, dwMaxValueLen;
84 DWORD dwMaxLen, dwSize;
85 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
90 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
94 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
95 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
96 if (ret) goto cleanup;
100 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
101 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
103 /* Name too big: alloc a buffer for it */
104 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
106 ret = ERROR_NOT_ENOUGH_MEMORY;
111 /* Recursively delete all the subkeys */
115 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
116 NULL, NULL, NULL)) break;
118 ret = package_RegDeleteTreeW(hSubKey, lpszName);
119 if (ret) goto cleanup;
123 ret = RegDeleteKeyW(hKey, lpszSubKey);
128 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
129 NULL, NULL, NULL, NULL)) break;
131 ret = RegDeleteValueW(hKey, lpszName);
132 if (ret) goto cleanup;
136 if (lpszName != szNameBuf)
137 HeapFree(GetProcessHeap(), 0, lpszName);
139 RegCloseKey(hSubKey);
143 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
148 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
162 out[17+i*2] = in[n++];
163 out[16+i*2] = in[n++];
168 out[17+i*2] = in[n++];
169 out[16+i*2] = in[n++];
175 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
177 WCHAR guidW[MAX_PATH];
178 WCHAR squashedW[MAX_PATH];
183 hr = CoCreateGuid(&guid);
184 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
186 size = StringFromGUID2(&guid, guidW, MAX_PATH);
187 ok(size == 39, "Expected 39, got %d\n", hr);
189 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
190 squash_guid(guidW, squashedW);
191 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
194 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
195 LPCSTR guid, LPSTR usersid, BOOL dir)
197 WCHAR guidW[MAX_PATH];
198 WCHAR squashedW[MAX_PATH];
199 CHAR squashed[MAX_PATH];
200 CHAR comppath[MAX_PATH];
201 CHAR prodpath[MAX_PATH];
206 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
207 squash_guid(guidW, squashedW);
208 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
210 if (context == MSIINSTALLCONTEXT_MACHINE)
212 prod = "3D0DAE300FACA1300AD792060BCDAA92";
214 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
215 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
217 "SOFTWARE\\Classes\\Installer\\"
218 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
220 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
222 prod = "7D2F387510109040002000060BECB6AB";
224 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
225 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
227 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
228 "Installer\\%s\\Installer\\Products\\"
229 "7D2F387510109040002000060BECB6AB", usersid);
231 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
233 prod = "7D2F387510109040002000060BECB6AB";
235 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
236 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
238 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
239 "Installer\\Managed\\%s\\Installer\\Products\\"
240 "7D2F387510109040002000060BECB6AB", usersid);
243 RegCreateKeyA(HKEY_LOCAL_MACHINE, comppath, &hkey);
245 lstrcpyA(path, CURR_DIR);
246 lstrcatA(path, "\\");
247 if (!dir) lstrcatA(path, filename);
249 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
252 RegCreateKeyA(HKEY_LOCAL_MACHINE, prodpath, &hkey);
256 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
258 WCHAR guidW[MAX_PATH];
259 WCHAR squashedW[MAX_PATH];
260 WCHAR substrW[MAX_PATH];
261 CHAR squashed[MAX_PATH];
262 CHAR comppath[MAX_PATH];
263 CHAR prodpath[MAX_PATH];
265 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
266 squash_guid(guidW, squashedW);
267 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
269 if (context == MSIINSTALLCONTEXT_MACHINE)
272 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
273 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
275 "SOFTWARE\\Classes\\Installer\\"
276 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
278 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
281 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
282 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
284 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
285 "Installer\\%s\\Installer\\Products\\"
286 "7D2F387510109040002000060BECB6AB", usersid);
288 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
291 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
292 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
294 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
295 "Installer\\Managed\\%s\\Installer\\Products\\"
296 "7D2F387510109040002000060BECB6AB", usersid);
299 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
300 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
302 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
303 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
306 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
311 /* open a select query */
312 r = MsiDatabaseOpenView(hdb, query, &hview);
313 if (r != ERROR_SUCCESS)
315 r = MsiViewExecute(hview, 0);
316 if (r != ERROR_SUCCESS)
318 ret = MsiViewFetch(hview, phrec);
319 r = MsiViewClose(hview);
320 if (r != ERROR_SUCCESS)
322 r = MsiCloseHandle(hview);
323 if (r != ERROR_SUCCESS)
328 static UINT run_query( MSIHANDLE hdb, const char *query )
333 r = MsiDatabaseOpenView(hdb, query, &hview);
334 if( r != ERROR_SUCCESS )
337 r = MsiViewExecute(hview, 0);
338 if( r == ERROR_SUCCESS )
339 r = MsiViewClose(hview);
340 MsiCloseHandle(hview);
344 static UINT create_component_table( MSIHANDLE hdb )
346 return run_query( hdb,
347 "CREATE TABLE `Component` ( "
348 "`Component` CHAR(72) NOT NULL, "
349 "`ComponentId` CHAR(38), "
350 "`Directory_` CHAR(72) NOT NULL, "
351 "`Attributes` SHORT NOT NULL, "
352 "`Condition` CHAR(255), "
353 "`KeyPath` CHAR(72) "
354 "PRIMARY KEY `Component`)" );
357 static UINT create_feature_table( MSIHANDLE hdb )
359 return run_query( hdb,
360 "CREATE TABLE `Feature` ( "
361 "`Feature` CHAR(38) NOT NULL, "
362 "`Feature_Parent` CHAR(38), "
364 "`Description` CHAR(255), "
365 "`Display` SHORT NOT NULL, "
366 "`Level` SHORT NOT NULL, "
367 "`Directory_` CHAR(72), "
368 "`Attributes` SHORT NOT NULL "
369 "PRIMARY KEY `Feature`)" );
372 static UINT create_feature_components_table( MSIHANDLE hdb )
374 return run_query( hdb,
375 "CREATE TABLE `FeatureComponents` ( "
376 "`Feature_` CHAR(38) NOT NULL, "
377 "`Component_` CHAR(72) NOT NULL "
378 "PRIMARY KEY `Feature_`, `Component_` )" );
381 static UINT create_file_table( MSIHANDLE hdb )
383 return run_query( hdb,
384 "CREATE TABLE `File` ("
385 "`File` CHAR(72) NOT NULL, "
386 "`Component_` CHAR(72) NOT NULL, "
387 "`FileName` CHAR(255) NOT NULL, "
388 "`FileSize` LONG NOT NULL, "
389 "`Version` CHAR(72), "
390 "`Language` CHAR(20), "
391 "`Attributes` SHORT, "
392 "`Sequence` SHORT NOT NULL "
393 "PRIMARY KEY `File`)" );
396 static UINT create_remove_file_table( MSIHANDLE hdb )
398 return run_query( hdb,
399 "CREATE TABLE `RemoveFile` ("
400 "`FileKey` CHAR(72) NOT NULL, "
401 "`Component_` CHAR(72) NOT NULL, "
402 "`FileName` CHAR(255) LOCALIZABLE, "
403 "`DirProperty` CHAR(72) NOT NULL, "
404 "`InstallMode` SHORT NOT NULL "
405 "PRIMARY KEY `FileKey`)" );
408 static UINT create_appsearch_table( MSIHANDLE hdb )
410 return run_query( hdb,
411 "CREATE TABLE `AppSearch` ("
412 "`Property` CHAR(72) NOT NULL, "
413 "`Signature_` CHAR(72) NOT NULL "
414 "PRIMARY KEY `Property`, `Signature_`)" );
417 static UINT create_reglocator_table( MSIHANDLE hdb )
419 return run_query( hdb,
420 "CREATE TABLE `RegLocator` ("
421 "`Signature_` CHAR(72) NOT NULL, "
422 "`Root` SHORT NOT NULL, "
423 "`Key` CHAR(255) NOT NULL, "
426 "PRIMARY KEY `Signature_`)" );
429 static UINT create_signature_table( MSIHANDLE hdb )
431 return run_query( hdb,
432 "CREATE TABLE `Signature` ("
433 "`Signature` CHAR(72) NOT NULL, "
434 "`FileName` CHAR(255) NOT NULL, "
435 "`MinVersion` CHAR(20), "
436 "`MaxVersion` CHAR(20), "
441 "`Languages` CHAR(255) "
442 "PRIMARY KEY `Signature`)" );
445 static UINT create_launchcondition_table( MSIHANDLE hdb )
447 return run_query( hdb,
448 "CREATE TABLE `LaunchCondition` ("
449 "`Condition` CHAR(255) NOT NULL, "
450 "`Description` CHAR(255) NOT NULL "
451 "PRIMARY KEY `Condition`)" );
454 static UINT create_property_table( MSIHANDLE hdb )
456 return run_query( hdb,
457 "CREATE TABLE `Property` ("
458 "`Property` CHAR(72) NOT NULL, "
460 "PRIMARY KEY `Property`)" );
463 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
465 return run_query( hdb,
466 "CREATE TABLE `InstallExecuteSequence` ("
467 "`Action` CHAR(72) NOT NULL, "
468 "`Condition` CHAR(255), "
470 "PRIMARY KEY `Action`)" );
473 static UINT create_media_table( MSIHANDLE hdb )
475 return run_query( hdb,
476 "CREATE TABLE `Media` ("
477 "`DiskId` SHORT NOT NULL, "
478 "`LastSequence` SHORT NOT NULL, "
479 "`DiskPrompt` CHAR(64), "
480 "`Cabinet` CHAR(255), "
481 "`VolumeLabel` CHAR(32), "
483 "PRIMARY KEY `DiskId`)" );
486 static UINT create_ccpsearch_table( MSIHANDLE hdb )
488 return run_query( hdb,
489 "CREATE TABLE `CCPSearch` ("
490 "`Signature_` CHAR(72) NOT NULL "
491 "PRIMARY KEY `Signature_`)" );
494 static UINT create_drlocator_table( MSIHANDLE hdb )
496 return run_query( hdb,
497 "CREATE TABLE `DrLocator` ("
498 "`Signature_` CHAR(72) NOT NULL, "
499 "`Parent` CHAR(72), "
502 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
505 static UINT create_complocator_table( MSIHANDLE hdb )
507 return run_query( hdb,
508 "CREATE TABLE `CompLocator` ("
509 "`Signature_` CHAR(72) NOT NULL, "
510 "`ComponentId` CHAR(38) NOT NULL, "
512 "PRIMARY KEY `Signature_`)" );
515 static UINT create_inilocator_table( MSIHANDLE hdb )
517 return run_query( hdb,
518 "CREATE TABLE `IniLocator` ("
519 "`Signature_` CHAR(72) NOT NULL, "
520 "`FileName` CHAR(255) NOT NULL, "
521 "`Section` CHAR(96)NOT NULL, "
522 "`Key` CHAR(128)NOT NULL, "
525 "PRIMARY KEY `Signature_`)" );
528 #define make_add_entry(type, qtext) \
529 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
531 char insert[] = qtext; \
534 sz = strlen(values) + sizeof insert; \
535 query = HeapAlloc(GetProcessHeap(),0,sz); \
536 sprintf(query,insert,values); \
537 r = run_query( hdb, query ); \
538 HeapFree(GetProcessHeap(), 0, query); \
542 make_add_entry(component,
543 "INSERT INTO `Component` "
544 "(`Component`, `ComponentId`, `Directory_`, "
545 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
547 make_add_entry(directory,
548 "INSERT INTO `Directory` "
549 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
551 make_add_entry(feature,
552 "INSERT INTO `Feature` "
553 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
554 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
556 make_add_entry(feature_components,
557 "INSERT INTO `FeatureComponents` "
558 "(`Feature_`, `Component_`) VALUES( %s )")
561 "INSERT INTO `File` "
562 "(`File`, `Component_`, `FileName`, `FileSize`, "
563 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
565 make_add_entry(appsearch,
566 "INSERT INTO `AppSearch` "
567 "(`Property`, `Signature_`) VALUES( %s )")
569 make_add_entry(reglocator,
570 "INSERT INTO `RegLocator` "
571 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES( %s )")
573 make_add_entry(signature,
574 "INSERT INTO `Signature` "
575 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
576 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
579 make_add_entry(launchcondition,
580 "INSERT INTO `LaunchCondition` "
581 "(`Condition`, `Description`) VALUES( %s )")
583 make_add_entry(property,
584 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
586 make_add_entry(install_execute_sequence,
587 "INSERT INTO `InstallExecuteSequence` "
588 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
590 make_add_entry(media,
591 "INSERT INTO `Media` "
592 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
593 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
595 make_add_entry(ccpsearch,
596 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
598 make_add_entry(drlocator,
599 "INSERT INTO `DrLocator` "
600 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
602 make_add_entry(complocator,
603 "INSERT INTO `CompLocator` "
604 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
606 make_add_entry(inilocator,
607 "INSERT INTO `IniLocator` "
608 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
611 static UINT set_summary_info(MSIHANDLE hdb)
616 /* build summary info */
617 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
618 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
620 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
621 "Installation Database");
622 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
624 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
625 "Installation Database");
626 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
628 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
630 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
632 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
634 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
636 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
637 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
638 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
640 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
641 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
643 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
644 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
646 res = MsiSummaryInfoPersist(suminfo);
647 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
649 res = MsiCloseHandle( suminfo);
650 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
656 static MSIHANDLE create_package_db(void)
663 /* create an empty database */
664 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
665 ok( res == ERROR_SUCCESS , "Failed to create database\n" );
666 if( res != ERROR_SUCCESS )
669 res = MsiDatabaseCommit( hdb );
670 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
672 res = set_summary_info(hdb);
674 res = run_query( hdb,
675 "CREATE TABLE `Directory` ( "
676 "`Directory` CHAR(255) NOT NULL, "
677 "`Directory_Parent` CHAR(255), "
678 "`DefaultDir` CHAR(255) NOT NULL "
679 "PRIMARY KEY `Directory`)" );
680 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
685 static MSIHANDLE package_from_db(MSIHANDLE hdb)
691 sprintf(szPackage,"#%i",hdb);
692 res = MsiOpenPackage(szPackage,&hPackage);
693 if (res != ERROR_SUCCESS)
696 res = MsiCloseHandle(hdb);
697 if (res != ERROR_SUCCESS)
703 static void create_test_file(const CHAR *name)
708 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
709 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
710 WriteFile(file, name, strlen(name), &written, NULL);
711 WriteFile(file, "\n", strlen("\n"), &written, NULL);
715 typedef struct _tagVS_VERSIONINFO
722 VS_FIXEDFILEINFO Value;
727 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
728 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
730 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
732 VS_VERSIONINFO *pVerInfo;
733 VS_FIXEDFILEINFO *pFixedInfo;
740 GetSystemDirectory(path, MAX_PATH);
741 lstrcatA(path, "\\kernel32.dll");
743 CopyFileA(path, name, FALSE);
745 size = GetFileVersionInfoSize(path, &handle);
746 buffer = HeapAlloc(GetProcessHeap(), 0, size);
748 GetFileVersionInfoA(path, 0, size, buffer);
750 pVerInfo = (VS_VERSIONINFO *)buffer;
751 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
752 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
754 pFixedInfo->dwFileVersionMS = ms;
755 pFixedInfo->dwFileVersionLS = ls;
756 pFixedInfo->dwProductVersionMS = ms;
757 pFixedInfo->dwProductVersionLS = ls;
759 resource = BeginUpdateResource(name, FALSE);
763 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
764 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
767 if (!EndUpdateResource(resource, FALSE))
773 HeapFree(GetProcessHeap(), 0, buffer);
777 static void test_createpackage(void)
779 MSIHANDLE hPackage = 0;
782 hPackage = package_from_db(create_package_db());
783 ok( hPackage != 0, " Failed to create package\n");
785 res = MsiCloseHandle( hPackage);
786 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
790 static void test_doaction( void )
795 r = MsiDoAction( -1, NULL );
796 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
798 hpkg = package_from_db(create_package_db());
799 ok( hpkg, "failed to create package\n");
801 r = MsiDoAction(hpkg, NULL);
802 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
804 r = MsiDoAction(0, "boo");
805 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
807 r = MsiDoAction(hpkg, "boo");
808 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
810 MsiCloseHandle( hpkg );
814 static void test_gettargetpath_bad(void)
821 hpkg = package_from_db(create_package_db());
822 ok( hpkg, "failed to create package\n");
824 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
825 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
827 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
828 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
830 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
831 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
833 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
834 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
836 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
837 ok( r == ERROR_DIRECTORY, "wrong return val\n");
839 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
840 ok( r == ERROR_DIRECTORY, "wrong return val\n");
842 MsiCloseHandle( hpkg );
846 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
852 rec = MsiCreateRecord( 1 );
853 ok(rec, "MsiCreate record failed\n");
855 r = MsiRecordSetString( rec, 0, file );
856 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
859 r = MsiFormatRecord( hpkg, rec, buff, &size );
860 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
862 MsiCloseHandle( rec );
865 static void test_settargetpath(void)
867 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
873 hdb = create_package_db();
874 ok ( hdb, "failed to create package database\n" );
876 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
877 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
879 r = create_component_table( hdb );
880 ok( r == S_OK, "cannot create Component table: %d\n", r );
882 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
883 ok( r == S_OK, "cannot add dummy component: %d\n", r );
885 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
886 ok( r == S_OK, "cannot add test component: %d\n", r );
888 r = create_feature_table( hdb );
889 ok( r == S_OK, "cannot create Feature table: %d\n", r );
891 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
892 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
894 r = create_feature_components_table( hdb );
895 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
897 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
898 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
900 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
901 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
903 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
904 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
906 r = create_file_table( hdb );
907 ok( r == S_OK, "cannot create File table: %d\n", r );
909 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
910 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
912 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
913 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
915 hpkg = package_from_db( hdb );
916 ok( hpkg, "failed to create package\n");
918 r = MsiDoAction( hpkg, "CostInitialize");
919 ok( r == ERROR_SUCCESS, "cost init failed\n");
921 r = MsiDoAction( hpkg, "FileCost");
922 ok( r == ERROR_SUCCESS, "file cost failed\n");
924 r = MsiDoAction( hpkg, "CostFinalize");
925 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
927 r = MsiSetTargetPath( 0, NULL, NULL );
928 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
930 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
931 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
933 r = MsiSetTargetPath( hpkg, "boo", NULL );
934 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
936 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
937 ok( r == ERROR_DIRECTORY, "wrong return val\n");
939 sz = sizeof tempdir - 1;
940 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
941 sprintf( file, "%srootfile.txt", tempdir );
942 query_file_path( hpkg, "[#RootFile]", buffer );
943 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
944 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
946 GetTempFileName( tempdir, "_wt", 0, buffer );
947 sprintf( tempdir, "%s\\subdir", buffer );
949 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
950 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
951 "MsiSetTargetPath on file returned %d\n", r );
953 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
954 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
955 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
957 DeleteFile( buffer );
959 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
960 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
962 r = GetFileAttributes( buffer );
963 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
965 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
966 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
968 sz = sizeof buffer - 1;
969 lstrcat( tempdir, "\\" );
970 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
971 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
972 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
974 sprintf( file, "%srootfile.txt", tempdir );
975 query_file_path( hpkg, "[#RootFile]", buffer );
976 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
978 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
979 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
981 query_file_path( hpkg, "[#TestFile]", buffer );
982 ok( !lstrcmp(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
983 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
985 sz = sizeof buffer - 1;
986 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
987 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
988 ok( !lstrcmp(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
990 MsiCloseHandle( hpkg );
993 static void test_condition(void)
998 hpkg = package_from_db(create_package_db());
999 ok( hpkg, "failed to create package\n");
1001 r = MsiEvaluateCondition(0, NULL);
1002 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1004 r = MsiEvaluateCondition(hpkg, NULL);
1005 ok( r == MSICONDITION_NONE, "wrong return val\n");
1007 r = MsiEvaluateCondition(hpkg, "");
1008 ok( r == MSICONDITION_NONE, "wrong return val\n");
1010 r = MsiEvaluateCondition(hpkg, "1");
1011 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1013 r = MsiEvaluateCondition(hpkg, "0");
1014 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1016 r = MsiEvaluateCondition(hpkg, "-1");
1017 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1019 r = MsiEvaluateCondition(hpkg, "0 = 0");
1020 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1022 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1023 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1025 r = MsiEvaluateCondition(hpkg, "0 = 1");
1026 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1028 r = MsiEvaluateCondition(hpkg, "0 > 1");
1029 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1031 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1032 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1034 r = MsiEvaluateCondition(hpkg, "1 > 1");
1035 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1037 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1038 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1040 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1041 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1043 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1044 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1046 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1047 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1049 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1050 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1052 r = MsiEvaluateCondition(hpkg, "0 < 1");
1053 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1055 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1056 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1058 r = MsiEvaluateCondition(hpkg, "1 < 1");
1059 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1061 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1062 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1064 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1065 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1067 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1068 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1070 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1071 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1073 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1074 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1076 r = MsiEvaluateCondition(hpkg, "0 >=");
1077 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1079 r = MsiEvaluateCondition(hpkg, " ");
1080 ok( r == MSICONDITION_NONE, "wrong return val\n");
1082 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1083 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1085 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1086 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1088 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1089 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1091 r = MsiEvaluateCondition(hpkg, "not 0");
1092 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1094 r = MsiEvaluateCondition(hpkg, "not LicView");
1095 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1097 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1098 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1100 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1101 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1103 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1104 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1106 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1107 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1109 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1110 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1112 r = MsiEvaluateCondition(hpkg, "\"0\"");
1113 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1115 r = MsiEvaluateCondition(hpkg, "1 and 2");
1116 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1118 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1119 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1121 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1122 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1124 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1125 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1127 r = MsiEvaluateCondition(hpkg, "(0)");
1128 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1130 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1131 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1133 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1134 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1136 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1137 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1139 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1140 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1142 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1143 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1145 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1146 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1148 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1149 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1151 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1152 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1154 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1155 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1157 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1158 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1160 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1161 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1163 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1164 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1166 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1167 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1169 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1170 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1172 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1173 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1175 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1176 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1178 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1179 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1181 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1182 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1184 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1185 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1187 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1188 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1190 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1191 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1193 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1194 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1196 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1197 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1199 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1200 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1202 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1203 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1205 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1206 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1208 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1209 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1211 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1212 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1214 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1215 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1217 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1218 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1220 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1221 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1223 MsiSetProperty(hpkg, "mm", "5" );
1225 r = MsiEvaluateCondition(hpkg, "mm = 5");
1226 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1228 r = MsiEvaluateCondition(hpkg, "mm < 6");
1229 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1231 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1232 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1234 r = MsiEvaluateCondition(hpkg, "mm > 4");
1235 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1237 r = MsiEvaluateCondition(hpkg, "mm < 12");
1238 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1240 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1241 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1243 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1244 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1246 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1247 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1249 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1250 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1252 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1253 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1255 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1256 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1258 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1259 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1261 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1262 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1264 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1265 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1267 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1268 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1270 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1271 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1273 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1274 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1276 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1277 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1279 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1280 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1282 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1283 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1285 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1286 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1288 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1289 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1291 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1292 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1294 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1295 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1297 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1298 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1300 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1301 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1303 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1304 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1306 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1307 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1309 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1310 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1312 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1313 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1315 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1316 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1318 MsiSetProperty(hpkg, "bandalmael", "0" );
1319 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1320 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1322 MsiSetProperty(hpkg, "bandalmael", "" );
1323 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1324 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1326 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1327 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1328 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1330 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1331 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1332 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1334 MsiSetProperty(hpkg, "bandalmael", "0 " );
1335 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1336 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1338 MsiSetProperty(hpkg, "bandalmael", "-0" );
1339 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1340 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1342 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1343 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1344 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1346 MsiSetProperty(hpkg, "bandalmael", "--0" );
1347 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1348 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1350 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1351 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1352 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1354 MsiSetProperty(hpkg, "bandalmael", "-" );
1355 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1356 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1358 MsiSetProperty(hpkg, "bandalmael", "+0" );
1359 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1360 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1362 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1363 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1364 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1365 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1366 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1368 MsiSetProperty(hpkg, "one", "hi");
1369 MsiSetProperty(hpkg, "two", "hithere");
1370 r = MsiEvaluateCondition(hpkg, "one >< two");
1371 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1373 MsiSetProperty(hpkg, "one", "hithere");
1374 MsiSetProperty(hpkg, "two", "hi");
1375 r = MsiEvaluateCondition(hpkg, "one >< two");
1376 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1378 MsiSetProperty(hpkg, "one", "hello");
1379 MsiSetProperty(hpkg, "two", "hi");
1380 r = MsiEvaluateCondition(hpkg, "one >< two");
1381 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1383 MsiSetProperty(hpkg, "one", "hellohithere");
1384 MsiSetProperty(hpkg, "two", "hi");
1385 r = MsiEvaluateCondition(hpkg, "one >< two");
1386 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1388 MsiSetProperty(hpkg, "one", "");
1389 MsiSetProperty(hpkg, "two", "hi");
1390 r = MsiEvaluateCondition(hpkg, "one >< two");
1391 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1393 MsiSetProperty(hpkg, "one", "hi");
1394 MsiSetProperty(hpkg, "two", "");
1395 r = MsiEvaluateCondition(hpkg, "one >< two");
1396 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1398 MsiSetProperty(hpkg, "one", "");
1399 MsiSetProperty(hpkg, "two", "");
1400 r = MsiEvaluateCondition(hpkg, "one >< two");
1401 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1403 MsiSetProperty(hpkg, "one", "1234");
1404 MsiSetProperty(hpkg, "two", "1");
1405 r = MsiEvaluateCondition(hpkg, "one >< two");
1406 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1408 MsiSetProperty(hpkg, "one", "one 1234");
1409 MsiSetProperty(hpkg, "two", "1");
1410 r = MsiEvaluateCondition(hpkg, "one >< two");
1411 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1413 MsiSetProperty(hpkg, "one", "hithere");
1414 MsiSetProperty(hpkg, "two", "hi");
1415 r = MsiEvaluateCondition(hpkg, "one << two");
1416 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1418 MsiSetProperty(hpkg, "one", "hi");
1419 MsiSetProperty(hpkg, "two", "hithere");
1420 r = MsiEvaluateCondition(hpkg, "one << two");
1421 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1423 MsiSetProperty(hpkg, "one", "hi");
1424 MsiSetProperty(hpkg, "two", "hi");
1425 r = MsiEvaluateCondition(hpkg, "one << two");
1426 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1428 MsiSetProperty(hpkg, "one", "abcdhithere");
1429 MsiSetProperty(hpkg, "two", "hi");
1430 r = MsiEvaluateCondition(hpkg, "one << two");
1431 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1433 MsiSetProperty(hpkg, "one", "");
1434 MsiSetProperty(hpkg, "two", "hi");
1435 r = MsiEvaluateCondition(hpkg, "one << two");
1436 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1438 MsiSetProperty(hpkg, "one", "hithere");
1439 MsiSetProperty(hpkg, "two", "");
1440 r = MsiEvaluateCondition(hpkg, "one << two");
1441 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1443 MsiSetProperty(hpkg, "one", "");
1444 MsiSetProperty(hpkg, "two", "");
1445 r = MsiEvaluateCondition(hpkg, "one << two");
1446 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1448 MsiSetProperty(hpkg, "one", "1234");
1449 MsiSetProperty(hpkg, "two", "1");
1450 r = MsiEvaluateCondition(hpkg, "one << two");
1451 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1453 MsiSetProperty(hpkg, "one", "1234 one");
1454 MsiSetProperty(hpkg, "two", "1");
1455 r = MsiEvaluateCondition(hpkg, "one << two");
1456 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1458 MsiSetProperty(hpkg, "one", "hithere");
1459 MsiSetProperty(hpkg, "two", "there");
1460 r = MsiEvaluateCondition(hpkg, "one >> two");
1461 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1463 MsiSetProperty(hpkg, "one", "hithere");
1464 MsiSetProperty(hpkg, "two", "hi");
1465 r = MsiEvaluateCondition(hpkg, "one >> two");
1466 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1468 MsiSetProperty(hpkg, "one", "there");
1469 MsiSetProperty(hpkg, "two", "hithere");
1470 r = MsiEvaluateCondition(hpkg, "one >> two");
1471 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1473 MsiSetProperty(hpkg, "one", "there");
1474 MsiSetProperty(hpkg, "two", "there");
1475 r = MsiEvaluateCondition(hpkg, "one >> two");
1476 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1478 MsiSetProperty(hpkg, "one", "abcdhithere");
1479 MsiSetProperty(hpkg, "two", "hi");
1480 r = MsiEvaluateCondition(hpkg, "one >> two");
1481 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1483 MsiSetProperty(hpkg, "one", "");
1484 MsiSetProperty(hpkg, "two", "there");
1485 r = MsiEvaluateCondition(hpkg, "one >> two");
1486 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1488 MsiSetProperty(hpkg, "one", "there");
1489 MsiSetProperty(hpkg, "two", "");
1490 r = MsiEvaluateCondition(hpkg, "one >> two");
1491 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1493 MsiSetProperty(hpkg, "one", "");
1494 MsiSetProperty(hpkg, "two", "");
1495 r = MsiEvaluateCondition(hpkg, "one >> two");
1496 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1498 MsiSetProperty(hpkg, "one", "1234");
1499 MsiSetProperty(hpkg, "two", "4");
1500 r = MsiEvaluateCondition(hpkg, "one >> two");
1501 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1503 MsiSetProperty(hpkg, "one", "one 1234");
1504 MsiSetProperty(hpkg, "two", "4");
1505 r = MsiEvaluateCondition(hpkg, "one >> two");
1506 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1508 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1510 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1511 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1513 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1514 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1516 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1517 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1519 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1520 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1522 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1523 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1525 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1526 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1528 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1529 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1531 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1532 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1534 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1535 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1537 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1538 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1540 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1541 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1543 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1544 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1546 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1547 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1549 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1550 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1552 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1553 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1555 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1556 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1558 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1559 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1561 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1562 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1564 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1565 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1567 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1568 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1570 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1571 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1573 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1574 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1576 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1577 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1579 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1580 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1582 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1583 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1585 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1586 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1588 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1589 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1591 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1592 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1594 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1595 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1597 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1598 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1600 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1601 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1603 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1604 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1606 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1607 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1609 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1610 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1612 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1613 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1615 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1616 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1618 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1619 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1621 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1622 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1623 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1625 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1626 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1628 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1629 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1631 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1632 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1634 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1635 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1637 MsiSetProperty(hpkg, "one", "1");
1638 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1639 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1641 MsiSetProperty(hpkg, "X", "5.0");
1643 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1644 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1646 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1647 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1649 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1650 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1652 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1653 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1655 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1656 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1658 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1659 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1661 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1662 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1664 /* feature doesn't exist */
1665 r = MsiEvaluateCondition(hpkg, "&nofeature");
1666 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1668 MsiSetProperty(hpkg, "A", "2");
1669 MsiSetProperty(hpkg, "X", "50");
1671 r = MsiEvaluateCondition(hpkg, "2 <= X");
1672 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1674 r = MsiEvaluateCondition(hpkg, "A <= X");
1675 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1677 r = MsiEvaluateCondition(hpkg, "A <= 50");
1678 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1680 MsiSetProperty(hpkg, "X", "50val");
1682 r = MsiEvaluateCondition(hpkg, "2 <= X");
1683 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1685 r = MsiEvaluateCondition(hpkg, "A <= X");
1686 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1688 MsiSetProperty(hpkg, "A", "7");
1689 MsiSetProperty(hpkg, "X", "50");
1691 r = MsiEvaluateCondition(hpkg, "7 <= X");
1692 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1694 r = MsiEvaluateCondition(hpkg, "A <= X");
1695 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1697 r = MsiEvaluateCondition(hpkg, "A <= 50");
1698 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1700 MsiSetProperty(hpkg, "X", "50val");
1702 r = MsiEvaluateCondition(hpkg, "2 <= X");
1703 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1705 r = MsiEvaluateCondition(hpkg, "A <= X");
1706 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1708 MsiCloseHandle( hpkg );
1709 DeleteFile(msifile);
1712 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1720 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1721 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1724 static void test_props(void)
1726 MSIHANDLE hpkg, hdb;
1731 hdb = create_package_db();
1733 "CREATE TABLE `Property` ( "
1734 "`Property` CHAR(255) NOT NULL, "
1735 "`Value` CHAR(255) "
1736 "PRIMARY KEY `Property`)" );
1737 ok( r == ERROR_SUCCESS , "Failed\n" );
1740 "INSERT INTO `Property` "
1741 "(`Property`, `Value`) "
1742 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1743 ok( r == ERROR_SUCCESS , "Failed\n" );
1745 hpkg = package_from_db( hdb );
1746 ok( hpkg, "failed to create package\n");
1748 /* test invalid values */
1749 r = MsiGetProperty( 0, NULL, NULL, NULL );
1750 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1752 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1753 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1755 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1756 ok( r == ERROR_SUCCESS, "wrong return val\n");
1758 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1759 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1761 /* test retrieving an empty/nonexistent property */
1763 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1764 ok( r == ERROR_SUCCESS, "wrong return val\n");
1765 ok( sz == 0, "wrong size returned\n");
1767 check_prop_empty( hpkg, "boo");
1770 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1771 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1772 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1773 ok( sz == 0, "wrong size returned\n");
1777 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1778 ok( r == ERROR_SUCCESS, "wrong return val\n");
1779 ok( buffer[0] == 0, "buffer was not changed\n");
1780 ok( sz == 0, "wrong size returned\n");
1782 /* set the property to something */
1783 r = MsiSetProperty( 0, NULL, NULL );
1784 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1786 r = MsiSetProperty( hpkg, NULL, NULL );
1787 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1789 r = MsiSetProperty( hpkg, "", NULL );
1790 ok( r == ERROR_SUCCESS, "wrong return val\n");
1792 /* try set and get some illegal property identifiers */
1793 r = MsiSetProperty( hpkg, "", "asdf" );
1794 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1796 r = MsiSetProperty( hpkg, "=", "asdf" );
1797 ok( r == ERROR_SUCCESS, "wrong return val\n");
1799 r = MsiSetProperty( hpkg, " ", "asdf" );
1800 ok( r == ERROR_SUCCESS, "wrong return val\n");
1802 r = MsiSetProperty( hpkg, "'", "asdf" );
1803 ok( r == ERROR_SUCCESS, "wrong return val\n");
1807 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1808 ok( r == ERROR_SUCCESS, "wrong return val\n");
1809 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1811 /* set empty values */
1812 r = MsiSetProperty( hpkg, "boo", NULL );
1813 ok( r == ERROR_SUCCESS, "wrong return val\n");
1814 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1816 r = MsiSetProperty( hpkg, "boo", "" );
1817 ok( r == ERROR_SUCCESS, "wrong return val\n");
1818 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1820 /* set a non-empty value */
1821 r = MsiSetProperty( hpkg, "boo", "xyz" );
1822 ok( r == ERROR_SUCCESS, "wrong return val\n");
1826 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1827 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1828 ok( buffer[0] == 0, "buffer was not changed\n");
1829 ok( sz == 3, "wrong size returned\n");
1833 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1834 ok( r == ERROR_SUCCESS, "wrong return val\n");
1835 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1836 ok( sz == 3, "wrong size returned\n");
1840 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1841 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1842 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1843 ok( sz == 3, "wrong size returned\n");
1845 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1846 ok( r == ERROR_SUCCESS, "wrong return val\n");
1849 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1850 ok( r == ERROR_SUCCESS, "wrong return val\n");
1851 ok( !strcmp(buffer,""), "buffer wrong\n");
1852 ok( sz == 0, "wrong size returned\n");
1855 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1856 ok( r == ERROR_SUCCESS, "wrong return val\n");
1857 ok( !strcmp(buffer,""), "buffer wrong\n");
1858 ok( sz == 0, "wrong size returned\n");
1861 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1862 ok( r == ERROR_SUCCESS, "wrong return val\n");
1863 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1864 ok( sz == 3, "wrong size returned\n");
1866 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1867 ok( r == ERROR_SUCCESS, "wrong return val\n");
1870 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1871 ok( r == ERROR_SUCCESS, "return wrong\n");
1872 ok( sz == 13, "size wrong (%d)\n", sz);
1875 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1876 ok( r == ERROR_MORE_DATA, "return wrong\n");
1877 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1879 r = MsiSetProperty(hpkg, "property", "value");
1880 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1883 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1884 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1885 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1887 r = MsiSetProperty(hpkg, "property", NULL);
1888 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1891 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1893 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1895 MsiCloseHandle( hpkg );
1896 DeleteFile(msifile);
1899 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1901 MSIHANDLE hview, hrec;
1903 CHAR buffer[MAX_PATH];
1907 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1908 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1909 r = MsiViewExecute(hview, 0);
1910 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1913 while (r == ERROR_SUCCESS && !found)
1915 r = MsiViewFetch(hview, &hrec);
1916 if (r != ERROR_SUCCESS) break;
1919 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1920 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1923 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1924 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1928 MsiCloseHandle(hrec);
1931 MsiViewClose(hview);
1932 MsiCloseHandle(hview);
1937 static void test_property_table(void)
1941 MSIHANDLE hpkg, hdb, hrec;
1942 char buffer[MAX_PATH];
1946 hdb = create_package_db();
1947 ok( hdb, "failed to create package\n");
1949 hpkg = package_from_db(hdb);
1950 ok( hpkg, "failed to create package\n");
1952 MsiCloseHandle(hdb);
1954 hdb = MsiGetActiveDatabase(hpkg);
1956 query = "CREATE TABLE `_Property` ( "
1957 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1958 r = run_query(hdb, query);
1959 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1961 MsiCloseHandle(hdb);
1962 MsiCloseHandle(hpkg);
1963 DeleteFile(msifile);
1965 hdb = create_package_db();
1966 ok( hdb, "failed to create package\n");
1968 query = "CREATE TABLE `_Property` ( "
1969 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1970 r = run_query(hdb, query);
1971 ok(r == ERROR_SUCCESS, "failed to create table\n");
1973 query = "ALTER `_Property` ADD `foo` INTEGER";
1974 r = run_query(hdb, query);
1975 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1977 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
1978 r = run_query(hdb, query);
1979 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1981 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
1982 r = run_query(hdb, query);
1983 ok(r == ERROR_SUCCESS, "failed to add column\n");
1985 hpkg = package_from_db(hdb);
1988 ok(!hpkg, "package should not be created\n");
1991 MsiCloseHandle(hdb);
1992 MsiCloseHandle(hpkg);
1993 DeleteFile(msifile);
1995 hdb = create_package_db();
1996 ok (hdb, "failed to create package database\n");
1998 r = create_property_table(hdb);
1999 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2001 r = add_property_entry(hdb, "'prop', 'val'");
2002 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2004 hpkg = package_from_db(hdb);
2005 ok(hpkg, "failed to create package\n");
2007 MsiCloseHandle(hdb);
2010 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2011 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2012 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2014 hdb = MsiGetActiveDatabase(hpkg);
2016 found = find_prop_in_property(hdb, "prop", "val");
2017 ok(found, "prop should be in the _Property table\n");
2019 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2020 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2022 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2023 r = do_query(hdb, query, &hrec);
2024 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2026 found = find_prop_in_property(hdb, "dantes", "mercedes");
2027 ok(found == FALSE, "dantes should not be in the _Property table\n");
2030 lstrcpy(buffer, "aaa");
2031 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2033 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2035 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2038 found = find_prop_in_property(hdb, "dantes", "mercedes");
2039 ok(found == TRUE, "dantes should be in the _Property table\n");
2041 MsiCloseHandle(hdb);
2042 MsiCloseHandle(hpkg);
2043 DeleteFile(msifile);
2046 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2051 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2052 if( res == ERROR_SUCCESS )
2056 r = MsiViewExecute( htab, hrec );
2057 if( r != ERROR_SUCCESS )
2060 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2063 r = MsiViewClose( htab );
2064 if( r != ERROR_SUCCESS )
2067 r = MsiCloseHandle( htab );
2068 if( r != ERROR_SUCCESS )
2074 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2076 return try_query_param( hdb, szQuery, 0 );
2079 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2084 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2087 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2088 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2090 r = MsiSummaryInfoPersist(summary);
2091 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2093 MsiCloseHandle(summary);
2096 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2101 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2104 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2105 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2107 r = MsiSummaryInfoPersist(summary);
2108 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2110 MsiCloseHandle(summary);
2113 static void test_msipackage(void)
2115 MSIHANDLE hdb = 0, hpack = 100;
2120 /* NULL szPackagePath */
2121 r = MsiOpenPackage(NULL, &hpack);
2122 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2124 /* empty szPackagePath */
2125 r = MsiOpenPackage("", &hpack);
2128 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2131 if (r == ERROR_SUCCESS)
2132 MsiCloseHandle(hpack);
2134 /* nonexistent szPackagePath */
2135 r = MsiOpenPackage("nonexistent", &hpack);
2136 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2139 r = MsiOpenPackage(msifile, NULL);
2140 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2144 r = MsiOpenPackage(name, &hpack);
2145 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2147 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2150 /* database exists, but is emtpy */
2151 sprintf(name, "#%d", hdb);
2152 r = MsiOpenPackage(name, &hpack);
2153 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2154 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2156 query = "CREATE TABLE `Property` ( "
2157 "`Property` CHAR(72), `Value` CHAR(0) "
2158 "PRIMARY KEY `Property`)";
2159 r = try_query(hdb, query);
2160 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2162 query = "CREATE TABLE `InstallExecuteSequence` ("
2163 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2164 "PRIMARY KEY `Action`)";
2165 r = try_query(hdb, query);
2166 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2168 /* a few key tables exist */
2169 sprintf(name, "#%d", hdb);
2170 r = MsiOpenPackage(name, &hpack);
2171 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2172 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2174 MsiCloseHandle(hdb);
2175 DeleteFile(msifile);
2177 /* start with a clean database to show what constitutes a valid package */
2178 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2179 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2181 sprintf(name, "#%d", hdb);
2183 /* The following summary information props must exist:
2188 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2189 r = MsiOpenPackage(name, &hpack);
2190 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2191 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2193 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2194 r = MsiOpenPackage(name, &hpack);
2195 ok(r == ERROR_SUCCESS,
2196 "Expected ERROR_SUCCESS, got %d\n", r);
2198 MsiCloseHandle(hpack);
2199 MsiCloseHandle(hdb);
2200 DeleteFile(msifile);
2203 static void test_formatrecord2(void)
2205 MSIHANDLE hpkg, hrec ;
2210 hpkg = package_from_db(create_package_db());
2211 ok( hpkg, "failed to create package\n");
2213 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2214 ok( r == ERROR_SUCCESS, "set property failed\n");
2216 hrec = MsiCreateRecord(2);
2217 ok(hrec, "create record failed\n");
2219 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2220 ok( r == ERROR_SUCCESS, "format record failed\n");
2224 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2226 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2227 r = MsiRecordSetString(hrec, 1, "hoo");
2229 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2230 ok( sz == 3, "size wrong\n");
2231 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2232 ok( r == ERROR_SUCCESS, "format failed\n");
2234 r = MsiRecordSetString(hrec, 0, "x[~]x");
2236 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2237 ok( sz == 3, "size wrong\n");
2238 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2239 ok( r == ERROR_SUCCESS, "format failed\n");
2241 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2242 r = MsiRecordSetString(hrec, 1, "hoo");
2244 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2245 ok( sz == 3, "size wrong\n");
2246 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2247 ok( r == ERROR_SUCCESS, "format failed\n");
2249 r = MsiRecordSetString(hrec, 0, "[\\[]");
2251 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2252 ok( sz == 1, "size wrong\n");
2253 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2254 ok( r == ERROR_SUCCESS, "format failed\n");
2256 SetEnvironmentVariable("FOO", "BAR");
2257 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2259 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2260 ok( sz == 3, "size wrong\n");
2261 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2262 ok( r == ERROR_SUCCESS, "format failed\n");
2264 r = MsiRecordSetString(hrec, 0, "[[1]]");
2265 r = MsiRecordSetString(hrec, 1, "%FOO");
2267 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2268 ok( sz == 3, "size wrong\n");
2269 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2270 ok( r == ERROR_SUCCESS, "format failed\n");
2272 MsiCloseHandle( hrec );
2273 MsiCloseHandle( hpkg );
2274 DeleteFile(msifile);
2277 static void test_states(void)
2282 INSTALLSTATE state, action;
2284 static const CHAR msifile2[] = "winetest2.msi";
2285 static const CHAR msifile3[] = "winetest3.msi";
2286 static const CHAR msifile4[] = "winetest4.msi";
2288 hdb = create_package_db();
2289 ok ( hdb, "failed to create package database\n" );
2291 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2292 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2294 r = create_property_table( hdb );
2295 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2297 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2298 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2300 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2301 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2303 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2304 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2306 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2307 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2309 r = create_install_execute_sequence_table( hdb );
2310 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2312 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2313 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2315 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2316 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2318 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2319 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2321 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2322 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2324 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2325 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2327 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2328 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2330 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2331 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2333 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2334 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2336 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2337 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2339 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2340 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2342 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2343 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2345 r = create_media_table( hdb );
2346 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2348 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2349 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2351 r = create_feature_table( hdb );
2352 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2354 r = create_component_table( hdb );
2355 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2357 /* msidbFeatureAttributesFavorLocal */
2358 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2359 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2361 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2362 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2363 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2365 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2366 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2367 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2369 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2370 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2371 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2373 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2374 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2375 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2377 /* msidbFeatureAttributesFavorSource */
2378 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2379 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2381 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2382 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2383 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2385 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2386 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2387 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2389 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2390 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2391 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2393 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2394 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2395 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2397 /* msidbFeatureAttributesFavorSource */
2398 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2399 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2401 /* msidbFeatureAttributesFavorLocal */
2402 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2403 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2406 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2407 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2409 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2410 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2411 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2413 /* no feature parent:msidbComponentAttributesLocalOnly */
2414 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2415 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2417 /* msidbFeatureAttributesFavorLocal:removed */
2418 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2419 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2421 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2422 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2423 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2425 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2426 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2427 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2429 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2430 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2431 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2433 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2434 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2435 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2437 /* msidbFeatureAttributesFavorSource:removed */
2438 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2439 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2441 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2442 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2443 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2445 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2446 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2447 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2449 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2450 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2451 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2453 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2454 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2455 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2457 /* msidbFeatureAttributesFavorLocal */
2458 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2459 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2461 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2462 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2464 /* msidbFeatureAttributesFavorSource */
2465 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2466 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2468 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2469 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2471 /* msidbFeatureAttributesFavorAdvertise */
2472 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2473 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2475 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2476 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2478 r = create_feature_components_table( hdb );
2479 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2481 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2482 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2484 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2485 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2487 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2488 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2490 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2491 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2493 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2494 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2496 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2497 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2499 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2500 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2502 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2503 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2505 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2506 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2508 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2509 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2511 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2512 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2514 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2515 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2517 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2518 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2520 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2521 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2523 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2524 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2526 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2527 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2529 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2530 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2532 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2533 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2535 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2536 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2538 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2539 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2541 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2542 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2544 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2545 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2547 r = create_file_table( hdb );
2548 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2550 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2551 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2553 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2554 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2556 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2557 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2559 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2560 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2562 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2563 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2565 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2566 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2568 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2569 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2571 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2572 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2574 /* compressed file */
2575 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2576 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2578 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2579 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2581 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2582 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2584 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2585 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2587 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2588 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2590 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2591 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2593 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2594 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2596 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2597 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2599 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2600 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2602 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2603 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2605 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2606 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2608 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2609 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2611 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2612 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2614 MsiDatabaseCommit(hdb);
2616 /* these properties must not be in the saved msi file */
2617 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2618 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2620 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2621 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2623 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2624 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2626 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2627 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2629 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2630 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2632 hpkg = package_from_db( hdb );
2633 ok( hpkg, "failed to create package\n");
2635 MsiCloseHandle(hdb);
2637 CopyFileA(msifile, msifile2, FALSE);
2638 CopyFileA(msifile, msifile3, FALSE);
2639 CopyFileA(msifile, msifile4, FALSE);
2643 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2644 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2645 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2646 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2650 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2651 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2652 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2653 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2657 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2658 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2659 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2660 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2664 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2665 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2666 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2667 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2671 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2672 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2673 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2674 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2678 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2679 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2680 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2681 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2685 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2686 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2687 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2688 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2692 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2693 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2694 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2695 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2699 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2700 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2701 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2702 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2706 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2707 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2708 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2709 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2713 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2714 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2715 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2716 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2720 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2721 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2722 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2723 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2727 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2728 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2729 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2730 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2734 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2735 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2736 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2737 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2741 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2742 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2743 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2744 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2748 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2749 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2750 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2751 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2755 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2756 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2757 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2758 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2762 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2763 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2764 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2765 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2769 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2770 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2771 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2772 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2776 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2777 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2778 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2779 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2783 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2784 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2785 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2786 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2790 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2791 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2792 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2793 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2797 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2798 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2799 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2800 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2804 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2805 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2806 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2807 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2811 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2812 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2813 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2814 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2818 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2819 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2820 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2821 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2825 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2826 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2827 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2828 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2832 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2833 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2834 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2835 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2839 r = MsiGetComponentState(hpkg, "tau", &state, &action);
2840 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2841 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2842 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2846 r = MsiGetComponentState(hpkg, "phi", &state, &action);
2847 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2848 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2849 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2853 r = MsiGetComponentState(hpkg, "chi", &state, &action);
2854 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2855 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2856 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2858 r = MsiDoAction( hpkg, "CostInitialize");
2859 ok( r == ERROR_SUCCESS, "cost init failed\n");
2863 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2864 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2865 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2866 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2870 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2871 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2872 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2873 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2877 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2879 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2880 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2884 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2886 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2887 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2891 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2893 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2894 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2898 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2900 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2901 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2905 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2906 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2907 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2908 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2912 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2913 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2914 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2915 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2919 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2920 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2921 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2922 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2926 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2927 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2928 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2929 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2933 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2934 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2935 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2936 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2940 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2941 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2942 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2943 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2947 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2949 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2950 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2954 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2956 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2957 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2961 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2963 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2964 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2968 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2970 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2971 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2975 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2977 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2978 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2982 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2983 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2984 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2985 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2989 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2990 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2991 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2992 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2996 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2997 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2998 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2999 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3003 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3004 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3005 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3006 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3010 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3011 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3012 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3013 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3017 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3018 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3019 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3020 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3024 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3026 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3027 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3031 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3032 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3033 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3034 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3038 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3040 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3041 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3045 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3047 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3048 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3052 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3054 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3059 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3060 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3061 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3062 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3066 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3068 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3069 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3073 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3075 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3076 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3078 r = MsiDoAction( hpkg, "FileCost");
3079 ok( r == ERROR_SUCCESS, "file cost failed\n");
3083 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3084 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3085 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3086 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3090 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3092 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3093 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3097 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3099 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3100 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3104 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3106 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3107 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3111 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3112 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3113 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3114 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3118 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3120 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3121 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3125 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3126 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3127 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3128 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3132 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3133 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3134 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3135 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3139 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3140 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3141 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3142 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3146 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3147 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3148 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3149 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3153 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3155 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3156 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3160 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3161 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3162 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3163 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3167 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3168 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3169 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3170 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3174 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3175 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3176 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3177 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3181 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3182 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3183 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3184 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3188 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3190 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3191 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3195 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3197 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3198 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3202 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3204 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3205 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3209 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3211 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3212 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3216 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3218 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3219 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3223 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3224 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3225 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3226 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3230 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3232 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3233 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3237 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3238 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3239 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3240 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3244 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3245 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3246 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3247 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3251 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3253 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3254 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3258 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3260 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3261 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3265 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3266 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3267 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3268 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3272 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3274 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3275 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3279 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3281 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3282 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3286 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3288 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3289 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3293 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3295 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3296 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3298 r = MsiDoAction( hpkg, "CostFinalize");
3299 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3303 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3304 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3305 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3306 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3310 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3311 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3312 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3313 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3317 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3318 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3319 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3320 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3324 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3325 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3326 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3327 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3331 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3332 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3333 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3334 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3338 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3339 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3340 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3341 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3345 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3346 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3347 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3348 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3352 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3353 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3354 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3355 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3359 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3360 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3361 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3362 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3366 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3367 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3368 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3369 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3373 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3374 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3375 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3376 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3380 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3381 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3382 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3383 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3387 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3388 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3389 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3390 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3394 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3395 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3396 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3397 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3401 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3402 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3403 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3404 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3408 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3409 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3410 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3411 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3415 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3416 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3417 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3418 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3422 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3423 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3424 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3425 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3429 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3430 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3431 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3432 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3436 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3437 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3438 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3439 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3443 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3444 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3445 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3446 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3450 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3451 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3452 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3453 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3457 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3458 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3459 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3460 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3464 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3465 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3466 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3467 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3471 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3472 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3473 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3474 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3478 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3479 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3480 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3481 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3485 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3486 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3487 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3488 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3492 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3493 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3494 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3495 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3499 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3500 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3501 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3502 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3506 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3507 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3508 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3509 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3513 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3514 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3515 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3516 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3518 MsiCloseHandle( hpkg );
3520 /* publish the features and components */
3521 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3524 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3525 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3527 /* these properties must not be in the saved msi file */
3528 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3529 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3531 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3532 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3534 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3535 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3537 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3538 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3540 hpkg = package_from_db( hdb );
3541 ok( hpkg, "failed to create package\n");
3543 MsiCloseHandle(hdb);
3547 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3548 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3549 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3550 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3554 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3555 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3556 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3557 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3561 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3562 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3563 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3564 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3568 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3569 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3570 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3571 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3575 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3576 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3577 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3578 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3582 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3583 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3584 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3585 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3589 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3590 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3591 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3592 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3596 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3597 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3598 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3599 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3603 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3604 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3605 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3606 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3610 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3611 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3612 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3613 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3617 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3618 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3619 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3620 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3624 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3625 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3626 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3627 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3631 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3632 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3633 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3634 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3638 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3639 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3640 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3641 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3645 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3646 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3647 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3648 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3652 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3653 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3654 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3655 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3659 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3660 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3661 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3662 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3666 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3667 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3668 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3669 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3673 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3674 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3675 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3676 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3680 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3681 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3682 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3683 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3687 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3688 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3689 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3690 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3694 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3695 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3696 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3697 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3701 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3702 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3703 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3704 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3708 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3709 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3710 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3711 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3715 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3716 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3717 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3718 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3722 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3723 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3724 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3725 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3729 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3730 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3731 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3732 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3736 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3737 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3738 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3739 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3743 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3744 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3745 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3746 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3750 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3751 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3752 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3753 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3757 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3758 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3759 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3760 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3762 r = MsiDoAction( hpkg, "CostInitialize");
3763 ok( r == ERROR_SUCCESS, "cost init failed\n");
3767 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3768 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3769 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3770 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3774 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3775 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3776 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3777 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3781 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3783 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3784 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3788 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3790 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3791 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3795 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3797 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3798 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3802 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3803 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3804 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3805 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3809 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3810 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3811 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3812 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3816 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3817 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3818 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3819 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3823 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3824 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3825 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3826 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3830 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3831 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3832 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3833 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3837 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3839 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3840 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3844 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3845 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3846 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3847 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3851 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3852 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3853 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3854 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3858 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3859 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3860 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3861 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3865 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3866 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3867 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3868 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3872 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3873 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3874 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3875 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3879 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3880 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3881 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3882 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3886 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3887 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3888 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3889 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3893 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3894 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3895 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3896 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3900 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3901 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3902 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3903 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3907 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3908 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3909 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3910 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3914 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3915 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3916 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3917 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3921 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3922 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3923 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3924 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3928 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3929 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3930 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3931 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3935 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3936 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3937 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3938 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3942 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3943 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3944 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3945 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3949 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3950 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3951 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3952 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3956 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3957 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3958 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3959 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3963 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3964 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3965 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3966 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3970 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3971 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3972 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3973 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3977 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3978 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3979 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3980 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3982 r = MsiDoAction( hpkg, "FileCost");
3983 ok( r == ERROR_SUCCESS, "file cost failed\n");
3987 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3989 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3990 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3994 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3996 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3997 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4001 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4002 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4003 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4004 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4008 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4009 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4010 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4011 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4015 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4016 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4017 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4018 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4022 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4023 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4024 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4025 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4029 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4030 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4031 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4032 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4036 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4037 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4038 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4039 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4043 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4044 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4045 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4046 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4050 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4051 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4052 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4053 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4057 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4058 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4059 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4060 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4064 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4065 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4066 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4067 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4071 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4072 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4073 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4074 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4078 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4079 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4080 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4081 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4085 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4086 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4087 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4088 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4092 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4094 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4095 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4099 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4101 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4102 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4106 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4108 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4113 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4115 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4116 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4120 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4122 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4127 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4134 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4141 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4148 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4155 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4162 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4164 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4165 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4169 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4171 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4176 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4178 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4183 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4185 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4186 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4190 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4192 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4193 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4195 r = MsiDoAction( hpkg, "CostFinalize");
4196 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4200 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4202 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4203 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4207 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4209 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4210 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4214 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4215 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4216 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4217 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4221 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4222 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4223 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4224 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4228 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4229 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4230 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4231 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4235 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4236 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4237 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4238 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4242 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4243 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4244 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4245 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4249 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4250 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4251 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4252 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4256 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4257 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4258 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4259 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4263 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4264 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4265 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4266 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4270 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4271 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4272 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4273 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4277 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4278 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4279 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4280 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4284 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4285 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4286 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4287 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4291 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4292 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4293 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4294 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4298 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4299 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4300 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4301 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4305 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4306 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4307 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4308 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4312 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4313 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4314 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4315 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4319 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4320 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4321 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4322 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4326 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4328 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4329 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4333 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4334 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4335 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4336 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4340 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4342 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4343 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4347 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4349 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4350 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4354 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4356 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4361 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4363 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4368 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4370 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4371 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4375 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4377 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4378 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4382 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4384 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4385 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4389 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4391 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4392 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4396 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4398 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4403 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4405 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4410 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4411 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4412 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4413 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4415 MsiCloseHandle(hpkg);
4417 /* uninstall the product */
4418 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4421 /* all features installed locally */
4422 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4425 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4426 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4428 /* these properties must not be in the saved msi file */
4429 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4430 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4432 hpkg = package_from_db( hdb );
4433 ok( hpkg, "failed to create package\n");
4437 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4438 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4439 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4440 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4444 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4445 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4446 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4447 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4451 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4452 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4453 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4454 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4458 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4459 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4460 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4461 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4465 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4466 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4467 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4468 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4472 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4473 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4474 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4475 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4479 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4480 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4481 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4482 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4486 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4487 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4488 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4489 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4493 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4494 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4495 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4496 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4500 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4501 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4502 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4503 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4507 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4508 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4509 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4510 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4514 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4515 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4516 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4517 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4521 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4522 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4523 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4524 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4528 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4529 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4530 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4531 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4535 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4536 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4537 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4538 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4542 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4543 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4544 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4545 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4549 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4550 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4551 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4552 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4556 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4557 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4558 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4559 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4563 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4564 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4565 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4566 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4570 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4571 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4572 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4573 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4577 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4578 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4579 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4580 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4584 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4585 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4586 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4587 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4591 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4592 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4593 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4594 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4598 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4599 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4600 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4601 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4605 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4606 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4607 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4608 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4612 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4613 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4614 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4615 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4619 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4620 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4621 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4622 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4626 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4627 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4628 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4629 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4633 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4634 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4635 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4636 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4640 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4641 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4642 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4643 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4647 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4648 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4649 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4650 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4652 r = MsiDoAction( hpkg, "CostInitialize");
4653 ok( r == ERROR_SUCCESS, "cost init failed\n");
4657 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4659 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4660 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4664 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4665 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4666 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4667 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4671 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4673 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4674 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4678 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4679 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4680 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4681 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4685 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4687 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4688 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4692 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4693 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4694 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4695 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4699 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4700 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4701 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4702 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4706 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4707 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4708 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4709 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4713 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4714 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4715 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4716 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4720 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4721 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4722 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4723 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4727 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4728 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4729 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4730 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4734 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4735 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4736 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4737 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4741 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4743 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4744 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4748 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4749 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4750 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4751 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4755 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4756 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4757 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4758 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4762 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4763 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4764 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4765 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4769 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4770 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4771 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4772 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4776 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4777 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4778 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4779 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4783 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4784 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4785 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4786 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4790 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4791 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4792 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4793 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4797 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4798 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4799 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4800 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4804 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4805 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4806 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4807 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4811 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4812 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4813 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4814 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4818 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4819 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4820 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4821 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4825 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4826 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4827 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4828 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4832 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4833 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4834 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4835 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4839 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4840 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4841 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4842 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4846 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4847 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4848 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4849 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4853 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4854 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4855 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4856 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4860 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4861 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4862 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4863 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4867 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4868 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4869 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4870 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4872 r = MsiDoAction( hpkg, "FileCost");
4873 ok( r == ERROR_SUCCESS, "file cost failed\n");
4877 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4879 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4880 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4884 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4886 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4887 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4891 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4893 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4894 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4898 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4900 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4901 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4905 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4906 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4907 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4908 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4912 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4913 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4914 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4915 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4919 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4920 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4921 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4922 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4926 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4927 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4928 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4929 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4933 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4934 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4935 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4936 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4940 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4941 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4942 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4943 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4947 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4949 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4950 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4954 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4956 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4957 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4961 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4963 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4964 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4968 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4970 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4971 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4975 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4977 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4978 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4982 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4983 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4984 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4985 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4989 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4990 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4991 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4992 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4996 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4997 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4998 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4999 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5003 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5004 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5005 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5006 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5010 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5011 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5012 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5013 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5017 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5018 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5019 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5020 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5024 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5026 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5027 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5031 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5032 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5033 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5034 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5038 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5040 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5041 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5045 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5047 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5048 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5052 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5054 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5059 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5060 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5061 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5062 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5066 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5068 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5069 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5073 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5075 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5076 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5080 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5082 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5083 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5087 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5089 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5090 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5092 r = MsiDoAction( hpkg, "CostFinalize");
5093 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5097 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5099 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5100 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5104 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5106 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5107 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5111 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5112 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5113 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5114 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5118 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5120 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5121 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5125 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5126 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5127 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5128 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5132 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5133 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5134 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5135 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5139 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5140 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5141 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5142 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5146 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5147 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5148 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5149 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5153 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5155 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5156 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5160 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5161 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5162 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5163 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5167 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5168 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5169 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5170 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5174 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5175 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5176 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5177 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5181 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5182 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5183 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5184 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5188 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5190 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5191 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5195 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5197 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5198 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5202 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5204 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5205 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5209 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5211 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5212 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5216 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5218 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5219 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5223 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5224 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5225 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5226 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5230 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5232 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5233 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5237 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5238 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5239 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5240 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5244 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5245 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5246 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5247 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5251 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5253 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5254 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5258 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5260 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5261 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5265 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5266 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5267 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5268 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5272 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5274 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5275 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5279 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5281 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5282 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5286 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5288 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5289 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5293 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5295 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5296 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5300 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5301 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5302 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5303 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5307 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5308 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5309 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5310 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5312 MsiCloseHandle(hpkg);
5314 /* uninstall the product */
5315 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5318 /* all features installed from source */
5319 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5322 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5323 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5325 /* this property must not be in the saved msi file */
5326 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5327 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5329 hpkg = package_from_db( hdb );
5330 ok( hpkg, "failed to create package\n");
5334 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5335 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5336 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5337 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5341 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5342 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5343 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5344 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5348 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5349 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5350 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5351 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5355 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5356 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5357 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5358 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5362 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5363 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5364 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5365 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5369 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5370 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5371 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5372 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5376 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5377 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5378 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5379 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5383 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5384 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5385 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5386 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5390 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5391 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5392 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5393 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5397 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5398 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5399 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5400 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5404 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5405 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5406 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5407 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5411 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5412 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5413 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5414 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5418 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5419 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5420 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5421 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5425 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5426 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5427 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5428 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5432 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5433 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5434 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5435 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5439 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5440 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5441 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5442 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5446 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5447 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5448 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5449 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5453 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5454 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5455 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5456 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5460 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5461 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5462 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5463 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5467 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5468 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5469 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5470 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5474 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5475 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5476 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5477 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5481 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5482 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5483 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5484 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5488 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5489 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5490 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5491 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5495 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5496 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5497 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5498 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5502 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5503 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5504 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5505 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5509 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5510 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5511 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5512 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5516 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5517 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5518 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5519 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5523 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5524 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5525 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5526 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5530 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5531 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5532 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5533 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5537 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5538 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5539 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5540 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5544 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5545 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5546 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5547 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5549 r = MsiDoAction( hpkg, "CostInitialize");
5550 ok( r == ERROR_SUCCESS, "cost init failed\n");
5554 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5555 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5556 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5557 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5561 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5562 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5563 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5564 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5568 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5569 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5570 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5571 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5575 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5576 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5577 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5578 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5582 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5583 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5584 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5585 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5589 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5590 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5591 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5592 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5596 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5597 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5598 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5599 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5603 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5604 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5605 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5606 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5610 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5611 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5612 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5613 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5617 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5618 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5619 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5620 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5624 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5625 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5626 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5627 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5631 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5632 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5633 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5634 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5638 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5639 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5640 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5641 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5645 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5646 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5647 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5648 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5652 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5654 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5655 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5659 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5660 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5661 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5662 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5666 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5668 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5669 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5673 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5675 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5676 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5680 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5681 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5682 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5683 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5687 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5688 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5689 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5690 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5694 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5695 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5696 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5697 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5701 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5703 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5704 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5708 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5710 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5711 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5715 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5716 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5717 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5718 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5722 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5723 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5724 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5725 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5729 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5730 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5731 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5732 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5736 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5737 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5738 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5739 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5743 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5744 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5745 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5746 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5750 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5751 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5752 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5753 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5757 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5758 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5759 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5760 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5764 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5765 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5766 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5767 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5769 r = MsiDoAction( hpkg, "FileCost");
5770 ok( r == ERROR_SUCCESS, "file cost failed\n");
5774 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5775 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5776 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5777 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5781 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5783 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5784 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5788 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5790 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5791 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5795 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5797 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5798 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5802 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5803 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5804 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5805 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5809 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5810 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5811 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5812 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5816 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5817 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5818 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5819 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5823 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5824 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5825 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5826 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5830 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5831 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5832 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5833 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5837 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5839 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5840 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5844 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5845 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5846 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5847 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5851 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5852 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5853 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5854 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5858 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5859 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5860 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5861 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5865 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5866 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5867 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5868 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5872 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5873 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5874 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5875 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5879 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5880 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5881 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5882 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5886 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5887 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5888 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5889 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5893 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5894 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5895 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5896 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5900 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5901 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5902 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5903 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5907 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5908 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5909 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5910 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5914 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5915 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5916 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5917 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5921 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5922 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5923 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5924 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5928 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5929 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5930 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5931 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5935 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5936 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5937 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5938 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5942 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5943 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5944 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5945 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5949 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5950 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5951 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5952 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5956 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5957 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5958 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5959 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5963 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5964 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5965 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5966 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5970 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5971 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5972 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5973 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5977 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5978 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5979 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5980 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5984 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5985 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5986 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5987 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5989 r = MsiDoAction( hpkg, "CostFinalize");
5990 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5994 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5996 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5997 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6001 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6002 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6003 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6004 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6008 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6009 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6010 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6011 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6015 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6016 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6017 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6018 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6022 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6023 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6024 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6025 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6029 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6030 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6031 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6032 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6036 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6037 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6038 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6039 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6043 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6044 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6045 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6046 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6050 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6051 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6052 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6053 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6057 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6058 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6059 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6060 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6064 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6065 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6066 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6067 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6071 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6072 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6073 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6074 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6078 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6079 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6080 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6081 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6085 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6086 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6087 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6088 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6092 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6094 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6095 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6099 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6101 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6102 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6106 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6108 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6113 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6115 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6116 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6120 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6122 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6123 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6127 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6129 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6134 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6136 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6137 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6141 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6143 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6148 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6150 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6155 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6157 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6158 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6162 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6164 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6165 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6169 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6171 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6176 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6178 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6183 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6185 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6186 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6190 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6192 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6193 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6197 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6199 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6200 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6204 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6206 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6207 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6209 MsiCloseHandle(hpkg);
6211 /* reinstall the product */
6212 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6213 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6215 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6216 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6218 /* this property must not be in the saved msi file */
6219 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6220 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6222 hpkg = package_from_db( hdb );
6223 ok( hpkg, "failed to create package\n");
6227 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6228 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6229 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6230 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6234 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6235 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6236 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6237 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6241 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6242 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6243 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6244 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6248 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6249 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6250 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6251 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6255 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6256 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6257 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6258 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6262 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6263 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6264 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6265 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6269 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6270 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6271 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6272 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6276 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6277 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6278 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6279 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6283 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6284 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6285 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6286 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6290 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6291 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6292 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6293 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6297 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6298 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6299 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6300 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6304 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6305 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6306 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6307 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6311 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6312 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6313 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6314 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6318 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6319 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6320 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6321 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6325 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6326 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6327 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6328 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6332 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6333 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6334 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6335 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6339 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6340 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6341 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6342 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6346 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6347 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6348 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6349 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6353 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6354 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6355 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6356 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6360 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6361 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6362 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6363 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6367 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6368 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6369 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6370 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6374 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6375 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6376 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6377 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6381 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6382 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6383 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6384 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6388 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6389 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6390 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6391 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6395 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6396 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6397 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6398 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6402 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6403 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6404 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6405 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6409 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6410 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6411 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6412 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6416 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6417 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6418 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6419 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6423 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6424 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6425 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6426 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6430 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6431 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6432 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6433 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6437 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6438 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6439 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6440 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6442 r = MsiDoAction( hpkg, "CostInitialize");
6443 ok( r == ERROR_SUCCESS, "cost init failed\n");
6447 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6449 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6450 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6454 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6456 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6457 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6461 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6463 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6464 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6468 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6470 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6471 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6475 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6477 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6478 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6482 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6484 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6485 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6489 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6491 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6492 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6496 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6498 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6499 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6503 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6505 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6506 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6510 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6512 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6513 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6517 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6519 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6520 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6524 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6526 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6527 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6531 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6533 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6534 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6538 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6540 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6541 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6545 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6547 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6548 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6552 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6554 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6555 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6559 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6561 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6562 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6566 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6568 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6569 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6573 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6575 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6576 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6580 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6581 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6582 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6583 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6587 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6588 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6589 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6590 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6594 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6595 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6596 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6597 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6601 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6602 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6603 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6604 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6608 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6609 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6610 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6611 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6615 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6616 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6617 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6618 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6622 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6623 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6624 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6625 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6629 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6630 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6631 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6632 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6636 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6637 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6638 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6639 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6643 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6644 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6645 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6646 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6650 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6652 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6653 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6657 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6659 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6660 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6662 r = MsiDoAction( hpkg, "FileCost");
6663 ok( r == ERROR_SUCCESS, "file cost failed\n");
6667 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6668 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6669 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6670 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6674 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6676 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6677 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6681 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6683 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6684 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6688 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6690 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6691 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6695 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6696 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6697 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6698 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6702 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6703 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6704 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6705 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6709 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6710 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6711 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6712 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6716 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6717 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6718 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6719 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6723 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6724 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6725 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6726 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6730 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6731 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6732 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6733 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6737 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6738 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6739 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6740 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6744 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6745 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6746 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6747 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6751 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6752 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6753 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6754 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6758 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6759 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6760 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6761 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6765 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6766 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6767 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6768 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6772 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6773 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6774 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6775 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6779 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6780 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6781 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6782 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6786 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6787 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6788 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6789 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6793 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6794 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6795 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6796 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6800 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6801 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6802 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6803 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6807 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6808 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6809 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6810 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6814 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6815 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6816 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6817 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6821 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6822 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6823 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6824 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6828 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6829 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6830 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6831 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6835 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6836 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6837 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6838 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6842 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6843 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6844 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6845 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6849 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6850 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6851 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6852 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6856 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6858 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6859 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6863 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6864 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6865 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6866 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6870 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6871 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6872 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6873 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6877 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6879 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6880 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6882 r = MsiDoAction( hpkg, "CostFinalize");
6883 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6887 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6888 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6889 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6890 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6894 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6895 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6896 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6897 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6901 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6902 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6903 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6904 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6908 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6909 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6910 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6911 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6915 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6916 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6917 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6918 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6922 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6923 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6924 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6925 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6929 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6930 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6931 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6932 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6936 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6937 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6938 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6939 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6943 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6944 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6945 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6946 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6950 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6951 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6952 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6953 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6957 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6958 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6959 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6960 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6964 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6965 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6966 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6967 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6971 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6972 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6973 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6974 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6978 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6979 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6980 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6981 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6985 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6986 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6987 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6988 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6992 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6993 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6994 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6995 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6999 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7000 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7001 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7002 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7006 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7007 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7008 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7009 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7013 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7014 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7015 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7016 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7020 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7021 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7022 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7023 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7027 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7029 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7030 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7034 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7035 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7036 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7037 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7041 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7042 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7043 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7044 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7048 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7049 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7050 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7051 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7055 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7056 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7057 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7058 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7062 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7063 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7064 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7065 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7069 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7071 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7072 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7076 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7077 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7078 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7079 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7083 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7084 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7085 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7086 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7090 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7092 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7093 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7097 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7099 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7100 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7102 MsiCloseHandle(hpkg);
7104 /* uninstall the product */
7105 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7108 DeleteFileA(msifile);
7109 DeleteFileA(msifile2);
7110 DeleteFileA(msifile3);
7111 DeleteFileA(msifile4);
7114 static void test_getproperty(void)
7116 MSIHANDLE hPackage = 0;
7118 static CHAR empty[] = "";
7122 hPackage = package_from_db(create_package_db());
7123 ok( hPackage != 0, " Failed to create package\n");
7125 /* set the property */
7126 r = MsiSetProperty(hPackage, "Name", "Value");
7127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7129 /* retrieve the size, NULL pointer */
7131 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7133 ok( size == 5, "Expected 5, got %d\n", size);
7135 /* retrieve the size, empty string */
7137 r = MsiGetProperty(hPackage, "Name", empty, &size);
7138 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7139 ok( size == 5, "Expected 5, got %d\n", size);
7141 /* don't change size */
7142 r = MsiGetProperty(hPackage, "Name", prop, &size);
7143 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7144 ok( size == 5, "Expected 5, got %d\n", size);
7145 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7147 /* increase the size by 1 */
7149 r = MsiGetProperty(hPackage, "Name", prop, &size);
7150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7151 ok( size == 5, "Expected 5, got %d\n", size);
7152 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7154 r = MsiCloseHandle( hPackage);
7155 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7156 DeleteFile(msifile);
7159 static void test_removefiles(void)
7165 hdb = create_package_db();
7166 ok ( hdb, "failed to create package database\n" );
7168 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7169 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7171 r = create_feature_table( hdb );
7172 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7174 r = create_component_table( hdb );
7175 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7177 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7178 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7180 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7181 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7183 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7184 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7186 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7187 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7189 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7190 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7192 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7193 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7195 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7196 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7198 r = create_feature_components_table( hdb );
7199 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7201 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7202 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7204 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7205 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7207 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7208 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7210 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7211 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7213 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7214 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7216 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7217 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7219 r = create_file_table( hdb );
7220 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7222 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7223 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7225 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7226 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7228 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7229 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7231 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7232 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7234 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7235 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7237 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7238 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7240 r = create_remove_file_table( hdb );
7241 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7243 hpkg = package_from_db( hdb );
7244 ok( hpkg, "failed to create package\n");
7246 MsiCloseHandle( hdb );
7248 create_test_file( "hydrogen.txt" );
7249 create_test_file( "helium.txt" );
7250 create_test_file( "lithium.txt" );
7251 create_test_file( "beryllium.txt" );
7252 create_test_file( "boron.txt" );
7253 create_test_file( "carbon.txt" );
7255 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7256 ok( r == ERROR_SUCCESS, "set property failed\n");
7258 r = MsiDoAction( hpkg, "CostInitialize");
7259 ok( r == ERROR_SUCCESS, "cost init failed\n");
7261 r = MsiDoAction( hpkg, "FileCost");
7262 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7264 r = MsiDoAction( hpkg, "CostFinalize");
7265 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7267 r = MsiDoAction( hpkg, "InstallValidate");
7268 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7270 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7271 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7273 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7274 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7276 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7277 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7279 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7280 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7282 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7283 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7285 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7286 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7288 r = MsiDoAction( hpkg, "RemoveFiles");
7289 ok( r == ERROR_SUCCESS, "remove files failed\n");
7291 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7292 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7293 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7294 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7295 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7296 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7298 MsiCloseHandle( hpkg );
7299 DeleteFileA(msifile);
7302 static void test_appsearch(void)
7307 CHAR prop[MAX_PATH];
7308 DWORD size = MAX_PATH;
7310 hdb = create_package_db();
7311 ok ( hdb, "failed to create package database\n" );
7313 r = create_appsearch_table( hdb );
7314 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7316 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7317 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7319 r = create_reglocator_table( hdb );
7320 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7322 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7323 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7325 r = create_signature_table( hdb );
7326 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7328 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7329 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7331 hpkg = package_from_db( hdb );
7332 ok( hpkg, "failed to create package\n");
7334 MsiCloseHandle( hdb );
7336 r = MsiDoAction( hpkg, "AppSearch" );
7337 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7339 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7340 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7343 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7346 MsiCloseHandle( hpkg );
7347 DeleteFileA(msifile);
7350 static void test_appsearch_complocator(void)
7352 MSIHANDLE hpkg, hdb;
7353 CHAR path[MAX_PATH];
7354 CHAR prop[MAX_PATH];
7359 if (!get_user_sid(&usersid))
7362 create_test_file("FileName1");
7363 create_test_file("FileName4");
7364 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7365 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7367 create_test_file("FileName2");
7368 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7369 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7371 create_test_file("FileName3");
7372 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7373 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7375 create_test_file("FileName5");
7376 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7377 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7379 create_test_file("FileName6");
7380 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7381 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7383 create_test_file("FileName7");
7384 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7385 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7387 /* dir is FALSE, but we're pretending it's a directory */
7388 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7389 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7391 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7392 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7393 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7395 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7396 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7397 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7399 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7400 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7401 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7403 hdb = create_package_db();
7404 ok(hdb, "Expected a valid database handle\n");
7406 r = create_appsearch_table(hdb);
7407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7409 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7410 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7412 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7415 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7418 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7421 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7424 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7427 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7428 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7430 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7433 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7436 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7437 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7439 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7442 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7445 r = create_complocator_table(hdb);
7446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7448 /* published component, machine, file, signature, misdbLocatorTypeFile */
7449 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7452 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7453 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7456 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7457 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7458 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7460 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7461 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7464 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7465 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7468 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7469 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7470 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7472 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7473 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7476 /* unpublished component, no signature, misdbLocatorTypeDir */
7477 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7480 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7481 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7484 /* published component, signature w/ ver, misdbLocatorTypeFile */
7485 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7488 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7489 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7492 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7493 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7496 r = create_signature_table(hdb);
7497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7499 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7502 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7505 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7508 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7511 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7512 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7514 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7517 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7520 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7523 hpkg = package_from_db(hdb);
7524 ok(hpkg, "Expected a valid package handle\n");
7526 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
7527 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7529 r = MsiDoAction(hpkg, "AppSearch");
7530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7533 sprintf(path, "%s\\FileName1", CURR_DIR);
7534 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7536 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7539 sprintf(path, "%s\\FileName2", CURR_DIR);
7540 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7542 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7545 sprintf(path, "%s\\FileName3", CURR_DIR);
7546 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7548 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7551 sprintf(path, "%s\\FileName4", CURR_DIR);
7552 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
7553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7554 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7557 sprintf(path, "%s\\FileName5", CURR_DIR);
7558 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7559 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7560 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7563 sprintf(path, "%s\\", CURR_DIR);
7564 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7566 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7569 sprintf(path, "%s\\", CURR_DIR);
7570 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7572 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7575 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7577 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
7580 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7582 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7585 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
7586 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7587 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7588 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7591 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
7592 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7593 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7596 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
7597 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
7598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7599 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7601 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7602 MSIINSTALLCONTEXT_MACHINE, NULL);
7603 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7604 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
7605 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7606 MSIINSTALLCONTEXT_USERMANAGED, usersid);
7607 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7608 MSIINSTALLCONTEXT_MACHINE, NULL);
7609 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7610 MSIINSTALLCONTEXT_MACHINE, NULL);
7611 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7612 MSIINSTALLCONTEXT_MACHINE, NULL);
7613 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7614 MSIINSTALLCONTEXT_MACHINE, NULL);
7615 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7616 MSIINSTALLCONTEXT_MACHINE, NULL);
7617 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7618 MSIINSTALLCONTEXT_MACHINE, NULL);
7619 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7620 MSIINSTALLCONTEXT_MACHINE, NULL);
7622 DeleteFileA("FileName1");
7623 DeleteFileA("FileName2");
7624 DeleteFileA("FileName3");
7625 DeleteFileA("FileName4");
7626 DeleteFileA("FileName5");
7627 DeleteFileA("FileName6");
7628 DeleteFileA("FileName7");
7629 DeleteFileA("FileName8.dll");
7630 DeleteFileA("FileName9.dll");
7631 DeleteFileA("FileName10.dll");
7632 MsiCloseHandle(hpkg);
7633 DeleteFileA(msifile);
7636 static void test_appsearch_reglocator(void)
7638 MSIHANDLE hpkg, hdb;
7639 CHAR path[MAX_PATH];
7640 CHAR prop[MAX_PATH];
7643 BOOL space, version;
7654 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7657 DeleteFileA("test.dll");
7659 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
7660 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7662 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
7663 (const BYTE *)"regszdata", 10);
7664 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7666 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
7667 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7669 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
7670 (const BYTE *)"regszdata", 10);
7671 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7674 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
7675 ok(res == ERROR_SUCCESS ||
7676 broken(res == ERROR_INVALID_PARAMETER),
7677 "Expected ERROR_SUCCESS, got %d\n", res);
7679 if (res == ERROR_SUCCESS)
7681 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
7682 (const BYTE *)"regszdata", 10);
7683 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7686 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
7687 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7689 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
7690 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7692 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
7693 (const BYTE *)"regszdata", 10);
7694 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7697 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
7698 (const BYTE *)&val, sizeof(DWORD));
7699 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7702 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
7703 (const BYTE *)&val, sizeof(DWORD));
7704 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7706 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
7707 (const BYTE *)"%PATH%", 7);
7708 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7710 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
7711 (const BYTE *)"my%NOVAR%", 10);
7712 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7714 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
7715 (const BYTE *)"one\0two\0", 9);
7716 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7718 binary[0] = 0x1234abcd;
7719 binary[1] = 0x567890ef;
7720 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
7721 (const BYTE *)binary, sizeof(binary));
7722 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7724 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
7725 (const BYTE *)"#regszdata", 11);
7726 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7728 create_test_file("FileName1");
7729 sprintf(path, "%s\\FileName1", CURR_DIR);
7730 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
7731 (const BYTE *)path, lstrlenA(path) + 1);
7732 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7734 sprintf(path, "%s\\FileName2", CURR_DIR);
7735 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
7736 (const BYTE *)path, lstrlenA(path) + 1);
7737 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7739 lstrcpyA(path, CURR_DIR);
7740 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
7741 (const BYTE *)path, lstrlenA(path) + 1);
7742 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7744 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
7745 (const BYTE *)"", 1);
7746 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7748 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7749 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
7750 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
7751 (const BYTE *)path, lstrlenA(path) + 1);
7752 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7754 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7755 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
7756 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
7757 (const BYTE *)path, lstrlenA(path) + 1);
7758 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7760 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7761 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
7762 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
7763 (const BYTE *)path, lstrlenA(path) + 1);
7764 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7766 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
7767 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
7768 (const BYTE *)path, lstrlenA(path) + 1);
7770 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
7771 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
7772 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
7773 (const BYTE *)path, lstrlenA(path) + 1);
7775 hdb = create_package_db();
7776 ok(hdb, "Expected a valid database handle\n");
7778 r = create_appsearch_table(hdb);
7779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7781 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7784 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7787 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7790 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7791 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7793 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7796 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7799 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7800 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7802 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7805 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7808 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7811 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7812 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7814 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7817 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
7818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7820 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
7821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7823 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
7824 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7826 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
7827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7829 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
7830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7832 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
7833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7835 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
7836 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7838 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
7839 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7841 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
7842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7844 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
7845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7847 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
7848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7850 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
7851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7853 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
7854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7856 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
7857 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7859 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
7860 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7862 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
7863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7865 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
7866 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7868 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
7869 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7871 r = create_reglocator_table(hdb);
7872 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7874 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
7875 str = "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
7876 r = add_reglocator_entry(hdb, str);
7877 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7879 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
7880 str = "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
7881 r = add_reglocator_entry(hdb, str);
7882 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7884 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
7885 str = "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
7886 r = add_reglocator_entry(hdb, str);
7887 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7889 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7890 str = "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
7891 r = add_reglocator_entry(hdb, str);
7892 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7894 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7895 str = "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
7896 r = add_reglocator_entry(hdb, str);
7897 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7899 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
7900 str = "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
7901 r = add_reglocator_entry(hdb, str);
7902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7904 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
7905 str = "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
7906 r = add_reglocator_entry(hdb, str);
7907 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7909 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
7910 str = "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
7911 r = add_reglocator_entry(hdb, str);
7912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7914 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
7915 str = "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
7916 r = add_reglocator_entry(hdb, str);
7917 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7919 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
7920 str = "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
7921 r = add_reglocator_entry(hdb, str);
7922 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7924 /* HKLM, msidbLocatorTypeFileName, no signature */
7925 str = "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
7926 r = add_reglocator_entry(hdb, str);
7927 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7929 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
7930 str = "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
7931 r = add_reglocator_entry(hdb, str);
7932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7934 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
7935 str = "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
7936 r = add_reglocator_entry(hdb, str);
7937 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7939 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
7940 str = "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
7941 r = add_reglocator_entry(hdb, str);
7942 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7944 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
7945 str = "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
7946 r = add_reglocator_entry(hdb, str);
7947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7949 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
7950 str = "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
7951 r = add_reglocator_entry(hdb, str);
7952 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7954 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
7955 str = "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
7956 r = add_reglocator_entry(hdb, str);
7957 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7959 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
7960 str = "'NewSignature18', 2, 'Software\\Wine', '', 2";
7961 r = add_reglocator_entry(hdb, str);
7962 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7964 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
7965 str = "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
7966 r = add_reglocator_entry(hdb, str);
7967 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7969 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
7970 str = "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
7971 r = add_reglocator_entry(hdb, str);
7972 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7974 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
7975 str = "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
7976 r = add_reglocator_entry(hdb, str);
7977 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7979 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
7980 str = "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
7981 r = add_reglocator_entry(hdb, str);
7982 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7984 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
7985 str = "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
7986 r = add_reglocator_entry(hdb, str);
7987 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7989 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
7990 str = "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
7991 r = add_reglocator_entry(hdb, str);
7992 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7994 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
7995 str = "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
7996 r = add_reglocator_entry(hdb, str);
7997 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7999 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8000 str = "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
8001 r = add_reglocator_entry(hdb, str);
8002 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8004 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8005 str = "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
8006 r = add_reglocator_entry(hdb, str);
8007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8009 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8010 str = "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
8011 r = add_reglocator_entry(hdb, str);
8012 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8014 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8015 str = "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
8016 r = add_reglocator_entry(hdb, str);
8017 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8019 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8020 str = "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
8021 r = add_reglocator_entry(hdb, str);
8022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8024 r = create_signature_table(hdb);
8025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8027 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8028 r = add_signature_entry(hdb, str);
8029 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8031 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8032 r = add_signature_entry(hdb, str);
8033 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8035 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8036 r = add_signature_entry(hdb, str);
8037 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8039 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8040 r = add_signature_entry(hdb, str);
8041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8043 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8044 r = add_signature_entry(hdb, str);
8045 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8047 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8048 r = add_signature_entry(hdb, str);
8049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8051 ptr = strrchr(CURR_DIR, '\\') + 1;
8052 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8053 r = add_signature_entry(hdb, path);
8054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8056 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8057 r = add_signature_entry(hdb, str);
8058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8060 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8061 r = add_signature_entry(hdb, str);
8062 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8064 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8065 r = add_signature_entry(hdb, str);
8066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8068 hpkg = package_from_db(hdb);
8069 ok(hpkg, "Expected a valid package handle\n");
8071 r = MsiDoAction(hpkg, "AppSearch");
8072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8075 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8077 ok(!lstrcmpA(prop, "regszdata"),
8078 "Expected \"regszdata\", got \"%s\"\n", prop);
8081 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8083 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8086 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8088 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8090 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8091 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8093 /* Workaround for Win95 */
8095 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8097 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8098 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8101 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8104 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8105 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8107 ok(!lstrcmpA(pathdata, pathvar),
8108 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8110 HeapFree(GetProcessHeap(), 0, pathvar);
8111 HeapFree(GetProcessHeap(), 0, pathdata);
8114 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8117 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8120 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8124 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8125 "Expected \"\\0one\\0two\\0\\0\"\n");
8129 lstrcpyA(path, "#xCDAB3412EF907856");
8130 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8132 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8135 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8137 ok(!lstrcmpA(prop, "##regszdata"),
8138 "Expected \"##regszdata\", got \"%s\"\n", prop);
8141 sprintf(path, "%s\\FileName1", CURR_DIR);
8142 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8143 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8144 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8147 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8149 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8152 sprintf(path, "%s\\", CURR_DIR);
8153 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8154 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8155 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8158 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8160 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8163 sprintf(path, "%s\\", CURR_DIR);
8164 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8166 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8169 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8170 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8171 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8174 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8176 ok(!lstrcmpA(prop, "regszdata"),
8177 "Expected \"regszdata\", got \"%s\"\n", prop);
8180 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8182 ok(!lstrcmpA(prop, "regszdata"),
8183 "Expected \"regszdata\", got \"%s\"\n", prop);
8188 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8190 ok(!lstrcmpA(prop, "regszdata"),
8191 "Expected \"regszdata\", got \"%s\"\n", prop);
8195 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8197 ok(!lstrcmpA(prop, "defvalue"),
8198 "Expected \"defvalue\", got \"%s\"\n", prop);
8201 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8202 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8203 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8206 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8208 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8213 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8214 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8215 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8216 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8219 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8220 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8221 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8224 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8225 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8226 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8227 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8231 lstrcpyA(path, CURR_DIR);
8232 ptr = strrchr(path, '\\') + 1;
8234 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8235 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8236 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8239 sprintf(path, "%s\\", CURR_DIR);
8240 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8241 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8242 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8245 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8247 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8250 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8251 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8252 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8255 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8256 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8257 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8260 sprintf(path, "%s\\FileName1", CURR_DIR);
8261 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8262 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8263 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8266 sprintf(path, "%s\\FileName1", CURR_DIR);
8267 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8268 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8270 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8272 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8274 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8275 RegDeleteValueA(hklm, "Value1");
8276 RegDeleteValueA(hklm, "Value2");
8277 RegDeleteValueA(hklm, "Value3");
8278 RegDeleteValueA(hklm, "Value4");
8279 RegDeleteValueA(hklm, "Value5");
8280 RegDeleteValueA(hklm, "Value6");
8281 RegDeleteValueA(hklm, "Value7");
8282 RegDeleteValueA(hklm, "Value8");
8283 RegDeleteValueA(hklm, "Value9");
8284 RegDeleteValueA(hklm, "Value10");
8285 RegDeleteValueA(hklm, "Value11");
8286 RegDeleteValueA(hklm, "Value12");
8287 RegDeleteValueA(hklm, "Value13");
8288 RegDeleteValueA(hklm, "Value14");
8289 RegDeleteValueA(hklm, "Value15");
8290 RegDeleteValueA(hklm, "Value16");
8291 RegDeleteValueA(hklm, "Value17");
8292 RegDeleteKeyA(hklm, "");
8295 RegDeleteValueA(classes, "Value1");
8296 RegDeleteKeyA(classes, "");
8297 RegCloseKey(classes);
8299 RegDeleteValueA(hkcu, "Value1");
8300 RegDeleteKeyA(hkcu, "");
8303 RegDeleteValueA(users, "Value1");
8304 RegDeleteKeyA(users, "");
8307 DeleteFileA("FileName1");
8308 DeleteFileA("FileName3.dll");
8309 DeleteFileA("FileName4.dll");
8310 DeleteFileA("FileName5.dll");
8311 MsiCloseHandle(hpkg);
8312 DeleteFileA(msifile);
8315 static void delete_win_ini(LPCSTR file)
8317 CHAR path[MAX_PATH];
8319 GetWindowsDirectoryA(path, MAX_PATH);
8320 lstrcatA(path, "\\");
8321 lstrcatA(path, file);
8326 static void test_appsearch_inilocator(void)
8328 MSIHANDLE hpkg, hdb;
8329 CHAR path[MAX_PATH];
8330 CHAR prop[MAX_PATH];
8338 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8341 DeleteFileA("test.dll");
8343 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8345 create_test_file("FileName1");
8346 sprintf(path, "%s\\FileName1", CURR_DIR);
8347 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8349 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8351 sprintf(path, "%s\\IDontExist", CURR_DIR);
8352 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8354 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8355 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8356 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8358 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8359 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8360 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8362 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8363 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8364 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8366 hdb = create_package_db();
8367 ok(hdb, "Expected a valid database handle\n");
8369 r = create_appsearch_table(hdb);
8370 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8372 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8373 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8375 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8378 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8381 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8382 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8384 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8385 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8387 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8390 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8393 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8394 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8396 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8399 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8400 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8402 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8403 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8405 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8406 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8408 r = create_inilocator_table(hdb);
8409 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8411 /* msidbLocatorTypeRawValue, field 1 */
8412 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8413 r = add_inilocator_entry(hdb, str);
8414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8416 /* msidbLocatorTypeRawValue, field 2 */
8417 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8418 r = add_inilocator_entry(hdb, str);
8419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8421 /* msidbLocatorTypeRawValue, entire field */
8422 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8423 r = add_inilocator_entry(hdb, str);
8424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8426 /* msidbLocatorTypeFile */
8427 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8428 r = add_inilocator_entry(hdb, str);
8429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8431 /* msidbLocatorTypeDirectory, file */
8432 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8433 r = add_inilocator_entry(hdb, str);
8434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8436 /* msidbLocatorTypeDirectory, directory */
8437 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8438 r = add_inilocator_entry(hdb, str);
8439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8441 /* msidbLocatorTypeFile, file, no signature */
8442 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8443 r = add_inilocator_entry(hdb, str);
8444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8446 /* msidbLocatorTypeFile, dir, no signature */
8447 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8448 r = add_inilocator_entry(hdb, str);
8449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8451 /* msidbLocatorTypeFile, file does not exist */
8452 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8453 r = add_inilocator_entry(hdb, str);
8454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8456 /* msidbLocatorTypeFile, signature with version */
8457 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8458 r = add_inilocator_entry(hdb, str);
8459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8461 /* msidbLocatorTypeFile, signature with version, ver > max */
8462 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8463 r = add_inilocator_entry(hdb, str);
8464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8466 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8467 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8468 r = add_inilocator_entry(hdb, str);
8469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8471 r = create_signature_table(hdb);
8472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8474 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8477 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8480 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8483 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8486 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8489 hpkg = package_from_db(hdb);
8490 ok(hpkg, "Expected a valid package handle\n");
8492 r = MsiDoAction(hpkg, "AppSearch");
8493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8496 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8498 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
8501 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8502 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8503 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
8506 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8508 ok(!lstrcmpA(prop, "keydata,field2"),
8509 "Expected \"keydata,field2\", got \"%s\"\n", prop);
8512 sprintf(path, "%s\\FileName1", CURR_DIR);
8513 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8515 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8518 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8520 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8523 sprintf(path, "%s\\", CURR_DIR);
8524 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8526 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8529 sprintf(path, "%s\\", CURR_DIR);
8530 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8532 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8535 lstrcpyA(path, CURR_DIR);
8536 ptr = strrchr(path, '\\');
8538 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8539 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8540 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8543 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8545 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8550 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8551 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8553 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8556 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8557 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8558 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8561 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8562 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8563 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8564 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8567 delete_win_ini("IniFile.ini");
8568 DeleteFileA("FileName1");
8569 DeleteFileA("FileName2.dll");
8570 DeleteFileA("FileName3.dll");
8571 DeleteFileA("FileName4.dll");
8572 MsiCloseHandle(hpkg);
8573 DeleteFileA(msifile);
8577 * MSI AppSearch action on DrLocator table always returns absolute paths.
8578 * If a relative path was set, it returns the first absolute path that
8579 * matches or an empty string if it didn't find anything.
8580 * This helper function replicates this behaviour.
8582 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
8587 size = lstrlenA(relative);
8588 drives = GetLogicalDrives();
8589 lstrcpyA(absolute, "A:\\");
8590 for (i = 0; i < 26; absolute[0] = '\0', i++)
8592 if (!(drives & (1 << i)))
8595 absolute[0] = 'A' + i;
8596 if (GetDriveType(absolute) != DRIVE_FIXED)
8599 lstrcpynA(absolute + 3, relative, size + 1);
8600 attr = GetFileAttributesA(absolute);
8601 if (attr != INVALID_FILE_ATTRIBUTES &&
8602 (attr & FILE_ATTRIBUTE_DIRECTORY))
8604 if (absolute[3 + size - 1] != '\\')
8605 lstrcatA(absolute, "\\");
8612 static void test_appsearch_drlocator(void)
8614 MSIHANDLE hpkg, hdb;
8615 CHAR path[MAX_PATH];
8616 CHAR prop[MAX_PATH];
8623 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8626 DeleteFileA("test.dll");
8628 create_test_file("FileName1");
8629 CreateDirectoryA("one", NULL);
8630 CreateDirectoryA("one\\two", NULL);
8631 CreateDirectoryA("one\\two\\three", NULL);
8632 create_test_file("one\\two\\three\\FileName2");
8633 CreateDirectoryA("another", NULL);
8634 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8635 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8636 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8638 hdb = create_package_db();
8639 ok(hdb, "Expected a valid database handle\n");
8641 r = create_appsearch_table(hdb);
8642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8644 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8647 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8650 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8653 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8656 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8659 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8662 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8665 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8668 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8671 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8672 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8674 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8677 r = create_drlocator_table(hdb);
8678 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8680 /* no parent, full path, depth 0, signature */
8681 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
8682 r = add_drlocator_entry(hdb, path);
8683 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8685 /* no parent, full path, depth 0, no signature */
8686 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
8687 r = add_drlocator_entry(hdb, path);
8688 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8690 /* no parent, relative path, depth 0, no signature */
8691 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
8692 r = add_drlocator_entry(hdb, path);
8693 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8695 /* no parent, full path, depth 2, signature */
8696 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
8697 r = add_drlocator_entry(hdb, path);
8698 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8700 /* no parent, full path, depth 3, signature */
8701 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
8702 r = add_drlocator_entry(hdb, path);
8703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8705 /* no parent, full path, depth 1, signature is dir */
8706 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
8707 r = add_drlocator_entry(hdb, path);
8708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8710 /* parent is in DrLocator, relative path, depth 0, signature */
8711 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8712 r = add_drlocator_entry(hdb, path);
8713 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8715 /* no parent, full path, depth 0, signature w/ version */
8716 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
8717 r = add_drlocator_entry(hdb, path);
8718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8720 /* no parent, full path, depth 0, signature w/ version, ver > max */
8721 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
8722 r = add_drlocator_entry(hdb, path);
8723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8725 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8726 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
8727 r = add_drlocator_entry(hdb, path);
8728 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8730 /* no parent, relative empty path, depth 0, no signature */
8731 sprintf(path, "'NewSignature11', '', '', 0");
8732 r = add_drlocator_entry(hdb, path);
8733 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8735 r = create_signature_table(hdb);
8736 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8738 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
8739 r = add_signature_entry(hdb, str);
8740 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8742 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
8743 r = add_signature_entry(hdb, str);
8744 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8746 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
8747 r = add_signature_entry(hdb, str);
8748 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8750 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
8751 r = add_signature_entry(hdb, str);
8752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8754 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
8755 r = add_signature_entry(hdb, str);
8756 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8758 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8759 r = add_signature_entry(hdb, str);
8760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8762 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8763 r = add_signature_entry(hdb, str);
8764 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8766 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8767 r = add_signature_entry(hdb, str);
8768 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8770 hpkg = package_from_db(hdb);
8771 ok(hpkg, "Expected a valid package handle\n");
8773 r = MsiDoAction(hpkg, "AppSearch");
8774 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8777 sprintf(path, "%s\\FileName1", CURR_DIR);
8778 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8780 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8783 sprintf(path, "%s\\", CURR_DIR);
8784 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8786 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8789 search_absolute_directory(path, CURR_DIR + 3);
8790 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8791 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8792 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8795 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8796 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8797 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8800 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8801 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8803 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8806 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8807 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8808 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8811 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8812 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8813 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8814 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8819 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8820 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8822 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8825 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8826 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8827 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8830 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8832 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8836 search_absolute_directory(path, "");
8837 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8838 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8839 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8841 DeleteFileA("FileName1");
8842 DeleteFileA("FileName3.dll");
8843 DeleteFileA("FileName4.dll");
8844 DeleteFileA("FileName5.dll");
8845 DeleteFileA("one\\two\\three\\FileName2");
8846 RemoveDirectoryA("one\\two\\three");
8847 RemoveDirectoryA("one\\two");
8848 RemoveDirectoryA("one");
8849 RemoveDirectoryA("another");
8850 MsiCloseHandle(hpkg);
8851 DeleteFileA(msifile);
8854 static void test_featureparents(void)
8859 INSTALLSTATE state, action;
8861 hdb = create_package_db();
8862 ok ( hdb, "failed to create package database\n" );
8864 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
8865 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
8867 r = create_feature_table( hdb );
8868 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
8870 r = create_component_table( hdb );
8871 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
8873 r = create_feature_components_table( hdb );
8874 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
8876 r = create_file_table( hdb );
8877 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
8879 /* msidbFeatureAttributesFavorLocal */
8880 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
8881 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8883 /* msidbFeatureAttributesFavorSource */
8884 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
8885 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8887 /* msidbFeatureAttributesFavorLocal */
8888 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
8889 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8891 /* disabled because of install level */
8892 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
8893 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8895 /* child feature of disabled feature */
8896 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
8897 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8899 /* component of disabled feature (install level) */
8900 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
8901 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8903 /* component of disabled child feature (install level) */
8904 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
8905 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8907 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8908 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
8909 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8911 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8912 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
8913 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8915 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8916 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
8917 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8919 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
8920 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
8921 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8923 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
8924 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
8925 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8927 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
8928 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
8929 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8931 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8932 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
8933 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8935 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8936 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
8937 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8939 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8940 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
8942 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
8943 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8945 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
8946 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8948 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
8949 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8951 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
8952 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8954 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
8955 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8957 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
8958 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8960 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
8961 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8963 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
8964 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8966 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
8967 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8969 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
8970 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8972 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
8973 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8975 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
8976 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8978 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
8979 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8981 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
8982 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8984 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
8985 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8987 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
8988 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8990 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
8991 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8993 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
8994 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8996 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
8997 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8999 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9000 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9002 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9003 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9005 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9006 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9008 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9009 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9011 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9012 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9014 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9015 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9017 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9018 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9020 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9021 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9023 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9024 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9026 hpkg = package_from_db( hdb );
9027 ok( hpkg, "failed to create package\n");
9029 MsiCloseHandle( hdb );
9031 r = MsiDoAction( hpkg, "CostInitialize");
9032 ok( r == ERROR_SUCCESS, "cost init failed\n");
9034 r = MsiDoAction( hpkg, "FileCost");
9035 ok( r == ERROR_SUCCESS, "file cost failed\n");
9037 r = MsiDoAction( hpkg, "CostFinalize");
9038 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9042 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9044 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9045 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9049 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9051 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9052 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9056 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9058 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9059 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9063 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9065 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9070 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9072 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9077 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9080 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9084 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9086 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9087 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9091 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9093 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9094 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9098 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9100 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9101 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9105 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9107 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9108 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9112 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9114 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9115 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9119 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9121 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9122 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9126 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9128 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9129 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9133 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9135 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9136 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9140 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9142 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9143 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9147 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9149 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9150 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9152 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9153 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9157 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9159 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9160 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9164 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9166 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9167 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9171 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9173 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9174 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9178 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9180 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9181 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9185 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9187 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9188 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9192 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9194 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9195 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9199 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9201 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9202 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9206 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9208 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9209 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9213 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9215 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9216 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9220 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9222 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9223 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9227 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9229 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9230 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9234 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9236 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9237 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9241 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9243 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9244 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9248 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9250 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9251 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9253 MsiCloseHandle(hpkg);
9254 DeleteFileA(msifile);
9257 static void test_installprops(void)
9259 MSIHANDLE hpkg, hdb;
9260 CHAR path[MAX_PATH];
9268 GetCurrentDirectory(MAX_PATH, path);
9269 lstrcat(path, "\\");
9270 lstrcat(path, msifile);
9272 hdb = create_package_db();
9273 ok( hdb, "failed to create database\n");
9275 hpkg = package_from_db(hdb);
9276 ok( hpkg, "failed to create package\n");
9278 MsiCloseHandle(hdb);
9281 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
9282 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9283 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9285 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
9287 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
9292 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9296 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
9299 /* win9x doesn't set this */
9303 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
9304 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9305 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9311 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9315 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
9321 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
9322 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9323 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9327 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
9328 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9329 trace("VersionDatabase = %s\n", buf);
9332 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
9333 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9334 trace("VersionMsi = %s\n", buf);
9337 r = MsiGetProperty(hpkg, "Date", buf, &size);
9338 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9339 trace("Date = %s\n", buf);
9342 r = MsiGetProperty(hpkg, "Time", buf, &size);
9343 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9344 trace("Time = %s\n", buf);
9347 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
9348 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9349 trace("PackageCode = %s\n", buf);
9351 langid = GetUserDefaultLangID();
9352 sprintf(path, "%d", langid);
9355 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
9356 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9357 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
9359 res = GetSystemMetrics(SM_CXSCREEN);
9361 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
9362 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9364 res = GetSystemMetrics(SM_CYSCREEN);
9366 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
9367 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9371 MsiCloseHandle(hpkg);
9372 DeleteFile(msifile);
9375 static void test_launchconditions(void)
9381 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9383 hdb = create_package_db();
9384 ok( hdb, "failed to create package database\n" );
9386 r = create_launchcondition_table( hdb );
9387 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
9389 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
9390 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9392 /* invalid condition */
9393 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
9394 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9396 hpkg = package_from_db( hdb );
9397 ok( hpkg, "failed to create package\n");
9399 MsiCloseHandle( hdb );
9401 r = MsiSetProperty( hpkg, "X", "1" );
9402 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9404 /* invalid conditions are ignored */
9405 r = MsiDoAction( hpkg, "LaunchConditions" );
9406 ok( r == ERROR_SUCCESS, "cost init failed\n" );
9408 /* verify LaunchConditions still does some verification */
9409 r = MsiSetProperty( hpkg, "X", "2" );
9410 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9412 r = MsiDoAction( hpkg, "LaunchConditions" );
9413 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
9415 MsiCloseHandle( hpkg );
9416 DeleteFile( msifile );
9419 static void test_ccpsearch(void)
9421 MSIHANDLE hdb, hpkg;
9422 CHAR prop[MAX_PATH];
9423 DWORD size = MAX_PATH;
9426 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9428 hdb = create_package_db();
9429 ok(hdb, "failed to create package database\n");
9431 r = create_ccpsearch_table(hdb);
9432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9434 r = add_ccpsearch_entry(hdb, "'CCP_random'");
9435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9437 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
9438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9440 r = create_reglocator_table(hdb);
9441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9443 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9446 r = create_drlocator_table(hdb);
9447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9449 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
9450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9452 r = create_signature_table(hdb);
9453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9455 hpkg = package_from_db(hdb);
9456 ok(hpkg, "failed to create package\n");
9458 MsiCloseHandle(hdb);
9460 r = MsiDoAction(hpkg, "CCPSearch");
9461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9463 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
9464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9465 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
9467 MsiCloseHandle(hpkg);
9468 DeleteFileA(msifile);
9471 static void test_complocator(void)
9473 MSIHANDLE hdb, hpkg;
9475 CHAR prop[MAX_PATH];
9476 CHAR expected[MAX_PATH];
9477 DWORD size = MAX_PATH;
9479 hdb = create_package_db();
9480 ok(hdb, "failed to create package database\n");
9482 r = create_appsearch_table(hdb);
9483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9485 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
9486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9488 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
9489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9491 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
9492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9494 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
9495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9497 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
9498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9500 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
9501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9503 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
9504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9506 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
9507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9509 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
9510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9512 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
9513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9515 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
9516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9518 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
9519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9521 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
9522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9524 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
9525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9527 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
9528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9530 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
9531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9533 r = create_complocator_table(hdb);
9534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9536 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9539 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9540 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9542 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9545 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9548 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9551 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9554 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9557 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9560 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9563 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9566 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9569 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9570 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9572 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9575 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9578 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9581 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9584 r = create_signature_table(hdb);
9585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9587 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9590 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9593 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9596 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9599 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9600 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9602 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9603 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9605 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9608 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9611 hpkg = package_from_db(hdb);
9612 ok(hpkg, "failed to create package\n");
9614 MsiCloseHandle(hdb);
9616 create_test_file("abelisaurus");
9617 create_test_file("bactrosaurus");
9618 create_test_file("camelotia");
9619 create_test_file("diclonius");
9620 create_test_file("echinodon");
9621 create_test_file("falcarius");
9622 create_test_file("gallimimus");
9623 create_test_file("hagryphus");
9624 CreateDirectoryA("iguanodon", NULL);
9625 CreateDirectoryA("jobaria", NULL);
9626 CreateDirectoryA("kakuru", NULL);
9627 CreateDirectoryA("labocania", NULL);
9628 CreateDirectoryA("megaraptor", NULL);
9629 CreateDirectoryA("neosodon", NULL);
9630 CreateDirectoryA("olorotitan", NULL);
9631 CreateDirectoryA("pantydraco", NULL);
9633 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
9634 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
9635 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
9636 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
9637 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
9638 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
9639 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
9640 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
9641 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
9642 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
9643 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
9644 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
9645 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
9646 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
9647 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
9648 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
9650 r = MsiDoAction(hpkg, "AppSearch");
9651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9654 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
9655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9657 lstrcpyA(expected, CURR_DIR);
9658 lstrcatA(expected, "\\abelisaurus");
9659 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9660 "Expected %s or empty string, got %s\n", expected, prop);
9663 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
9664 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9665 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9668 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
9669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9670 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9673 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
9674 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9675 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9678 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
9679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9681 lstrcpyA(expected, CURR_DIR);
9682 lstrcatA(expected, "\\");
9683 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9684 "Expected %s or empty string, got %s\n", expected, prop);
9687 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
9688 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9689 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9692 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
9693 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9694 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9697 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
9698 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9699 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9702 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
9703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9704 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9707 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
9708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9709 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9712 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
9713 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9714 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9717 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
9718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9719 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9722 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
9723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9725 lstrcpyA(expected, CURR_DIR);
9726 lstrcatA(expected, "\\");
9727 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9728 "Expected %s or empty string, got %s\n", expected, prop);
9731 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
9732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9734 lstrcpyA(expected, CURR_DIR);
9735 lstrcatA(expected, "\\neosodon\\");
9736 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9737 "Expected %s or empty string, got %s\n", expected, prop);
9740 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
9741 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9742 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9745 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
9746 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9747 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9749 MsiCloseHandle(hpkg);
9750 DeleteFileA("abelisaurus");
9751 DeleteFileA("bactrosaurus");
9752 DeleteFileA("camelotia");
9753 DeleteFileA("diclonius");
9754 DeleteFileA("echinodon");
9755 DeleteFileA("falcarius");
9756 DeleteFileA("gallimimus");
9757 DeleteFileA("hagryphus");
9758 RemoveDirectoryA("iguanodon");
9759 RemoveDirectoryA("jobaria");
9760 RemoveDirectoryA("kakuru");
9761 RemoveDirectoryA("labocania");
9762 RemoveDirectoryA("megaraptor");
9763 RemoveDirectoryA("neosodon");
9764 RemoveDirectoryA("olorotitan");
9765 RemoveDirectoryA("pantydraco");
9766 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
9767 MSIINSTALLCONTEXT_MACHINE, NULL);
9768 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
9769 MSIINSTALLCONTEXT_MACHINE, NULL);
9770 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
9771 MSIINSTALLCONTEXT_MACHINE, NULL);
9772 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
9773 MSIINSTALLCONTEXT_MACHINE, NULL);
9774 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
9775 MSIINSTALLCONTEXT_MACHINE, NULL);
9776 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
9777 MSIINSTALLCONTEXT_MACHINE, NULL);
9778 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
9779 MSIINSTALLCONTEXT_MACHINE, NULL);
9780 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
9781 MSIINSTALLCONTEXT_MACHINE, NULL);
9782 DeleteFileA(msifile);
9785 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
9790 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
9791 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9793 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
9794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9796 r = MsiSummaryInfoPersist(summary);
9797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9799 MsiCloseHandle(summary);
9802 static void test_MsiGetSourcePath(void)
9804 MSIHANDLE hdb, hpkg;
9805 CHAR path[MAX_PATH];
9807 CHAR subsrc[MAX_PATH];
9808 CHAR sub2[MAX_PATH];
9812 lstrcpyA(cwd, CURR_DIR);
9813 lstrcatA(cwd, "\\");
9815 lstrcpyA(subsrc, cwd);
9816 lstrcatA(subsrc, "subsource");
9817 lstrcatA(subsrc, "\\");
9819 lstrcpyA(sub2, subsrc);
9820 lstrcatA(sub2, "sub2");
9821 lstrcatA(sub2, "\\");
9823 /* uncompressed source */
9825 hdb = create_package_db();
9826 ok( hdb, "failed to create database\n");
9828 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
9830 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
9831 ok(r == S_OK, "failed\n");
9833 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
9834 ok(r == S_OK, "failed\n");
9836 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
9837 ok(r == S_OK, "failed\n");
9839 r = MsiDatabaseCommit(hdb);
9840 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
9842 hpkg = package_from_db(hdb);
9843 ok(hpkg, "failed to create package\n");
9845 MsiCloseHandle(hdb);
9847 /* invalid database handle */
9849 lstrcpyA(path, "kiwi");
9850 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
9851 ok(r == ERROR_INVALID_HANDLE,
9852 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
9853 ok(!lstrcmpA(path, "kiwi"),
9854 "Expected path to be unchanged, got \"%s\"\n", path);
9855 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9859 lstrcpyA(path, "kiwi");
9860 r = MsiGetSourcePath(hpkg, NULL, path, &size);
9861 ok(r == ERROR_INVALID_PARAMETER,
9862 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
9863 ok(!lstrcmpA(path, "kiwi"),
9864 "Expected path to be unchanged, got \"%s\"\n", path);
9865 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9867 /* empty szFolder */
9869 lstrcpyA(path, "kiwi");
9870 r = MsiGetSourcePath(hpkg, "", path, &size);
9871 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9872 ok(!lstrcmpA(path, "kiwi"),
9873 "Expected path to be unchanged, got \"%s\"\n", path);
9874 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9878 lstrcpyA(path, "kiwi");
9879 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9880 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9881 ok(!lstrcmpA(path, "kiwi"),
9882 "Expected path to be unchanged, got \"%s\"\n", path);
9883 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9887 lstrcpyA(path, "kiwi");
9888 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9889 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9890 ok(!lstrcmpA(path, "kiwi"),
9891 "Expected path to be unchanged, got \"%s\"\n", path);
9892 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9896 lstrcpyA(path, "kiwi");
9897 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9898 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9899 ok(!lstrcmpA(path, "kiwi"),
9900 "Expected path to be unchanged, got \"%s\"\n", path);
9901 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9903 /* source path does not exist, but the property exists */
9905 lstrcpyA(path, "kiwi");
9906 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9907 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9908 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9909 ok(size == 0, "Expected 0, got %d\n", size);
9913 lstrcpyA(path, "kiwi");
9914 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9915 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9916 ok(!lstrcmpA(path, "kiwi"),
9917 "Expected path to be unchanged, got \"%s\"\n", path);
9918 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9922 lstrcpyA(path, "kiwi");
9923 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9924 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9925 ok(!lstrcmpA(path, "kiwi"),
9926 "Expected path to be unchanged, got \"%s\"\n", path);
9927 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9929 r = MsiDoAction(hpkg, "CostInitialize");
9930 ok(r == ERROR_SUCCESS, "cost init failed\n");
9932 /* try TARGETDIR after CostInitialize */
9934 lstrcpyA(path, "kiwi");
9935 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9936 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9937 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9938 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9940 /* try SourceDir after CostInitialize */
9942 lstrcpyA(path, "kiwi");
9943 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9944 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9945 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9946 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9948 /* try SOURCEDIR after CostInitialize */
9950 lstrcpyA(path, "kiwi");
9951 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9952 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9953 ok(!lstrcmpA(path, "kiwi"),
9954 "Expected path to be unchanged, got \"%s\"\n", path);
9955 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9957 /* source path does not exist, but the property exists */
9959 lstrcpyA(path, "kiwi");
9960 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9961 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9964 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9965 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9968 /* try SubDir after CostInitialize */
9970 lstrcpyA(path, "kiwi");
9971 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9972 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9973 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9974 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9976 /* try SubDir2 after CostInitialize */
9978 lstrcpyA(path, "kiwi");
9979 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9981 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
9982 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
9984 r = MsiDoAction(hpkg, "ResolveSource");
9985 ok(r == ERROR_SUCCESS, "file cost failed\n");
9987 /* try TARGETDIR after ResolveSource */
9989 lstrcpyA(path, "kiwi");
9990 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9991 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9992 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9993 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9995 /* try SourceDir after ResolveSource */
9997 lstrcpyA(path, "kiwi");
9998 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9999 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10000 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10001 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10003 /* try SOURCEDIR after ResolveSource */
10005 lstrcpyA(path, "kiwi");
10006 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10007 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10008 ok(!lstrcmpA(path, "kiwi"),
10009 "Expected path to be unchanged, got \"%s\"\n", path);
10010 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10012 /* source path does not exist, but the property exists */
10014 lstrcpyA(path, "kiwi");
10015 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10016 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10017 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10018 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10020 /* try SubDir after ResolveSource */
10022 lstrcpyA(path, "kiwi");
10023 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10024 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10025 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10026 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10028 /* try SubDir2 after ResolveSource */
10030 lstrcpyA(path, "kiwi");
10031 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10033 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10034 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10036 r = MsiDoAction(hpkg, "FileCost");
10037 ok(r == ERROR_SUCCESS, "file cost failed\n");
10039 /* try TARGETDIR after FileCost */
10041 lstrcpyA(path, "kiwi");
10042 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10043 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10044 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10045 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10047 /* try SourceDir after FileCost */
10049 lstrcpyA(path, "kiwi");
10050 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10052 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10053 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10055 /* try SOURCEDIR after FileCost */
10057 lstrcpyA(path, "kiwi");
10058 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10059 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10060 ok(!lstrcmpA(path, "kiwi"),
10061 "Expected path to be unchanged, got \"%s\"\n", path);
10062 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10064 /* try SubDir after FileCost */
10066 lstrcpyA(path, "kiwi");
10067 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10068 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10069 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10070 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10072 /* try SubDir2 after FileCost */
10074 lstrcpyA(path, "kiwi");
10075 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10077 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10078 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10080 r = MsiDoAction(hpkg, "CostFinalize");
10081 ok(r == ERROR_SUCCESS, "file cost failed\n");
10083 /* try TARGETDIR after CostFinalize */
10085 lstrcpyA(path, "kiwi");
10086 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10088 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10089 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10091 /* try SourceDir after CostFinalize */
10093 lstrcpyA(path, "kiwi");
10094 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10096 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10097 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10099 /* try SOURCEDIR after CostFinalize */
10101 lstrcpyA(path, "kiwi");
10102 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10103 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10104 ok(!lstrcmpA(path, "kiwi"),
10105 "Expected path to be unchanged, got \"%s\"\n", path);
10106 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10108 /* try SubDir after CostFinalize */
10110 lstrcpyA(path, "kiwi");
10111 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10112 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10113 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10114 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10116 /* try SubDir2 after CostFinalize */
10118 lstrcpyA(path, "kiwi");
10119 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10121 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10122 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10124 /* nonexistent directory */
10126 lstrcpyA(path, "kiwi");
10127 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
10128 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10129 ok(!lstrcmpA(path, "kiwi"),
10130 "Expected path to be unchanged, got \"%s\"\n", path);
10131 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10133 /* NULL szPathBuf */
10135 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
10136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10137 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10139 /* NULL pcchPathBuf */
10140 lstrcpyA(path, "kiwi");
10141 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
10142 ok(r == ERROR_INVALID_PARAMETER,
10143 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10144 ok(!lstrcmpA(path, "kiwi"),
10145 "Expected path to be unchanged, got \"%s\"\n", path);
10147 /* pcchPathBuf is 0 */
10149 lstrcpyA(path, "kiwi");
10150 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10151 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10152 ok(!lstrcmpA(path, "kiwi"),
10153 "Expected path to be unchanged, got \"%s\"\n", path);
10154 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10156 /* pcchPathBuf does not have room for NULL terminator */
10157 size = lstrlenA(cwd);
10158 lstrcpyA(path, "kiwi");
10159 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10160 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10161 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
10162 "Expected path with no backslash, got \"%s\"\n", path);
10163 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10165 /* pcchPathBuf has room for NULL terminator */
10166 size = lstrlenA(cwd) + 1;
10167 lstrcpyA(path, "kiwi");
10168 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10169 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10170 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10171 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10173 MsiCloseHandle(hpkg);
10175 /* compressed source */
10177 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10180 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
10182 hpkg = package_from_db(hdb);
10183 ok(hpkg, "failed to create package\n");
10185 r = MsiDoAction(hpkg, "CostInitialize");
10186 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10187 r = MsiDoAction(hpkg, "FileCost");
10188 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10189 r = MsiDoAction(hpkg, "CostFinalize");
10190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10192 /* try TARGETDIR after CostFinalize */
10194 lstrcpyA(path, "kiwi");
10195 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10197 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10198 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10200 /* try SourceDir after CostFinalize */
10202 lstrcpyA(path, "kiwi");
10203 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10204 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10205 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10206 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10208 /* try SOURCEDIR after CostFinalize */
10210 lstrcpyA(path, "kiwi");
10211 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10214 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10215 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10216 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10219 /* try SubDir after CostFinalize */
10221 lstrcpyA(path, "kiwi");
10222 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10223 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10224 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10225 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10227 /* try SubDir2 after CostFinalize */
10229 lstrcpyA(path, "kiwi");
10230 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10231 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10232 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10233 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10235 MsiCloseHandle(hpkg);
10236 DeleteFile(msifile);
10239 static void test_shortlongsource(void)
10241 MSIHANDLE hdb, hpkg;
10242 CHAR path[MAX_PATH];
10243 CHAR cwd[MAX_PATH];
10244 CHAR subsrc[MAX_PATH];
10248 lstrcpyA(cwd, CURR_DIR);
10249 lstrcatA(cwd, "\\");
10251 lstrcpyA(subsrc, cwd);
10252 lstrcatA(subsrc, "long");
10253 lstrcatA(subsrc, "\\");
10255 /* long file names */
10257 hdb = create_package_db();
10258 ok( hdb, "failed to create database\n");
10260 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10262 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10263 ok(r == S_OK, "failed\n");
10265 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
10266 ok(r == S_OK, "failed\n");
10268 /* CostInitialize:short */
10269 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
10270 ok(r == S_OK, "failed\n");
10272 /* CostInitialize:long */
10273 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
10274 ok(r == S_OK, "failed\n");
10276 /* FileCost:short */
10277 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
10278 ok(r == S_OK, "failed\n");
10280 /* FileCost:long */
10281 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
10282 ok(r == S_OK, "failed\n");
10284 /* CostFinalize:short */
10285 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
10286 ok(r == S_OK, "failed\n");
10288 /* CostFinalize:long */
10289 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
10290 ok(r == S_OK, "failed\n");
10292 MsiDatabaseCommit(hdb);
10294 hpkg = package_from_db(hdb);
10295 ok(hpkg, "failed to create package\n");
10297 MsiCloseHandle(hdb);
10299 CreateDirectoryA("one", NULL);
10300 CreateDirectoryA("four", NULL);
10302 r = MsiDoAction(hpkg, "CostInitialize");
10303 ok(r == ERROR_SUCCESS, "file cost failed\n");
10305 CreateDirectory("five", NULL);
10306 CreateDirectory("eight", NULL);
10308 r = MsiDoAction(hpkg, "FileCost");
10309 ok(r == ERROR_SUCCESS, "file cost failed\n");
10311 CreateDirectory("nine", NULL);
10312 CreateDirectory("twelve", NULL);
10314 r = MsiDoAction(hpkg, "CostFinalize");
10315 ok(r == ERROR_SUCCESS, "file cost failed\n");
10317 /* neither short nor long source directories exist */
10319 lstrcpyA(path, "kiwi");
10320 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10321 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10322 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10323 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10325 CreateDirectoryA("short", NULL);
10327 /* short source directory exists */
10329 lstrcpyA(path, "kiwi");
10330 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10331 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10332 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10333 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10335 CreateDirectoryA("long", NULL);
10337 /* both short and long source directories exist */
10339 lstrcpyA(path, "kiwi");
10340 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10341 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10342 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10343 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10345 lstrcpyA(subsrc, cwd);
10346 lstrcatA(subsrc, "two");
10347 lstrcatA(subsrc, "\\");
10349 /* short dir exists before CostInitialize */
10351 lstrcpyA(path, "kiwi");
10352 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10353 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10354 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10355 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10357 lstrcpyA(subsrc, cwd);
10358 lstrcatA(subsrc, "four");
10359 lstrcatA(subsrc, "\\");
10361 /* long dir exists before CostInitialize */
10363 lstrcpyA(path, "kiwi");
10364 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10366 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10367 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10369 lstrcpyA(subsrc, cwd);
10370 lstrcatA(subsrc, "six");
10371 lstrcatA(subsrc, "\\");
10373 /* short dir exists before FileCost */
10375 lstrcpyA(path, "kiwi");
10376 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10378 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10379 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10381 lstrcpyA(subsrc, cwd);
10382 lstrcatA(subsrc, "eight");
10383 lstrcatA(subsrc, "\\");
10385 /* long dir exists before FileCost */
10387 lstrcpyA(path, "kiwi");
10388 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10390 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10391 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10393 lstrcpyA(subsrc, cwd);
10394 lstrcatA(subsrc, "ten");
10395 lstrcatA(subsrc, "\\");
10397 /* short dir exists before CostFinalize */
10399 lstrcpyA(path, "kiwi");
10400 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10402 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10403 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10405 lstrcpyA(subsrc, cwd);
10406 lstrcatA(subsrc, "twelve");
10407 lstrcatA(subsrc, "\\");
10409 /* long dir exists before CostFinalize */
10411 lstrcpyA(path, "kiwi");
10412 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10414 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10415 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10417 MsiCloseHandle(hpkg);
10418 RemoveDirectoryA("short");
10419 RemoveDirectoryA("long");
10420 RemoveDirectoryA("one");
10421 RemoveDirectoryA("four");
10422 RemoveDirectoryA("five");
10423 RemoveDirectoryA("eight");
10424 RemoveDirectoryA("nine");
10425 RemoveDirectoryA("twelve");
10427 /* short file names */
10429 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10432 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
10434 hpkg = package_from_db(hdb);
10435 ok(hpkg, "failed to create package\n");
10437 MsiCloseHandle(hdb);
10439 CreateDirectoryA("one", NULL);
10440 CreateDirectoryA("four", NULL);
10442 r = MsiDoAction(hpkg, "CostInitialize");
10443 ok(r == ERROR_SUCCESS, "file cost failed\n");
10445 CreateDirectory("five", NULL);
10446 CreateDirectory("eight", NULL);
10448 r = MsiDoAction(hpkg, "FileCost");
10449 ok(r == ERROR_SUCCESS, "file cost failed\n");
10451 CreateDirectory("nine", NULL);
10452 CreateDirectory("twelve", NULL);
10454 r = MsiDoAction(hpkg, "CostFinalize");
10455 ok(r == ERROR_SUCCESS, "file cost failed\n");
10457 lstrcpyA(subsrc, cwd);
10458 lstrcatA(subsrc, "short");
10459 lstrcatA(subsrc, "\\");
10461 /* neither short nor long source directories exist */
10463 lstrcpyA(path, "kiwi");
10464 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10466 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10467 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10469 CreateDirectoryA("short", NULL);
10471 /* short source directory exists */
10473 lstrcpyA(path, "kiwi");
10474 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10476 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10477 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10479 CreateDirectoryA("long", NULL);
10481 /* both short and long source directories exist */
10483 lstrcpyA(path, "kiwi");
10484 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10486 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10487 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10489 lstrcpyA(subsrc, cwd);
10490 lstrcatA(subsrc, "one");
10491 lstrcatA(subsrc, "\\");
10493 /* short dir exists before CostInitialize */
10495 lstrcpyA(path, "kiwi");
10496 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10498 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10499 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10501 lstrcpyA(subsrc, cwd);
10502 lstrcatA(subsrc, "three");
10503 lstrcatA(subsrc, "\\");
10505 /* long dir exists before CostInitialize */
10507 lstrcpyA(path, "kiwi");
10508 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10510 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10511 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10513 lstrcpyA(subsrc, cwd);
10514 lstrcatA(subsrc, "five");
10515 lstrcatA(subsrc, "\\");
10517 /* short dir exists before FileCost */
10519 lstrcpyA(path, "kiwi");
10520 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10522 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10523 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10525 lstrcpyA(subsrc, cwd);
10526 lstrcatA(subsrc, "seven");
10527 lstrcatA(subsrc, "\\");
10529 /* long dir exists before FileCost */
10531 lstrcpyA(path, "kiwi");
10532 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10533 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10534 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10535 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10537 lstrcpyA(subsrc, cwd);
10538 lstrcatA(subsrc, "nine");
10539 lstrcatA(subsrc, "\\");
10541 /* short dir exists before CostFinalize */
10543 lstrcpyA(path, "kiwi");
10544 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10546 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10547 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10549 lstrcpyA(subsrc, cwd);
10550 lstrcatA(subsrc, "eleven");
10551 lstrcatA(subsrc, "\\");
10553 /* long dir exists before CostFinalize */
10555 lstrcpyA(path, "kiwi");
10556 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10557 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10558 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10559 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10561 MsiCloseHandle(hpkg);
10562 RemoveDirectoryA("short");
10563 RemoveDirectoryA("long");
10564 RemoveDirectoryA("one");
10565 RemoveDirectoryA("four");
10566 RemoveDirectoryA("five");
10567 RemoveDirectoryA("eight");
10568 RemoveDirectoryA("nine");
10569 RemoveDirectoryA("twelve");
10570 DeleteFileA(msifile);
10573 static void test_sourcedir(void)
10575 MSIHANDLE hdb, hpkg;
10577 CHAR path[MAX_PATH];
10578 CHAR cwd[MAX_PATH];
10579 CHAR subsrc[MAX_PATH];
10583 lstrcpyA(cwd, CURR_DIR);
10584 lstrcatA(cwd, "\\");
10586 lstrcpyA(subsrc, cwd);
10587 lstrcatA(subsrc, "long");
10588 lstrcatA(subsrc, "\\");
10590 hdb = create_package_db();
10591 ok( hdb, "failed to create database\n");
10593 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10594 ok(r == S_OK, "failed\n");
10596 sprintf(package, "#%i", hdb);
10597 r = MsiOpenPackage(package, &hpkg);
10598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10600 /* properties only */
10602 /* SourceDir prop */
10604 lstrcpyA(path, "kiwi");
10605 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10607 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10608 ok(size == 0, "Expected 0, got %d\n", size);
10610 /* SOURCEDIR prop */
10612 lstrcpyA(path, "kiwi");
10613 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10614 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10615 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10616 ok(size == 0, "Expected 0, got %d\n", size);
10618 r = MsiDoAction(hpkg, "CostInitialize");
10619 ok(r == ERROR_SUCCESS, "file cost failed\n");
10621 /* SourceDir after CostInitialize */
10623 lstrcpyA(path, "kiwi");
10624 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10625 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10626 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10627 ok(size == 0, "Expected 0, got %d\n", size);
10629 /* SOURCEDIR after CostInitialize */
10631 lstrcpyA(path, "kiwi");
10632 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10634 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10635 ok(size == 0, "Expected 0, got %d\n", size);
10637 r = MsiDoAction(hpkg, "FileCost");
10638 ok(r == ERROR_SUCCESS, "file cost failed\n");
10640 /* SourceDir after FileCost */
10642 lstrcpyA(path, "kiwi");
10643 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10644 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10645 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10646 ok(size == 0, "Expected 0, got %d\n", size);
10648 /* SOURCEDIR after FileCost */
10650 lstrcpyA(path, "kiwi");
10651 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10652 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10653 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10654 ok(size == 0, "Expected 0, got %d\n", size);
10656 r = MsiDoAction(hpkg, "CostFinalize");
10657 ok(r == ERROR_SUCCESS, "file cost failed\n");
10659 /* SourceDir after CostFinalize */
10661 lstrcpyA(path, "kiwi");
10662 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10664 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10665 ok(size == 0, "Expected 0, got %d\n", size);
10667 /* SOURCEDIR after CostFinalize */
10669 lstrcpyA(path, "kiwi");
10670 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10671 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10672 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10673 ok(size == 0, "Expected 0, got %d\n", size);
10675 r = MsiDoAction(hpkg, "ResolveSource");
10676 ok(r == ERROR_SUCCESS, "file cost failed\n");
10678 /* SourceDir after ResolveSource */
10680 lstrcpyA(path, "kiwi");
10681 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10683 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10684 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10686 /* SOURCEDIR after ResolveSource */
10688 lstrcpyA(path, "kiwi");
10689 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10690 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10691 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10692 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10694 /* random casing */
10696 lstrcpyA(path, "kiwi");
10697 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
10698 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10699 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10700 ok(size == 0, "Expected 0, got %d\n", size);
10702 MsiCloseHandle(hpkg);
10704 /* reset the package state */
10705 sprintf(package, "#%i", hdb);
10706 r = MsiOpenPackage(package, &hpkg);
10707 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10709 /* test how MsiGetSourcePath affects the properties */
10711 /* SourceDir prop */
10713 lstrcpyA(path, "kiwi");
10714 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10715 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10718 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10719 ok(size == 0, "Expected 0, got %d\n", size);
10723 lstrcpyA(path, "kiwi");
10724 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10725 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10726 ok(!lstrcmpA(path, "kiwi"),
10727 "Expected path to be unchanged, got \"%s\"\n", path);
10728 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10730 /* SourceDir after MsiGetSourcePath */
10732 lstrcpyA(path, "kiwi");
10733 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10737 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10738 ok(size == 0, "Expected 0, got %d\n", size);
10741 /* SOURCEDIR prop */
10743 lstrcpyA(path, "kiwi");
10744 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10745 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10748 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10749 ok(size == 0, "Expected 0, got %d\n", size);
10753 lstrcpyA(path, "kiwi");
10754 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10755 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10756 ok(!lstrcmpA(path, "kiwi"),
10757 "Expected path to be unchanged, got \"%s\"\n", path);
10758 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10760 /* SOURCEDIR prop after MsiGetSourcePath */
10762 lstrcpyA(path, "kiwi");
10763 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10764 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10767 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10768 ok(size == 0, "Expected 0, got %d\n", size);
10771 r = MsiDoAction(hpkg, "CostInitialize");
10772 ok(r == ERROR_SUCCESS, "file cost failed\n");
10774 /* SourceDir after CostInitialize */
10776 lstrcpyA(path, "kiwi");
10777 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10781 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10782 ok(size == 0, "Expected 0, got %d\n", size);
10786 lstrcpyA(path, "kiwi");
10787 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10789 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10790 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10792 /* SourceDir after MsiGetSourcePath */
10794 lstrcpyA(path, "kiwi");
10795 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10796 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10797 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10798 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10800 /* SOURCEDIR after CostInitialize */
10802 lstrcpyA(path, "kiwi");
10803 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10805 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10806 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10808 /* SOURCEDIR source path still does not exist */
10810 lstrcpyA(path, "kiwi");
10811 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10812 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10813 ok(!lstrcmpA(path, "kiwi"),
10814 "Expected path to be unchanged, got \"%s\"\n", path);
10815 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10817 r = MsiDoAction(hpkg, "FileCost");
10818 ok(r == ERROR_SUCCESS, "file cost failed\n");
10820 /* SourceDir after FileCost */
10822 lstrcpyA(path, "kiwi");
10823 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10824 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10825 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10826 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10828 /* SOURCEDIR after FileCost */
10830 lstrcpyA(path, "kiwi");
10831 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10832 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10833 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10834 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10836 /* SOURCEDIR source path still does not exist */
10838 lstrcpyA(path, "kiwi");
10839 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10840 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10841 ok(!lstrcmpA(path, "kiwi"),
10842 "Expected path to be unchanged, got \"%s\"\n", path);
10843 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10845 r = MsiDoAction(hpkg, "CostFinalize");
10846 ok(r == ERROR_SUCCESS, "file cost failed\n");
10848 /* SourceDir after CostFinalize */
10850 lstrcpyA(path, "kiwi");
10851 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10853 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10854 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10856 /* SOURCEDIR after CostFinalize */
10858 lstrcpyA(path, "kiwi");
10859 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10860 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10861 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10862 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10864 /* SOURCEDIR source path still does not exist */
10866 lstrcpyA(path, "kiwi");
10867 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10868 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10869 ok(!lstrcmpA(path, "kiwi"),
10870 "Expected path to be unchanged, got \"%s\"\n", path);
10871 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10873 r = MsiDoAction(hpkg, "ResolveSource");
10874 ok(r == ERROR_SUCCESS, "file cost failed\n");
10876 /* SourceDir after ResolveSource */
10878 lstrcpyA(path, "kiwi");
10879 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10880 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10881 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10882 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10884 /* SOURCEDIR after ResolveSource */
10886 lstrcpyA(path, "kiwi");
10887 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10888 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10889 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10890 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10892 /* SOURCEDIR source path still does not exist */
10894 lstrcpyA(path, "kiwi");
10895 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10896 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10897 ok(!lstrcmpA(path, "kiwi"),
10898 "Expected path to be unchanged, got \"%s\"\n", path);
10899 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10901 MsiCloseHandle(hdb);
10902 MsiCloseHandle(hpkg);
10903 DeleteFileA(msifile);
10913 static const struct access_res create[16] =
10915 { TRUE, ERROR_SUCCESS, TRUE },
10916 { TRUE, ERROR_SUCCESS, TRUE },
10917 { TRUE, ERROR_SUCCESS, FALSE },
10918 { TRUE, ERROR_SUCCESS, FALSE },
10919 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10920 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10921 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10922 { TRUE, ERROR_SUCCESS, FALSE },
10923 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10924 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10925 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10926 { TRUE, ERROR_SUCCESS, TRUE },
10927 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10928 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10929 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10930 { TRUE, ERROR_SUCCESS, TRUE }
10933 static const struct access_res create_commit[16] =
10935 { TRUE, ERROR_SUCCESS, TRUE },
10936 { TRUE, ERROR_SUCCESS, TRUE },
10937 { TRUE, ERROR_SUCCESS, FALSE },
10938 { TRUE, ERROR_SUCCESS, FALSE },
10939 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10940 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10941 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10942 { TRUE, ERROR_SUCCESS, FALSE },
10943 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10944 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10945 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10946 { TRUE, ERROR_SUCCESS, TRUE },
10947 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10948 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10949 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10950 { TRUE, ERROR_SUCCESS, TRUE }
10953 static const struct access_res create_close[16] =
10955 { TRUE, ERROR_SUCCESS, FALSE },
10956 { TRUE, ERROR_SUCCESS, FALSE },
10957 { TRUE, ERROR_SUCCESS, FALSE },
10958 { TRUE, ERROR_SUCCESS, FALSE },
10959 { TRUE, ERROR_SUCCESS, FALSE },
10960 { TRUE, ERROR_SUCCESS, FALSE },
10961 { TRUE, ERROR_SUCCESS, FALSE },
10962 { TRUE, ERROR_SUCCESS, FALSE },
10963 { TRUE, ERROR_SUCCESS, FALSE },
10964 { TRUE, ERROR_SUCCESS, FALSE },
10965 { TRUE, ERROR_SUCCESS, FALSE },
10966 { TRUE, ERROR_SUCCESS, FALSE },
10967 { TRUE, ERROR_SUCCESS, FALSE },
10968 { TRUE, ERROR_SUCCESS, FALSE },
10969 { TRUE, ERROR_SUCCESS, FALSE },
10970 { TRUE, ERROR_SUCCESS }
10973 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
10975 DWORD access = 0, share = 0;
10980 for (i = 0; i < 4; i++)
10982 if (i == 0) access = 0;
10983 if (i == 1) access = GENERIC_READ;
10984 if (i == 2) access = GENERIC_WRITE;
10985 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
10987 for (j = 0; j < 4; j++)
10989 if (ares[idx].ignore)
10992 if (j == 0) share = 0;
10993 if (j == 1) share = FILE_SHARE_READ;
10994 if (j == 2) share = FILE_SHARE_WRITE;
10995 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
10997 SetLastError(0xdeadbeef);
10998 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
10999 FILE_ATTRIBUTE_NORMAL, 0);
11000 lasterr = GetLastError();
11002 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
11003 "(%d, handle, %d): Expected %d, got %d\n",
11004 line, idx, ares[idx].gothandle,
11005 (hfile != INVALID_HANDLE_VALUE));
11007 ok(lasterr == ares[idx].lasterr ||
11008 lasterr == 0xdeadbeef, /* win9x */
11009 "(%d, lasterr, %d): Expected %d, got %d\n",
11010 line, idx, ares[idx].lasterr, lasterr);
11012 CloseHandle(hfile);
11018 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
11020 static void test_access(void)
11025 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
11026 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11028 test_file_access(msifile, create);
11030 r = MsiDatabaseCommit(hdb);
11031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11033 test_file_access(msifile, create_commit);
11035 MsiCloseHandle(hdb);
11037 test_file_access(msifile, create_close);
11039 DeleteFileA(msifile);
11041 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
11042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11044 test_file_access(msifile, create);
11046 r = MsiDatabaseCommit(hdb);
11047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11049 test_file_access(msifile, create_commit);
11051 MsiCloseHandle(hdb);
11053 test_file_access(msifile, create_close);
11055 DeleteFileA(msifile);
11058 static void test_emptypackage(void)
11060 MSIHANDLE hpkg, hdb, hsuminfo;
11061 MSIHANDLE hview, hrec;
11062 MSICONDITION condition;
11063 CHAR buffer[MAX_PATH];
11067 r = MsiOpenPackageA("", &hpkg);
11070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11073 hdb = MsiGetActiveDatabase(hpkg);
11076 ok(hdb != 0, "Expected a valid database handle\n");
11079 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
11082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11084 r = MsiViewExecute(hview, 0);
11087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11090 r = MsiViewFetch(hview, &hrec);
11093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11097 r = MsiRecordGetString(hrec, 1, buffer, &size);
11100 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11101 ok(!lstrcmpA(buffer, "_Property"),
11102 "Expected \"_Property\", got \"%s\"\n", buffer);
11105 MsiCloseHandle(hrec);
11107 r = MsiViewFetch(hview, &hrec);
11110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11114 r = MsiRecordGetString(hrec, 1, buffer, &size);
11117 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11118 ok(!lstrcmpA(buffer, "#_FolderCache"),
11119 "Expected \"_Property\", got \"%s\"\n", buffer);
11122 MsiCloseHandle(hrec);
11123 MsiViewClose(hview);
11124 MsiCloseHandle(hview);
11126 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
11129 ok(condition == MSICONDITION_FALSE,
11130 "Expected MSICONDITION_FALSE, got %d\n", condition);
11133 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
11136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11138 r = MsiViewExecute(hview, 0);
11141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11144 /* _Property table is not empty */
11145 r = MsiViewFetch(hview, &hrec);
11148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11151 MsiCloseHandle(hrec);
11152 MsiViewClose(hview);
11153 MsiCloseHandle(hview);
11155 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
11158 ok(condition == MSICONDITION_FALSE,
11159 "Expected MSICONDITION_FALSE, got %d\n", condition);
11162 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
11165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11167 r = MsiViewExecute(hview, 0);
11170 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11173 /* #_FolderCache is not empty */
11174 r = MsiViewFetch(hview, &hrec);
11177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11180 MsiCloseHandle(hrec);
11181 MsiViewClose(hview);
11182 MsiCloseHandle(hview);
11184 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
11187 ok(r == ERROR_BAD_QUERY_SYNTAX,
11188 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11191 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
11194 ok(r == ERROR_BAD_QUERY_SYNTAX,
11195 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11198 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
11201 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
11202 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
11205 MsiCloseHandle(hsuminfo);
11207 r = MsiDatabaseCommit(hdb);
11210 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11213 MsiCloseHandle(hdb);
11214 MsiCloseHandle(hpkg);
11217 static void test_MsiGetProductProperty(void)
11219 MSIHANDLE hprod, hdb;
11220 CHAR val[MAX_PATH];
11221 CHAR path[MAX_PATH];
11222 CHAR query[MAX_PATH];
11223 CHAR keypath[MAX_PATH*2];
11224 CHAR prodcode[MAX_PATH];
11225 CHAR prod_squashed[MAX_PATH];
11226 HKEY prodkey, userkey, props;
11232 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
11233 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
11235 win_skip("Different registry keys on Win9x and WinMe\n");
11238 CloseServiceHandle(scm);
11240 GetCurrentDirectoryA(MAX_PATH, path);
11241 lstrcatA(path, "\\");
11243 create_test_guid(prodcode, prod_squashed);
11245 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
11246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11248 r = MsiDatabaseCommit(hdb);
11249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11251 r = set_summary_info(hdb);
11252 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11255 "CREATE TABLE `Directory` ( "
11256 "`Directory` CHAR(255) NOT NULL, "
11257 "`Directory_Parent` CHAR(255), "
11258 "`DefaultDir` CHAR(255) NOT NULL "
11259 "PRIMARY KEY `Directory`)");
11260 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11263 "CREATE TABLE `Property` ( "
11264 "`Property` CHAR(72) NOT NULL, "
11265 "`Value` CHAR(255) "
11266 "PRIMARY KEY `Property`)");
11267 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11269 sprintf(query, "INSERT INTO `Property` "
11270 "(`Property`, `Value`) "
11271 "VALUES( 'ProductCode', '%s' )", prodcode);
11272 r = run_query(hdb, query);
11273 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11275 r = MsiDatabaseCommit(hdb);
11276 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11278 MsiCloseHandle(hdb);
11280 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
11281 lstrcatA(keypath, prod_squashed);
11283 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &prodkey);
11284 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11286 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
11287 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
11288 lstrcatA(keypath, prod_squashed);
11290 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &userkey);
11291 if (res == ERROR_ACCESS_DENIED)
11293 skip("Not enough rights to perform tests\n");
11294 RegDeleteKeyA(prodkey, "");
11295 RegCloseKey(prodkey);
11298 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11300 res = RegCreateKeyA(userkey, "InstallProperties", &props);
11301 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11303 lstrcpyA(val, path);
11304 lstrcatA(val, "\\winetest.msi");
11305 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
11306 (const BYTE *)val, lstrlenA(val) + 1);
11307 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11309 hprod = 0xdeadbeef;
11310 r = MsiOpenProductA(prodcode, &hprod);
11311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11312 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
11314 /* hProduct is invalid */
11316 lstrcpyA(val, "apple");
11317 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
11318 ok(r == ERROR_INVALID_HANDLE,
11319 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11320 ok(!lstrcmpA(val, "apple"),
11321 "Expected val to be unchanged, got \"%s\"\n", val);
11322 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11324 /* szProperty is NULL */
11326 lstrcpyA(val, "apple");
11327 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
11328 ok(r == ERROR_INVALID_PARAMETER,
11329 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11330 ok(!lstrcmpA(val, "apple"),
11331 "Expected val to be unchanged, got \"%s\"\n", val);
11332 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11334 /* szProperty is empty */
11336 lstrcpyA(val, "apple");
11337 r = MsiGetProductPropertyA(hprod, "", val, &size);
11338 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11339 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11340 ok(size == 0, "Expected 0, got %d\n", size);
11342 /* get the property */
11344 lstrcpyA(val, "apple");
11345 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11347 ok(!lstrcmpA(val, prodcode),
11348 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11349 ok(size == lstrlenA(prodcode),
11350 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11352 /* lpValueBuf is NULL */
11354 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
11355 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11356 ok(size == lstrlenA(prodcode),
11357 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11359 /* pcchValueBuf is NULL */
11360 lstrcpyA(val, "apple");
11361 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
11362 ok(r == ERROR_INVALID_PARAMETER,
11363 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11364 ok(!lstrcmpA(val, "apple"),
11365 "Expected val to be unchanged, got \"%s\"\n", val);
11366 ok(size == lstrlenA(prodcode),
11367 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11369 /* pcchValueBuf is too small */
11371 lstrcpyA(val, "apple");
11372 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11373 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11374 ok(!strncmp(val, prodcode, 3),
11375 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
11376 ok(size == lstrlenA(prodcode),
11377 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11379 /* pcchValueBuf does not leave room for NULL terminator */
11380 size = lstrlenA(prodcode);
11381 lstrcpyA(val, "apple");
11382 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11383 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11384 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
11385 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
11386 ok(size == lstrlenA(prodcode),
11387 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11389 /* pcchValueBuf has enough room for NULL terminator */
11390 size = lstrlenA(prodcode) + 1;
11391 lstrcpyA(val, "apple");
11392 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11394 ok(!lstrcmpA(val, prodcode),
11395 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11396 ok(size == lstrlenA(prodcode),
11397 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11399 /* nonexistent property */
11401 lstrcpyA(val, "apple");
11402 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
11403 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11404 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11405 ok(size == 0, "Expected 0, got %d\n", size);
11407 r = MsiSetPropertyA(hprod, "NewProperty", "value");
11408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11410 /* non-product property set */
11412 lstrcpyA(val, "apple");
11413 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
11414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11415 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11416 ok(size == 0, "Expected 0, got %d\n", size);
11418 r = MsiSetPropertyA(hprod, "ProductCode", "value");
11419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11421 /* non-product property that is also a product property set */
11423 lstrcpyA(val, "apple");
11424 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11426 ok(!lstrcmpA(val, prodcode),
11427 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11428 ok(size == lstrlenA(prodcode),
11429 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11431 MsiCloseHandle(hprod);
11433 RegDeleteValueA(props, "LocalPackage");
11434 RegDeleteKeyA(props, "");
11435 RegCloseKey(props);
11436 RegDeleteKeyA(userkey, "");
11437 RegCloseKey(userkey);
11438 RegDeleteKeyA(prodkey, "");
11439 RegCloseKey(prodkey);
11440 DeleteFileA(msifile);
11443 static void test_MsiSetProperty(void)
11445 MSIHANDLE hpkg, hdb, hrec;
11446 CHAR buf[MAX_PATH];
11451 hpkg = package_from_db(create_package_db());
11452 ok(hpkg != 0, "Expected a valid package\n");
11454 /* invalid hInstall */
11455 r = MsiSetPropertyA(0, "Prop", "Val");
11456 ok(r == ERROR_INVALID_HANDLE,
11457 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11459 /* invalid hInstall */
11460 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
11461 ok(r == ERROR_INVALID_HANDLE,
11462 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11464 /* szName is NULL */
11465 r = MsiSetPropertyA(hpkg, NULL, "Val");
11466 ok(r == ERROR_INVALID_PARAMETER,
11467 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11469 /* both szName and szValue are NULL */
11470 r = MsiSetPropertyA(hpkg, NULL, NULL);
11471 ok(r == ERROR_INVALID_PARAMETER,
11472 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11474 /* szName is empty */
11475 r = MsiSetPropertyA(hpkg, "", "Val");
11476 ok(r == ERROR_FUNCTION_FAILED,
11477 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
11479 /* szName is empty and szValue is NULL */
11480 r = MsiSetPropertyA(hpkg, "", NULL);
11481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11483 /* set a property */
11484 r = MsiSetPropertyA(hpkg, "Prop", "Val");
11485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11487 /* get the property */
11489 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11491 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
11492 ok(size == 3, "Expected 3, got %d\n", size);
11494 /* update the property */
11495 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
11496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11498 /* get the property */
11500 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11502 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
11503 ok(size == 4, "Expected 4, got %d\n", size);
11505 hdb = MsiGetActiveDatabase(hpkg);
11506 ok(hdb != 0, "Expected a valid database handle\n");
11508 /* set prop is not in the _Property table */
11509 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
11510 r = do_query(hdb, query, &hrec);
11511 ok(r == ERROR_BAD_QUERY_SYNTAX,
11512 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11514 /* set prop is not in the Property table */
11515 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
11516 r = do_query(hdb, query, &hrec);
11517 ok(r == ERROR_BAD_QUERY_SYNTAX,
11518 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11520 MsiCloseHandle(hdb);
11522 /* szValue is an empty string */
11523 r = MsiSetPropertyA(hpkg, "Prop", "");
11524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11526 /* try to get the property */
11528 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11530 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11531 ok(size == 0, "Expected 0, got %d\n", size);
11533 /* reset the property */
11534 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
11535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11537 /* delete the property */
11538 r = MsiSetPropertyA(hpkg, "Prop", NULL);
11539 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11541 /* try to get the property */
11543 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11545 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11546 ok(size == 0, "Expected 0, got %d\n", size);
11548 MsiCloseHandle(hpkg);
11549 DeleteFileA(msifile);
11552 static void test_MsiApplyMultiplePatches(void)
11554 UINT r, type = GetDriveType(NULL);
11556 if (!pMsiApplyMultiplePatchesA) {
11557 win_skip("MsiApplyMultiplePatchesA not found\n");
11561 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
11562 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11564 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
11565 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11567 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
11570 if (type == DRIVE_FIXED)
11571 ok(r == ERROR_PATH_NOT_FOUND,
11572 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11574 ok(r == ERROR_INVALID_NAME,
11575 "Expected ERROR_INVALID_NAME, got %u\n", r);
11578 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
11581 if (type == DRIVE_FIXED)
11582 ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED,
11583 "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
11585 ok(r == ERROR_INVALID_NAME,
11586 "Expected ERROR_INVALID_NAME, got %u\n", r);
11589 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
11592 if (type == DRIVE_FIXED)
11593 ok(r == ERROR_PATH_NOT_FOUND,
11594 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11596 ok(r == ERROR_INVALID_NAME,
11597 "Expected ERROR_INVALID_NAME, got %u\n", r);
11600 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
11601 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11603 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
11606 if (type == DRIVE_FIXED)
11607 ok(r == ERROR_PATH_NOT_FOUND,
11608 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11610 ok(r == ERROR_INVALID_NAME,
11611 "Expected ERROR_INVALID_NAME, got %u\n", r);
11614 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
11615 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11617 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
11618 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11621 static void test_MsiApplyPatch(void)
11625 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
11626 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11628 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
11629 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11632 START_TEST(package)
11634 init_functionpointers();
11636 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
11638 test_createpackage();
11640 test_gettargetpath_bad();
11641 test_settargetpath();
11643 test_property_table();
11646 test_formatrecord2();
11648 test_getproperty();
11649 test_removefiles();
11651 test_appsearch_complocator();
11652 test_appsearch_reglocator();
11653 test_appsearch_inilocator();
11654 test_appsearch_drlocator();
11655 test_featureparents();
11656 test_installprops();
11657 test_launchconditions();
11659 test_complocator();
11660 test_MsiGetSourcePath();
11661 test_shortlongsource();
11664 test_emptypackage();
11665 test_MsiGetProductProperty();
11666 test_MsiSetProperty();
11667 test_MsiApplyMultiplePatches();
11668 test_MsiApplyPatch();