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
29 #include <srrestoreptapi.h>
32 #include "wine/test.h"
35 static const char msifile[] = "winetest-package.msi";
36 static char CURR_DIR[MAX_PATH];
38 static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
39 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
40 static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
42 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
43 static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
44 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
45 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
46 static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
47 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
48 static void (WINAPI *pGetSystemInfo)(LPSYSTEM_INFO);
49 static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR, UINT);
51 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
52 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
54 static void init_functionpointers(void)
56 HMODULE hmsi = GetModuleHandleA("msi.dll");
57 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
58 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
59 HMODULE hshell32 = GetModuleHandleA("shell32.dll");
62 #define GET_PROC(mod, func) \
63 p ## func = (void*)GetProcAddress(mod, #func);
65 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
66 GET_PROC(hmsi, MsiGetComponentPathExA);
67 GET_PROC(hshell32, SHGetFolderPathA);
69 GET_PROC(hadvapi32, ConvertSidToStringSidA);
70 GET_PROC(hadvapi32, GetTokenInformation);
71 GET_PROC(hadvapi32, OpenProcessToken);
72 GET_PROC(hadvapi32, RegDeleteKeyExA)
73 GET_PROC(hadvapi32, RegDeleteKeyExW)
74 GET_PROC(hkernel32, IsWow64Process)
75 GET_PROC(hkernel32, GetSystemInfo)
76 GET_PROC(hkernel32, GetSystemWow64DirectoryA)
78 hsrclient = LoadLibraryA("srclient.dll");
79 GET_PROC(hsrclient, SRRemoveRestorePoint);
80 GET_PROC(hsrclient, SRSetRestorePointA);
84 static BOOL is_process_limited(void)
88 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
90 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
93 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
96 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
98 return (ret && type == TokenElevationTypeLimited);
103 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
105 if (pRegDeleteKeyExA)
106 return pRegDeleteKeyExA( key, subkey, access, 0 );
107 return RegDeleteKeyA( key, subkey );
110 static LPSTR get_user_sid(LPSTR *usersid)
117 if (!pConvertSidToStringSidA)
119 win_skip("ConvertSidToStringSidA is not available\n");
124 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
126 GetTokenInformation(token, TokenUser, buf, size, &size);
127 user = (PTOKEN_USER)buf;
128 pConvertSidToStringSidA(user->User.Sid, usersid);
129 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
134 /* RegDeleteTreeW from dlls/advapi32/registry.c */
135 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM access)
138 DWORD dwMaxSubkeyLen, dwMaxValueLen;
139 DWORD dwMaxLen, dwSize;
140 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
145 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, access, &hSubKey);
149 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
150 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
151 if (ret) goto cleanup;
155 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
156 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
158 /* Name too big: alloc a buffer for it */
159 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
161 ret = ERROR_NOT_ENOUGH_MEMORY;
166 /* Recursively delete all the subkeys */
170 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
171 NULL, NULL, NULL)) break;
173 ret = package_RegDeleteTreeW(hSubKey, lpszName, access);
174 if (ret) goto cleanup;
179 if (pRegDeleteKeyExW)
180 ret = pRegDeleteKeyExW(hKey, lpszSubKey, access, 0);
182 ret = RegDeleteKeyW(hKey, lpszSubKey);
188 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
189 NULL, NULL, NULL, NULL)) break;
191 ret = RegDeleteValueW(hKey, lpszName);
192 if (ret) goto cleanup;
196 if (lpszName != szNameBuf)
197 HeapFree(GetProcessHeap(), 0, lpszName);
199 RegCloseKey(hSubKey);
203 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
208 if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid)))
222 out[17+i*2] = in[n++];
223 out[16+i*2] = in[n++];
228 out[17+i*2] = in[n++];
229 out[16+i*2] = in[n++];
235 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
237 WCHAR guidW[MAX_PATH];
238 WCHAR squashedW[MAX_PATH];
243 hr = CoCreateGuid(&guid);
244 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
246 size = StringFromGUID2(&guid, guidW, MAX_PATH);
247 ok(size == 39, "Expected 39, got %d\n", hr);
249 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
250 squash_guid(guidW, squashedW);
251 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
254 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
255 LPCSTR guid, LPSTR usersid, BOOL dir)
257 WCHAR guidW[MAX_PATH];
258 WCHAR squashedW[MAX_PATH];
259 CHAR squashed[MAX_PATH];
260 CHAR comppath[MAX_PATH];
261 CHAR prodpath[MAX_PATH];
265 REGSAM access = KEY_ALL_ACCESS;
268 access |= KEY_WOW64_64KEY;
270 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
271 squash_guid(guidW, squashedW);
272 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
274 if (context == MSIINSTALLCONTEXT_MACHINE)
276 prod = "3D0DAE300FACA1300AD792060BCDAA92";
278 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
279 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
281 "SOFTWARE\\Classes\\Installer\\"
282 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
284 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
286 prod = "7D2F387510109040002000060BECB6AB";
288 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
289 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
291 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
292 "Installer\\%s\\Installer\\Products\\"
293 "7D2F387510109040002000060BECB6AB", usersid);
295 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
297 prod = "7D2F387510109040002000060BECB6AB";
299 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
300 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
302 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
303 "Installer\\Managed\\%s\\Installer\\Products\\"
304 "7D2F387510109040002000060BECB6AB", usersid);
307 RegCreateKeyExA(HKEY_LOCAL_MACHINE, comppath, 0, NULL, 0, access, NULL, &hkey, NULL);
309 lstrcpyA(path, CURR_DIR);
310 lstrcatA(path, "\\");
311 if (!dir) lstrcatA(path, filename);
313 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
316 RegCreateKeyExA(HKEY_LOCAL_MACHINE, prodpath, 0, NULL, 0, access, NULL, &hkey, NULL);
320 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
322 WCHAR guidW[MAX_PATH];
323 WCHAR squashedW[MAX_PATH];
324 WCHAR substrW[MAX_PATH];
325 CHAR squashed[MAX_PATH];
326 CHAR comppath[MAX_PATH];
327 CHAR prodpath[MAX_PATH];
328 REGSAM access = KEY_ALL_ACCESS;
331 access |= KEY_WOW64_64KEY;
333 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
334 squash_guid(guidW, squashedW);
335 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
337 if (context == MSIINSTALLCONTEXT_MACHINE)
340 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
341 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
343 "SOFTWARE\\Classes\\Installer\\"
344 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
346 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
349 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
350 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
352 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
353 "Installer\\%s\\Installer\\Products\\"
354 "7D2F387510109040002000060BECB6AB", usersid);
356 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
359 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
360 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
362 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
363 "Installer\\Managed\\%s\\Installer\\Products\\"
364 "7D2F387510109040002000060BECB6AB", usersid);
367 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
368 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
370 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
371 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
374 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
379 /* open a select query */
380 r = MsiDatabaseOpenView(hdb, query, &hview);
381 if (r != ERROR_SUCCESS)
383 r = MsiViewExecute(hview, 0);
384 if (r != ERROR_SUCCESS)
386 ret = MsiViewFetch(hview, phrec);
387 r = MsiViewClose(hview);
388 if (r != ERROR_SUCCESS)
390 r = MsiCloseHandle(hview);
391 if (r != ERROR_SUCCESS)
396 static UINT run_query( MSIHANDLE hdb, const char *query )
401 r = MsiDatabaseOpenView(hdb, query, &hview);
402 if( r != ERROR_SUCCESS )
405 r = MsiViewExecute(hview, 0);
406 if( r == ERROR_SUCCESS )
407 r = MsiViewClose(hview);
408 MsiCloseHandle(hview);
412 static UINT create_component_table( MSIHANDLE hdb )
414 return run_query( hdb,
415 "CREATE TABLE `Component` ( "
416 "`Component` CHAR(72) NOT NULL, "
417 "`ComponentId` CHAR(38), "
418 "`Directory_` CHAR(72) NOT NULL, "
419 "`Attributes` SHORT NOT NULL, "
420 "`Condition` CHAR(255), "
421 "`KeyPath` CHAR(72) "
422 "PRIMARY KEY `Component`)" );
425 static UINT create_feature_table( MSIHANDLE hdb )
427 return run_query( hdb,
428 "CREATE TABLE `Feature` ( "
429 "`Feature` CHAR(38) NOT NULL, "
430 "`Feature_Parent` CHAR(38), "
432 "`Description` CHAR(255), "
433 "`Display` SHORT NOT NULL, "
434 "`Level` SHORT NOT NULL, "
435 "`Directory_` CHAR(72), "
436 "`Attributes` SHORT NOT NULL "
437 "PRIMARY KEY `Feature`)" );
440 static UINT create_feature_components_table( MSIHANDLE hdb )
442 return run_query( hdb,
443 "CREATE TABLE `FeatureComponents` ( "
444 "`Feature_` CHAR(38) NOT NULL, "
445 "`Component_` CHAR(72) NOT NULL "
446 "PRIMARY KEY `Feature_`, `Component_` )" );
449 static UINT create_file_table( MSIHANDLE hdb )
451 return run_query( hdb,
452 "CREATE TABLE `File` ("
453 "`File` CHAR(72) NOT NULL, "
454 "`Component_` CHAR(72) NOT NULL, "
455 "`FileName` CHAR(255) NOT NULL, "
456 "`FileSize` LONG NOT NULL, "
457 "`Version` CHAR(72), "
458 "`Language` CHAR(20), "
459 "`Attributes` SHORT, "
460 "`Sequence` SHORT NOT NULL "
461 "PRIMARY KEY `File`)" );
464 static UINT create_remove_file_table( MSIHANDLE hdb )
466 return run_query( hdb,
467 "CREATE TABLE `RemoveFile` ("
468 "`FileKey` CHAR(72) NOT NULL, "
469 "`Component_` CHAR(72) NOT NULL, "
470 "`FileName` CHAR(255) LOCALIZABLE, "
471 "`DirProperty` CHAR(72) NOT NULL, "
472 "`InstallMode` SHORT NOT NULL "
473 "PRIMARY KEY `FileKey`)" );
476 static UINT create_appsearch_table( MSIHANDLE hdb )
478 return run_query( hdb,
479 "CREATE TABLE `AppSearch` ("
480 "`Property` CHAR(72) NOT NULL, "
481 "`Signature_` CHAR(72) NOT NULL "
482 "PRIMARY KEY `Property`, `Signature_`)" );
485 static UINT create_reglocator_table( MSIHANDLE hdb )
487 return run_query( hdb,
488 "CREATE TABLE `RegLocator` ("
489 "`Signature_` CHAR(72) NOT NULL, "
490 "`Root` SHORT NOT NULL, "
491 "`Key` CHAR(255) NOT NULL, "
494 "PRIMARY KEY `Signature_`)" );
497 static UINT create_signature_table( MSIHANDLE hdb )
499 return run_query( hdb,
500 "CREATE TABLE `Signature` ("
501 "`Signature` CHAR(72) NOT NULL, "
502 "`FileName` CHAR(255) NOT NULL, "
503 "`MinVersion` CHAR(20), "
504 "`MaxVersion` CHAR(20), "
509 "`Languages` CHAR(255) "
510 "PRIMARY KEY `Signature`)" );
513 static UINT create_launchcondition_table( MSIHANDLE hdb )
515 return run_query( hdb,
516 "CREATE TABLE `LaunchCondition` ("
517 "`Condition` CHAR(255) NOT NULL, "
518 "`Description` CHAR(255) NOT NULL "
519 "PRIMARY KEY `Condition`)" );
522 static UINT create_property_table( MSIHANDLE hdb )
524 return run_query( hdb,
525 "CREATE TABLE `Property` ("
526 "`Property` CHAR(72) NOT NULL, "
528 "PRIMARY KEY `Property`)" );
531 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
533 return run_query( hdb,
534 "CREATE TABLE `InstallExecuteSequence` ("
535 "`Action` CHAR(72) NOT NULL, "
536 "`Condition` CHAR(255), "
538 "PRIMARY KEY `Action`)" );
541 static UINT create_media_table( MSIHANDLE hdb )
543 return run_query( hdb,
544 "CREATE TABLE `Media` ("
545 "`DiskId` SHORT NOT NULL, "
546 "`LastSequence` SHORT NOT NULL, "
547 "`DiskPrompt` CHAR(64), "
548 "`Cabinet` CHAR(255), "
549 "`VolumeLabel` CHAR(32), "
551 "PRIMARY KEY `DiskId`)" );
554 static UINT create_ccpsearch_table( MSIHANDLE hdb )
556 return run_query( hdb,
557 "CREATE TABLE `CCPSearch` ("
558 "`Signature_` CHAR(72) NOT NULL "
559 "PRIMARY KEY `Signature_`)" );
562 static UINT create_drlocator_table( MSIHANDLE hdb )
564 return run_query( hdb,
565 "CREATE TABLE `DrLocator` ("
566 "`Signature_` CHAR(72) NOT NULL, "
567 "`Parent` CHAR(72), "
570 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
573 static UINT create_complocator_table( MSIHANDLE hdb )
575 return run_query( hdb,
576 "CREATE TABLE `CompLocator` ("
577 "`Signature_` CHAR(72) NOT NULL, "
578 "`ComponentId` CHAR(38) NOT NULL, "
580 "PRIMARY KEY `Signature_`)" );
583 static UINT create_inilocator_table( MSIHANDLE hdb )
585 return run_query( hdb,
586 "CREATE TABLE `IniLocator` ("
587 "`Signature_` CHAR(72) NOT NULL, "
588 "`FileName` CHAR(255) NOT NULL, "
589 "`Section` CHAR(96)NOT NULL, "
590 "`Key` CHAR(128)NOT NULL, "
593 "PRIMARY KEY `Signature_`)" );
596 #define make_add_entry(type, qtext) \
597 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
599 char insert[] = qtext; \
602 sz = strlen(values) + sizeof insert; \
603 query = HeapAlloc(GetProcessHeap(),0,sz); \
604 sprintf(query,insert,values); \
605 r = run_query( hdb, query ); \
606 HeapFree(GetProcessHeap(), 0, query); \
610 make_add_entry(component,
611 "INSERT INTO `Component` "
612 "(`Component`, `ComponentId`, `Directory_`, "
613 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
615 make_add_entry(directory,
616 "INSERT INTO `Directory` "
617 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
619 make_add_entry(feature,
620 "INSERT INTO `Feature` "
621 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
622 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
624 make_add_entry(feature_components,
625 "INSERT INTO `FeatureComponents` "
626 "(`Feature_`, `Component_`) VALUES( %s )")
629 "INSERT INTO `File` "
630 "(`File`, `Component_`, `FileName`, `FileSize`, "
631 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
633 make_add_entry(appsearch,
634 "INSERT INTO `AppSearch` "
635 "(`Property`, `Signature_`) VALUES( %s )")
637 make_add_entry(signature,
638 "INSERT INTO `Signature` "
639 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
640 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
643 make_add_entry(launchcondition,
644 "INSERT INTO `LaunchCondition` "
645 "(`Condition`, `Description`) VALUES( %s )")
647 make_add_entry(property,
648 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
650 make_add_entry(install_execute_sequence,
651 "INSERT INTO `InstallExecuteSequence` "
652 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
654 make_add_entry(media,
655 "INSERT INTO `Media` "
656 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
657 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
659 make_add_entry(ccpsearch,
660 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
662 make_add_entry(drlocator,
663 "INSERT INTO `DrLocator` "
664 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
666 make_add_entry(complocator,
667 "INSERT INTO `CompLocator` "
668 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
670 make_add_entry(inilocator,
671 "INSERT INTO `IniLocator` "
672 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
675 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char *path,
676 const char *name, UINT type )
678 const char insert[] =
679 "INSERT INTO `RegLocator` (`Signature_`, `Root`, `Key`, `Name`, `Type`) "
680 "VALUES( '%s', %u, '%s', '%s', %u )";
684 sz = strlen( sig ) + 10 + strlen( path ) + strlen( name ) + 10 + sizeof( insert );
685 query = HeapAlloc( GetProcessHeap(), 0, sz );
686 sprintf( query, insert, sig, root, path, name, type );
687 r = run_query( hdb, query );
688 HeapFree( GetProcessHeap(), 0, query );
692 static UINT set_summary_info(MSIHANDLE hdb)
697 /* build summary info */
698 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
699 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
701 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
702 "Installation Database");
703 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
705 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
706 "Installation Database");
707 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
709 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
711 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
713 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
715 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
717 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
718 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
719 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
721 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
722 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
724 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
725 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
727 res = MsiSummaryInfoPersist(suminfo);
728 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
730 res = MsiCloseHandle( suminfo);
731 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
737 static MSIHANDLE create_package_db(void)
744 /* create an empty database */
745 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
746 ok( res == ERROR_SUCCESS , "Failed to create database %u\n", res );
747 if( res != ERROR_SUCCESS )
750 res = MsiDatabaseCommit( hdb );
751 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
753 res = set_summary_info(hdb);
755 res = run_query( hdb,
756 "CREATE TABLE `Directory` ( "
757 "`Directory` CHAR(255) NOT NULL, "
758 "`Directory_Parent` CHAR(255), "
759 "`DefaultDir` CHAR(255) NOT NULL "
760 "PRIMARY KEY `Directory`)" );
761 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
766 static UINT package_from_db(MSIHANDLE hdb, MSIHANDLE *handle)
772 sprintf(szPackage, "#%u", hdb);
773 res = MsiOpenPackage(szPackage, &hPackage);
774 if (res != ERROR_SUCCESS)
780 res = MsiCloseHandle(hdb);
781 if (res != ERROR_SUCCESS)
783 MsiCloseHandle(hPackage);
788 return ERROR_SUCCESS;
791 static void create_test_file(const CHAR *name)
796 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
797 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
798 WriteFile(file, name, strlen(name), &written, NULL);
799 WriteFile(file, "\n", strlen("\n"), &written, NULL);
803 typedef struct _tagVS_VERSIONINFO
810 VS_FIXEDFILEINFO Value;
815 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
816 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
818 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
820 VS_VERSIONINFO *pVerInfo;
821 VS_FIXEDFILEINFO *pFixedInfo;
828 GetSystemDirectory(path, MAX_PATH);
829 /* Some dlls can't be updated on Vista/W2K8 */
830 lstrcatA(path, "\\version.dll");
832 CopyFileA(path, name, FALSE);
834 size = GetFileVersionInfoSize(path, &handle);
835 buffer = HeapAlloc(GetProcessHeap(), 0, size);
837 GetFileVersionInfoA(path, 0, size, buffer);
839 pVerInfo = (VS_VERSIONINFO *)buffer;
840 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
841 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
843 pFixedInfo->dwFileVersionMS = ms;
844 pFixedInfo->dwFileVersionLS = ls;
845 pFixedInfo->dwProductVersionMS = ms;
846 pFixedInfo->dwProductVersionLS = ls;
848 resource = BeginUpdateResource(name, FALSE);
852 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
853 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
856 if (!EndUpdateResource(resource, FALSE))
862 HeapFree(GetProcessHeap(), 0, buffer);
866 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
868 RESTOREPOINTINFOA spec;
870 spec.dwEventType = event_type;
871 spec.dwRestorePtType = APPLICATION_INSTALL;
872 spec.llSequenceNumber = status->llSequenceNumber;
873 lstrcpyA(spec.szDescription, "msitest restore point");
875 return pSRSetRestorePointA(&spec, status);
878 static void remove_restore_point(DWORD seq_number)
882 res = pSRRemoveRestorePoint(seq_number);
883 if (res != ERROR_SUCCESS)
884 trace("Failed to remove the restore point : %08x\n", res);
887 static void test_createpackage(void)
889 MSIHANDLE hPackage = 0;
892 res = package_from_db(create_package_db(), &hPackage);
893 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
895 skip("Not enough rights to perform tests\n");
899 ok( res == ERROR_SUCCESS, " Failed to create package %u\n", res );
901 res = MsiCloseHandle( hPackage);
902 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
906 static void test_doaction( void )
911 r = MsiDoAction( -1, NULL );
912 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
914 r = package_from_db(create_package_db(), &hpkg);
915 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
917 skip("Not enough rights to perform tests\n");
921 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
923 r = MsiDoAction(hpkg, NULL);
924 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
926 r = MsiDoAction(0, "boo");
927 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
929 r = MsiDoAction(hpkg, "boo");
930 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
932 MsiCloseHandle( hpkg );
936 static void test_gettargetpath_bad(void)
938 static const WCHAR boo[] = {'b','o','o',0};
939 static const WCHAR empty[] = {0};
946 r = package_from_db(create_package_db(), &hpkg);
947 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
949 skip("Not enough rights to perform tests\n");
953 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
955 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
956 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
958 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
959 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
961 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
962 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
964 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
965 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
967 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
968 ok( r == ERROR_DIRECTORY, "wrong return val\n");
970 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
971 ok( r == ERROR_DIRECTORY, "wrong return val\n");
974 r = MsiGetTargetPath( hpkg, "", buffer, &sz );
975 ok( r == ERROR_DIRECTORY, "wrong return val\n");
977 r = MsiGetTargetPathW( 0, NULL, NULL, NULL );
978 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
980 r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
981 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
983 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
984 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
986 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
987 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
989 r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
990 ok( r == ERROR_DIRECTORY, "wrong return val\n");
992 r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
993 ok( r == ERROR_DIRECTORY, "wrong return val\n");
996 r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
997 ok( r == ERROR_DIRECTORY, "wrong return val\n");
999 MsiCloseHandle( hpkg );
1000 DeleteFile(msifile);
1003 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
1009 rec = MsiCreateRecord( 1 );
1010 ok(rec, "MsiCreate record failed\n");
1012 r = MsiRecordSetString( rec, 0, file );
1013 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1016 r = MsiFormatRecord( hpkg, rec, buff, &size );
1017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1019 MsiCloseHandle( rec );
1022 static void test_settargetpath(void)
1024 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
1030 hdb = create_package_db();
1031 ok ( hdb, "failed to create package database\n" );
1033 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
1034 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
1036 r = create_component_table( hdb );
1037 ok( r == S_OK, "cannot create Component table: %d\n", r );
1039 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1040 ok( r == S_OK, "cannot add dummy component: %d\n", r );
1042 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1043 ok( r == S_OK, "cannot add test component: %d\n", r );
1045 r = create_feature_table( hdb );
1046 ok( r == S_OK, "cannot create Feature table: %d\n", r );
1048 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
1049 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
1051 r = create_feature_components_table( hdb );
1052 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
1054 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
1055 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1057 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
1058 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1060 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
1061 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
1063 r = create_file_table( hdb );
1064 ok( r == S_OK, "cannot create File table: %d\n", r );
1066 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1067 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1069 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1070 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1072 r = package_from_db( hdb, &hpkg );
1073 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1075 skip("Not enough rights to perform tests\n");
1076 DeleteFile(msifile);
1079 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1081 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
1083 r = MsiDoAction( hpkg, "CostInitialize");
1084 ok( r == ERROR_SUCCESS, "cost init failed\n");
1086 r = MsiDoAction( hpkg, "FileCost");
1087 ok( r == ERROR_SUCCESS, "file cost failed\n");
1089 r = MsiDoAction( hpkg, "CostFinalize");
1090 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
1092 r = MsiSetTargetPath( 0, NULL, NULL );
1093 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1095 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1096 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1098 r = MsiSetTargetPath( hpkg, "boo", NULL );
1099 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1101 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
1102 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1104 sz = sizeof tempdir - 1;
1105 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
1106 sprintf( file, "%srootfile.txt", tempdir );
1108 query_file_path( hpkg, "[#RootFile]", buffer );
1109 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1110 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
1112 GetTempFileName( tempdir, "_wt", 0, buffer );
1113 sprintf( tempdir, "%s\\subdir", buffer );
1115 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1116 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1117 "MsiSetTargetPath on file returned %d\n", r );
1119 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1120 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1121 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
1123 DeleteFile( buffer );
1125 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1126 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1128 r = GetFileAttributes( buffer );
1129 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
1131 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1132 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
1134 sz = sizeof buffer - 1;
1135 lstrcat( tempdir, "\\" );
1136 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
1137 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1138 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
1140 sprintf( file, "%srootfile.txt", tempdir );
1141 query_file_path( hpkg, "[#RootFile]", buffer );
1142 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
1144 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
1145 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1147 query_file_path( hpkg, "[#TestFile]", buffer );
1148 ok( !lstrcmpi(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
1149 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
1151 sz = sizeof buffer - 1;
1152 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1153 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1154 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
1156 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two\\three" );
1157 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1159 sz = sizeof buffer - 1;
1160 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1161 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1162 ok( !lstrcmpi(buffer, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer);
1164 MsiCloseHandle( hpkg );
1167 static void test_condition(void)
1169 static const WCHAR cond1[] = {'\"','a',0x30a,'\"','<','\"',0xe5,'\"',0};
1170 static const WCHAR cond2[] = {'\"','a',0x30a,'\"','>','\"',0xe5,'\"',0};
1171 static const WCHAR cond3[] = {'\"','a',0x30a,'\"','<','>','\"',0xe5,'\"',0};
1172 static const WCHAR cond4[] = {'\"','a',0x30a,'\"','=','\"',0xe5,'\"',0};
1176 r = package_from_db(create_package_db(), &hpkg);
1177 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1179 skip("Not enough rights to perform tests\n");
1180 DeleteFile(msifile);
1183 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1185 r = MsiEvaluateCondition(0, NULL);
1186 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1188 r = MsiEvaluateCondition(hpkg, NULL);
1189 ok( r == MSICONDITION_NONE, "wrong return val\n");
1191 r = MsiEvaluateCondition(hpkg, "");
1192 ok( r == MSICONDITION_NONE, "wrong return val\n");
1194 r = MsiEvaluateCondition(hpkg, "1");
1195 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1197 r = MsiEvaluateCondition(hpkg, "0");
1198 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1200 r = MsiEvaluateCondition(hpkg, "-1");
1201 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1203 r = MsiEvaluateCondition(hpkg, "0 = 0");
1204 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1206 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1207 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1209 r = MsiEvaluateCondition(hpkg, "0 = 1");
1210 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1212 r = MsiEvaluateCondition(hpkg, "0 > 1");
1213 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1215 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1216 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1218 r = MsiEvaluateCondition(hpkg, "1 > 1");
1219 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1221 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1222 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1224 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1225 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1227 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1228 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1230 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1231 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1233 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1234 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1236 r = MsiEvaluateCondition(hpkg, "0 < 1");
1237 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1239 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1240 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1242 r = MsiEvaluateCondition(hpkg, "1 < 1");
1243 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1245 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1246 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1248 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1249 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1251 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1252 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1254 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1255 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1257 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1258 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1260 r = MsiEvaluateCondition(hpkg, "0 >=");
1261 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1263 r = MsiEvaluateCondition(hpkg, " ");
1264 ok( r == MSICONDITION_NONE, "wrong return val\n");
1266 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1267 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1269 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1270 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1272 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1273 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1275 r = MsiEvaluateCondition(hpkg, "not 0");
1276 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1278 r = MsiEvaluateCondition(hpkg, "not LicView");
1279 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1281 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1282 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1284 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1285 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1287 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1288 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1290 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1291 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1293 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1294 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1296 r = MsiEvaluateCondition(hpkg, "\"0\"");
1297 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1299 r = MsiEvaluateCondition(hpkg, "1 and 2");
1300 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1302 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1303 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1305 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1306 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1308 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1309 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1311 r = MsiEvaluateCondition(hpkg, "(0)");
1312 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1314 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1315 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1317 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1318 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1320 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1321 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1323 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1324 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1326 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1327 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1329 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1330 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1332 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1333 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1335 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1336 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1338 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1339 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1341 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1342 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1344 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1345 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1347 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1348 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1350 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1351 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1353 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1354 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1356 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1357 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1359 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1360 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1362 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1363 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1365 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1366 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1368 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1369 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1371 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1372 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1374 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1375 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1377 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1378 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1380 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1381 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1383 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1384 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1386 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1387 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1389 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1390 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1392 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1393 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1395 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1396 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1398 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1399 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1401 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1402 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1404 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1405 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1407 MsiSetProperty(hpkg, "mm", "5" );
1409 r = MsiEvaluateCondition(hpkg, "mm = 5");
1410 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1412 r = MsiEvaluateCondition(hpkg, "mm < 6");
1413 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1415 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1416 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1418 r = MsiEvaluateCondition(hpkg, "mm > 4");
1419 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1421 r = MsiEvaluateCondition(hpkg, "mm < 12");
1422 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1424 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1425 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1427 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1428 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1430 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1431 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1433 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1434 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1436 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1437 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1439 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1440 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1442 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1443 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1445 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1446 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1448 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1449 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1451 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1452 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1454 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1455 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1457 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1458 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1460 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1461 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1463 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1464 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1466 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1467 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1469 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1470 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1472 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1473 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1475 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1476 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1478 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1479 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1481 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1482 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1484 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1485 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1487 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1488 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1490 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1491 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1493 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1494 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1496 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1497 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1499 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1500 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1502 MsiSetProperty(hpkg, "bandalmael", "0" );
1503 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1504 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1506 MsiSetProperty(hpkg, "bandalmael", "" );
1507 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1508 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1510 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1511 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1512 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1514 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1515 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1516 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1518 MsiSetProperty(hpkg, "bandalmael", "0 " );
1519 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1520 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1522 MsiSetProperty(hpkg, "bandalmael", "-0" );
1523 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1524 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1526 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1527 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1528 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1530 MsiSetProperty(hpkg, "bandalmael", "--0" );
1531 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1532 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1534 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1535 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1536 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1538 MsiSetProperty(hpkg, "bandalmael", "-" );
1539 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1540 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1542 MsiSetProperty(hpkg, "bandalmael", "+0" );
1543 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1544 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1546 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1547 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1548 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1549 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1550 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1552 MsiSetProperty(hpkg, "one", "hi");
1553 MsiSetProperty(hpkg, "two", "hithere");
1554 r = MsiEvaluateCondition(hpkg, "one >< two");
1555 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1557 MsiSetProperty(hpkg, "one", "hithere");
1558 MsiSetProperty(hpkg, "two", "hi");
1559 r = MsiEvaluateCondition(hpkg, "one >< two");
1560 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1562 MsiSetProperty(hpkg, "one", "hello");
1563 MsiSetProperty(hpkg, "two", "hi");
1564 r = MsiEvaluateCondition(hpkg, "one >< two");
1565 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1567 MsiSetProperty(hpkg, "one", "hellohithere");
1568 MsiSetProperty(hpkg, "two", "hi");
1569 r = MsiEvaluateCondition(hpkg, "one >< two");
1570 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1572 MsiSetProperty(hpkg, "one", "");
1573 MsiSetProperty(hpkg, "two", "hi");
1574 r = MsiEvaluateCondition(hpkg, "one >< two");
1575 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1577 MsiSetProperty(hpkg, "one", "hi");
1578 MsiSetProperty(hpkg, "two", "");
1579 r = MsiEvaluateCondition(hpkg, "one >< two");
1580 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1582 MsiSetProperty(hpkg, "one", "");
1583 MsiSetProperty(hpkg, "two", "");
1584 r = MsiEvaluateCondition(hpkg, "one >< two");
1585 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1587 MsiSetProperty(hpkg, "one", "1234");
1588 MsiSetProperty(hpkg, "two", "1");
1589 r = MsiEvaluateCondition(hpkg, "one >< two");
1590 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1592 MsiSetProperty(hpkg, "one", "one 1234");
1593 MsiSetProperty(hpkg, "two", "1");
1594 r = MsiEvaluateCondition(hpkg, "one >< two");
1595 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1597 MsiSetProperty(hpkg, "one", "hithere");
1598 MsiSetProperty(hpkg, "two", "hi");
1599 r = MsiEvaluateCondition(hpkg, "one << two");
1600 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1602 MsiSetProperty(hpkg, "one", "hi");
1603 MsiSetProperty(hpkg, "two", "hithere");
1604 r = MsiEvaluateCondition(hpkg, "one << two");
1605 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1607 MsiSetProperty(hpkg, "one", "hi");
1608 MsiSetProperty(hpkg, "two", "hi");
1609 r = MsiEvaluateCondition(hpkg, "one << two");
1610 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1612 MsiSetProperty(hpkg, "one", "abcdhithere");
1613 MsiSetProperty(hpkg, "two", "hi");
1614 r = MsiEvaluateCondition(hpkg, "one << two");
1615 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1617 MsiSetProperty(hpkg, "one", "");
1618 MsiSetProperty(hpkg, "two", "hi");
1619 r = MsiEvaluateCondition(hpkg, "one << two");
1620 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1622 MsiSetProperty(hpkg, "one", "hithere");
1623 MsiSetProperty(hpkg, "two", "");
1624 r = MsiEvaluateCondition(hpkg, "one << two");
1625 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1627 MsiSetProperty(hpkg, "one", "");
1628 MsiSetProperty(hpkg, "two", "");
1629 r = MsiEvaluateCondition(hpkg, "one << two");
1630 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1632 MsiSetProperty(hpkg, "one", "1234");
1633 MsiSetProperty(hpkg, "two", "1");
1634 r = MsiEvaluateCondition(hpkg, "one << two");
1635 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1637 MsiSetProperty(hpkg, "one", "1234 one");
1638 MsiSetProperty(hpkg, "two", "1");
1639 r = MsiEvaluateCondition(hpkg, "one << two");
1640 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1642 MsiSetProperty(hpkg, "one", "hithere");
1643 MsiSetProperty(hpkg, "two", "there");
1644 r = MsiEvaluateCondition(hpkg, "one >> two");
1645 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1647 MsiSetProperty(hpkg, "one", "hithere");
1648 MsiSetProperty(hpkg, "two", "hi");
1649 r = MsiEvaluateCondition(hpkg, "one >> two");
1650 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1652 MsiSetProperty(hpkg, "one", "there");
1653 MsiSetProperty(hpkg, "two", "hithere");
1654 r = MsiEvaluateCondition(hpkg, "one >> two");
1655 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1657 MsiSetProperty(hpkg, "one", "there");
1658 MsiSetProperty(hpkg, "two", "there");
1659 r = MsiEvaluateCondition(hpkg, "one >> two");
1660 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1662 MsiSetProperty(hpkg, "one", "abcdhithere");
1663 MsiSetProperty(hpkg, "two", "hi");
1664 r = MsiEvaluateCondition(hpkg, "one >> two");
1665 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1667 MsiSetProperty(hpkg, "one", "");
1668 MsiSetProperty(hpkg, "two", "there");
1669 r = MsiEvaluateCondition(hpkg, "one >> two");
1670 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1672 MsiSetProperty(hpkg, "one", "there");
1673 MsiSetProperty(hpkg, "two", "");
1674 r = MsiEvaluateCondition(hpkg, "one >> two");
1675 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1677 MsiSetProperty(hpkg, "one", "");
1678 MsiSetProperty(hpkg, "two", "");
1679 r = MsiEvaluateCondition(hpkg, "one >> two");
1680 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1682 MsiSetProperty(hpkg, "one", "1234");
1683 MsiSetProperty(hpkg, "two", "4");
1684 r = MsiEvaluateCondition(hpkg, "one >> two");
1685 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1687 MsiSetProperty(hpkg, "one", "one 1234");
1688 MsiSetProperty(hpkg, "two", "4");
1689 r = MsiEvaluateCondition(hpkg, "one >> two");
1690 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1692 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1694 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1695 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1697 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1698 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1700 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1701 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1703 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1704 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1706 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1707 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1709 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1710 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1712 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1713 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1715 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1716 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1718 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1719 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1721 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1722 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1724 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1725 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1727 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1728 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1730 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1731 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1733 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1734 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1736 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1737 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1739 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1740 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1742 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1743 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1745 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1746 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1748 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1749 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1751 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1752 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1754 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1755 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1757 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1758 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1760 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1761 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1763 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1764 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1766 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1767 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1769 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1770 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1772 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1773 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1775 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1776 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1778 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1779 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1781 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1782 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1784 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1785 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1787 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1788 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1790 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1791 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1793 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1794 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1796 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1797 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1799 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1800 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1802 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1803 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1805 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1806 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1807 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1809 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1810 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1812 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1813 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1815 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1816 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1818 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1819 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1821 MsiSetProperty(hpkg, "one", "1");
1822 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1823 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1825 MsiSetProperty(hpkg, "X", "5.0");
1827 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1828 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1830 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1831 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1833 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1834 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1836 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1837 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1839 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1840 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1842 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1843 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1845 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1846 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1848 /* feature doesn't exist */
1849 r = MsiEvaluateCondition(hpkg, "&nofeature");
1850 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1852 MsiSetProperty(hpkg, "A", "2");
1853 MsiSetProperty(hpkg, "X", "50");
1855 r = MsiEvaluateCondition(hpkg, "2 <= X");
1856 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1858 r = MsiEvaluateCondition(hpkg, "A <= X");
1859 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1861 r = MsiEvaluateCondition(hpkg, "A <= 50");
1862 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1864 MsiSetProperty(hpkg, "X", "50val");
1866 r = MsiEvaluateCondition(hpkg, "2 <= X");
1867 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1869 r = MsiEvaluateCondition(hpkg, "A <= X");
1870 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1872 MsiSetProperty(hpkg, "A", "7");
1873 MsiSetProperty(hpkg, "X", "50");
1875 r = MsiEvaluateCondition(hpkg, "7 <= X");
1876 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1878 r = MsiEvaluateCondition(hpkg, "A <= X");
1879 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1881 r = MsiEvaluateCondition(hpkg, "A <= 50");
1882 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1884 MsiSetProperty(hpkg, "X", "50val");
1886 r = MsiEvaluateCondition(hpkg, "2 <= X");
1887 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1889 r = MsiEvaluateCondition(hpkg, "A <= X");
1890 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1892 r = MsiEvaluateConditionW(hpkg, cond1);
1893 ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
1894 "wrong return val (%d)\n", r);
1896 r = MsiEvaluateConditionW(hpkg, cond2);
1897 ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
1898 "wrong return val (%d)\n", r);
1900 r = MsiEvaluateConditionW(hpkg, cond3);
1901 ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
1902 "wrong return val (%d)\n", r);
1904 r = MsiEvaluateConditionW(hpkg, cond4);
1905 ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
1906 "wrong return val (%d)\n", r);
1908 MsiCloseHandle( hpkg );
1909 DeleteFile(msifile);
1912 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1920 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1921 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1924 static void test_props(void)
1926 MSIHANDLE hpkg, hdb;
1931 hdb = create_package_db();
1933 "CREATE TABLE `Property` ( "
1934 "`Property` CHAR(255) NOT NULL, "
1935 "`Value` CHAR(255) "
1936 "PRIMARY KEY `Property`)" );
1937 ok( r == ERROR_SUCCESS , "Failed\n" );
1940 "INSERT INTO `Property` "
1941 "(`Property`, `Value`) "
1942 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1943 ok( r == ERROR_SUCCESS , "Failed\n" );
1945 r = package_from_db( hdb, &hpkg );
1946 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1948 skip("Not enough rights to perform tests\n");
1949 DeleteFile(msifile);
1952 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1954 /* test invalid values */
1955 r = MsiGetProperty( 0, NULL, NULL, NULL );
1956 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1958 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1959 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1961 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1962 ok( r == ERROR_SUCCESS, "wrong return val\n");
1964 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1965 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1967 /* test retrieving an empty/nonexistent property */
1969 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1970 ok( r == ERROR_SUCCESS, "wrong return val\n");
1971 ok( sz == 0, "wrong size returned\n");
1973 check_prop_empty( hpkg, "boo");
1976 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1977 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1978 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1979 ok( sz == 0, "wrong size returned\n");
1983 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1984 ok( r == ERROR_SUCCESS, "wrong return val\n");
1985 ok( buffer[0] == 0, "buffer was not changed\n");
1986 ok( sz == 0, "wrong size returned\n");
1988 /* set the property to something */
1989 r = MsiSetProperty( 0, NULL, NULL );
1990 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1992 r = MsiSetProperty( hpkg, NULL, NULL );
1993 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1995 r = MsiSetProperty( hpkg, "", NULL );
1996 ok( r == ERROR_SUCCESS, "wrong return val\n");
1998 /* try set and get some illegal property identifiers */
1999 r = MsiSetProperty( hpkg, "", "asdf" );
2000 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
2002 r = MsiSetProperty( hpkg, "=", "asdf" );
2003 ok( r == ERROR_SUCCESS, "wrong return val\n");
2005 r = MsiSetProperty( hpkg, " ", "asdf" );
2006 ok( r == ERROR_SUCCESS, "wrong return val\n");
2008 r = MsiSetProperty( hpkg, "'", "asdf" );
2009 ok( r == ERROR_SUCCESS, "wrong return val\n");
2013 r = MsiGetProperty( hpkg, "'", buffer, &sz );
2014 ok( r == ERROR_SUCCESS, "wrong return val\n");
2015 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
2017 /* set empty values */
2018 r = MsiSetProperty( hpkg, "boo", NULL );
2019 ok( r == ERROR_SUCCESS, "wrong return val\n");
2020 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2022 r = MsiSetProperty( hpkg, "boo", "" );
2023 ok( r == ERROR_SUCCESS, "wrong return val\n");
2024 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2026 /* set a non-empty value */
2027 r = MsiSetProperty( hpkg, "boo", "xyz" );
2028 ok( r == ERROR_SUCCESS, "wrong return val\n");
2032 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2033 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2034 ok( buffer[0] == 0, "buffer was not changed\n");
2035 ok( sz == 3, "wrong size returned\n");
2039 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2040 ok( r == ERROR_SUCCESS, "wrong return val\n");
2041 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
2042 ok( sz == 3, "wrong size returned\n");
2046 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2047 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2048 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
2049 ok( sz == 3, "wrong size returned\n");
2051 r = MsiSetProperty(hpkg, "SourceDir", "foo");
2052 ok( r == ERROR_SUCCESS, "wrong return val\n");
2055 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
2056 ok( r == ERROR_SUCCESS, "wrong return val\n");
2057 ok( !strcmp(buffer,""), "buffer wrong\n");
2058 ok( sz == 0, "wrong size returned\n");
2061 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
2062 ok( r == ERROR_SUCCESS, "wrong return val\n");
2063 ok( !strcmp(buffer,""), "buffer wrong\n");
2064 ok( sz == 0, "wrong size returned\n");
2067 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
2068 ok( r == ERROR_SUCCESS, "wrong return val\n");
2069 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
2070 ok( sz == 3, "wrong size returned\n");
2072 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
2073 ok( r == ERROR_SUCCESS, "wrong return val\n");
2076 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
2077 ok( r == ERROR_SUCCESS, "return wrong\n");
2078 ok( sz == 13, "size wrong (%d)\n", sz);
2081 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
2082 ok( r == ERROR_MORE_DATA, "return wrong\n");
2083 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
2085 r = MsiSetProperty(hpkg, "property", "value");
2086 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2089 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2091 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
2093 r = MsiSetProperty(hpkg, "property", NULL);
2094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2097 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2099 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
2101 MsiCloseHandle( hpkg );
2102 DeleteFile(msifile);
2105 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
2107 MSIHANDLE hview, hrec;
2109 CHAR buffer[MAX_PATH];
2113 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
2114 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
2115 r = MsiViewExecute(hview, 0);
2116 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
2119 while (r == ERROR_SUCCESS && !found)
2121 r = MsiViewFetch(hview, &hrec);
2122 if (r != ERROR_SUCCESS) break;
2125 r = MsiRecordGetString(hrec, 1, buffer, &sz);
2126 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
2129 r = MsiRecordGetString(hrec, 2, buffer, &sz);
2130 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
2134 MsiCloseHandle(hrec);
2137 MsiViewClose(hview);
2138 MsiCloseHandle(hview);
2143 static void test_property_table(void)
2147 MSIHANDLE hpkg, hdb, hrec;
2148 char buffer[MAX_PATH], package[10];
2152 hdb = create_package_db();
2153 ok( hdb, "failed to create package\n");
2155 r = package_from_db(hdb, &hpkg);
2156 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2158 skip("Not enough rights to perform tests\n");
2159 DeleteFile(msifile);
2162 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2164 MsiCloseHandle(hdb);
2166 hdb = MsiGetActiveDatabase(hpkg);
2168 query = "CREATE TABLE `_Property` ( "
2169 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2170 r = run_query(hdb, query);
2171 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2173 MsiCloseHandle(hdb);
2174 MsiCloseHandle(hpkg);
2175 DeleteFile(msifile);
2177 hdb = create_package_db();
2178 ok( hdb, "failed to create package\n");
2180 query = "CREATE TABLE `_Property` ( "
2181 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2182 r = run_query(hdb, query);
2183 ok(r == ERROR_SUCCESS, "failed to create table\n");
2185 query = "ALTER `_Property` ADD `foo` INTEGER";
2186 r = run_query(hdb, query);
2187 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2189 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2190 r = run_query(hdb, query);
2191 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2193 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2194 r = run_query(hdb, query);
2195 ok(r == ERROR_SUCCESS, "failed to add column\n");
2197 sprintf(package, "#%i", hdb);
2198 r = MsiOpenPackage(package, &hpkg);
2199 todo_wine ok(r != ERROR_SUCCESS, "MsiOpenPackage succeeded\n");
2200 if (r == ERROR_SUCCESS)
2201 MsiCloseHandle(hpkg);
2203 r = MsiCloseHandle(hdb);
2204 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
2206 hdb = create_package_db();
2207 ok (hdb, "failed to create package database\n");
2209 r = create_property_table(hdb);
2210 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2212 r = add_property_entry(hdb, "'prop', 'val'");
2213 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2215 r = package_from_db(hdb, &hpkg);
2216 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
2218 MsiCloseHandle(hdb);
2221 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2222 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2223 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2225 hdb = MsiGetActiveDatabase(hpkg);
2227 found = find_prop_in_property(hdb, "prop", "val");
2228 ok(found, "prop should be in the _Property table\n");
2230 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2231 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2233 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2234 r = do_query(hdb, query, &hrec);
2235 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2237 found = find_prop_in_property(hdb, "dantes", "mercedes");
2238 ok(found == FALSE, "dantes should not be in the _Property table\n");
2241 lstrcpy(buffer, "aaa");
2242 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2243 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2244 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2246 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2247 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2249 found = find_prop_in_property(hdb, "dantes", "mercedes");
2250 ok(found == TRUE, "dantes should be in the _Property table\n");
2252 MsiCloseHandle(hdb);
2253 MsiCloseHandle(hpkg);
2254 DeleteFile(msifile);
2257 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2262 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2263 if( res == ERROR_SUCCESS )
2267 r = MsiViewExecute( htab, hrec );
2268 if( r != ERROR_SUCCESS )
2271 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2274 r = MsiViewClose( htab );
2275 if( r != ERROR_SUCCESS )
2278 r = MsiCloseHandle( htab );
2279 if( r != ERROR_SUCCESS )
2285 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2287 return try_query_param( hdb, szQuery, 0 );
2290 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2295 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2296 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2298 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2299 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2301 r = MsiSummaryInfoPersist(summary);
2302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2304 MsiCloseHandle(summary);
2307 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2312 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2313 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2315 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2318 r = MsiSummaryInfoPersist(summary);
2319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2321 MsiCloseHandle(summary);
2324 static void test_msipackage(void)
2326 MSIHANDLE hdb = 0, hpack = 100;
2331 /* NULL szPackagePath */
2332 r = MsiOpenPackage(NULL, &hpack);
2333 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2335 /* empty szPackagePath */
2336 r = MsiOpenPackage("", &hpack);
2337 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2339 skip("Not enough rights to perform tests\n");
2344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2347 if (r == ERROR_SUCCESS)
2348 MsiCloseHandle(hpack);
2350 /* nonexistent szPackagePath */
2351 r = MsiOpenPackage("nonexistent", &hpack);
2352 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2355 r = MsiOpenPackage(msifile, NULL);
2356 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2360 r = MsiOpenPackage(name, &hpack);
2361 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2363 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2366 /* database exists, but is emtpy */
2367 sprintf(name, "#%d", hdb);
2368 r = MsiOpenPackage(name, &hpack);
2369 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2370 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2372 query = "CREATE TABLE `Property` ( "
2373 "`Property` CHAR(72), `Value` CHAR(0) "
2374 "PRIMARY KEY `Property`)";
2375 r = try_query(hdb, query);
2376 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2378 query = "CREATE TABLE `InstallExecuteSequence` ("
2379 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2380 "PRIMARY KEY `Action`)";
2381 r = try_query(hdb, query);
2382 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2384 /* a few key tables exist */
2385 sprintf(name, "#%d", hdb);
2386 r = MsiOpenPackage(name, &hpack);
2387 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2388 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2390 MsiCloseHandle(hdb);
2391 DeleteFile(msifile);
2393 /* start with a clean database to show what constitutes a valid package */
2394 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2397 sprintf(name, "#%d", hdb);
2399 /* The following summary information props must exist:
2404 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2405 r = MsiOpenPackage(name, &hpack);
2406 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2407 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2409 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2410 r = MsiOpenPackage(name, &hpack);
2411 ok(r == ERROR_SUCCESS,
2412 "Expected ERROR_SUCCESS, got %d\n", r);
2414 MsiCloseHandle(hpack);
2415 MsiCloseHandle(hdb);
2416 DeleteFile(msifile);
2419 static void test_formatrecord2(void)
2421 MSIHANDLE hpkg, hrec ;
2426 r = package_from_db(create_package_db(), &hpkg);
2427 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2429 skip("Not enough rights to perform tests\n");
2430 DeleteFile(msifile);
2433 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2435 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2436 ok( r == ERROR_SUCCESS, "set property failed\n");
2438 hrec = MsiCreateRecord(2);
2439 ok(hrec, "create record failed\n");
2441 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2442 ok( r == ERROR_SUCCESS, "format record failed\n");
2446 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2448 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2449 r = MsiRecordSetString(hrec, 1, "hoo");
2451 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2452 ok( sz == 3, "size wrong\n");
2453 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2454 ok( r == ERROR_SUCCESS, "format failed\n");
2456 r = MsiRecordSetString(hrec, 0, "x[~]x");
2458 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2459 ok( sz == 3, "size wrong\n");
2460 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2461 ok( r == ERROR_SUCCESS, "format failed\n");
2463 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2464 r = MsiRecordSetString(hrec, 1, "hoo");
2466 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2467 ok( sz == 3, "size wrong\n");
2468 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2469 ok( r == ERROR_SUCCESS, "format failed\n");
2471 r = MsiRecordSetString(hrec, 0, "[\\[]");
2473 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2474 ok( sz == 1, "size wrong\n");
2475 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2476 ok( r == ERROR_SUCCESS, "format failed\n");
2478 SetEnvironmentVariable("FOO", "BAR");
2479 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2481 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2482 ok( sz == 3, "size wrong\n");
2483 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2484 ok( r == ERROR_SUCCESS, "format failed\n");
2486 r = MsiRecordSetString(hrec, 0, "[[1]]");
2487 r = MsiRecordSetString(hrec, 1, "%FOO");
2489 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2490 ok( sz == 3, "size wrong\n");
2491 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2492 ok( r == ERROR_SUCCESS, "format failed\n");
2494 MsiCloseHandle( hrec );
2495 MsiCloseHandle( hpkg );
2496 DeleteFile(msifile);
2499 static void test_states(void)
2504 INSTALLSTATE state, action;
2506 static const CHAR msifile2[] = "winetest2-package.msi";
2507 static const CHAR msifile3[] = "winetest3-package.msi";
2508 static const CHAR msifile4[] = "winetest4-package.msi";
2510 if (is_process_limited())
2512 skip("process is limited\n");
2516 hdb = create_package_db();
2517 ok ( hdb, "failed to create package database\n" );
2519 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2520 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2522 r = create_property_table( hdb );
2523 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2525 r = add_property_entry( hdb, "'ProductCode', '{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
2526 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2528 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2529 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2531 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2532 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2534 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2535 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2537 r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
2538 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2540 r = create_install_execute_sequence_table( hdb );
2541 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2543 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2544 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2546 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2547 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2549 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2550 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2552 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2553 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2555 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2556 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2558 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2559 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2561 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2562 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2564 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2565 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2567 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2568 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2570 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2571 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2573 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2574 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2576 r = create_media_table( hdb );
2577 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2579 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2580 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2582 r = create_feature_table( hdb );
2583 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2585 r = create_component_table( hdb );
2586 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2588 /* msidbFeatureAttributesFavorLocal */
2589 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2590 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2592 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2593 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2594 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2596 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2597 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2598 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2600 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2601 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2602 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2604 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2605 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2606 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2608 /* msidbFeatureAttributesFavorSource */
2609 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2610 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2612 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2613 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2614 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2616 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2617 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2618 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2620 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2621 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2622 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2624 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2625 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2626 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2628 /* msidbFeatureAttributesFavorSource */
2629 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2630 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2632 /* msidbFeatureAttributesFavorLocal */
2633 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2634 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2637 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2638 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2640 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2641 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2642 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2644 /* no feature parent:msidbComponentAttributesLocalOnly */
2645 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2646 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2648 /* msidbFeatureAttributesFavorLocal:removed */
2649 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2650 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2652 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2653 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2654 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2656 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2657 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2658 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2660 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2661 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2662 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2664 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2665 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2666 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2668 /* msidbFeatureAttributesFavorSource:removed */
2669 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2670 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2672 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2673 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2674 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2676 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2677 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2678 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2680 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2681 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2682 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2684 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2685 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2686 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2688 /* msidbFeatureAttributesFavorLocal */
2689 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2690 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2692 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2693 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2695 /* msidbFeatureAttributesFavorSource */
2696 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2697 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2699 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2700 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2702 /* msidbFeatureAttributesFavorAdvertise */
2703 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2704 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2706 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2707 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2709 /* msidbFeatureAttributesUIDisallowAbsent */
2710 r = add_feature_entry( hdb, "'eleven', '', '', '', 2, 1, '', 16" );
2711 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2713 r = add_component_entry( hdb, "'psi', '{A06B23B5-746B-427A-8A6E-FD6AC8F46A95}', 'TARGETDIR', 1, '', 'psi_file'" );
2714 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2716 r = create_feature_components_table( hdb );
2717 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2719 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2720 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2722 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2723 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2725 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2726 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2728 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2729 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2731 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2732 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2734 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2735 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2737 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2738 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2740 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2741 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2743 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2744 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2746 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2747 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2749 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2750 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2752 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2753 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2755 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2756 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2758 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2759 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2761 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2762 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2764 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2765 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2767 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2768 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2770 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2771 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2773 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2774 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2776 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2777 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2779 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2780 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2782 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2783 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2785 r = add_feature_components_entry( hdb, "'eleven', 'psi'" );
2786 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2788 r = create_file_table( hdb );
2789 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2791 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2792 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2794 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2795 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2797 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2798 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2800 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2801 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2803 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2804 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2806 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2807 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2809 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2810 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2812 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2813 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2815 /* compressed file */
2816 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2817 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2819 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2820 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2822 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2823 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2825 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2826 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2828 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2829 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2831 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2832 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2834 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2835 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2837 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2838 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2840 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2841 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2843 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2844 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2846 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2847 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2849 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2850 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2852 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2853 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2855 r = add_file_entry( hdb, "'psi_file', 'psi', 'psi.txt', 100, '', '1033', 8192, 1" );
2856 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2858 MsiDatabaseCommit(hdb);
2860 /* these properties must not be in the saved msi file */
2861 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2862 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2864 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2865 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2867 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2868 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2870 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2871 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2873 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2874 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2876 r = package_from_db( hdb, &hpkg );
2877 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2879 skip("Not enough rights to perform tests\n");
2880 DeleteFile(msifile);
2883 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
2885 MsiCloseHandle(hdb);
2887 CopyFileA(msifile, msifile2, FALSE);
2888 CopyFileA(msifile, msifile3, FALSE);
2889 CopyFileA(msifile, msifile4, FALSE);
2893 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2894 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2895 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2896 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2900 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2901 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2902 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2903 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2907 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2908 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2909 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2910 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2914 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2915 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2916 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2917 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2921 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2922 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2923 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2924 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2928 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2929 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2930 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2931 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2935 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2936 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2937 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2938 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2942 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2943 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2944 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2945 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2949 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2950 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2951 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2952 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2956 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2957 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2958 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2959 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2963 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
2964 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2965 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2966 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2970 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2971 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2972 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2973 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2977 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2978 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2979 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2980 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2984 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2985 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2986 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2987 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2991 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2992 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2993 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2994 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2998 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2999 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3000 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3001 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3005 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3006 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3007 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3008 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3012 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3013 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3014 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3015 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3019 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3020 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3021 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3022 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3026 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3027 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3028 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3029 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3033 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3034 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3035 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3036 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3040 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3041 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3042 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3043 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3047 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3048 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3049 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3050 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3054 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3055 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3056 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3057 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3061 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3062 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3063 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3064 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3068 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3069 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3070 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3071 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3075 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3076 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3077 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3078 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3082 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3083 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3084 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3085 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3089 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3090 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3091 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3092 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3096 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3097 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3098 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3099 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3103 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3104 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3105 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3106 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3110 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3111 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3112 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3113 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3117 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3118 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3119 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3120 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3122 r = MsiDoAction( hpkg, "CostInitialize");
3123 ok( r == ERROR_SUCCESS, "cost init failed\n");
3127 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3134 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3141 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3148 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3155 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3162 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3164 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3165 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3169 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3171 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3176 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3178 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3183 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3185 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3186 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3190 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3192 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3193 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3197 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3199 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3200 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3204 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3206 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3207 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3211 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3212 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3213 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3214 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3218 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3219 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3220 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3221 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3225 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3226 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3227 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3228 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3232 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3234 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3235 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3239 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3241 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3242 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3246 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3248 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3249 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3253 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3255 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3256 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3260 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3262 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3263 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3267 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3269 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3270 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3274 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3275 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3276 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3277 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3281 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3283 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3284 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3288 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3290 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3291 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3295 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3297 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3298 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3302 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3304 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3305 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3309 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3310 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3311 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3312 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3316 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3318 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3319 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3323 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3325 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3326 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3330 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3332 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3333 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3337 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3339 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3340 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3344 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3346 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3347 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3351 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3353 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3354 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3356 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3358 r = MsiDoAction( hpkg, "FileCost");
3359 ok( r == ERROR_SUCCESS, "file cost failed\n");
3361 r = MsiGetFeatureState(hpkg, "one", NULL, NULL);
3362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3365 r = MsiGetFeatureState(hpkg, "one", NULL, &action);
3366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3367 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3370 r = MsiGetFeatureState( hpkg, "one", &state, NULL);
3371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3372 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3376 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3377 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3378 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3379 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3383 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3384 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3385 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3386 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3390 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3391 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3392 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3393 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3397 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3398 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3399 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3400 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3404 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3405 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3406 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3407 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3411 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3412 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3413 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3414 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3418 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3419 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3420 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3421 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3425 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3426 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3427 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3428 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3432 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3433 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3434 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3435 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3439 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3440 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3441 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3442 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3446 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3447 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3448 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3449 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3453 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3454 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3455 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3456 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3460 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3461 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3462 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3463 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3467 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3468 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3469 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3470 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3474 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3475 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3476 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3477 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3481 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3482 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3483 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3484 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3488 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3489 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3490 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3491 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3495 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3496 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3497 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3498 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3502 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3503 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3504 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3505 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3509 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3510 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3511 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3512 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3516 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3517 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3518 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3519 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3523 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3524 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3525 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3526 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3530 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3531 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3532 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3533 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3537 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3538 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3539 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3540 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3544 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3545 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3546 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3547 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3551 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3552 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3553 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3554 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3558 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3559 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3560 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3561 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3565 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3566 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3567 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3568 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3572 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3573 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3574 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3575 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3579 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3580 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3581 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3582 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3586 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3587 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3588 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3589 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3593 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3594 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3595 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3596 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3600 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3601 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3602 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3603 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3605 r = MsiDoAction( hpkg, "CostFinalize");
3606 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3610 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3611 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3612 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3613 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3617 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3618 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3619 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3620 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3624 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3625 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3626 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3627 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3631 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3632 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3633 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3634 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3638 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3639 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3640 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3641 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3645 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3646 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3647 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3648 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3652 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3654 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3655 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3659 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3660 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3661 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3662 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3666 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3668 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3669 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3673 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3675 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3676 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3680 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3681 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3682 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3683 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3687 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3688 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3689 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3690 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3694 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3695 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3696 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3697 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3701 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3703 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3704 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3708 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3710 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3711 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3715 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3716 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3717 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3718 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3722 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3723 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3724 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3725 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3729 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3730 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3731 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3732 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3736 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3737 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3738 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3739 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3743 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3744 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3745 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3746 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3750 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3751 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3752 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3753 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3757 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3758 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3759 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3760 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3764 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3765 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3766 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3767 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3771 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3772 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3773 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3774 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3778 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3779 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3780 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3781 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3785 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3786 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3787 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3788 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3792 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3793 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3794 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3795 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3799 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3800 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3801 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3802 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3806 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3807 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3808 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3809 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3813 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3814 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3815 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3816 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3820 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3821 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3822 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3823 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3827 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3828 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3829 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3830 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3834 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3835 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3836 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3837 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3839 MsiCloseHandle( hpkg );
3841 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3843 /* publish the features and components */
3844 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3847 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3848 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3850 /* these properties must not be in the saved msi file */
3851 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3852 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3854 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3855 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3857 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3858 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3860 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3861 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3863 r = package_from_db( hdb, &hpkg );
3864 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
3866 MsiCloseHandle(hdb);
3870 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3871 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3872 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3873 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3877 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3878 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3879 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3880 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3884 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3885 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3886 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3887 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3891 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3892 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3893 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3894 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3898 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3899 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3900 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3901 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3905 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3906 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3907 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3908 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3912 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3913 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3914 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3915 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3919 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3920 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3921 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3922 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3926 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3927 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3928 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3929 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3933 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3934 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3935 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3936 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3940 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3941 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3942 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3943 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3947 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3948 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3949 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3950 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3954 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3955 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3956 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3957 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3961 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3962 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3963 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3964 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3968 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3969 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3970 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3971 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3975 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3976 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3977 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3978 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3982 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3983 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3984 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3985 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3989 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3990 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3991 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3992 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3996 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3997 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3998 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3999 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4003 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4004 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4005 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4006 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4010 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4011 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4012 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4013 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4017 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4018 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4019 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4020 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4024 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4025 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4026 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4027 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4031 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4032 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4033 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4034 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4038 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4039 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4040 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4041 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4045 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4046 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4047 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4048 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4052 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4053 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4054 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4055 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4059 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4060 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4061 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4062 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4066 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4067 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4068 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4069 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4073 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4074 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4075 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4076 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4080 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4081 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4082 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4083 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4087 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4088 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4089 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4090 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4094 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4095 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4096 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4097 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4099 r = MsiDoAction( hpkg, "CostInitialize");
4100 ok( r == ERROR_SUCCESS, "cost init failed\n");
4104 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4106 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4107 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4111 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4112 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4113 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4114 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4118 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4120 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4121 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4125 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4126 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4127 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4128 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4132 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4133 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4134 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4135 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4139 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4140 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4141 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4142 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4146 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4147 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4148 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4149 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4153 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4155 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4156 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4160 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4161 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4162 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4163 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4167 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4168 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4169 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4170 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4174 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4175 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4176 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4177 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4181 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4182 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4183 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4184 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4188 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4190 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4191 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4195 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4197 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4198 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4202 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4204 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4205 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4209 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4211 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4212 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4216 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4218 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4219 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4223 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4224 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4225 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4226 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4230 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4232 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4233 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4237 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4238 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4239 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4240 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4244 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4245 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4246 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4247 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4251 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4253 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4254 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4258 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4260 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4261 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4265 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4266 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4267 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4268 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4272 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4274 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4275 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4279 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4281 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4282 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4286 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4288 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4289 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4293 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4295 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4296 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4300 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4301 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4302 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4303 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4307 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4308 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4309 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4310 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4314 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4315 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4316 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4317 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4321 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4322 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4323 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4324 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4328 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4329 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4330 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4331 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4333 r = MsiDoAction( hpkg, "FileCost");
4334 ok( r == ERROR_SUCCESS, "file cost failed\n");
4338 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4339 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4340 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4341 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4345 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4346 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4347 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4348 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4352 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4353 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4354 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4355 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4359 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4360 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4361 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4362 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4366 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4367 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4368 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4369 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4373 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4374 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4375 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4376 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4380 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4381 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4382 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4383 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4387 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4388 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4389 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4390 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4394 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4395 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4396 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4397 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4401 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4402 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4403 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4404 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4408 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4409 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4410 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4411 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4415 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4416 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4417 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4418 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4422 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4423 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4424 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4425 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4429 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4430 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4431 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4432 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4436 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4437 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4438 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4439 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4443 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4444 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4445 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4446 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4450 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4451 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4452 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4453 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4457 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4458 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4459 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4460 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4464 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4465 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4466 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4467 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4471 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4472 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4473 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4474 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4478 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4479 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4480 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4481 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4485 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4486 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4487 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4488 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4492 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4493 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4494 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4495 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4499 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4500 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4501 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4502 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4506 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4507 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4508 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4509 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4513 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4514 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4515 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4516 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4520 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4521 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4522 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4523 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4527 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4528 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4529 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4530 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4534 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4535 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4536 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4537 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4541 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4542 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4543 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4544 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4548 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4549 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4550 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4551 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4553 r = MsiDoAction( hpkg, "CostFinalize");
4554 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4558 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4559 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4560 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4561 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4565 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4566 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4567 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4568 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4572 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4573 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4574 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4575 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4579 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4580 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4581 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4582 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4586 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4587 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4588 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4589 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4593 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4594 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4595 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4596 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4600 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4601 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4602 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4603 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4607 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4608 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4609 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4610 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4614 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4615 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4616 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4617 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4621 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4622 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4623 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4624 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4628 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4629 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4630 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4631 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4635 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4636 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4637 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4638 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4642 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4643 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4644 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4645 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4649 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4650 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4651 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4652 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4656 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4657 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4658 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4659 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4663 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4664 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4665 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4666 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4670 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4671 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4672 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4673 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4677 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4678 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4679 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4680 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4684 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4685 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4686 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4687 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4691 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4692 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4693 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4694 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4698 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4699 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4700 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4701 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4705 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4706 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4707 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4708 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4712 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4713 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4714 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4715 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4719 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4720 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4721 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4722 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4726 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4727 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4728 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4729 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4733 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4734 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4735 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4736 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4740 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4741 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4742 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4743 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4747 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4748 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4749 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4750 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4754 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4755 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4756 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4757 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4761 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4762 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4763 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4764 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4768 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4769 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4770 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4771 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4775 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4776 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4777 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4778 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4782 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4784 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4785 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4787 MsiCloseHandle(hpkg);
4789 /* uninstall the product */
4790 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4791 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4793 /* all features installed locally */
4794 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4797 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4798 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4800 /* these properties must not be in the saved msi file */
4801 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4802 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4804 r = package_from_db( hdb, &hpkg );
4805 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
4809 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4810 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4811 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4812 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4816 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4817 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4818 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4819 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4823 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4824 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4825 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4826 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4830 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4831 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4832 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4833 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4837 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4838 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4839 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4840 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4844 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4845 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4846 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4847 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4851 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4852 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4853 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4854 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4858 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4859 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4860 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4861 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4865 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4866 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4867 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4868 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4872 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4873 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4874 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4875 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4879 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4880 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4881 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4882 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4886 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4887 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4888 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4889 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4893 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4894 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4895 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4896 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4900 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4901 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4902 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4903 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4907 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4908 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4909 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4910 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4914 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4915 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4916 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4917 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4921 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4922 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4923 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4924 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4928 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4929 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4930 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4931 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4935 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4936 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4937 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4938 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4942 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4943 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4944 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4945 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4949 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4950 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4951 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4952 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4956 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4957 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4958 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4959 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4963 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4964 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4965 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4966 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4970 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4971 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4972 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4973 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4977 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4978 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4979 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4980 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4984 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4985 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4986 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4987 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4991 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4992 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4993 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4994 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4998 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4999 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5000 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5001 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5005 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5006 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5007 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5008 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5012 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5013 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5014 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5015 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5019 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5020 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5021 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5022 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5026 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5027 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5028 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5029 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5033 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5034 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5035 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5036 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5038 r = MsiDoAction( hpkg, "CostInitialize");
5039 ok( r == ERROR_SUCCESS, "cost init failed\n");
5043 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5044 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5045 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5046 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5050 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5051 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5052 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5053 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5057 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5058 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5059 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5060 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5064 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5065 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5066 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5067 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5071 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5072 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5073 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5074 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5078 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5079 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5080 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5081 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5085 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5086 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5087 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5088 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5092 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5094 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5095 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5099 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5101 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5102 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5106 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5108 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5113 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5115 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5116 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5120 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5122 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5127 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5134 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5141 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5148 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5155 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5162 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5164 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5165 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5169 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5171 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5176 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5178 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5183 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5185 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5186 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5190 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5192 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5193 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5197 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5199 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5200 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5204 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5206 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5207 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5211 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5212 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5213 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5214 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5218 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5219 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5220 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5221 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5225 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5226 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5227 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5228 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5232 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5234 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5235 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5239 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5241 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5242 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5246 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5248 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5249 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5253 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5255 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5256 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5260 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5262 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5263 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5267 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5269 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5270 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5272 r = MsiDoAction( hpkg, "FileCost");
5273 ok( r == ERROR_SUCCESS, "file cost failed\n");
5277 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5278 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5279 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5280 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5284 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5285 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5286 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5287 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5291 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5292 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5293 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5294 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5298 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5299 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5300 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5301 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5305 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5306 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5307 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5308 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5312 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5313 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5314 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5315 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5319 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5320 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5321 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5322 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5326 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5328 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5329 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5333 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5334 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5335 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5336 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5340 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5342 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5343 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5347 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5349 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5350 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5354 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5356 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5361 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5363 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5368 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5370 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5371 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5375 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5377 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5378 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5382 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5384 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5385 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5389 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5391 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5392 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5396 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5398 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5403 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5405 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5410 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5411 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5412 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5413 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5417 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5418 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5419 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5420 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5424 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5425 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5426 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5427 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5431 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5432 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5433 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5434 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5438 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5439 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5440 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5441 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5445 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5446 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5447 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5448 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5452 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5453 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5454 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5455 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5459 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5460 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5461 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5462 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5466 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5467 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5468 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5469 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5473 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5474 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5475 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5476 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5480 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5482 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5483 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5487 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5488 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5489 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5490 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5494 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5495 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5496 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5497 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5501 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5502 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5503 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5504 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5506 r = MsiDoAction( hpkg, "CostFinalize");
5507 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5511 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5513 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5514 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5518 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5520 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5521 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5525 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5526 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5527 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5528 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5532 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5534 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5535 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5539 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5541 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5542 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5546 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5548 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5549 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5553 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5555 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5556 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5560 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5562 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5563 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5567 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5569 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5570 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5574 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5576 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5577 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5581 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5583 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5584 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5588 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5589 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5590 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5591 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5595 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5596 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5597 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5598 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5602 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5603 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5604 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5605 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5609 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5610 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5611 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5612 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5616 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5617 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5618 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5619 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5623 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5624 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5625 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5626 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5630 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5631 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5632 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5633 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5637 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5638 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5639 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5640 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5644 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5645 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5646 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5647 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5651 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5652 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5653 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5654 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5658 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5659 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5660 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5661 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5665 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5666 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5667 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5668 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5672 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5673 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5674 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5675 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5679 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5680 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5681 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5682 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5686 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5687 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5688 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5689 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5693 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5694 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5695 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5696 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5700 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5701 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5702 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5703 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5707 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5708 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5709 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5710 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5714 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5715 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5716 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5717 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5721 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5722 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5723 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5724 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5728 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5729 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5730 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5731 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5735 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5736 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5737 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5738 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5740 MsiCloseHandle(hpkg);
5742 /* uninstall the product */
5743 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5744 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5746 /* all features installed from source */
5747 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5748 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5750 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5751 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5753 /* this property must not be in the saved msi file */
5754 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5755 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5757 r = package_from_db( hdb, &hpkg );
5758 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
5762 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5763 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5764 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5765 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5769 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5770 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5771 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5772 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5776 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5777 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5778 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5779 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5783 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5784 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5785 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5786 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5790 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5791 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5792 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5793 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5797 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5798 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5799 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5800 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5804 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5805 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5806 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5807 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5811 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5812 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5813 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5814 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5818 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5819 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5820 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5821 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5825 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5826 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5827 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5828 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5832 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5833 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5834 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5835 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5839 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5840 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5841 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5842 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5846 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5847 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5848 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5849 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5853 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5854 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5855 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5856 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5860 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5861 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5862 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5863 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5867 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5868 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5869 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5870 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5874 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5875 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5876 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5877 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5881 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5882 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5883 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5884 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5888 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5889 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5890 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5891 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5895 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5896 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5897 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5898 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5902 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5903 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5904 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5905 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5909 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5910 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5911 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5912 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5916 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5917 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5918 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5919 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5923 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5924 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5925 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5926 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5930 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5931 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5932 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5933 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5937 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5938 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5939 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5940 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5944 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5945 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5946 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5947 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5951 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5952 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5953 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5954 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5958 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5959 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5960 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5961 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5965 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5966 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5967 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5968 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5972 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5973 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5974 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5975 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5979 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5980 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5981 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5982 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5986 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5987 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5988 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5989 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5991 r = MsiDoAction( hpkg, "CostInitialize");
5992 ok( r == ERROR_SUCCESS, "cost init failed\n");
5996 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5997 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5998 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5999 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6003 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6004 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6005 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6006 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6010 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6011 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6012 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6013 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6017 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6018 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6019 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6020 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6024 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6026 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6027 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6031 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6032 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6033 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6034 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6038 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6040 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6041 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6045 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6047 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6048 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6052 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6054 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6059 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6060 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6061 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6062 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6066 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6068 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6069 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6073 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6075 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6076 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6080 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6082 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6083 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6087 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6089 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6090 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6094 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6096 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6097 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6101 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6103 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6104 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6108 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6110 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6111 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6115 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6117 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6118 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6122 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6124 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6125 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6129 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6131 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6132 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6136 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6138 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6139 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6143 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6145 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6146 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6150 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6152 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6153 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6157 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6159 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6160 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6164 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6166 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6167 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6171 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6173 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6174 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6178 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6180 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6181 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6185 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6187 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6192 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6199 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6206 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6213 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6220 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6225 r = MsiDoAction( hpkg, "FileCost");
6226 ok( r == ERROR_SUCCESS, "file cost failed\n");
6230 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6232 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6233 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6237 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6238 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6239 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6240 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6244 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6245 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6246 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6247 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6251 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6253 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6254 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6258 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6260 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6261 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6265 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6266 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6267 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6268 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6272 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6274 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6275 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6279 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6281 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6282 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6286 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6288 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6289 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6293 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6295 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6296 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6300 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6301 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6302 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6303 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6307 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6308 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6309 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6310 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6314 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6315 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6316 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6317 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6321 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6322 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6323 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6324 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6328 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6329 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6330 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6331 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6335 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6336 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6337 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6338 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6342 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6344 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6345 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6349 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6350 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6351 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6352 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6356 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6357 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6358 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6359 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6363 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6365 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6366 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6370 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6372 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6373 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6377 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6378 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6379 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6380 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6384 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6386 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6387 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6391 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6393 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6394 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6398 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6400 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6401 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6405 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6407 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6408 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6412 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6414 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6415 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6419 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6421 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6422 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6426 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6428 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6429 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6433 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6435 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6436 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6440 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6442 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6443 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6447 r = MsiGetComponentState(hpkg, "chi", &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 = MsiGetComponentState(hpkg, "psi", &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);
6459 r = MsiDoAction( hpkg, "CostFinalize");
6460 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6464 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6465 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6466 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6467 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6471 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6472 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6473 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6474 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6478 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6479 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6480 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6481 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6485 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6486 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6487 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6488 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6492 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6493 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6494 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6495 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6499 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6500 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6501 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6502 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6506 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6507 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6508 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6509 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6513 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6514 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6515 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6516 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6520 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6521 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6522 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6523 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6527 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6528 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6529 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6530 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6534 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6535 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6536 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6537 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6541 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6542 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6543 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6544 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6548 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6549 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6550 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6551 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6555 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6556 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6557 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6558 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6562 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6563 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6564 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6565 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6569 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6570 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6571 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6572 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6576 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6577 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6578 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6579 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6583 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6584 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6585 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6586 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6590 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6591 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6592 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6593 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6597 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6598 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6599 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6600 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6604 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6605 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6606 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6607 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6611 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6612 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6613 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6614 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6618 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6619 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6620 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6621 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6625 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6626 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6627 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6628 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6632 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6633 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6634 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6635 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6639 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6640 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6641 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6642 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6646 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6647 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6648 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6649 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6653 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6654 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6655 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6656 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6660 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6661 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6662 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6663 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6667 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6668 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6669 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6670 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6674 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6676 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6677 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6681 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6683 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6684 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6688 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6690 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6691 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6693 MsiCloseHandle(hpkg);
6695 /* reinstall the product */
6696 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6697 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6699 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6700 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6702 /* this property must not be in the saved msi file */
6703 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6704 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6706 r = package_from_db( hdb, &hpkg );
6707 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
6711 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6712 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6713 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6714 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6718 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6719 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6720 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6721 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6725 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6726 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6727 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6728 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6732 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6733 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6734 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6735 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6739 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6740 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6741 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6742 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6746 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6747 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6748 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6749 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6753 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6754 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6755 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6756 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6760 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6761 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6762 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6763 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6767 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6768 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6769 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6770 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6774 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6775 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6776 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6777 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6781 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6782 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6783 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6784 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6788 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6789 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6790 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6791 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6795 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6796 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6797 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6798 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6802 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6803 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6804 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6805 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6809 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6810 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6811 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6812 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6816 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6817 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6818 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6819 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6823 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6824 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6825 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6826 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6830 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6831 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6832 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6833 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6837 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6838 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6839 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6840 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6844 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6845 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6846 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6847 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6851 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6852 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6853 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6854 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6858 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6859 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6860 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6861 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6865 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6866 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6867 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6868 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6872 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6873 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6874 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6875 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6879 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6880 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6881 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6882 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6886 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6887 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6888 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6889 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6893 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6894 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6895 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6896 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6900 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6901 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6902 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6903 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6907 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6908 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6909 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6910 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6914 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6915 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6916 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6917 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6921 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6922 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6923 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6924 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6928 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6929 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6930 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6931 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6935 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6936 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6937 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6938 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6940 r = MsiDoAction( hpkg, "CostInitialize");
6941 ok( r == ERROR_SUCCESS, "cost init failed\n");
6945 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6947 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6948 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6952 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6953 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6954 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6955 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6959 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6961 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6962 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6966 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6968 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6969 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6973 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6975 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6976 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6980 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6982 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6983 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6987 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6989 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6990 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6994 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6996 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6997 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7001 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7002 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7003 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7004 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7008 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7009 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7010 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7011 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7015 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7016 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7017 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7018 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7022 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7023 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7024 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7025 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7029 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7030 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7031 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7032 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7036 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7037 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7038 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7039 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7043 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7044 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7045 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7046 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7050 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7051 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7052 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7053 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7057 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7058 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7059 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7060 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7064 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7065 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7066 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7067 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7071 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7072 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7073 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7074 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7078 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7079 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7080 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7081 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7085 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7086 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7087 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7088 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7092 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7094 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7095 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7099 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7101 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7102 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7106 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7108 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7113 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7115 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7116 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7120 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7122 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7127 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7134 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7141 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7148 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7155 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7162 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7164 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7165 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7169 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7171 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7174 r = MsiDoAction( hpkg, "FileCost");
7175 ok( r == ERROR_SUCCESS, "file cost failed\n");
7179 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7180 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7181 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7182 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7186 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7187 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7188 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7189 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7193 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7194 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7195 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7196 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7200 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7202 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7203 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7207 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7209 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7210 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7214 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7215 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7216 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7217 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7221 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7222 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7223 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7224 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7228 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7229 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7230 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7231 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7235 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7236 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7237 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7238 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7242 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7243 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7244 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7245 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7249 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7250 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7251 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7252 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7256 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7257 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7258 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7259 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7263 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7264 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7265 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7266 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7270 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7271 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7272 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7273 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7277 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7278 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7279 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7280 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7284 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7285 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7286 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7287 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7291 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7292 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7293 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7294 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7298 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7299 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7300 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7301 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7305 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7306 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7307 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7308 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7312 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7313 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7314 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7315 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7319 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7320 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7321 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7322 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7326 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7328 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7329 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7333 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7334 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7335 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7336 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7340 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7342 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7343 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7347 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7349 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7350 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7354 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7356 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7361 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7363 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7368 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7370 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7371 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7375 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7377 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7378 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7382 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7384 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7385 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7389 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7391 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7392 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7396 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7398 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7403 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7405 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7408 r = MsiDoAction( hpkg, "CostFinalize");
7409 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
7413 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7414 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7415 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7416 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7420 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7421 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7422 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7423 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7427 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7428 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7429 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7430 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7434 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7435 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7436 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7437 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7441 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7442 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7443 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7444 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7448 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7449 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7450 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7451 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7455 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7456 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7457 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7458 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7462 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7464 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7465 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7469 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7470 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7471 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7472 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7476 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7478 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7479 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7483 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7484 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7485 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7486 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7490 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7491 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7492 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7493 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7497 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7499 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7500 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7504 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7505 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7506 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7507 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7511 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7513 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7514 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7518 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7520 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7521 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7525 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7526 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7527 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7528 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7532 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7534 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7535 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7539 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7541 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7542 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7546 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7548 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7549 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7553 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7555 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7556 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7560 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7562 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7563 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7567 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7569 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7570 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7574 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7576 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7577 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7581 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7583 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7584 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7588 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7589 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7590 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7591 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7595 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7596 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7597 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7598 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7602 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7603 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7604 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7605 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7609 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7610 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7611 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7612 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7616 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7617 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7618 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7619 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7623 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7624 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7625 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7626 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7630 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7631 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7632 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7633 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7637 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7638 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7639 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7640 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7642 MsiCloseHandle(hpkg);
7644 /* uninstall the product */
7645 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7648 DeleteFileA(msifile);
7649 DeleteFileA(msifile2);
7650 DeleteFileA(msifile3);
7651 DeleteFileA(msifile4);
7654 static void test_getproperty(void)
7656 MSIHANDLE hPackage = 0;
7658 static CHAR empty[] = "";
7662 r = package_from_db(create_package_db(), &hPackage);
7663 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7665 skip("Not enough rights to perform tests\n");
7666 DeleteFile(msifile);
7669 ok( r == ERROR_SUCCESS, "Failed to create package %u\n", r );
7671 /* set the property */
7672 r = MsiSetProperty(hPackage, "Name", "Value");
7673 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7675 /* retrieve the size, NULL pointer */
7677 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7678 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7679 ok( size == 5, "Expected 5, got %d\n", size);
7681 /* retrieve the size, empty string */
7683 r = MsiGetProperty(hPackage, "Name", empty, &size);
7684 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7685 ok( size == 5, "Expected 5, got %d\n", size);
7687 /* don't change size */
7688 r = MsiGetProperty(hPackage, "Name", prop, &size);
7689 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7690 ok( size == 5, "Expected 5, got %d\n", size);
7691 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7693 /* increase the size by 1 */
7695 r = MsiGetProperty(hPackage, "Name", prop, &size);
7696 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7697 ok( size == 5, "Expected 5, got %d\n", size);
7698 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7700 r = MsiCloseHandle( hPackage);
7701 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7702 DeleteFile(msifile);
7705 static void test_removefiles(void)
7710 INSTALLSTATE installed, action;
7712 hdb = create_package_db();
7713 ok ( hdb, "failed to create package database\n" );
7715 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7716 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7718 r = create_feature_table( hdb );
7719 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7721 r = create_component_table( hdb );
7722 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7724 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7725 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7727 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7728 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7730 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7731 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7733 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7734 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7736 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7737 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7739 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7740 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7742 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7743 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7745 r = add_component_entry( hdb, "'oxygen', '', 'TARGETDIR', 0, '0', 'oxygen_file'" );
7746 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7748 r = create_feature_components_table( hdb );
7749 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7751 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7752 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7754 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7755 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7757 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7758 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7760 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7761 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7763 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7764 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7766 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7767 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7769 r = add_feature_components_entry( hdb, "'one', 'oxygen'" );
7770 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7772 r = create_file_table( hdb );
7773 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7775 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7776 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7778 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7779 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7781 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7782 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7784 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7785 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7787 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7788 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7790 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7791 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7793 r = add_file_entry( hdb, "'oxygen_file', 'oxygen', 'oxygen.txt', 0, '', '1033', 16384, 1" );
7794 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7796 r = create_remove_file_table( hdb );
7797 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7799 r = package_from_db( hdb, &hpkg );
7800 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7802 skip("Not enough rights to perform tests\n");
7803 DeleteFile(msifile);
7806 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7808 MsiCloseHandle( hdb );
7810 create_test_file( "hydrogen.txt" );
7811 create_test_file( "helium.txt" );
7812 create_test_file( "lithium.txt" );
7813 create_test_file( "beryllium.txt" );
7814 create_test_file( "boron.txt" );
7815 create_test_file( "carbon.txt" );
7816 create_test_file( "oxygen.txt" );
7818 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7819 ok( r == ERROR_SUCCESS, "set property failed\n");
7821 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7823 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7824 ok( r == ERROR_UNKNOWN_COMPONENT, "expected ERROR_UNKNOWN_COMPONENT, got %u\n", r );
7826 r = MsiDoAction( hpkg, "CostInitialize");
7827 ok( r == ERROR_SUCCESS, "cost init failed\n");
7829 r = MsiDoAction( hpkg, "FileCost");
7830 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7832 installed = action = 0xdeadbeef;
7833 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7834 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7835 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7836 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7838 r = MsiDoAction( hpkg, "CostFinalize");
7839 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7841 r = MsiDoAction( hpkg, "InstallValidate");
7842 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7844 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7845 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7847 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7848 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7850 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7851 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7853 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7854 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7856 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7857 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7859 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7860 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7862 installed = action = 0xdeadbeef;
7863 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7864 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7865 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7866 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7868 r = MsiSetComponentState( hpkg, "oxygen", INSTALLSTATE_ABSENT );
7869 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7871 installed = action = 0xdeadbeef;
7872 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7873 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7874 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7875 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7877 r = MsiDoAction( hpkg, "RemoveFiles");
7878 ok( r == ERROR_SUCCESS, "remove files failed\n");
7880 installed = action = 0xdeadbeef;
7881 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7882 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7883 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7884 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7886 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7887 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7888 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7889 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7890 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7891 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7892 ok(DeleteFileA("oxygen.txt"), "Expected oxygen.txt to exist\n");
7894 MsiCloseHandle( hpkg );
7895 DeleteFileA(msifile);
7898 static void test_appsearch(void)
7903 CHAR prop[MAX_PATH];
7906 hdb = create_package_db();
7907 ok ( hdb, "failed to create package database\n" );
7909 r = create_appsearch_table( hdb );
7910 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7912 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7913 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7915 r = add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" );
7916 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7918 r = create_reglocator_table( hdb );
7919 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7921 r = add_reglocator_entry( hdb, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 );
7922 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7924 r = create_drlocator_table( hdb );
7925 ok( r == ERROR_SUCCESS, "cannot create DrLocator table: %d\n", r );
7927 r = add_drlocator_entry( hdb, "'NewSignature2', 0, 'c:\\windows\\system32', 0" );
7928 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7930 r = create_signature_table( hdb );
7931 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7933 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7934 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7936 r = add_signature_entry( hdb, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" );
7937 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7939 r = package_from_db( hdb, &hpkg );
7940 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7942 skip("Not enough rights to perform tests\n");
7943 DeleteFile(msifile);
7946 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7947 MsiCloseHandle( hdb );
7948 if (r != ERROR_SUCCESS)
7951 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7953 r = MsiDoAction( hpkg, "AppSearch" );
7954 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7956 size = sizeof(prop);
7957 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7958 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7961 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7964 size = sizeof(prop);
7965 r = MsiGetPropertyA( hpkg, "NOTEPAD", prop, &size );
7966 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7969 MsiCloseHandle( hpkg );
7970 DeleteFileA(msifile);
7973 static void test_appsearch_complocator(void)
7975 MSIHANDLE hpkg, hdb;
7976 CHAR path[MAX_PATH];
7977 CHAR prop[MAX_PATH];
7982 if (!get_user_sid(&usersid))
7985 if (is_process_limited())
7987 skip("process is limited\n");
7991 create_test_file("FileName1");
7992 create_test_file("FileName4");
7993 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7994 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7996 create_test_file("FileName2");
7997 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7998 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
8000 create_test_file("FileName3");
8001 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
8002 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
8004 create_test_file("FileName5");
8005 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
8006 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
8008 create_test_file("FileName6");
8009 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
8010 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
8012 create_test_file("FileName7");
8013 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
8014 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
8016 /* dir is FALSE, but we're pretending it's a directory */
8017 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
8018 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
8020 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8021 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
8022 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
8024 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8025 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
8026 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
8028 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8029 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
8030 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
8032 hdb = create_package_db();
8033 ok(hdb, "Expected a valid database handle\n");
8035 r = create_appsearch_table(hdb);
8036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8038 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8041 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8044 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8045 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8047 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8048 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8050 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8053 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8056 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8059 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8062 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8065 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8068 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8071 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8074 r = create_complocator_table(hdb);
8075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8077 /* published component, machine, file, signature, misdbLocatorTypeFile */
8078 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
8079 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8081 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
8082 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
8083 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8085 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
8086 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
8087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8089 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
8090 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
8091 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8093 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
8094 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
8095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8097 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
8098 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
8099 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8101 /* published component, machine, file, no signature, misdbLocatorTypeFile */
8102 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
8103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8105 /* unpublished component, no signature, misdbLocatorTypeDir */
8106 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
8107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8109 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
8110 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
8111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8113 /* published component, signature w/ ver, misdbLocatorTypeFile */
8114 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
8115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8117 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
8118 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
8119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8121 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
8122 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
8123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8125 r = create_signature_table(hdb);
8126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8128 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
8129 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8131 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
8132 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8134 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
8135 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8137 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
8138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8140 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
8141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8143 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8144 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8146 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8149 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8152 r = package_from_db(hdb, &hpkg);
8153 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8155 skip("Not enough rights to perform tests\n");
8158 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8160 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
8161 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8163 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8165 r = MsiDoAction(hpkg, "AppSearch");
8166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8169 sprintf(path, "%s\\FileName1", CURR_DIR);
8170 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8172 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8175 sprintf(path, "%s\\FileName2", CURR_DIR);
8176 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8178 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8181 sprintf(path, "%s\\FileName3", CURR_DIR);
8182 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8183 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8184 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8187 sprintf(path, "%s\\FileName4", CURR_DIR);
8188 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8190 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8193 sprintf(path, "%s\\FileName5", CURR_DIR);
8194 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8195 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8196 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8199 sprintf(path, "%s\\", CURR_DIR);
8200 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8201 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8202 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8205 sprintf(path, "%s\\", CURR_DIR);
8206 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8208 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8211 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8213 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
8216 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8217 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8218 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8221 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
8222 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8223 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8224 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8227 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8228 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8229 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8232 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
8233 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8234 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8235 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8237 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
8238 MSIINSTALLCONTEXT_MACHINE, NULL);
8239 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
8240 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
8241 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
8242 MSIINSTALLCONTEXT_USERMANAGED, usersid);
8243 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
8244 MSIINSTALLCONTEXT_MACHINE, NULL);
8245 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
8246 MSIINSTALLCONTEXT_MACHINE, NULL);
8247 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
8248 MSIINSTALLCONTEXT_MACHINE, NULL);
8249 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
8250 MSIINSTALLCONTEXT_MACHINE, NULL);
8251 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
8252 MSIINSTALLCONTEXT_MACHINE, NULL);
8253 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
8254 MSIINSTALLCONTEXT_MACHINE, NULL);
8255 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
8256 MSIINSTALLCONTEXT_MACHINE, NULL);
8258 MsiCloseHandle(hpkg);
8261 DeleteFileA("FileName1");
8262 DeleteFileA("FileName2");
8263 DeleteFileA("FileName3");
8264 DeleteFileA("FileName4");
8265 DeleteFileA("FileName5");
8266 DeleteFileA("FileName6");
8267 DeleteFileA("FileName7");
8268 DeleteFileA("FileName8.dll");
8269 DeleteFileA("FileName9.dll");
8270 DeleteFileA("FileName10.dll");
8271 DeleteFileA(msifile);
8275 static void test_appsearch_reglocator(void)
8277 MSIHANDLE hpkg, hdb;
8278 CHAR path[MAX_PATH], prop[MAX_PATH];
8279 DWORD binary[2], size, val;
8280 BOOL space, version, is_64bit = sizeof(void *) > sizeof(int);
8281 HKEY hklm, classes, hkcu, users;
8282 LPSTR pathdata, pathvar, ptr;
8288 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8291 DeleteFileA("test.dll");
8293 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
8294 if (res == ERROR_ACCESS_DENIED)
8296 skip("Not enough rights to perform tests\n");
8299 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8301 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
8302 (const BYTE *)"regszdata", 10);
8303 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8305 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
8306 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8308 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
8309 (const BYTE *)"regszdata", 10);
8310 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8313 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
8314 ok(res == ERROR_SUCCESS ||
8315 broken(res == ERROR_INVALID_PARAMETER),
8316 "Expected ERROR_SUCCESS, got %d\n", res);
8318 if (res == ERROR_SUCCESS)
8320 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
8321 (const BYTE *)"regszdata", 10);
8322 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8325 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
8326 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8328 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
8329 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8331 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
8332 (const BYTE *)"regszdata", 10);
8333 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8336 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
8337 (const BYTE *)&val, sizeof(DWORD));
8338 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8341 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
8342 (const BYTE *)&val, sizeof(DWORD));
8343 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8345 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
8346 (const BYTE *)"%PATH%", 7);
8347 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8349 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
8350 (const BYTE *)"my%NOVAR%", 10);
8351 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8353 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
8354 (const BYTE *)"one\0two\0", 9);
8355 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8357 binary[0] = 0x1234abcd;
8358 binary[1] = 0x567890ef;
8359 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
8360 (const BYTE *)binary, sizeof(binary));
8361 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8363 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
8364 (const BYTE *)"#regszdata", 11);
8365 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8367 create_test_file("FileName1");
8368 sprintf(path, "%s\\FileName1", CURR_DIR);
8369 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
8370 (const BYTE *)path, lstrlenA(path) + 1);
8371 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8373 sprintf(path, "%s\\FileName2", CURR_DIR);
8374 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
8375 (const BYTE *)path, lstrlenA(path) + 1);
8376 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8378 lstrcpyA(path, CURR_DIR);
8379 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
8380 (const BYTE *)path, lstrlenA(path) + 1);
8381 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8383 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
8384 (const BYTE *)"", 1);
8385 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8387 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8388 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8389 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
8390 (const BYTE *)path, lstrlenA(path) + 1);
8391 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8393 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8394 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8395 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
8396 (const BYTE *)path, lstrlenA(path) + 1);
8397 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8399 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8400 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8401 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
8402 (const BYTE *)path, lstrlenA(path) + 1);
8403 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8405 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
8406 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
8407 (const BYTE *)path, lstrlenA(path) + 1);
8409 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
8410 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
8411 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
8412 (const BYTE *)path, lstrlenA(path) + 1);
8414 hdb = create_package_db();
8415 ok(hdb, "Expected a valid database handle\n");
8417 r = create_appsearch_table(hdb);
8418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8420 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8423 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8426 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8429 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8432 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8435 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8438 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8441 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8444 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8447 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8450 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8453 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8456 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
8457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8459 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
8460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8462 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
8463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8465 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
8466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8468 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
8469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8471 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
8472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8474 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
8475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8477 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
8478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8480 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
8481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8483 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
8484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8486 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
8487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8489 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
8490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8492 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
8493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8495 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
8496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8498 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
8499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8501 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
8502 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8504 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
8505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8507 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
8508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8510 r = create_reglocator_table(hdb);
8511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8513 type = msidbLocatorTypeRawValue;
8515 type |= msidbLocatorType64bit;
8517 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
8518 r = add_reglocator_entry(hdb, "NewSignature1", 2, "Software\\Wine", "Value1", type);
8519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8521 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
8522 r = add_reglocator_entry(hdb, "NewSignature2", 2, "Software\\Wine", "Value2", type);
8523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8525 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
8526 r = add_reglocator_entry(hdb, "NewSignature3", 2, "Software\\Wine", "Value3", type);
8527 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8529 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8530 r = add_reglocator_entry(hdb, "NewSignature4", 2, "Software\\Wine", "Value4", type);
8531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8533 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8534 r = add_reglocator_entry(hdb, "NewSignature5", 2, "Software\\Wine", "Value5", type);
8535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8537 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
8538 r = add_reglocator_entry(hdb, "NewSignature6", 2, "Software\\Wine", "Value6", type);
8539 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8541 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
8542 r = add_reglocator_entry(hdb, "NewSignature7", 2, "Software\\Wine", "Value7", type);
8543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8545 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
8546 r = add_reglocator_entry(hdb, "NewSignature8", 2, "Software\\Wine", "Value8", type);
8547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8549 type = msidbLocatorTypeFileName;
8551 type |= msidbLocatorType64bit;
8553 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
8554 r = add_reglocator_entry(hdb, "NewSignature9", 2, "Software\\Wine", "Value9", type);
8555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8557 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
8558 r = add_reglocator_entry(hdb, "NewSignature10", 2, "Software\\Wine", "Value10", type);
8559 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8561 /* HKLM, msidbLocatorTypeFileName, no signature */
8562 r = add_reglocator_entry(hdb, "NewSignature11", 2, "Software\\Wine", "Value9", type);
8563 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8565 type = msidbLocatorTypeDirectory;
8567 type |= msidbLocatorType64bit;
8569 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
8570 r = add_reglocator_entry(hdb, "NewSignature12", 2, "Software\\Wine", "Value9", type);
8571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8573 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8574 r = add_reglocator_entry(hdb, "NewSignature13", 2, "Software\\Wine", "Value11", type);
8575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8577 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8578 r = add_reglocator_entry(hdb, "NewSignature14", 2, "Software\\Wine", "Value9", type);
8579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8581 type = msidbLocatorTypeRawValue;
8583 type |= msidbLocatorType64bit;
8585 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8586 r = add_reglocator_entry(hdb, "NewSignature15", 0, "Software\\Wine", "Value1", type);
8587 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8589 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8590 r = add_reglocator_entry(hdb, "NewSignature16", 1, "Software\\Wine", "Value1", type);
8591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8593 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8594 r = add_reglocator_entry(hdb, "NewSignature17", 3, "S-1-5-18\\Software\\Wine", "Value1", type);
8595 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8597 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8598 r = add_reglocator_entry(hdb, "NewSignature18", 2, "Software\\Wine", "", type);
8599 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8601 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8602 r = add_reglocator_entry(hdb, "NewSignature19", 2, "Software\\IDontExist", "", type);
8603 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8605 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8606 r = add_reglocator_entry(hdb, "NewSignature20", 2, "Software\\Wine", "Value12", type);
8607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8609 type = msidbLocatorTypeFileName;
8611 type |= msidbLocatorType64bit;
8613 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8614 r = add_reglocator_entry(hdb, "NewSignature21", 2, "Software\\Wine", "Value13", type);
8615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8617 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8618 r = add_reglocator_entry(hdb, "NewSignature22", 2, "Software\\Wine", "Value14", type);
8619 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8621 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8622 r = add_reglocator_entry(hdb, "NewSignature23", 2, "Software\\Wine", "Value15", type);
8623 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8625 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8626 r = add_reglocator_entry(hdb, "NewSignature24", 2, "Software\\Wine", "Value11", type);
8627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8629 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8630 r = add_reglocator_entry(hdb, "NewSignature25", 2, "Software\\Wine", "Value10", type);
8631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8633 type = msidbLocatorTypeDirectory;
8635 type |= msidbLocatorType64bit;
8637 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8638 r = add_reglocator_entry(hdb, "NewSignature26", 2, "Software\\Wine", "Value11", type);
8639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8641 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8642 r = add_reglocator_entry(hdb, "NewSignature27", 2, "Software\\Wine", "Value10", type);
8643 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8645 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8646 r = add_reglocator_entry(hdb, "NewSignature28", 2, "Software\\Wine", "Value10", type);
8647 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8649 type = msidbLocatorTypeFileName;
8651 type |= msidbLocatorType64bit;
8653 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8654 r = add_reglocator_entry(hdb, "NewSignature29", 2, "Software\\Wine", "Value16", type);
8655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8657 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8658 r = add_reglocator_entry(hdb, "NewSignature30", 2, "Software\\Wine", "Value17", type);
8659 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8661 r = create_signature_table(hdb);
8662 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8664 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8665 r = add_signature_entry(hdb, str);
8666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8668 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8669 r = add_signature_entry(hdb, str);
8670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8672 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8673 r = add_signature_entry(hdb, str);
8674 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8676 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8677 r = add_signature_entry(hdb, str);
8678 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8680 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8681 r = add_signature_entry(hdb, str);
8682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8684 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8685 r = add_signature_entry(hdb, str);
8686 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8688 ptr = strrchr(CURR_DIR, '\\') + 1;
8689 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8690 r = add_signature_entry(hdb, path);
8691 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8693 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8694 r = add_signature_entry(hdb, str);
8695 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8697 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8698 r = add_signature_entry(hdb, str);
8699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8701 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8702 r = add_signature_entry(hdb, str);
8703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8705 r = package_from_db(hdb, &hpkg);
8706 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8708 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8710 r = MsiDoAction(hpkg, "AppSearch");
8711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8714 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8715 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8716 ok(!lstrcmpA(prop, "regszdata"),
8717 "Expected \"regszdata\", got \"%s\"\n", prop);
8720 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8721 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8722 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8725 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8727 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8729 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8730 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8732 /* Workaround for Win95 */
8734 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8736 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8737 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8740 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8741 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8743 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8744 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8745 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8746 ok(!lstrcmpA(pathdata, pathvar),
8747 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8749 HeapFree(GetProcessHeap(), 0, pathvar);
8750 HeapFree(GetProcessHeap(), 0, pathdata);
8753 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8756 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8759 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8763 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8764 "Expected \"\\0one\\0two\\0\\0\"\n");
8768 lstrcpyA(path, "#xCDAB3412EF907856");
8769 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8771 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8774 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8775 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8776 ok(!lstrcmpA(prop, "##regszdata"),
8777 "Expected \"##regszdata\", got \"%s\"\n", prop);
8780 sprintf(path, "%s\\FileName1", CURR_DIR);
8781 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8783 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8786 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8787 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8788 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8791 sprintf(path, "%s\\", CURR_DIR);
8792 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8794 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8797 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8799 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8802 sprintf(path, "%s\\", CURR_DIR);
8803 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8805 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8808 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8810 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8813 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8815 ok(!lstrcmpA(prop, "regszdata"),
8816 "Expected \"regszdata\", got \"%s\"\n", prop);
8819 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8820 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8821 ok(!lstrcmpA(prop, "regszdata"),
8822 "Expected \"regszdata\", got \"%s\"\n", prop);
8827 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8829 ok(!lstrcmpA(prop, "regszdata"),
8830 "Expected \"regszdata\", got \"%s\"\n", prop);
8834 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8835 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8836 ok(!lstrcmpA(prop, "defvalue"),
8837 "Expected \"defvalue\", got \"%s\"\n", prop);
8840 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8841 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8842 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8845 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8846 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8847 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8852 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8853 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8855 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8858 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8859 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8860 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8863 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8864 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8866 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8870 lstrcpyA(path, CURR_DIR);
8871 ptr = strrchr(path, '\\') + 1;
8873 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8874 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8875 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8878 sprintf(path, "%s\\", CURR_DIR);
8879 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8880 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8881 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8884 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8885 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8886 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8889 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8890 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8891 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8894 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8895 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8896 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8899 sprintf(path, "%s\\FileName1", CURR_DIR);
8900 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8901 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8902 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8905 sprintf(path, "%s\\FileName1", CURR_DIR);
8906 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8907 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8909 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8911 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8913 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8914 RegDeleteValueA(hklm, "Value1");
8915 RegDeleteValueA(hklm, "Value2");
8916 RegDeleteValueA(hklm, "Value3");
8917 RegDeleteValueA(hklm, "Value4");
8918 RegDeleteValueA(hklm, "Value5");
8919 RegDeleteValueA(hklm, "Value6");
8920 RegDeleteValueA(hklm, "Value7");
8921 RegDeleteValueA(hklm, "Value8");
8922 RegDeleteValueA(hklm, "Value9");
8923 RegDeleteValueA(hklm, "Value10");
8924 RegDeleteValueA(hklm, "Value11");
8925 RegDeleteValueA(hklm, "Value12");
8926 RegDeleteValueA(hklm, "Value13");
8927 RegDeleteValueA(hklm, "Value14");
8928 RegDeleteValueA(hklm, "Value15");
8929 RegDeleteValueA(hklm, "Value16");
8930 RegDeleteValueA(hklm, "Value17");
8931 RegDeleteKey(hklm, "");
8934 RegDeleteValueA(classes, "Value1");
8935 RegDeleteKeyA(classes, "");
8936 RegCloseKey(classes);
8938 RegDeleteValueA(hkcu, "Value1");
8939 RegDeleteKeyA(hkcu, "");
8942 RegDeleteValueA(users, "Value1");
8943 RegDeleteKeyA(users, "");
8946 DeleteFileA("FileName1");
8947 DeleteFileA("FileName3.dll");
8948 DeleteFileA("FileName4.dll");
8949 DeleteFileA("FileName5.dll");
8950 MsiCloseHandle(hpkg);
8951 DeleteFileA(msifile);
8954 static void delete_win_ini(LPCSTR file)
8956 CHAR path[MAX_PATH];
8958 GetWindowsDirectoryA(path, MAX_PATH);
8959 lstrcatA(path, "\\");
8960 lstrcatA(path, file);
8965 static void test_appsearch_inilocator(void)
8967 MSIHANDLE hpkg, hdb;
8968 CHAR path[MAX_PATH];
8969 CHAR prop[MAX_PATH];
8977 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8980 DeleteFileA("test.dll");
8982 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8984 create_test_file("FileName1");
8985 sprintf(path, "%s\\FileName1", CURR_DIR);
8986 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8988 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8990 sprintf(path, "%s\\IDontExist", CURR_DIR);
8991 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8993 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8994 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8995 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8997 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8998 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8999 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
9001 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9002 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9003 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
9005 hdb = create_package_db();
9006 ok(hdb, "Expected a valid database handle\n");
9008 r = create_appsearch_table(hdb);
9009 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9011 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9012 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9014 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9015 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9017 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9018 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9020 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9021 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9023 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9024 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9026 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9029 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9030 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9032 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9033 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9035 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9038 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9041 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9044 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
9045 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9047 r = create_inilocator_table(hdb);
9048 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9050 /* msidbLocatorTypeRawValue, field 1 */
9051 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
9052 r = add_inilocator_entry(hdb, str);
9053 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9055 /* msidbLocatorTypeRawValue, field 2 */
9056 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
9057 r = add_inilocator_entry(hdb, str);
9058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9060 /* msidbLocatorTypeRawValue, entire field */
9061 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
9062 r = add_inilocator_entry(hdb, str);
9063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9065 /* msidbLocatorTypeFile */
9066 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9067 r = add_inilocator_entry(hdb, str);
9068 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9070 /* msidbLocatorTypeDirectory, file */
9071 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
9072 r = add_inilocator_entry(hdb, str);
9073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9075 /* msidbLocatorTypeDirectory, directory */
9076 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
9077 r = add_inilocator_entry(hdb, str);
9078 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9080 /* msidbLocatorTypeFile, file, no signature */
9081 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9082 r = add_inilocator_entry(hdb, str);
9083 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9085 /* msidbLocatorTypeFile, dir, no signature */
9086 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
9087 r = add_inilocator_entry(hdb, str);
9088 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9090 /* msidbLocatorTypeFile, file does not exist */
9091 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
9092 r = add_inilocator_entry(hdb, str);
9093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9095 /* msidbLocatorTypeFile, signature with version */
9096 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
9097 r = add_inilocator_entry(hdb, str);
9098 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9100 /* msidbLocatorTypeFile, signature with version, ver > max */
9101 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
9102 r = add_inilocator_entry(hdb, str);
9103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9105 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
9106 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
9107 r = add_inilocator_entry(hdb, str);
9108 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9110 r = create_signature_table(hdb);
9111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9113 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
9114 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9116 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
9117 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9119 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9122 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9125 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9128 r = package_from_db(hdb, &hpkg);
9129 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9131 skip("Not enough rights to perform tests\n");
9134 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9136 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9138 r = MsiDoAction(hpkg, "AppSearch");
9139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9142 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9143 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9144 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
9147 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9149 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
9152 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9154 ok(!lstrcmpA(prop, "keydata,field2"),
9155 "Expected \"keydata,field2\", got \"%s\"\n", prop);
9158 sprintf(path, "%s\\FileName1", CURR_DIR);
9159 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9160 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9161 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9164 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9166 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9169 sprintf(path, "%s\\", CURR_DIR);
9170 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9172 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9175 sprintf(path, "%s\\", CURR_DIR);
9176 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9178 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9181 lstrcpyA(path, CURR_DIR);
9182 ptr = strrchr(path, '\\');
9184 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9185 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9186 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9189 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9191 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9196 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9197 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9198 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9199 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9202 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9203 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9204 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9207 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9208 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
9209 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9210 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9213 MsiCloseHandle(hpkg);
9216 delete_win_ini("IniFile.ini");
9217 DeleteFileA("FileName1");
9218 DeleteFileA("FileName2.dll");
9219 DeleteFileA("FileName3.dll");
9220 DeleteFileA("FileName4.dll");
9221 DeleteFileA(msifile);
9225 * MSI AppSearch action on DrLocator table always returns absolute paths.
9226 * If a relative path was set, it returns the first absolute path that
9227 * matches or an empty string if it didn't find anything.
9228 * This helper function replicates this behaviour.
9230 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
9235 size = lstrlenA(relative);
9236 drives = GetLogicalDrives();
9237 lstrcpyA(absolute, "A:\\");
9238 for (i = 0; i < 26; absolute[0] = '\0', i++)
9240 if (!(drives & (1 << i)))
9243 absolute[0] = 'A' + i;
9244 if (GetDriveType(absolute) != DRIVE_FIXED)
9247 lstrcpynA(absolute + 3, relative, size + 1);
9248 attr = GetFileAttributesA(absolute);
9249 if (attr != INVALID_FILE_ATTRIBUTES &&
9250 (attr & FILE_ATTRIBUTE_DIRECTORY))
9252 if (absolute[3 + size - 1] != '\\')
9253 lstrcatA(absolute, "\\");
9260 static void test_appsearch_drlocator(void)
9262 MSIHANDLE hpkg, hdb;
9263 CHAR path[MAX_PATH];
9264 CHAR prop[MAX_PATH];
9271 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9274 DeleteFileA("test.dll");
9276 create_test_file("FileName1");
9277 CreateDirectoryA("one", NULL);
9278 CreateDirectoryA("one\\two", NULL);
9279 CreateDirectoryA("one\\two\\three", NULL);
9280 create_test_file("one\\two\\three\\FileName2");
9281 CreateDirectoryA("another", NULL);
9282 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9283 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9284 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9286 hdb = create_package_db();
9287 ok(hdb, "Expected a valid database handle\n");
9289 r = create_appsearch_table(hdb);
9290 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9292 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9293 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9295 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9296 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9298 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9299 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9301 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9304 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9305 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9307 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9308 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9310 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9313 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9314 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9316 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9317 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9319 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9322 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9323 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9325 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
9326 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9328 r = create_drlocator_table(hdb);
9329 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9331 /* no parent, full path, depth 0, signature */
9332 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
9333 r = add_drlocator_entry(hdb, path);
9334 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9336 /* no parent, full path, depth 0, no signature */
9337 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
9338 r = add_drlocator_entry(hdb, path);
9339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9341 /* no parent, relative path, depth 0, no signature */
9342 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
9343 r = add_drlocator_entry(hdb, path);
9344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9346 /* no parent, full path, depth 2, signature */
9347 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
9348 r = add_drlocator_entry(hdb, path);
9349 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9351 /* no parent, full path, depth 3, signature */
9352 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
9353 r = add_drlocator_entry(hdb, path);
9354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9356 /* no parent, full path, depth 1, signature is dir */
9357 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
9358 r = add_drlocator_entry(hdb, path);
9359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9361 /* parent is in DrLocator, relative path, depth 0, signature */
9362 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
9363 r = add_drlocator_entry(hdb, path);
9364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9366 /* no parent, full path, depth 0, signature w/ version */
9367 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
9368 r = add_drlocator_entry(hdb, path);
9369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9371 /* no parent, full path, depth 0, signature w/ version, ver > max */
9372 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
9373 r = add_drlocator_entry(hdb, path);
9374 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9376 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
9377 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
9378 r = add_drlocator_entry(hdb, path);
9379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9381 /* no parent, relative empty path, depth 0, no signature */
9382 sprintf(path, "'NewSignature11', '', '', 0");
9383 r = add_drlocator_entry(hdb, path);
9384 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9386 r = create_reglocator_table(hdb);
9387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9390 r = add_reglocator_entry(hdb, "NewSignature12", 2, "htmlfile\\shell\\open\\nonexistent", "", 1);
9391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9393 /* parent is in RegLocator, no path, depth 0, no signature */
9394 sprintf(path, "'NewSignature13', 'NewSignature12', '', 0");
9395 r = add_drlocator_entry(hdb, path);
9396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9398 r = create_signature_table(hdb);
9399 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9401 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9402 r = add_signature_entry(hdb, str);
9403 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9405 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9406 r = add_signature_entry(hdb, str);
9407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9409 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9410 r = add_signature_entry(hdb, str);
9411 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9413 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9414 r = add_signature_entry(hdb, str);
9415 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9417 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9418 r = add_signature_entry(hdb, str);
9419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9421 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9422 r = add_signature_entry(hdb, str);
9423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9425 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9426 r = add_signature_entry(hdb, str);
9427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9429 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9430 r = add_signature_entry(hdb, str);
9431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9433 r = package_from_db(hdb, &hpkg);
9434 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9436 skip("Not enough rights to perform tests\n");
9439 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9441 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9443 r = MsiDoAction(hpkg, "AppSearch");
9444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9447 sprintf(path, "%s\\FileName1", CURR_DIR);
9448 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9450 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9453 sprintf(path, "%s\\", CURR_DIR);
9454 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9455 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9456 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9459 search_absolute_directory(path, CURR_DIR + 3);
9460 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9462 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9465 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9467 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9470 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9471 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9473 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9476 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9478 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9481 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9482 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9484 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9489 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9490 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9492 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9495 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9497 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9500 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9502 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9506 search_absolute_directory(path, "");
9507 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9509 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9512 strcpy(path, "c:\\");
9513 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
9514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9515 ok(!prop[0], "Expected \"\", got \"%s\"\n", prop);
9517 MsiCloseHandle(hpkg);
9520 DeleteFileA("FileName1");
9521 DeleteFileA("FileName3.dll");
9522 DeleteFileA("FileName4.dll");
9523 DeleteFileA("FileName5.dll");
9524 DeleteFileA("one\\two\\three\\FileName2");
9525 RemoveDirectoryA("one\\two\\three");
9526 RemoveDirectoryA("one\\two");
9527 RemoveDirectoryA("one");
9528 RemoveDirectoryA("another");
9529 DeleteFileA(msifile);
9532 static void test_featureparents(void)
9537 INSTALLSTATE state, action;
9539 hdb = create_package_db();
9540 ok ( hdb, "failed to create package database\n" );
9542 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
9543 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
9545 r = create_feature_table( hdb );
9546 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
9548 r = create_component_table( hdb );
9549 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
9551 r = create_feature_components_table( hdb );
9552 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
9554 r = create_file_table( hdb );
9555 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
9557 /* msidbFeatureAttributesFavorLocal */
9558 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
9559 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9561 /* msidbFeatureAttributesFavorSource */
9562 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
9563 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9565 /* msidbFeatureAttributesFavorLocal */
9566 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
9567 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9569 /* msidbFeatureAttributesUIDisallowAbsent */
9570 r = add_feature_entry( hdb, "'lyra', '', '', '', 2, 1, '', 16" );
9571 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9573 /* disabled because of install level */
9574 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
9575 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9577 /* child feature of disabled feature */
9578 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9579 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9581 /* component of disabled feature (install level) */
9582 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9583 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9585 /* component of disabled child feature (install level) */
9586 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9587 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9589 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9590 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9591 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9593 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9594 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9595 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9597 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9598 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9599 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9601 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9602 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9603 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9605 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9606 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9607 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9609 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9610 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9611 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9613 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9614 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9615 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9617 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9618 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9619 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9621 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9622 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9624 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9625 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9627 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9628 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9630 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9631 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9633 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9634 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9636 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9637 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9639 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9640 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9642 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9643 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9645 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9646 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9648 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9649 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9651 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9652 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9654 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9655 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9657 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9658 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9660 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9661 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9663 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9664 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9666 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9667 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9669 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9670 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9672 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9673 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9675 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9676 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9678 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9679 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9681 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9682 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9684 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9685 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9687 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9688 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9690 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9691 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9693 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9694 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9696 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9697 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9699 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9700 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9702 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9703 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9705 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9706 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9708 r = package_from_db( hdb, &hpkg );
9709 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9711 skip("Not enough rights to perform tests\n");
9712 DeleteFile(msifile);
9715 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9717 MsiCloseHandle( hdb );
9719 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9721 r = MsiDoAction( hpkg, "CostInitialize");
9722 ok( r == ERROR_SUCCESS, "cost init failed\n");
9724 r = MsiDoAction( hpkg, "FileCost");
9725 ok( r == ERROR_SUCCESS, "file cost failed\n");
9727 r = MsiDoAction( hpkg, "CostFinalize");
9728 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9732 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9733 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9734 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9735 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9739 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9740 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9741 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9742 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9746 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9747 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9748 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9749 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9753 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9754 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9755 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9756 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9760 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9761 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9762 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9763 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9767 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9768 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9769 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9770 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9774 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9775 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9776 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9777 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9781 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9783 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9784 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9788 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9790 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9791 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9795 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9797 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9798 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9802 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9803 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9804 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9805 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9809 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9810 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9811 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9812 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9816 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9817 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9818 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9819 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9823 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9824 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9825 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9826 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9830 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9831 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9832 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9833 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9837 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9839 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9840 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9844 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9845 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9846 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9847 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9849 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9850 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9852 r = MsiSetFeatureState(hpkg, "lyra", INSTALLSTATE_ABSENT);
9853 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9855 r = MsiSetFeatureState(hpkg, "nosuchfeature", INSTALLSTATE_ABSENT);
9856 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r);
9860 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9861 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9862 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9863 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9867 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9868 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9869 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9870 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9874 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9875 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9876 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9877 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9881 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9882 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9883 ok( state == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", state);
9884 ok( action == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", action);
9888 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9889 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9890 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9891 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9895 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9896 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9897 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9898 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9902 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9903 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9904 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9905 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9909 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9910 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9911 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9912 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9916 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9917 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9918 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9919 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9923 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9924 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9925 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9926 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9930 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9931 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9932 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9933 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9937 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9938 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9939 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9940 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9944 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9945 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9946 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9947 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9951 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9952 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9953 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9954 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9958 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9959 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9960 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9961 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9963 MsiCloseHandle(hpkg);
9964 DeleteFileA(msifile);
9967 static void test_installprops(void)
9969 MSIHANDLE hpkg, hdb;
9970 CHAR path[MAX_PATH], buf[MAX_PATH];
9976 REGSAM access = KEY_ALL_ACCESS;
9980 access |= KEY_WOW64_64KEY;
9982 GetCurrentDirectory(MAX_PATH, path);
9983 lstrcat(path, "\\");
9984 lstrcat(path, msifile);
9986 hdb = create_package_db();
9987 ok( hdb, "failed to create database\n");
9989 r = package_from_db(hdb, &hpkg);
9990 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9992 skip("Not enough rights to perform tests\n");
9993 DeleteFile(msifile);
9996 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9998 MsiCloseHandle(hdb);
10001 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
10002 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10003 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10005 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
10006 RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
10011 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10015 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
10018 /* win9x doesn't set this */
10022 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
10023 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10024 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10030 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10034 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
10040 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
10041 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10042 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10046 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
10047 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10048 trace("VersionDatabase = %s\n", buf);
10051 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
10052 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10053 trace("VersionMsi = %s\n", buf);
10056 r = MsiGetProperty(hpkg, "Date", buf, &size);
10057 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10058 trace("Date = %s\n", buf);
10061 r = MsiGetProperty(hpkg, "Time", buf, &size);
10062 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10063 trace("Time = %s\n", buf);
10066 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
10067 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10068 trace("PackageCode = %s\n", buf);
10070 langid = GetUserDefaultLangID();
10071 sprintf(path, "%d", langid);
10074 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
10075 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10076 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
10078 res = GetSystemMetrics(SM_CXSCREEN);
10080 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
10081 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10083 res = GetSystemMetrics(SM_CYSCREEN);
10085 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
10086 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10088 if (pGetSystemInfo && pSHGetFolderPathA)
10090 pGetSystemInfo(&si);
10091 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
10095 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10096 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10097 ok(buf[0], "property not set\n");
10101 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10102 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10103 ok(buf[0], "property not set\n");
10107 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10108 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10109 GetSystemDirectoryA(path, MAX_PATH);
10110 if (size) buf[size - 1] = 0;
10111 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10115 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10116 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10117 pGetSystemWow64DirectoryA(path, MAX_PATH);
10118 if (size) buf[size - 1] = 0;
10119 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10123 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10124 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10125 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10126 if (size) buf[size - 1] = 0;
10127 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10131 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10132 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10133 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10134 if (size) buf[size - 1] = 0;
10135 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10139 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10140 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10141 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10142 if (size) buf[size - 1] = 0;
10143 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10147 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10148 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10149 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10150 if (size) buf[size - 1] = 0;
10151 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10155 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10156 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10157 ok(buf[0], "property not set\n");
10159 else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
10165 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10166 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10167 ok(!buf[0], "property set\n");
10171 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10172 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10173 ok(!buf[0], "property set\n");
10177 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10178 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10179 ok(!buf[0], "property set\n");
10183 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10184 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10185 GetSystemDirectoryA(path, MAX_PATH);
10186 if (size) buf[size - 1] = 0;
10187 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10191 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10192 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10193 ok(!buf[0], "property set\n");
10197 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10198 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10199 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10200 if (size) buf[size - 1] = 0;
10201 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10205 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10206 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10207 ok(!buf[0], "property set\n");
10211 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10212 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10213 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10214 if (size) buf[size - 1] = 0;
10215 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10219 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10220 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10221 ok(!buf[0], "property set\n");
10227 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10228 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10229 ok(buf[0], "property not set\n");
10233 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10234 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10235 ok(buf[0], "property not set\n");
10239 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10240 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10241 GetSystemDirectoryA(path, MAX_PATH);
10242 if (size) buf[size - 1] = 0;
10243 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10247 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10248 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10249 pGetSystemWow64DirectoryA(path, MAX_PATH);
10250 if (size) buf[size - 1] = 0;
10251 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10255 r = MsiGetProperty(hpkg, "ProgramFilesFolder64", buf, &size);
10256 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10257 ok(!buf[0], "property set\n");
10261 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10262 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10263 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10264 if (size) buf[size - 1] = 0;
10265 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10269 r = MsiGetProperty(hpkg, "CommonFilesFolder64", buf, &size);
10270 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10271 ok(!buf[0], "property set\n");
10275 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10276 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10277 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10278 if (size) buf[size - 1] = 0;
10279 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10283 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10284 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10285 ok(buf[0], "property not set\n");
10290 CloseHandle(hkey1);
10291 CloseHandle(hkey2);
10292 MsiCloseHandle(hpkg);
10293 DeleteFile(msifile);
10296 static void test_launchconditions(void)
10302 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10304 hdb = create_package_db();
10305 ok( hdb, "failed to create package database\n" );
10307 r = create_launchcondition_table( hdb );
10308 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
10310 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
10311 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10313 /* invalid condition */
10314 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
10315 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10317 r = package_from_db( hdb, &hpkg );
10318 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10320 skip("Not enough rights to perform tests\n");
10321 DeleteFile(msifile);
10324 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10326 MsiCloseHandle( hdb );
10328 r = MsiSetProperty( hpkg, "X", "1" );
10329 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10331 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10333 /* invalid conditions are ignored */
10334 r = MsiDoAction( hpkg, "LaunchConditions" );
10335 ok( r == ERROR_SUCCESS, "cost init failed\n" );
10337 /* verify LaunchConditions still does some verification */
10338 r = MsiSetProperty( hpkg, "X", "2" );
10339 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10341 r = MsiDoAction( hpkg, "LaunchConditions" );
10342 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
10344 MsiCloseHandle( hpkg );
10345 DeleteFile( msifile );
10348 static void test_ccpsearch(void)
10350 MSIHANDLE hdb, hpkg;
10351 CHAR prop[MAX_PATH];
10352 DWORD size = MAX_PATH;
10355 hdb = create_package_db();
10356 ok(hdb, "failed to create package database\n");
10358 r = create_ccpsearch_table(hdb);
10359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10361 r = add_ccpsearch_entry(hdb, "'CCP_random'");
10362 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10364 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
10365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10367 r = create_reglocator_table(hdb);
10368 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10370 r = add_reglocator_entry(hdb, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
10371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10373 r = create_drlocator_table(hdb);
10374 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10376 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
10377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10379 r = create_signature_table(hdb);
10380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10382 r = package_from_db(hdb, &hpkg);
10383 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10385 skip("Not enough rights to perform tests\n");
10386 DeleteFile(msifile);
10389 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10391 MsiCloseHandle(hdb);
10393 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10395 r = MsiDoAction(hpkg, "CCPSearch");
10396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10398 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
10399 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10400 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
10402 MsiCloseHandle(hpkg);
10403 DeleteFileA(msifile);
10406 static void test_complocator(void)
10408 MSIHANDLE hdb, hpkg;
10410 CHAR prop[MAX_PATH];
10411 CHAR expected[MAX_PATH];
10412 DWORD size = MAX_PATH;
10414 hdb = create_package_db();
10415 ok(hdb, "failed to create package database\n");
10417 r = create_appsearch_table(hdb);
10418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10420 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
10421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10423 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
10424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10426 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
10427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10429 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
10430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10432 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
10433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10435 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
10436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10438 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
10439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10441 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
10442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10444 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
10445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10447 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
10448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10450 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
10451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10453 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
10454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10456 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
10457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10459 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
10460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10462 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
10463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10465 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
10466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10468 r = create_complocator_table(hdb);
10469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10471 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
10472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10474 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
10475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10477 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
10478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10480 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
10481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10483 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
10484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10486 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
10487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10489 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
10490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10492 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
10493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10495 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
10496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10498 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
10499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10501 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
10502 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10504 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
10505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10507 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
10508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10510 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
10511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10513 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
10514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10516 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
10517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10519 r = create_signature_table(hdb);
10520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10522 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
10523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10525 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
10526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10528 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
10529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10531 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
10532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10534 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
10535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10537 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
10538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10540 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
10541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10543 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
10544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10546 r = package_from_db(hdb, &hpkg);
10547 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10549 skip("Not enough rights to perform tests\n");
10550 DeleteFile(msifile);
10553 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10555 MsiCloseHandle(hdb);
10557 create_test_file("abelisaurus");
10558 create_test_file("bactrosaurus");
10559 create_test_file("camelotia");
10560 create_test_file("diclonius");
10561 create_test_file("echinodon");
10562 create_test_file("falcarius");
10563 create_test_file("gallimimus");
10564 create_test_file("hagryphus");
10565 CreateDirectoryA("iguanodon", NULL);
10566 CreateDirectoryA("jobaria", NULL);
10567 CreateDirectoryA("kakuru", NULL);
10568 CreateDirectoryA("labocania", NULL);
10569 CreateDirectoryA("megaraptor", NULL);
10570 CreateDirectoryA("neosodon", NULL);
10571 CreateDirectoryA("olorotitan", NULL);
10572 CreateDirectoryA("pantydraco", NULL);
10574 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
10575 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
10576 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
10577 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
10578 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
10579 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
10580 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
10581 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
10582 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
10583 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
10584 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
10585 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
10586 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
10587 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
10588 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
10589 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
10591 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10593 r = MsiDoAction(hpkg, "AppSearch");
10594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10597 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
10598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10600 lstrcpyA(expected, CURR_DIR);
10601 lstrcatA(expected, "\\abelisaurus");
10602 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10603 "Expected %s or empty string, got %s\n", expected, prop);
10606 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
10607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10608 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10611 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
10612 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10613 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10616 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
10617 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10618 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10621 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
10622 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10624 lstrcpyA(expected, CURR_DIR);
10625 lstrcatA(expected, "\\");
10626 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10627 "Expected %s or empty string, got %s\n", expected, prop);
10630 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
10631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10632 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10635 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
10636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10637 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10640 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
10641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10642 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10645 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
10646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10647 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10650 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
10651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10652 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10655 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
10656 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10657 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10660 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
10661 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10662 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10665 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
10666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10668 lstrcpyA(expected, CURR_DIR);
10669 lstrcatA(expected, "\\");
10670 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10671 "Expected %s or empty string, got %s\n", expected, prop);
10674 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
10675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10677 lstrcpyA(expected, CURR_DIR);
10678 lstrcatA(expected, "\\neosodon\\");
10679 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10680 "Expected %s or empty string, got %s\n", expected, prop);
10683 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
10684 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10685 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10688 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
10689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10690 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10692 MsiCloseHandle(hpkg);
10693 DeleteFileA("abelisaurus");
10694 DeleteFileA("bactrosaurus");
10695 DeleteFileA("camelotia");
10696 DeleteFileA("diclonius");
10697 DeleteFileA("echinodon");
10698 DeleteFileA("falcarius");
10699 DeleteFileA("gallimimus");
10700 DeleteFileA("hagryphus");
10701 RemoveDirectoryA("iguanodon");
10702 RemoveDirectoryA("jobaria");
10703 RemoveDirectoryA("kakuru");
10704 RemoveDirectoryA("labocania");
10705 RemoveDirectoryA("megaraptor");
10706 RemoveDirectoryA("neosodon");
10707 RemoveDirectoryA("olorotitan");
10708 RemoveDirectoryA("pantydraco");
10709 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10710 MSIINSTALLCONTEXT_MACHINE, NULL);
10711 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10712 MSIINSTALLCONTEXT_MACHINE, NULL);
10713 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10714 MSIINSTALLCONTEXT_MACHINE, NULL);
10715 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10716 MSIINSTALLCONTEXT_MACHINE, NULL);
10717 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10718 MSIINSTALLCONTEXT_MACHINE, NULL);
10719 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10720 MSIINSTALLCONTEXT_MACHINE, NULL);
10721 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10722 MSIINSTALLCONTEXT_MACHINE, NULL);
10723 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10724 MSIINSTALLCONTEXT_MACHINE, NULL);
10725 DeleteFileA(msifile);
10728 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
10733 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
10734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10736 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
10737 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10739 r = MsiSummaryInfoPersist(summary);
10740 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10742 MsiCloseHandle(summary);
10745 static void test_MsiGetSourcePath(void)
10747 MSIHANDLE hdb, hpkg;
10748 CHAR path[MAX_PATH];
10749 CHAR cwd[MAX_PATH];
10750 CHAR subsrc[MAX_PATH];
10751 CHAR sub2[MAX_PATH];
10755 lstrcpyA(cwd, CURR_DIR);
10756 lstrcatA(cwd, "\\");
10758 lstrcpyA(subsrc, cwd);
10759 lstrcatA(subsrc, "subsource");
10760 lstrcatA(subsrc, "\\");
10762 lstrcpyA(sub2, subsrc);
10763 lstrcatA(sub2, "sub2");
10764 lstrcatA(sub2, "\\");
10766 /* uncompressed source */
10768 hdb = create_package_db();
10769 ok( hdb, "failed to create database\n");
10771 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10773 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10774 ok(r == S_OK, "failed\n");
10776 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10777 ok(r == S_OK, "failed\n");
10779 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
10780 ok(r == S_OK, "failed\n");
10782 r = MsiDatabaseCommit(hdb);
10783 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
10785 r = package_from_db(hdb, &hpkg);
10786 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10788 skip("Not enough rights to perform tests\n");
10789 DeleteFile(msifile);
10792 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10794 MsiCloseHandle(hdb);
10796 /* invalid database handle */
10798 lstrcpyA(path, "kiwi");
10799 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
10800 ok(r == ERROR_INVALID_HANDLE,
10801 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
10802 ok(!lstrcmpA(path, "kiwi"),
10803 "Expected path to be unchanged, got \"%s\"\n", path);
10804 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10806 /* NULL szFolder */
10808 lstrcpyA(path, "kiwi");
10809 r = MsiGetSourcePath(hpkg, NULL, path, &size);
10810 ok(r == ERROR_INVALID_PARAMETER,
10811 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10812 ok(!lstrcmpA(path, "kiwi"),
10813 "Expected path to be unchanged, got \"%s\"\n", path);
10814 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10816 /* empty szFolder */
10818 lstrcpyA(path, "kiwi");
10819 r = MsiGetSourcePath(hpkg, "", path, &size);
10820 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10821 ok(!lstrcmpA(path, "kiwi"),
10822 "Expected path to be unchanged, got \"%s\"\n", path);
10823 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10825 /* try TARGETDIR */
10827 lstrcpyA(path, "kiwi");
10828 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10829 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10830 ok(!lstrcmpA(path, "kiwi"),
10831 "Expected path to be unchanged, got \"%s\"\n", path);
10832 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10835 lstrcpyA(path, "kiwi");
10836 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10838 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10839 ok(size == 0, "Expected 0, got %d\n", size);
10842 lstrcpyA(path, "kiwi");
10843 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10844 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10845 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10846 ok(size == 0, "Expected 0, got %d\n", size);
10848 /* try SourceDir */
10850 lstrcpyA(path, "kiwi");
10851 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10852 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10853 ok(!lstrcmpA(path, "kiwi"),
10854 "Expected path to be unchanged, got \"%s\"\n", path);
10855 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10857 /* try SOURCEDIR */
10859 lstrcpyA(path, "kiwi");
10860 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10861 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10862 ok(!lstrcmpA(path, "kiwi"),
10863 "Expected path to be unchanged, got \"%s\"\n", path);
10864 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10866 /* source path does not exist, but the property exists */
10868 lstrcpyA(path, "kiwi");
10869 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10871 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10872 ok(size == 0, "Expected 0, got %d\n", size);
10875 lstrcpyA(path, "kiwi");
10876 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10877 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10878 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10879 ok(size == 0, "Expected 0, got %d\n", size);
10883 lstrcpyA(path, "kiwi");
10884 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10885 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10886 ok(!lstrcmpA(path, "kiwi"),
10887 "Expected path to be unchanged, got \"%s\"\n", path);
10888 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10892 lstrcpyA(path, "kiwi");
10893 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10894 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10895 ok(!lstrcmpA(path, "kiwi"),
10896 "Expected path to be unchanged, got \"%s\"\n", path);
10897 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10899 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10901 r = MsiDoAction(hpkg, "CostInitialize");
10902 ok(r == ERROR_SUCCESS, "cost init failed\n");
10904 /* try TARGETDIR after CostInitialize */
10906 lstrcpyA(path, "kiwi");
10907 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10908 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10909 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10910 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10912 /* try SourceDir after CostInitialize */
10914 lstrcpyA(path, "kiwi");
10915 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10916 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10917 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10918 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10920 /* try SOURCEDIR after CostInitialize */
10922 lstrcpyA(path, "kiwi");
10923 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10924 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10925 ok(!lstrcmpA(path, "kiwi"),
10926 "Expected path to be unchanged, got \"%s\"\n", path);
10927 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10929 /* source path does not exist, but the property exists */
10931 lstrcpyA(path, "kiwi");
10932 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10933 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10936 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10937 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10940 /* try SubDir after CostInitialize */
10942 lstrcpyA(path, "kiwi");
10943 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10944 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10945 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10946 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10948 /* try SubDir2 after CostInitialize */
10950 lstrcpyA(path, "kiwi");
10951 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10952 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10953 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10954 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10956 r = MsiDoAction(hpkg, "ResolveSource");
10957 ok(r == ERROR_SUCCESS, "file cost failed\n");
10959 /* try TARGETDIR after ResolveSource */
10961 lstrcpyA(path, "kiwi");
10962 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10963 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10964 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10965 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10967 /* try SourceDir after ResolveSource */
10969 lstrcpyA(path, "kiwi");
10970 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10971 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10972 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10973 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10975 /* try SOURCEDIR after ResolveSource */
10977 lstrcpyA(path, "kiwi");
10978 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10979 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10980 ok(!lstrcmpA(path, "kiwi"),
10981 "Expected path to be unchanged, got \"%s\"\n", path);
10982 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10984 /* source path does not exist, but the property exists */
10986 lstrcpyA(path, "kiwi");
10987 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10988 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10989 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10990 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10992 /* try SubDir after ResolveSource */
10994 lstrcpyA(path, "kiwi");
10995 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10996 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10997 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10998 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11000 /* try SubDir2 after ResolveSource */
11002 lstrcpyA(path, "kiwi");
11003 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11004 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11005 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11006 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11008 r = MsiDoAction(hpkg, "FileCost");
11009 ok(r == ERROR_SUCCESS, "file cost failed\n");
11011 /* try TARGETDIR after FileCost */
11013 lstrcpyA(path, "kiwi");
11014 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11015 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11016 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11017 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11019 /* try SourceDir after FileCost */
11021 lstrcpyA(path, "kiwi");
11022 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11024 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11025 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11027 /* try SOURCEDIR after FileCost */
11029 lstrcpyA(path, "kiwi");
11030 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11031 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11032 ok(!lstrcmpA(path, "kiwi"),
11033 "Expected path to be unchanged, got \"%s\"\n", path);
11034 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11036 /* source path does not exist, but the property exists */
11038 lstrcpyA(path, "kiwi");
11039 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11041 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11042 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11044 /* try SubDir after FileCost */
11046 lstrcpyA(path, "kiwi");
11047 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11048 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11049 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11050 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11052 /* try SubDir2 after FileCost */
11054 lstrcpyA(path, "kiwi");
11055 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11056 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11057 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11058 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11060 r = MsiDoAction(hpkg, "CostFinalize");
11061 ok(r == ERROR_SUCCESS, "file cost failed\n");
11063 /* try TARGETDIR after CostFinalize */
11065 lstrcpyA(path, "kiwi");
11066 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11068 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11069 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11071 /* try SourceDir after CostFinalize */
11073 lstrcpyA(path, "kiwi");
11074 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11076 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11077 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11079 /* try SOURCEDIR after CostFinalize */
11081 lstrcpyA(path, "kiwi");
11082 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11083 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11084 ok(!lstrcmpA(path, "kiwi"),
11085 "Expected path to be unchanged, got \"%s\"\n", path);
11086 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11088 /* source path does not exist, but the property exists */
11090 lstrcpyA(path, "kiwi");
11091 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11093 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11094 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11096 /* try SubDir after CostFinalize */
11098 lstrcpyA(path, "kiwi");
11099 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11100 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11101 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11102 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11104 /* try SubDir2 after CostFinalize */
11106 lstrcpyA(path, "kiwi");
11107 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11108 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11109 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11110 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11112 /* nonexistent directory */
11114 lstrcpyA(path, "kiwi");
11115 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
11116 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11117 ok(!lstrcmpA(path, "kiwi"),
11118 "Expected path to be unchanged, got \"%s\"\n", path);
11119 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11121 /* NULL szPathBuf */
11123 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
11124 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11125 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11127 /* NULL pcchPathBuf */
11128 lstrcpyA(path, "kiwi");
11129 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
11130 ok(r == ERROR_INVALID_PARAMETER,
11131 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11132 ok(!lstrcmpA(path, "kiwi"),
11133 "Expected path to be unchanged, got \"%s\"\n", path);
11135 /* pcchPathBuf is 0 */
11137 lstrcpyA(path, "kiwi");
11138 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11139 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11140 ok(!lstrcmpA(path, "kiwi"),
11141 "Expected path to be unchanged, got \"%s\"\n", path);
11142 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11144 /* pcchPathBuf does not have room for NULL terminator */
11145 size = lstrlenA(cwd);
11146 lstrcpyA(path, "kiwi");
11147 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11148 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11149 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
11150 "Expected path with no backslash, got \"%s\"\n", path);
11151 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11153 /* pcchPathBuf has room for NULL terminator */
11154 size = lstrlenA(cwd) + 1;
11155 lstrcpyA(path, "kiwi");
11156 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11157 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11158 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11159 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11161 /* remove property */
11162 r = MsiSetProperty(hpkg, "SourceDir", NULL);
11163 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11165 /* try SourceDir again */
11167 lstrcpyA(path, "kiwi");
11168 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11169 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11170 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11171 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11173 /* set property to a valid directory */
11174 r = MsiSetProperty(hpkg, "SOURCEDIR", cwd);
11175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11177 /* try SOURCEDIR again */
11179 lstrcpyA(path, "kiwi");
11180 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11181 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11182 ok(!lstrcmpA(path, "kiwi"),
11183 "Expected path to be unchanged, got \"%s\"\n", path);
11184 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11186 MsiCloseHandle(hpkg);
11188 /* compressed source */
11190 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11191 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11193 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
11195 r = package_from_db(hdb, &hpkg);
11196 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11198 /* try TARGETDIR */
11200 lstrcpyA(path, "kiwi");
11201 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11202 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11203 ok(!lstrcmpA(path, "kiwi"),
11204 "Expected path to be unchanged, got \"%s\"\n", path);
11205 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11207 /* try SourceDir */
11209 lstrcpyA(path, "kiwi");
11210 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11211 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11212 ok(!lstrcmpA(path, "kiwi"),
11213 "Expected path to be unchanged, got \"%s\"\n", path);
11214 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11216 /* try SOURCEDIR */
11218 lstrcpyA(path, "kiwi");
11219 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11220 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11221 ok(!lstrcmpA(path, "kiwi"),
11222 "Expected path to be unchanged, got \"%s\"\n", path);
11223 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11225 /* source path nor the property exist */
11227 lstrcpyA(path, "kiwi");
11228 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11229 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11230 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11231 ok(size == 0, "Expected 0, got %d\n", size);
11235 lstrcpyA(path, "kiwi");
11236 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11237 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11238 ok(!lstrcmpA(path, "kiwi"),
11239 "Expected path to be unchanged, got \"%s\"\n", path);
11240 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11244 lstrcpyA(path, "kiwi");
11245 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11246 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11247 ok(!lstrcmpA(path, "kiwi"),
11248 "Expected path to be unchanged, got \"%s\"\n", path);
11249 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11251 r = MsiDoAction(hpkg, "CostInitialize");
11252 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11254 /* try TARGETDIR after CostInitialize */
11256 lstrcpyA(path, "kiwi");
11257 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11258 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11259 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11260 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11262 /* try SourceDir after CostInitialize */
11264 lstrcpyA(path, "kiwi");
11265 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11266 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11267 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11268 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11270 /* try SOURCEDIR after CostInitialize */
11272 lstrcpyA(path, "kiwi");
11273 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11276 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11277 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11278 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11281 /* source path does not exist, but the property exists */
11283 lstrcpyA(path, "kiwi");
11284 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11285 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11288 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11289 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11292 /* try SubDir after CostInitialize */
11294 lstrcpyA(path, "kiwi");
11295 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11296 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11297 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11298 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11300 /* try SubDir2 after CostInitialize */
11302 lstrcpyA(path, "kiwi");
11303 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11304 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11305 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11306 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11308 r = MsiDoAction(hpkg, "ResolveSource");
11309 ok(r == ERROR_SUCCESS, "file cost failed\n");
11311 /* try TARGETDIR after ResolveSource */
11313 lstrcpyA(path, "kiwi");
11314 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11315 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11316 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11317 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11319 /* try SourceDir after ResolveSource */
11321 lstrcpyA(path, "kiwi");
11322 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11323 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11324 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11325 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11327 /* try SOURCEDIR after ResolveSource */
11329 lstrcpyA(path, "kiwi");
11330 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11333 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11334 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11335 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11338 /* source path and the property exist */
11340 lstrcpyA(path, "kiwi");
11341 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11342 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11343 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11344 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11346 /* try SubDir after ResolveSource */
11348 lstrcpyA(path, "kiwi");
11349 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11350 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11351 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11352 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11354 /* try SubDir2 after ResolveSource */
11356 lstrcpyA(path, "kiwi");
11357 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11358 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11359 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11360 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11362 r = MsiDoAction(hpkg, "FileCost");
11363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11365 /* try TARGETDIR after CostFinalize */
11367 lstrcpyA(path, "kiwi");
11368 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11370 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11371 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11373 /* try SourceDir after CostFinalize */
11375 lstrcpyA(path, "kiwi");
11376 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11378 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11379 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11381 /* try SOURCEDIR after CostFinalize */
11383 lstrcpyA(path, "kiwi");
11384 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11388 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11389 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11392 /* source path and the property exist */
11394 lstrcpyA(path, "kiwi");
11395 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11397 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11398 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11400 /* try SubDir after CostFinalize */
11402 lstrcpyA(path, "kiwi");
11403 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11405 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11406 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11408 /* try SubDir2 after CostFinalize */
11410 lstrcpyA(path, "kiwi");
11411 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11413 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11414 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11416 r = MsiDoAction(hpkg, "CostFinalize");
11417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11419 /* try TARGETDIR after CostFinalize */
11421 lstrcpyA(path, "kiwi");
11422 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11424 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11425 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11427 /* try SourceDir after CostFinalize */
11429 lstrcpyA(path, "kiwi");
11430 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11432 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11433 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11435 /* try SOURCEDIR after CostFinalize */
11437 lstrcpyA(path, "kiwi");
11438 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11442 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11443 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11446 /* source path and the property exist */
11448 lstrcpyA(path, "kiwi");
11449 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11451 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11452 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11454 /* try SubDir after CostFinalize */
11456 lstrcpyA(path, "kiwi");
11457 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11458 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11459 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11460 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11462 /* try SubDir2 after CostFinalize */
11464 lstrcpyA(path, "kiwi");
11465 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11467 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11468 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11470 MsiCloseHandle(hpkg);
11471 DeleteFile(msifile);
11474 static void test_shortlongsource(void)
11476 MSIHANDLE hdb, hpkg;
11477 CHAR path[MAX_PATH];
11478 CHAR cwd[MAX_PATH];
11479 CHAR subsrc[MAX_PATH];
11483 lstrcpyA(cwd, CURR_DIR);
11484 lstrcatA(cwd, "\\");
11486 lstrcpyA(subsrc, cwd);
11487 lstrcatA(subsrc, "long");
11488 lstrcatA(subsrc, "\\");
11490 /* long file names */
11492 hdb = create_package_db();
11493 ok( hdb, "failed to create database\n");
11495 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
11497 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11498 ok(r == S_OK, "failed\n");
11500 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
11501 ok(r == S_OK, "failed\n");
11503 /* CostInitialize:short */
11504 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
11505 ok(r == S_OK, "failed\n");
11507 /* CostInitialize:long */
11508 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
11509 ok(r == S_OK, "failed\n");
11511 /* FileCost:short */
11512 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
11513 ok(r == S_OK, "failed\n");
11515 /* FileCost:long */
11516 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
11517 ok(r == S_OK, "failed\n");
11519 /* CostFinalize:short */
11520 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
11521 ok(r == S_OK, "failed\n");
11523 /* CostFinalize:long */
11524 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
11525 ok(r == S_OK, "failed\n");
11527 MsiDatabaseCommit(hdb);
11529 r = package_from_db(hdb, &hpkg);
11530 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11532 skip("Not enough rights to perform tests\n");
11533 DeleteFile(msifile);
11536 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11538 MsiCloseHandle(hdb);
11540 CreateDirectoryA("one", NULL);
11541 CreateDirectoryA("four", NULL);
11543 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11545 r = MsiDoAction(hpkg, "CostInitialize");
11546 ok(r == ERROR_SUCCESS, "file cost failed\n");
11548 CreateDirectory("five", NULL);
11549 CreateDirectory("eight", NULL);
11551 r = MsiDoAction(hpkg, "FileCost");
11552 ok(r == ERROR_SUCCESS, "file cost failed\n");
11554 CreateDirectory("nine", NULL);
11555 CreateDirectory("twelve", NULL);
11557 r = MsiDoAction(hpkg, "CostFinalize");
11558 ok(r == ERROR_SUCCESS, "file cost failed\n");
11560 /* neither short nor long source directories exist */
11562 lstrcpyA(path, "kiwi");
11563 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11565 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11566 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11568 CreateDirectoryA("short", NULL);
11570 /* short source directory exists */
11572 lstrcpyA(path, "kiwi");
11573 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11575 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11576 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11578 CreateDirectoryA("long", NULL);
11580 /* both short and long source directories exist */
11582 lstrcpyA(path, "kiwi");
11583 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11584 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11585 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11586 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11588 lstrcpyA(subsrc, cwd);
11589 lstrcatA(subsrc, "two");
11590 lstrcatA(subsrc, "\\");
11592 /* short dir exists before CostInitialize */
11594 lstrcpyA(path, "kiwi");
11595 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11596 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11597 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11598 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11600 lstrcpyA(subsrc, cwd);
11601 lstrcatA(subsrc, "four");
11602 lstrcatA(subsrc, "\\");
11604 /* long dir exists before CostInitialize */
11606 lstrcpyA(path, "kiwi");
11607 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11608 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11609 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11610 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11612 lstrcpyA(subsrc, cwd);
11613 lstrcatA(subsrc, "six");
11614 lstrcatA(subsrc, "\\");
11616 /* short dir exists before FileCost */
11618 lstrcpyA(path, "kiwi");
11619 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11620 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11621 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11622 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11624 lstrcpyA(subsrc, cwd);
11625 lstrcatA(subsrc, "eight");
11626 lstrcatA(subsrc, "\\");
11628 /* long dir exists before FileCost */
11630 lstrcpyA(path, "kiwi");
11631 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11632 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11633 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11634 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11636 lstrcpyA(subsrc, cwd);
11637 lstrcatA(subsrc, "ten");
11638 lstrcatA(subsrc, "\\");
11640 /* short dir exists before CostFinalize */
11642 lstrcpyA(path, "kiwi");
11643 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11644 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11645 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11646 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11648 lstrcpyA(subsrc, cwd);
11649 lstrcatA(subsrc, "twelve");
11650 lstrcatA(subsrc, "\\");
11652 /* long dir exists before CostFinalize */
11654 lstrcpyA(path, "kiwi");
11655 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11656 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11657 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11658 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11660 MsiCloseHandle(hpkg);
11661 RemoveDirectoryA("short");
11662 RemoveDirectoryA("long");
11663 RemoveDirectoryA("one");
11664 RemoveDirectoryA("four");
11665 RemoveDirectoryA("five");
11666 RemoveDirectoryA("eight");
11667 RemoveDirectoryA("nine");
11668 RemoveDirectoryA("twelve");
11670 /* short file names */
11672 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11675 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
11677 r = package_from_db(hdb, &hpkg);
11678 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11680 MsiCloseHandle(hdb);
11682 CreateDirectoryA("one", NULL);
11683 CreateDirectoryA("four", NULL);
11685 r = MsiDoAction(hpkg, "CostInitialize");
11686 ok(r == ERROR_SUCCESS, "file cost failed\n");
11688 CreateDirectory("five", NULL);
11689 CreateDirectory("eight", NULL);
11691 r = MsiDoAction(hpkg, "FileCost");
11692 ok(r == ERROR_SUCCESS, "file cost failed\n");
11694 CreateDirectory("nine", NULL);
11695 CreateDirectory("twelve", NULL);
11697 r = MsiDoAction(hpkg, "CostFinalize");
11698 ok(r == ERROR_SUCCESS, "file cost failed\n");
11700 lstrcpyA(subsrc, cwd);
11701 lstrcatA(subsrc, "short");
11702 lstrcatA(subsrc, "\\");
11704 /* neither short nor long source directories exist */
11706 lstrcpyA(path, "kiwi");
11707 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11709 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11710 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11712 CreateDirectoryA("short", NULL);
11714 /* short source directory exists */
11716 lstrcpyA(path, "kiwi");
11717 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11719 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11720 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11722 CreateDirectoryA("long", NULL);
11724 /* both short and long source directories exist */
11726 lstrcpyA(path, "kiwi");
11727 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11728 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11729 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11730 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11732 lstrcpyA(subsrc, cwd);
11733 lstrcatA(subsrc, "one");
11734 lstrcatA(subsrc, "\\");
11736 /* short dir exists before CostInitialize */
11738 lstrcpyA(path, "kiwi");
11739 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11740 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11741 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11742 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11744 lstrcpyA(subsrc, cwd);
11745 lstrcatA(subsrc, "three");
11746 lstrcatA(subsrc, "\\");
11748 /* long dir exists before CostInitialize */
11750 lstrcpyA(path, "kiwi");
11751 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11753 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11754 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11756 lstrcpyA(subsrc, cwd);
11757 lstrcatA(subsrc, "five");
11758 lstrcatA(subsrc, "\\");
11760 /* short dir exists before FileCost */
11762 lstrcpyA(path, "kiwi");
11763 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11764 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11765 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11766 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11768 lstrcpyA(subsrc, cwd);
11769 lstrcatA(subsrc, "seven");
11770 lstrcatA(subsrc, "\\");
11772 /* long dir exists before FileCost */
11774 lstrcpyA(path, "kiwi");
11775 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11776 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11777 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11778 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11780 lstrcpyA(subsrc, cwd);
11781 lstrcatA(subsrc, "nine");
11782 lstrcatA(subsrc, "\\");
11784 /* short dir exists before CostFinalize */
11786 lstrcpyA(path, "kiwi");
11787 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11789 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11790 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11792 lstrcpyA(subsrc, cwd);
11793 lstrcatA(subsrc, "eleven");
11794 lstrcatA(subsrc, "\\");
11796 /* long dir exists before CostFinalize */
11798 lstrcpyA(path, "kiwi");
11799 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11800 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11801 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11802 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11804 MsiCloseHandle(hpkg);
11805 RemoveDirectoryA("short");
11806 RemoveDirectoryA("long");
11807 RemoveDirectoryA("one");
11808 RemoveDirectoryA("four");
11809 RemoveDirectoryA("five");
11810 RemoveDirectoryA("eight");
11811 RemoveDirectoryA("nine");
11812 RemoveDirectoryA("twelve");
11813 DeleteFileA(msifile);
11816 static void test_sourcedir(void)
11818 MSIHANDLE hdb, hpkg;
11820 CHAR path[MAX_PATH];
11821 CHAR cwd[MAX_PATH];
11822 CHAR subsrc[MAX_PATH];
11826 lstrcpyA(cwd, CURR_DIR);
11827 lstrcatA(cwd, "\\");
11829 lstrcpyA(subsrc, cwd);
11830 lstrcatA(subsrc, "long");
11831 lstrcatA(subsrc, "\\");
11833 hdb = create_package_db();
11834 ok( hdb, "failed to create database\n");
11836 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11837 ok(r == S_OK, "failed\n");
11839 sprintf(package, "#%u", hdb);
11840 r = MsiOpenPackage(package, &hpkg);
11841 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11843 skip("Not enough rights to perform tests\n");
11846 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11848 /* properties only */
11850 /* SourceDir prop */
11852 lstrcpyA(path, "kiwi");
11853 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11855 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11856 ok(size == 0, "Expected 0, got %d\n", size);
11858 /* SOURCEDIR prop */
11860 lstrcpyA(path, "kiwi");
11861 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11862 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11863 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11864 ok(size == 0, "Expected 0, got %d\n", size);
11866 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11868 r = MsiDoAction(hpkg, "CostInitialize");
11869 ok(r == ERROR_SUCCESS, "file cost failed\n");
11871 /* SourceDir after CostInitialize */
11873 lstrcpyA(path, "kiwi");
11874 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11875 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11876 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11877 ok(size == 0, "Expected 0, got %d\n", size);
11879 /* SOURCEDIR after CostInitialize */
11881 lstrcpyA(path, "kiwi");
11882 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11883 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11884 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11885 ok(size == 0, "Expected 0, got %d\n", size);
11887 r = MsiDoAction(hpkg, "FileCost");
11888 ok(r == ERROR_SUCCESS, "file cost failed\n");
11890 /* SourceDir after FileCost */
11892 lstrcpyA(path, "kiwi");
11893 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11895 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11896 ok(size == 0, "Expected 0, got %d\n", size);
11898 /* SOURCEDIR after FileCost */
11900 lstrcpyA(path, "kiwi");
11901 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11903 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11904 ok(size == 0, "Expected 0, got %d\n", size);
11906 r = MsiDoAction(hpkg, "CostFinalize");
11907 ok(r == ERROR_SUCCESS, "file cost failed\n");
11909 /* SourceDir after CostFinalize */
11911 lstrcpyA(path, "kiwi");
11912 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11913 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11914 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11915 ok(size == 0, "Expected 0, got %d\n", size);
11917 /* SOURCEDIR after CostFinalize */
11919 lstrcpyA(path, "kiwi");
11920 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11921 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11922 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11923 ok(size == 0, "Expected 0, got %d\n", size);
11925 r = MsiDoAction(hpkg, "ResolveSource");
11926 ok(r == ERROR_SUCCESS, "file cost failed\n");
11928 /* SourceDir after ResolveSource */
11930 lstrcpyA(path, "kiwi");
11931 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11933 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11934 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11936 /* SOURCEDIR after ResolveSource */
11938 lstrcpyA(path, "kiwi");
11939 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11940 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11941 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11942 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11944 /* random casing */
11946 lstrcpyA(path, "kiwi");
11947 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
11948 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11949 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11950 ok(size == 0, "Expected 0, got %d\n", size);
11952 MsiCloseHandle(hpkg);
11954 /* reset the package state */
11955 sprintf(package, "#%i", hdb);
11956 r = MsiOpenPackage(package, &hpkg);
11957 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11959 /* test how MsiGetSourcePath affects the properties */
11961 /* SourceDir prop */
11963 lstrcpyA(path, "kiwi");
11964 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11965 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11968 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11969 ok(size == 0, "Expected 0, got %d\n", size);
11973 lstrcpyA(path, "kiwi");
11974 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11975 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11976 ok(!lstrcmpA(path, "kiwi"),
11977 "Expected path to be unchanged, got \"%s\"\n", path);
11978 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11980 /* SourceDir after MsiGetSourcePath */
11982 lstrcpyA(path, "kiwi");
11983 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11984 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11987 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11988 ok(size == 0, "Expected 0, got %d\n", size);
11991 /* SOURCEDIR prop */
11993 lstrcpyA(path, "kiwi");
11994 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11995 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11998 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11999 ok(size == 0, "Expected 0, got %d\n", size);
12003 lstrcpyA(path, "kiwi");
12004 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12005 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12006 ok(!lstrcmpA(path, "kiwi"),
12007 "Expected path to be unchanged, got \"%s\"\n", path);
12008 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12010 /* SOURCEDIR prop after MsiGetSourcePath */
12012 lstrcpyA(path, "kiwi");
12013 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12017 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12018 ok(size == 0, "Expected 0, got %d\n", size);
12021 r = MsiDoAction(hpkg, "CostInitialize");
12022 ok(r == ERROR_SUCCESS, "file cost failed\n");
12024 /* SourceDir after CostInitialize */
12026 lstrcpyA(path, "kiwi");
12027 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12028 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12031 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12032 ok(size == 0, "Expected 0, got %d\n", size);
12036 lstrcpyA(path, "kiwi");
12037 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
12038 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12039 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12040 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12042 /* SourceDir after MsiGetSourcePath */
12044 lstrcpyA(path, "kiwi");
12045 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12046 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12047 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12048 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12050 /* SOURCEDIR after CostInitialize */
12052 lstrcpyA(path, "kiwi");
12053 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12055 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12056 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12058 /* SOURCEDIR source path still does not exist */
12060 lstrcpyA(path, "kiwi");
12061 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12062 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12063 ok(!lstrcmpA(path, "kiwi"),
12064 "Expected path to be unchanged, got \"%s\"\n", path);
12065 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12067 r = MsiDoAction(hpkg, "FileCost");
12068 ok(r == ERROR_SUCCESS, "file cost failed\n");
12070 /* SourceDir after FileCost */
12072 lstrcpyA(path, "kiwi");
12073 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12074 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12075 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12076 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12078 /* SOURCEDIR after FileCost */
12080 lstrcpyA(path, "kiwi");
12081 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12083 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12084 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12086 /* SOURCEDIR source path still does not exist */
12088 lstrcpyA(path, "kiwi");
12089 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12090 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12091 ok(!lstrcmpA(path, "kiwi"),
12092 "Expected path to be unchanged, got \"%s\"\n", path);
12093 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12095 r = MsiDoAction(hpkg, "CostFinalize");
12096 ok(r == ERROR_SUCCESS, "file cost failed\n");
12098 /* SourceDir after CostFinalize */
12100 lstrcpyA(path, "kiwi");
12101 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12103 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12104 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12106 /* SOURCEDIR after CostFinalize */
12108 lstrcpyA(path, "kiwi");
12109 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12111 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12112 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12114 /* SOURCEDIR source path still does not exist */
12116 lstrcpyA(path, "kiwi");
12117 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12118 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12119 ok(!lstrcmpA(path, "kiwi"),
12120 "Expected path to be unchanged, got \"%s\"\n", path);
12121 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12123 r = MsiDoAction(hpkg, "ResolveSource");
12124 ok(r == ERROR_SUCCESS, "file cost failed\n");
12126 /* SourceDir after ResolveSource */
12128 lstrcpyA(path, "kiwi");
12129 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12131 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12132 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12134 /* SOURCEDIR after ResolveSource */
12136 lstrcpyA(path, "kiwi");
12137 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12139 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12140 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12142 /* SOURCEDIR source path still does not exist */
12144 lstrcpyA(path, "kiwi");
12145 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12146 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12147 ok(!lstrcmpA(path, "kiwi"),
12148 "Expected path to be unchanged, got \"%s\"\n", path);
12149 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12151 MsiCloseHandle(hpkg);
12154 MsiCloseHandle(hdb);
12155 DeleteFileA(msifile);
12165 static const struct access_res create[16] =
12167 { TRUE, ERROR_SUCCESS, TRUE },
12168 { TRUE, ERROR_SUCCESS, TRUE },
12169 { TRUE, ERROR_SUCCESS, FALSE },
12170 { TRUE, ERROR_SUCCESS, FALSE },
12171 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12172 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12173 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12174 { TRUE, ERROR_SUCCESS, FALSE },
12175 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12176 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12177 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12178 { TRUE, ERROR_SUCCESS, TRUE },
12179 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12180 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12181 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12182 { TRUE, ERROR_SUCCESS, TRUE }
12185 static const struct access_res create_commit[16] =
12187 { TRUE, ERROR_SUCCESS, TRUE },
12188 { TRUE, ERROR_SUCCESS, TRUE },
12189 { TRUE, ERROR_SUCCESS, FALSE },
12190 { TRUE, ERROR_SUCCESS, FALSE },
12191 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12192 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12193 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12194 { TRUE, ERROR_SUCCESS, FALSE },
12195 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12196 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12197 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12198 { TRUE, ERROR_SUCCESS, TRUE },
12199 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12200 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12201 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12202 { TRUE, ERROR_SUCCESS, TRUE }
12205 static const struct access_res create_close[16] =
12207 { TRUE, ERROR_SUCCESS, FALSE },
12208 { TRUE, ERROR_SUCCESS, FALSE },
12209 { TRUE, ERROR_SUCCESS, FALSE },
12210 { TRUE, ERROR_SUCCESS, FALSE },
12211 { TRUE, ERROR_SUCCESS, FALSE },
12212 { TRUE, ERROR_SUCCESS, FALSE },
12213 { TRUE, ERROR_SUCCESS, FALSE },
12214 { TRUE, ERROR_SUCCESS, FALSE },
12215 { TRUE, ERROR_SUCCESS, FALSE },
12216 { TRUE, ERROR_SUCCESS, FALSE },
12217 { TRUE, ERROR_SUCCESS, FALSE },
12218 { TRUE, ERROR_SUCCESS, FALSE },
12219 { TRUE, ERROR_SUCCESS, FALSE },
12220 { TRUE, ERROR_SUCCESS, FALSE },
12221 { TRUE, ERROR_SUCCESS, FALSE },
12222 { TRUE, ERROR_SUCCESS }
12225 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
12227 DWORD access = 0, share = 0;
12232 for (i = 0; i < 4; i++)
12234 if (i == 0) access = 0;
12235 if (i == 1) access = GENERIC_READ;
12236 if (i == 2) access = GENERIC_WRITE;
12237 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
12239 for (j = 0; j < 4; j++)
12241 if (ares[idx].ignore)
12244 if (j == 0) share = 0;
12245 if (j == 1) share = FILE_SHARE_READ;
12246 if (j == 2) share = FILE_SHARE_WRITE;
12247 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
12249 SetLastError(0xdeadbeef);
12250 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
12251 FILE_ATTRIBUTE_NORMAL, 0);
12252 lasterr = GetLastError();
12254 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
12255 "(%d, handle, %d): Expected %d, got %d\n",
12256 line, idx, ares[idx].gothandle,
12257 (hfile != INVALID_HANDLE_VALUE));
12259 ok(lasterr == ares[idx].lasterr ||
12260 lasterr == 0xdeadbeef, /* win9x */
12261 "(%d, lasterr, %d): Expected %d, got %d\n",
12262 line, idx, ares[idx].lasterr, lasterr);
12264 CloseHandle(hfile);
12270 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
12272 static void test_access(void)
12277 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
12278 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12280 test_file_access(msifile, create);
12282 r = MsiDatabaseCommit(hdb);
12283 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12285 test_file_access(msifile, create_commit);
12286 MsiCloseHandle(hdb);
12288 test_file_access(msifile, create_close);
12289 DeleteFileA(msifile);
12291 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
12292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12294 test_file_access(msifile, create);
12296 r = MsiDatabaseCommit(hdb);
12297 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12299 test_file_access(msifile, create_commit);
12300 MsiCloseHandle(hdb);
12302 test_file_access(msifile, create_close);
12303 DeleteFileA(msifile);
12306 static void test_emptypackage(void)
12308 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
12309 MSIHANDLE hview = 0, hrec = 0;
12310 MSICONDITION condition;
12311 CHAR buffer[MAX_PATH];
12315 r = MsiOpenPackageA("", &hpkg);
12316 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12318 skip("Not enough rights to perform tests\n");
12323 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12326 hdb = MsiGetActiveDatabase(hpkg);
12329 ok(hdb != 0, "Expected a valid database handle\n");
12332 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
12335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12337 r = MsiViewExecute(hview, 0);
12340 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12343 r = MsiViewFetch(hview, &hrec);
12346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12351 r = MsiRecordGetString(hrec, 1, buffer, &size);
12354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12355 ok(!lstrcmpA(buffer, "_Property"),
12356 "Expected \"_Property\", got \"%s\"\n", buffer);
12359 MsiCloseHandle(hrec);
12361 r = MsiViewFetch(hview, &hrec);
12364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12368 r = MsiRecordGetString(hrec, 1, buffer, &size);
12371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12372 ok(!lstrcmpA(buffer, "#_FolderCache"),
12373 "Expected \"_Property\", got \"%s\"\n", buffer);
12376 MsiCloseHandle(hrec);
12377 MsiViewClose(hview);
12378 MsiCloseHandle(hview);
12380 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
12383 ok(condition == MSICONDITION_FALSE,
12384 "Expected MSICONDITION_FALSE, got %d\n", condition);
12387 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
12390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12392 r = MsiViewExecute(hview, 0);
12395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12398 /* _Property table is not empty */
12399 r = MsiViewFetch(hview, &hrec);
12402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12405 MsiCloseHandle(hrec);
12406 MsiViewClose(hview);
12407 MsiCloseHandle(hview);
12409 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
12412 ok(condition == MSICONDITION_FALSE,
12413 "Expected MSICONDITION_FALSE, got %d\n", condition);
12416 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
12419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12421 r = MsiViewExecute(hview, 0);
12424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12427 /* #_FolderCache is not empty */
12428 r = MsiViewFetch(hview, &hrec);
12431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12434 MsiCloseHandle(hrec);
12435 MsiViewClose(hview);
12436 MsiCloseHandle(hview);
12438 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
12441 ok(r == ERROR_BAD_QUERY_SYNTAX,
12442 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12445 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
12448 ok(r == ERROR_BAD_QUERY_SYNTAX,
12449 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12452 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
12455 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
12456 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
12459 MsiCloseHandle(hsuminfo);
12461 r = MsiDatabaseCommit(hdb);
12464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12467 MsiCloseHandle(hdb);
12468 MsiCloseHandle(hpkg);
12471 static void test_MsiGetProductProperty(void)
12473 MSIHANDLE hprod, hdb;
12474 CHAR val[MAX_PATH];
12475 CHAR path[MAX_PATH];
12476 CHAR query[MAX_PATH];
12477 CHAR keypath[MAX_PATH*2];
12478 CHAR prodcode[MAX_PATH];
12479 CHAR prod_squashed[MAX_PATH];
12480 HKEY prodkey, userkey, props;
12485 REGSAM access = KEY_ALL_ACCESS;
12487 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
12488 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
12490 win_skip("Different registry keys on Win9x and WinMe\n");
12493 CloseServiceHandle(scm);
12495 GetCurrentDirectoryA(MAX_PATH, path);
12496 lstrcatA(path, "\\");
12498 create_test_guid(prodcode, prod_squashed);
12501 access |= KEY_WOW64_64KEY;
12503 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
12504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12506 r = MsiDatabaseCommit(hdb);
12507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12509 r = set_summary_info(hdb);
12510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12513 "CREATE TABLE `Directory` ( "
12514 "`Directory` CHAR(255) NOT NULL, "
12515 "`Directory_Parent` CHAR(255), "
12516 "`DefaultDir` CHAR(255) NOT NULL "
12517 "PRIMARY KEY `Directory`)");
12518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12521 "CREATE TABLE `Property` ( "
12522 "`Property` CHAR(72) NOT NULL, "
12523 "`Value` CHAR(255) "
12524 "PRIMARY KEY `Property`)");
12525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12527 sprintf(query, "INSERT INTO `Property` "
12528 "(`Property`, `Value`) "
12529 "VALUES( 'ProductCode', '%s' )", prodcode);
12530 r = run_query(hdb, query);
12531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12533 r = MsiDatabaseCommit(hdb);
12534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12536 MsiCloseHandle(hdb);
12538 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
12539 lstrcatA(keypath, prod_squashed);
12541 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL);
12542 if (res == ERROR_ACCESS_DENIED)
12544 skip("Not enough rights to perform tests\n");
12545 DeleteFile(msifile);
12548 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12550 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
12551 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
12552 lstrcatA(keypath, prod_squashed);
12554 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL);
12555 if (res == ERROR_ACCESS_DENIED)
12557 skip("Not enough rights to perform tests\n");
12558 RegDeleteKeyA(prodkey, "");
12559 RegCloseKey(prodkey);
12562 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12564 res = RegCreateKeyExA(userkey, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
12565 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12567 lstrcpyA(val, path);
12568 lstrcatA(val, "\\");
12569 lstrcatA(val, msifile);
12570 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
12571 (const BYTE *)val, lstrlenA(val) + 1);
12572 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12574 hprod = 0xdeadbeef;
12575 r = MsiOpenProductA(prodcode, &hprod);
12576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12577 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
12579 /* hProduct is invalid */
12581 lstrcpyA(val, "apple");
12582 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
12583 ok(r == ERROR_INVALID_HANDLE,
12584 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12585 ok(!lstrcmpA(val, "apple"),
12586 "Expected val to be unchanged, got \"%s\"\n", val);
12587 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12589 /* szProperty is NULL */
12591 lstrcpyA(val, "apple");
12592 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
12593 ok(r == ERROR_INVALID_PARAMETER,
12594 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12595 ok(!lstrcmpA(val, "apple"),
12596 "Expected val to be unchanged, got \"%s\"\n", val);
12597 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12599 /* szProperty is empty */
12601 lstrcpyA(val, "apple");
12602 r = MsiGetProductPropertyA(hprod, "", val, &size);
12603 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12604 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12605 ok(size == 0, "Expected 0, got %d\n", size);
12607 /* get the property */
12609 lstrcpyA(val, "apple");
12610 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12611 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12612 ok(!lstrcmpA(val, prodcode),
12613 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12614 ok(size == lstrlenA(prodcode),
12615 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12617 /* lpValueBuf is NULL */
12619 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
12620 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12621 ok(size == lstrlenA(prodcode),
12622 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12624 /* pcchValueBuf is NULL */
12625 lstrcpyA(val, "apple");
12626 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
12627 ok(r == ERROR_INVALID_PARAMETER,
12628 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12629 ok(!lstrcmpA(val, "apple"),
12630 "Expected val to be unchanged, got \"%s\"\n", val);
12631 ok(size == lstrlenA(prodcode),
12632 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12634 /* pcchValueBuf is too small */
12636 lstrcpyA(val, "apple");
12637 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12638 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12639 ok(!strncmp(val, prodcode, 3),
12640 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
12641 ok(size == lstrlenA(prodcode),
12642 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12644 /* pcchValueBuf does not leave room for NULL terminator */
12645 size = lstrlenA(prodcode);
12646 lstrcpyA(val, "apple");
12647 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12648 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12649 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
12650 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
12651 ok(size == lstrlenA(prodcode),
12652 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12654 /* pcchValueBuf has enough room for NULL terminator */
12655 size = lstrlenA(prodcode) + 1;
12656 lstrcpyA(val, "apple");
12657 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12659 ok(!lstrcmpA(val, prodcode),
12660 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12661 ok(size == lstrlenA(prodcode),
12662 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12664 /* nonexistent property */
12666 lstrcpyA(val, "apple");
12667 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
12668 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12669 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12670 ok(size == 0, "Expected 0, got %d\n", size);
12672 r = MsiSetPropertyA(hprod, "NewProperty", "value");
12673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12675 /* non-product property set */
12677 lstrcpyA(val, "apple");
12678 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
12679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12680 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12681 ok(size == 0, "Expected 0, got %d\n", size);
12683 r = MsiSetPropertyA(hprod, "ProductCode", "value");
12684 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12686 /* non-product property that is also a product property set */
12688 lstrcpyA(val, "apple");
12689 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12690 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12691 ok(!lstrcmpA(val, prodcode),
12692 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12693 ok(size == lstrlenA(prodcode),
12694 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12696 MsiCloseHandle(hprod);
12698 RegDeleteValueA(props, "LocalPackage");
12699 delete_key(props, "", access);
12700 RegCloseKey(props);
12701 delete_key(userkey, "", access);
12702 RegCloseKey(userkey);
12703 delete_key(prodkey, "", access);
12704 RegCloseKey(prodkey);
12705 DeleteFileA(msifile);
12708 static void test_MsiSetProperty(void)
12710 MSIHANDLE hpkg, hdb, hrec;
12711 CHAR buf[MAX_PATH];
12716 r = package_from_db(create_package_db(), &hpkg);
12717 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12719 skip("Not enough rights to perform tests\n");
12720 DeleteFile(msifile);
12723 ok(r == ERROR_SUCCESS, "Expected a valid package %u\n", r);
12725 /* invalid hInstall */
12726 r = MsiSetPropertyA(0, "Prop", "Val");
12727 ok(r == ERROR_INVALID_HANDLE,
12728 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12730 /* invalid hInstall */
12731 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12732 ok(r == ERROR_INVALID_HANDLE,
12733 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12735 /* szName is NULL */
12736 r = MsiSetPropertyA(hpkg, NULL, "Val");
12737 ok(r == ERROR_INVALID_PARAMETER,
12738 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12740 /* both szName and szValue are NULL */
12741 r = MsiSetPropertyA(hpkg, NULL, NULL);
12742 ok(r == ERROR_INVALID_PARAMETER,
12743 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12745 /* szName is empty */
12746 r = MsiSetPropertyA(hpkg, "", "Val");
12747 ok(r == ERROR_FUNCTION_FAILED,
12748 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
12750 /* szName is empty and szValue is NULL */
12751 r = MsiSetPropertyA(hpkg, "", NULL);
12752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12754 /* set a property */
12755 r = MsiSetPropertyA(hpkg, "Prop", "Val");
12756 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12758 /* get the property */
12760 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12762 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
12763 ok(size == 3, "Expected 3, got %d\n", size);
12765 /* update the property */
12766 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
12767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12769 /* get the property */
12771 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12772 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12773 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
12774 ok(size == 4, "Expected 4, got %d\n", size);
12776 hdb = MsiGetActiveDatabase(hpkg);
12777 ok(hdb != 0, "Expected a valid database handle\n");
12779 /* set prop is not in the _Property table */
12780 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12781 r = do_query(hdb, query, &hrec);
12782 ok(r == ERROR_BAD_QUERY_SYNTAX,
12783 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12785 /* set prop is not in the Property table */
12786 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12787 r = do_query(hdb, query, &hrec);
12788 ok(r == ERROR_BAD_QUERY_SYNTAX,
12789 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12791 MsiCloseHandle(hdb);
12793 /* szValue is an empty string */
12794 r = MsiSetPropertyA(hpkg, "Prop", "");
12795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12797 /* try to get the property */
12799 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12800 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12801 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12802 ok(size == 0, "Expected 0, got %d\n", size);
12804 /* reset the property */
12805 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
12806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12808 /* delete the property */
12809 r = MsiSetPropertyA(hpkg, "Prop", NULL);
12810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12812 /* try to get the property */
12814 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12816 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12817 ok(size == 0, "Expected 0, got %d\n", size);
12819 MsiCloseHandle(hpkg);
12820 DeleteFileA(msifile);
12823 static void test_MsiApplyMultiplePatches(void)
12825 UINT r, type = GetDriveType(NULL);
12827 if (!pMsiApplyMultiplePatchesA) {
12828 win_skip("MsiApplyMultiplePatchesA not found\n");
12832 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
12833 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12835 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
12836 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12838 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
12839 if (type == DRIVE_FIXED)
12840 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12842 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12844 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
12845 if (type == DRIVE_FIXED)
12846 todo_wine ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED, "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
12848 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12850 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
12851 if (type == DRIVE_FIXED)
12852 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12854 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12856 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
12857 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12859 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
12860 if (type == DRIVE_FIXED)
12861 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12863 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12865 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
12866 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12868 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
12869 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12872 static void test_MsiApplyPatch(void)
12876 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
12877 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12879 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
12880 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12883 START_TEST(package)
12885 STATEMGRSTATUS status;
12888 init_functionpointers();
12890 if (pIsWow64Process)
12891 pIsWow64Process(GetCurrentProcess(), &is_wow64);
12893 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
12895 /* Create a restore point ourselves so we circumvent the multitude of restore points
12896 * that would have been created by all the installation and removal tests.
12898 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
12899 * creation of restore points.
12901 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
12903 memset(&status, 0, sizeof(status));
12904 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
12907 test_createpackage();
12909 test_gettargetpath_bad();
12910 test_settargetpath();
12912 test_property_table();
12915 test_formatrecord2();
12917 test_getproperty();
12918 test_removefiles();
12920 test_appsearch_complocator();
12921 test_appsearch_reglocator();
12922 test_appsearch_inilocator();
12923 test_appsearch_drlocator();
12924 test_featureparents();
12925 test_installprops();
12926 test_launchconditions();
12928 test_complocator();
12929 test_MsiGetSourcePath();
12930 test_shortlongsource();
12933 test_emptypackage();
12934 test_MsiGetProductProperty();
12935 test_MsiSetProperty();
12936 test_MsiApplyMultiplePatches();
12937 test_MsiApplyPatch();
12939 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
12941 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
12943 remove_restore_point(status.llSequenceNumber);