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 void (WINAPI *pGetNativeSystemInfo)(LPSYSTEM_INFO);
50 static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR, UINT);
52 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
53 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
55 static void init_functionpointers(void)
57 HMODULE hmsi = GetModuleHandleA("msi.dll");
58 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
59 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
60 HMODULE hshell32 = GetModuleHandleA("shell32.dll");
63 #define GET_PROC(mod, func) \
64 p ## func = (void*)GetProcAddress(mod, #func);
66 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
67 GET_PROC(hmsi, MsiGetComponentPathExA);
68 GET_PROC(hshell32, SHGetFolderPathA);
70 GET_PROC(hadvapi32, ConvertSidToStringSidA);
71 GET_PROC(hadvapi32, GetTokenInformation);
72 GET_PROC(hadvapi32, OpenProcessToken);
73 GET_PROC(hadvapi32, RegDeleteKeyExA)
74 GET_PROC(hadvapi32, RegDeleteKeyExW)
75 GET_PROC(hkernel32, IsWow64Process)
76 GET_PROC(hkernel32, GetNativeSystemInfo)
77 GET_PROC(hkernel32, GetSystemInfo)
78 GET_PROC(hkernel32, GetSystemWow64DirectoryA)
80 hsrclient = LoadLibraryA("srclient.dll");
81 GET_PROC(hsrclient, SRRemoveRestorePoint);
82 GET_PROC(hsrclient, SRSetRestorePointA);
86 static BOOL is_process_limited(void)
90 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
92 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
95 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
98 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
100 return (ret && type == TokenElevationTypeLimited);
105 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
107 if (pRegDeleteKeyExA)
108 return pRegDeleteKeyExA( key, subkey, access, 0 );
109 return RegDeleteKeyA( key, subkey );
112 static char *get_user_sid(void)
117 char *usersid = NULL;
119 if (!pConvertSidToStringSidA)
121 win_skip("ConvertSidToStringSidA is not available\n");
124 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
125 GetTokenInformation(token, TokenUser, NULL, size, &size);
127 user = HeapAlloc(GetProcessHeap(), 0, size);
128 GetTokenInformation(token, TokenUser, user, size, &size);
129 pConvertSidToStringSidA(user->User.Sid, &usersid);
130 HeapFree(GetProcessHeap(), 0, user);
136 /* RegDeleteTreeW from dlls/advapi32/registry.c */
137 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM access)
140 DWORD dwMaxSubkeyLen, dwMaxValueLen;
141 DWORD dwMaxLen, dwSize;
142 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
147 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, access, &hSubKey);
151 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
152 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
153 if (ret) goto cleanup;
157 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
158 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
160 /* Name too big: alloc a buffer for it */
161 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
163 ret = ERROR_NOT_ENOUGH_MEMORY;
168 /* Recursively delete all the subkeys */
172 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
173 NULL, NULL, NULL)) break;
175 ret = package_RegDeleteTreeW(hSubKey, lpszName, access);
176 if (ret) goto cleanup;
181 if (pRegDeleteKeyExW)
182 ret = pRegDeleteKeyExW(hKey, lpszSubKey, access, 0);
184 ret = RegDeleteKeyW(hKey, lpszSubKey);
190 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
191 NULL, NULL, NULL, NULL)) break;
193 ret = RegDeleteValueW(hKey, lpszName);
194 if (ret) goto cleanup;
198 if (lpszName != szNameBuf)
199 HeapFree(GetProcessHeap(), 0, lpszName);
201 RegCloseKey(hSubKey);
205 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
210 if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid)))
224 out[17+i*2] = in[n++];
225 out[16+i*2] = in[n++];
230 out[17+i*2] = in[n++];
231 out[16+i*2] = in[n++];
237 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
239 WCHAR guidW[MAX_PATH];
240 WCHAR squashedW[MAX_PATH];
245 hr = CoCreateGuid(&guid);
246 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
248 size = StringFromGUID2(&guid, guidW, MAX_PATH);
249 ok(size == 39, "Expected 39, got %d\n", hr);
251 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
252 squash_guid(guidW, squashedW);
253 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
256 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
257 LPCSTR guid, LPSTR usersid, BOOL dir)
259 WCHAR guidW[MAX_PATH];
260 WCHAR squashedW[MAX_PATH];
261 CHAR squashed[MAX_PATH];
262 CHAR comppath[MAX_PATH];
263 CHAR prodpath[MAX_PATH];
267 REGSAM access = KEY_ALL_ACCESS;
270 access |= KEY_WOW64_64KEY;
272 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
273 squash_guid(guidW, squashedW);
274 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
276 if (context == MSIINSTALLCONTEXT_MACHINE)
278 prod = "3D0DAE300FACA1300AD792060BCDAA92";
280 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
281 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
283 "SOFTWARE\\Classes\\Installer\\"
284 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
286 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
288 prod = "7D2F387510109040002000060BECB6AB";
290 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
291 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
293 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
294 "Installer\\%s\\Installer\\Products\\"
295 "7D2F387510109040002000060BECB6AB", usersid);
297 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
299 prod = "7D2F387510109040002000060BECB6AB";
301 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
302 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
304 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
305 "Installer\\Managed\\%s\\Installer\\Products\\"
306 "7D2F387510109040002000060BECB6AB", usersid);
309 RegCreateKeyExA(HKEY_LOCAL_MACHINE, comppath, 0, NULL, 0, access, NULL, &hkey, NULL);
311 lstrcpyA(path, CURR_DIR);
312 lstrcatA(path, "\\");
313 if (!dir) lstrcatA(path, filename);
315 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
318 RegCreateKeyExA(HKEY_LOCAL_MACHINE, prodpath, 0, NULL, 0, access, NULL, &hkey, NULL);
322 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
324 WCHAR guidW[MAX_PATH];
325 WCHAR squashedW[MAX_PATH];
326 WCHAR substrW[MAX_PATH];
327 CHAR squashed[MAX_PATH];
328 CHAR comppath[MAX_PATH];
329 CHAR prodpath[MAX_PATH];
330 REGSAM access = KEY_ALL_ACCESS;
333 access |= KEY_WOW64_64KEY;
335 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
336 squash_guid(guidW, squashedW);
337 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
339 if (context == MSIINSTALLCONTEXT_MACHINE)
342 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
343 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
345 "SOFTWARE\\Classes\\Installer\\"
346 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
348 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
351 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
352 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
354 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
355 "Installer\\%s\\Installer\\Products\\"
356 "7D2F387510109040002000060BECB6AB", usersid);
358 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
361 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
362 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
364 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
365 "Installer\\Managed\\%s\\Installer\\Products\\"
366 "7D2F387510109040002000060BECB6AB", usersid);
369 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
370 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
372 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
373 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
376 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
381 /* open a select query */
382 r = MsiDatabaseOpenView(hdb, query, &hview);
383 if (r != ERROR_SUCCESS)
385 r = MsiViewExecute(hview, 0);
386 if (r != ERROR_SUCCESS)
388 ret = MsiViewFetch(hview, phrec);
389 r = MsiViewClose(hview);
390 if (r != ERROR_SUCCESS)
392 r = MsiCloseHandle(hview);
393 if (r != ERROR_SUCCESS)
398 static UINT run_query( MSIHANDLE hdb, const char *query )
403 r = MsiDatabaseOpenView(hdb, query, &hview);
404 if( r != ERROR_SUCCESS )
407 r = MsiViewExecute(hview, 0);
408 if( r == ERROR_SUCCESS )
409 r = MsiViewClose(hview);
410 MsiCloseHandle(hview);
414 static UINT create_component_table( MSIHANDLE hdb )
416 return run_query( hdb,
417 "CREATE TABLE `Component` ( "
418 "`Component` CHAR(72) NOT NULL, "
419 "`ComponentId` CHAR(38), "
420 "`Directory_` CHAR(72) NOT NULL, "
421 "`Attributes` SHORT NOT NULL, "
422 "`Condition` CHAR(255), "
423 "`KeyPath` CHAR(72) "
424 "PRIMARY KEY `Component`)" );
427 static UINT create_feature_table( MSIHANDLE hdb )
429 return run_query( hdb,
430 "CREATE TABLE `Feature` ( "
431 "`Feature` CHAR(38) NOT NULL, "
432 "`Feature_Parent` CHAR(38), "
434 "`Description` CHAR(255), "
435 "`Display` SHORT NOT NULL, "
436 "`Level` SHORT NOT NULL, "
437 "`Directory_` CHAR(72), "
438 "`Attributes` SHORT NOT NULL "
439 "PRIMARY KEY `Feature`)" );
442 static UINT create_feature_components_table( MSIHANDLE hdb )
444 return run_query( hdb,
445 "CREATE TABLE `FeatureComponents` ( "
446 "`Feature_` CHAR(38) NOT NULL, "
447 "`Component_` CHAR(72) NOT NULL "
448 "PRIMARY KEY `Feature_`, `Component_` )" );
451 static UINT create_file_table( MSIHANDLE hdb )
453 return run_query( hdb,
454 "CREATE TABLE `File` ("
455 "`File` CHAR(72) NOT NULL, "
456 "`Component_` CHAR(72) NOT NULL, "
457 "`FileName` CHAR(255) NOT NULL, "
458 "`FileSize` LONG NOT NULL, "
459 "`Version` CHAR(72), "
460 "`Language` CHAR(20), "
461 "`Attributes` SHORT, "
462 "`Sequence` SHORT NOT NULL "
463 "PRIMARY KEY `File`)" );
466 static UINT create_remove_file_table( MSIHANDLE hdb )
468 return run_query( hdb,
469 "CREATE TABLE `RemoveFile` ("
470 "`FileKey` CHAR(72) NOT NULL, "
471 "`Component_` CHAR(72) NOT NULL, "
472 "`FileName` CHAR(255) LOCALIZABLE, "
473 "`DirProperty` CHAR(72) NOT NULL, "
474 "`InstallMode` SHORT NOT NULL "
475 "PRIMARY KEY `FileKey`)" );
478 static UINT create_appsearch_table( MSIHANDLE hdb )
480 return run_query( hdb,
481 "CREATE TABLE `AppSearch` ("
482 "`Property` CHAR(72) NOT NULL, "
483 "`Signature_` CHAR(72) NOT NULL "
484 "PRIMARY KEY `Property`, `Signature_`)" );
487 static UINT create_reglocator_table( MSIHANDLE hdb )
489 return run_query( hdb,
490 "CREATE TABLE `RegLocator` ("
491 "`Signature_` CHAR(72) NOT NULL, "
492 "`Root` SHORT NOT NULL, "
493 "`Key` CHAR(255) NOT NULL, "
496 "PRIMARY KEY `Signature_`)" );
499 static UINT create_signature_table( MSIHANDLE hdb )
501 return run_query( hdb,
502 "CREATE TABLE `Signature` ("
503 "`Signature` CHAR(72) NOT NULL, "
504 "`FileName` CHAR(255) NOT NULL, "
505 "`MinVersion` CHAR(20), "
506 "`MaxVersion` CHAR(20), "
511 "`Languages` CHAR(255) "
512 "PRIMARY KEY `Signature`)" );
515 static UINT create_launchcondition_table( MSIHANDLE hdb )
517 return run_query( hdb,
518 "CREATE TABLE `LaunchCondition` ("
519 "`Condition` CHAR(255) NOT NULL, "
520 "`Description` CHAR(255) NOT NULL "
521 "PRIMARY KEY `Condition`)" );
524 static UINT create_property_table( MSIHANDLE hdb )
526 return run_query( hdb,
527 "CREATE TABLE `Property` ("
528 "`Property` CHAR(72) NOT NULL, "
530 "PRIMARY KEY `Property`)" );
533 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
535 return run_query( hdb,
536 "CREATE TABLE `InstallExecuteSequence` ("
537 "`Action` CHAR(72) NOT NULL, "
538 "`Condition` CHAR(255), "
540 "PRIMARY KEY `Action`)" );
543 static UINT create_media_table( MSIHANDLE hdb )
545 return run_query( hdb,
546 "CREATE TABLE `Media` ("
547 "`DiskId` SHORT NOT NULL, "
548 "`LastSequence` SHORT NOT NULL, "
549 "`DiskPrompt` CHAR(64), "
550 "`Cabinet` CHAR(255), "
551 "`VolumeLabel` CHAR(32), "
553 "PRIMARY KEY `DiskId`)" );
556 static UINT create_ccpsearch_table( MSIHANDLE hdb )
558 return run_query( hdb,
559 "CREATE TABLE `CCPSearch` ("
560 "`Signature_` CHAR(72) NOT NULL "
561 "PRIMARY KEY `Signature_`)" );
564 static UINT create_drlocator_table( MSIHANDLE hdb )
566 return run_query( hdb,
567 "CREATE TABLE `DrLocator` ("
568 "`Signature_` CHAR(72) NOT NULL, "
569 "`Parent` CHAR(72), "
572 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
575 static UINT create_complocator_table( MSIHANDLE hdb )
577 return run_query( hdb,
578 "CREATE TABLE `CompLocator` ("
579 "`Signature_` CHAR(72) NOT NULL, "
580 "`ComponentId` CHAR(38) NOT NULL, "
582 "PRIMARY KEY `Signature_`)" );
585 static UINT create_inilocator_table( MSIHANDLE hdb )
587 return run_query( hdb,
588 "CREATE TABLE `IniLocator` ("
589 "`Signature_` CHAR(72) NOT NULL, "
590 "`FileName` CHAR(255) NOT NULL, "
591 "`Section` CHAR(96)NOT NULL, "
592 "`Key` CHAR(128)NOT NULL, "
595 "PRIMARY KEY `Signature_`)" );
598 #define make_add_entry(type, qtext) \
599 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
601 char insert[] = qtext; \
604 sz = strlen(values) + sizeof insert; \
605 query = HeapAlloc(GetProcessHeap(),0,sz); \
606 sprintf(query,insert,values); \
607 r = run_query( hdb, query ); \
608 HeapFree(GetProcessHeap(), 0, query); \
612 make_add_entry(component,
613 "INSERT INTO `Component` "
614 "(`Component`, `ComponentId`, `Directory_`, "
615 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
617 make_add_entry(directory,
618 "INSERT INTO `Directory` "
619 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
621 make_add_entry(feature,
622 "INSERT INTO `Feature` "
623 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
624 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
626 make_add_entry(feature_components,
627 "INSERT INTO `FeatureComponents` "
628 "(`Feature_`, `Component_`) VALUES( %s )")
631 "INSERT INTO `File` "
632 "(`File`, `Component_`, `FileName`, `FileSize`, "
633 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
635 make_add_entry(appsearch,
636 "INSERT INTO `AppSearch` "
637 "(`Property`, `Signature_`) VALUES( %s )")
639 make_add_entry(signature,
640 "INSERT INTO `Signature` "
641 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
642 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
645 make_add_entry(launchcondition,
646 "INSERT INTO `LaunchCondition` "
647 "(`Condition`, `Description`) VALUES( %s )")
649 make_add_entry(property,
650 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
652 make_add_entry(install_execute_sequence,
653 "INSERT INTO `InstallExecuteSequence` "
654 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
656 make_add_entry(media,
657 "INSERT INTO `Media` "
658 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
659 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
661 make_add_entry(ccpsearch,
662 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
664 make_add_entry(drlocator,
665 "INSERT INTO `DrLocator` "
666 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
668 make_add_entry(complocator,
669 "INSERT INTO `CompLocator` "
670 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
672 make_add_entry(inilocator,
673 "INSERT INTO `IniLocator` "
674 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
677 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char *path,
678 const char *name, UINT type )
680 const char insert[] =
681 "INSERT INTO `RegLocator` (`Signature_`, `Root`, `Key`, `Name`, `Type`) "
682 "VALUES( '%s', %u, '%s', '%s', %u )";
686 sz = strlen( sig ) + 10 + strlen( path ) + strlen( name ) + 10 + sizeof( insert );
687 query = HeapAlloc( GetProcessHeap(), 0, sz );
688 sprintf( query, insert, sig, root, path, name, type );
689 r = run_query( hdb, query );
690 HeapFree( GetProcessHeap(), 0, query );
694 static UINT set_summary_info(MSIHANDLE hdb)
699 /* build summary info */
700 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
701 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
703 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
704 "Installation Database");
705 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
707 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
708 "Installation Database");
709 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
711 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
713 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
715 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
717 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
719 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
720 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
721 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
723 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
724 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
726 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
727 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
729 res = MsiSummaryInfoPersist(suminfo);
730 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
732 res = MsiCloseHandle( suminfo);
733 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
739 static MSIHANDLE create_package_db(void)
746 /* create an empty database */
747 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
748 ok( res == ERROR_SUCCESS , "Failed to create database %u\n", res );
749 if( res != ERROR_SUCCESS )
752 res = MsiDatabaseCommit( hdb );
753 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
755 res = set_summary_info(hdb);
756 ok( res == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", res);
758 res = run_query( hdb,
759 "CREATE TABLE `Directory` ( "
760 "`Directory` CHAR(255) NOT NULL, "
761 "`Directory_Parent` CHAR(255), "
762 "`DefaultDir` CHAR(255) NOT NULL "
763 "PRIMARY KEY `Directory`)" );
764 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
769 static UINT package_from_db(MSIHANDLE hdb, MSIHANDLE *handle)
775 sprintf(szPackage, "#%u", hdb);
776 res = MsiOpenPackage(szPackage, &hPackage);
777 if (res != ERROR_SUCCESS)
783 res = MsiCloseHandle(hdb);
784 if (res != ERROR_SUCCESS)
786 MsiCloseHandle(hPackage);
791 return ERROR_SUCCESS;
794 static void create_test_file(const CHAR *name)
799 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
800 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
801 WriteFile(file, name, strlen(name), &written, NULL);
802 WriteFile(file, "\n", strlen("\n"), &written, NULL);
806 typedef struct _tagVS_VERSIONINFO
813 VS_FIXEDFILEINFO Value;
818 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
819 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
821 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
823 VS_VERSIONINFO *pVerInfo;
824 VS_FIXEDFILEINFO *pFixedInfo;
831 GetSystemDirectory(path, MAX_PATH);
832 /* Some dlls can't be updated on Vista/W2K8 */
833 lstrcatA(path, "\\version.dll");
835 CopyFileA(path, name, FALSE);
837 size = GetFileVersionInfoSize(path, &handle);
838 buffer = HeapAlloc(GetProcessHeap(), 0, size);
840 GetFileVersionInfoA(path, 0, size, buffer);
842 pVerInfo = (VS_VERSIONINFO *)buffer;
843 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
844 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
846 pFixedInfo->dwFileVersionMS = ms;
847 pFixedInfo->dwFileVersionLS = ls;
848 pFixedInfo->dwProductVersionMS = ms;
849 pFixedInfo->dwProductVersionLS = ls;
851 resource = BeginUpdateResource(name, FALSE);
855 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
856 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
859 if (!EndUpdateResource(resource, FALSE))
865 HeapFree(GetProcessHeap(), 0, buffer);
869 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
871 RESTOREPOINTINFOA spec;
873 spec.dwEventType = event_type;
874 spec.dwRestorePtType = APPLICATION_INSTALL;
875 spec.llSequenceNumber = status->llSequenceNumber;
876 lstrcpyA(spec.szDescription, "msitest restore point");
878 return pSRSetRestorePointA(&spec, status);
881 static void remove_restore_point(DWORD seq_number)
885 res = pSRRemoveRestorePoint(seq_number);
886 if (res != ERROR_SUCCESS)
887 trace("Failed to remove the restore point : %08x\n", res);
890 static void test_createpackage(void)
892 MSIHANDLE hPackage = 0;
895 res = package_from_db(create_package_db(), &hPackage);
896 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
898 skip("Not enough rights to perform tests\n");
902 ok( res == ERROR_SUCCESS, " Failed to create package %u\n", res );
904 res = MsiCloseHandle( hPackage);
905 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
909 static void test_doaction( void )
914 r = MsiDoAction( -1, NULL );
915 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
917 r = package_from_db(create_package_db(), &hpkg);
918 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
920 skip("Not enough rights to perform tests\n");
924 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
926 r = MsiDoAction(hpkg, NULL);
927 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
929 r = MsiDoAction(0, "boo");
930 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
932 r = MsiDoAction(hpkg, "boo");
933 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
935 MsiCloseHandle( hpkg );
939 static void test_gettargetpath_bad(void)
941 static const WCHAR boo[] = {'b','o','o',0};
942 static const WCHAR empty[] = {0};
949 r = package_from_db(create_package_db(), &hpkg);
950 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
952 skip("Not enough rights to perform tests\n");
956 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
958 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
959 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
961 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
962 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
964 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
965 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
967 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
968 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
970 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
971 ok( r == ERROR_DIRECTORY, "wrong return val\n");
973 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
974 ok( r == ERROR_DIRECTORY, "wrong return val\n");
977 r = MsiGetTargetPath( hpkg, "", buffer, &sz );
978 ok( r == ERROR_DIRECTORY, "wrong return val\n");
980 r = MsiGetTargetPathW( 0, NULL, NULL, NULL );
981 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
983 r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
984 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
986 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
987 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
989 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
990 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
992 r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
993 ok( r == ERROR_DIRECTORY, "wrong return val\n");
995 r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
996 ok( r == ERROR_DIRECTORY, "wrong return val\n");
999 r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
1000 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1002 MsiCloseHandle( hpkg );
1003 DeleteFile(msifile);
1006 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
1012 rec = MsiCreateRecord( 1 );
1013 ok(rec, "MsiCreate record failed\n");
1015 r = MsiRecordSetString( rec, 0, file );
1016 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1019 r = MsiFormatRecord( hpkg, rec, buff, &size );
1020 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1022 MsiCloseHandle( rec );
1025 static void test_settargetpath(void)
1027 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
1033 hdb = create_package_db();
1034 ok ( hdb, "failed to create package database\n" );
1036 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
1037 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
1039 r = create_component_table( hdb );
1040 ok( r == S_OK, "cannot create Component table: %d\n", r );
1042 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1043 ok( r == S_OK, "cannot add dummy component: %d\n", r );
1045 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1046 ok( r == S_OK, "cannot add test component: %d\n", r );
1048 r = create_feature_table( hdb );
1049 ok( r == S_OK, "cannot create Feature table: %d\n", r );
1051 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
1052 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
1054 r = create_feature_components_table( hdb );
1055 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
1057 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
1058 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1060 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
1061 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1063 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
1064 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
1066 r = create_file_table( hdb );
1067 ok( r == S_OK, "cannot create File table: %d\n", r );
1069 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1070 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1072 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1073 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1075 r = package_from_db( hdb, &hpkg );
1076 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1078 skip("Not enough rights to perform tests\n");
1079 DeleteFile(msifile);
1082 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1084 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
1086 r = MsiDoAction( hpkg, "CostInitialize");
1087 ok( r == ERROR_SUCCESS, "cost init failed\n");
1089 r = MsiDoAction( hpkg, "FileCost");
1090 ok( r == ERROR_SUCCESS, "file cost failed\n");
1092 r = MsiDoAction( hpkg, "CostFinalize");
1093 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
1095 r = MsiSetTargetPath( 0, NULL, NULL );
1096 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1098 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1099 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1101 r = MsiSetTargetPath( hpkg, "boo", NULL );
1102 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1104 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
1105 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1107 sz = sizeof tempdir - 1;
1108 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
1109 sprintf( file, "%srootfile.txt", tempdir );
1111 query_file_path( hpkg, "[#RootFile]", buffer );
1112 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1113 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
1115 GetTempFileName( tempdir, "_wt", 0, buffer );
1116 sprintf( tempdir, "%s\\subdir", buffer );
1118 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1119 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1120 "MsiSetTargetPath on file returned %d\n", r );
1122 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1123 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1124 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
1126 DeleteFile( buffer );
1128 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1129 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1131 r = GetFileAttributes( buffer );
1132 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
1134 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1135 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
1137 sz = sizeof buffer - 1;
1138 lstrcat( tempdir, "\\" );
1139 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
1140 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1141 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
1143 sprintf( file, "%srootfile.txt", tempdir );
1144 query_file_path( hpkg, "[#RootFile]", buffer );
1145 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
1147 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
1148 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1150 query_file_path( hpkg, "[#TestFile]", buffer );
1151 ok( !lstrcmpi(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
1152 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
1154 sz = sizeof buffer - 1;
1155 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1156 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1157 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
1159 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two\\three" );
1160 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1162 sz = sizeof buffer - 1;
1163 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1164 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1165 ok( !lstrcmpi(buffer, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer);
1167 MsiCloseHandle( hpkg );
1170 static void test_condition(void)
1172 static const WCHAR cond1[] = {'\"','a',0x30a,'\"','<','\"',0xe5,'\"',0};
1173 static const WCHAR cond2[] = {'\"','a',0x30a,'\"','>','\"',0xe5,'\"',0};
1174 static const WCHAR cond3[] = {'\"','a',0x30a,'\"','<','>','\"',0xe5,'\"',0};
1175 static const WCHAR cond4[] = {'\"','a',0x30a,'\"','=','\"',0xe5,'\"',0};
1179 r = package_from_db(create_package_db(), &hpkg);
1180 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1182 skip("Not enough rights to perform tests\n");
1183 DeleteFile(msifile);
1186 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1188 r = MsiEvaluateCondition(0, NULL);
1189 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1191 r = MsiEvaluateCondition(hpkg, NULL);
1192 ok( r == MSICONDITION_NONE, "wrong return val\n");
1194 r = MsiEvaluateCondition(hpkg, "");
1195 ok( r == MSICONDITION_NONE, "wrong return val\n");
1197 r = MsiEvaluateCondition(hpkg, "1");
1198 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1200 r = MsiEvaluateCondition(hpkg, "0");
1201 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1203 r = MsiEvaluateCondition(hpkg, "-1");
1204 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1206 r = MsiEvaluateCondition(hpkg, "0 = 0");
1207 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1209 r = MsiEvaluateCondition(hpkg, "0 <> 0");
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, "0 ~> 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, "1 ~> 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, "0 ~>= 1");
1231 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1233 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1234 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1236 r = MsiEvaluateCondition(hpkg, "1 ~>= 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, "0 ~< 1");
1243 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1245 r = MsiEvaluateCondition(hpkg, "1 < 1");
1246 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1248 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1249 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1251 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1252 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1254 r = MsiEvaluateCondition(hpkg, "0 ~<= 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, "1 ~<= 1");
1261 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1263 r = MsiEvaluateCondition(hpkg, "0 >=");
1264 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1266 r = MsiEvaluateCondition(hpkg, " ");
1267 ok( r == MSICONDITION_NONE, "wrong return val\n");
1269 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1270 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1272 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1273 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1275 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1276 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1278 r = MsiEvaluateCondition(hpkg, "not 0");
1279 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1281 r = MsiEvaluateCondition(hpkg, "not LicView");
1282 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1284 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1285 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1287 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1288 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1290 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1291 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1293 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1294 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1296 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1297 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1299 r = MsiEvaluateCondition(hpkg, "\"0\"");
1300 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1302 r = MsiEvaluateCondition(hpkg, "1 and 2");
1303 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1305 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1306 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1308 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1309 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1311 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1312 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1314 r = MsiEvaluateCondition(hpkg, "(0)");
1315 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1317 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1318 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1320 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1321 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1323 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1324 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1326 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1327 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1329 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1330 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1332 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1333 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1335 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1336 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1338 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1339 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1341 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1342 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1344 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1345 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1347 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1348 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1350 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1351 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1353 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1354 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1356 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1357 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1359 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1360 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1362 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1363 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1365 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1366 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1368 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1369 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1371 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1372 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1374 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1375 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1377 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1378 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1380 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1381 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1383 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1384 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1386 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1387 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1389 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1390 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1392 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1393 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1395 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1396 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1398 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1399 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1401 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1402 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1404 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1405 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1407 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1408 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1410 MsiSetProperty(hpkg, "mm", "5" );
1412 r = MsiEvaluateCondition(hpkg, "mm = 5");
1413 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1415 r = MsiEvaluateCondition(hpkg, "mm < 6");
1416 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1418 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1419 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1421 r = MsiEvaluateCondition(hpkg, "mm > 4");
1422 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1424 r = MsiEvaluateCondition(hpkg, "mm < 12");
1425 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1427 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1428 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1430 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1431 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1433 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1434 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1436 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1437 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1439 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1440 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1442 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1443 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1445 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1446 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1448 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1449 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1451 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1452 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1454 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1455 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1457 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1458 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1460 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1461 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1463 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1464 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1466 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1467 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1469 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1470 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1472 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1473 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1475 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1476 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1478 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1479 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1481 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1482 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1484 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1485 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1487 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1488 ok( r == MSICONDITION_TRUE, "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_FALSE, "wrong return val\n");
1502 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1503 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1505 MsiSetProperty(hpkg, "bandalmael", "0" );
1506 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1507 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1509 MsiSetProperty(hpkg, "bandalmael", "" );
1510 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1511 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1513 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1514 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1515 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1517 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1518 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1519 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1521 MsiSetProperty(hpkg, "bandalmael", "0 " );
1522 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1523 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1525 MsiSetProperty(hpkg, "bandalmael", "-0" );
1526 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1527 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1529 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1530 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1531 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1533 MsiSetProperty(hpkg, "bandalmael", "--0" );
1534 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1535 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1537 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1538 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1539 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1541 MsiSetProperty(hpkg, "bandalmael", "-" );
1542 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1543 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1545 MsiSetProperty(hpkg, "bandalmael", "+0" );
1546 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1547 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1549 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1550 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1551 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1552 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1553 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1555 MsiSetProperty(hpkg, "one", "hi");
1556 MsiSetProperty(hpkg, "two", "hithere");
1557 r = MsiEvaluateCondition(hpkg, "one >< two");
1558 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1560 MsiSetProperty(hpkg, "one", "hithere");
1561 MsiSetProperty(hpkg, "two", "hi");
1562 r = MsiEvaluateCondition(hpkg, "one >< two");
1563 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1565 MsiSetProperty(hpkg, "one", "hello");
1566 MsiSetProperty(hpkg, "two", "hi");
1567 r = MsiEvaluateCondition(hpkg, "one >< two");
1568 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1570 MsiSetProperty(hpkg, "one", "hellohithere");
1571 MsiSetProperty(hpkg, "two", "hi");
1572 r = MsiEvaluateCondition(hpkg, "one >< two");
1573 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1575 MsiSetProperty(hpkg, "one", "");
1576 MsiSetProperty(hpkg, "two", "hi");
1577 r = MsiEvaluateCondition(hpkg, "one >< two");
1578 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1580 MsiSetProperty(hpkg, "one", "hi");
1581 MsiSetProperty(hpkg, "two", "");
1582 r = MsiEvaluateCondition(hpkg, "one >< two");
1583 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1585 MsiSetProperty(hpkg, "one", "");
1586 MsiSetProperty(hpkg, "two", "");
1587 r = MsiEvaluateCondition(hpkg, "one >< two");
1588 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1590 MsiSetProperty(hpkg, "one", "1234");
1591 MsiSetProperty(hpkg, "two", "1");
1592 r = MsiEvaluateCondition(hpkg, "one >< two");
1593 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1595 MsiSetProperty(hpkg, "one", "one 1234");
1596 MsiSetProperty(hpkg, "two", "1");
1597 r = MsiEvaluateCondition(hpkg, "one >< two");
1598 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1600 MsiSetProperty(hpkg, "one", "hithere");
1601 MsiSetProperty(hpkg, "two", "hi");
1602 r = MsiEvaluateCondition(hpkg, "one << two");
1603 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1605 MsiSetProperty(hpkg, "one", "hi");
1606 MsiSetProperty(hpkg, "two", "hithere");
1607 r = MsiEvaluateCondition(hpkg, "one << two");
1608 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1610 MsiSetProperty(hpkg, "one", "hi");
1611 MsiSetProperty(hpkg, "two", "hi");
1612 r = MsiEvaluateCondition(hpkg, "one << two");
1613 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1615 MsiSetProperty(hpkg, "one", "abcdhithere");
1616 MsiSetProperty(hpkg, "two", "hi");
1617 r = MsiEvaluateCondition(hpkg, "one << two");
1618 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1620 MsiSetProperty(hpkg, "one", "");
1621 MsiSetProperty(hpkg, "two", "hi");
1622 r = MsiEvaluateCondition(hpkg, "one << two");
1623 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1625 MsiSetProperty(hpkg, "one", "hithere");
1626 MsiSetProperty(hpkg, "two", "");
1627 r = MsiEvaluateCondition(hpkg, "one << two");
1628 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1630 MsiSetProperty(hpkg, "one", "");
1631 MsiSetProperty(hpkg, "two", "");
1632 r = MsiEvaluateCondition(hpkg, "one << two");
1633 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1635 MsiSetProperty(hpkg, "one", "1234");
1636 MsiSetProperty(hpkg, "two", "1");
1637 r = MsiEvaluateCondition(hpkg, "one << two");
1638 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1640 MsiSetProperty(hpkg, "one", "1234 one");
1641 MsiSetProperty(hpkg, "two", "1");
1642 r = MsiEvaluateCondition(hpkg, "one << two");
1643 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1645 MsiSetProperty(hpkg, "one", "hithere");
1646 MsiSetProperty(hpkg, "two", "there");
1647 r = MsiEvaluateCondition(hpkg, "one >> two");
1648 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1650 MsiSetProperty(hpkg, "one", "hithere");
1651 MsiSetProperty(hpkg, "two", "hi");
1652 r = MsiEvaluateCondition(hpkg, "one >> two");
1653 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1655 MsiSetProperty(hpkg, "one", "there");
1656 MsiSetProperty(hpkg, "two", "hithere");
1657 r = MsiEvaluateCondition(hpkg, "one >> two");
1658 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1660 MsiSetProperty(hpkg, "one", "there");
1661 MsiSetProperty(hpkg, "two", "there");
1662 r = MsiEvaluateCondition(hpkg, "one >> two");
1663 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1665 MsiSetProperty(hpkg, "one", "abcdhithere");
1666 MsiSetProperty(hpkg, "two", "hi");
1667 r = MsiEvaluateCondition(hpkg, "one >> two");
1668 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1670 MsiSetProperty(hpkg, "one", "");
1671 MsiSetProperty(hpkg, "two", "there");
1672 r = MsiEvaluateCondition(hpkg, "one >> two");
1673 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1675 MsiSetProperty(hpkg, "one", "there");
1676 MsiSetProperty(hpkg, "two", "");
1677 r = MsiEvaluateCondition(hpkg, "one >> two");
1678 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1680 MsiSetProperty(hpkg, "one", "");
1681 MsiSetProperty(hpkg, "two", "");
1682 r = MsiEvaluateCondition(hpkg, "one >> two");
1683 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1685 MsiSetProperty(hpkg, "one", "1234");
1686 MsiSetProperty(hpkg, "two", "4");
1687 r = MsiEvaluateCondition(hpkg, "one >> two");
1688 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1690 MsiSetProperty(hpkg, "one", "one 1234");
1691 MsiSetProperty(hpkg, "two", "4");
1692 r = MsiEvaluateCondition(hpkg, "one >> two");
1693 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1695 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1697 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1698 ok( r == MSICONDITION_TRUE, "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_FALSE, "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 ~< \"1.1.4322\"");
1713 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1715 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1716 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1718 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1719 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1721 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1722 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1724 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1725 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1727 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1728 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1730 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1731 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1733 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1734 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1736 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1737 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1739 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1740 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1742 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1743 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1745 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1746 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1748 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1749 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1751 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1752 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1754 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1755 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1757 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1758 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1760 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
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 < \" \"");
1773 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1775 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1776 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1778 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1779 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1781 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1782 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1784 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1785 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1787 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]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 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1806 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1808 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1809 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1810 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1812 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1813 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1815 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1816 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1818 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1819 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1821 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1822 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1824 MsiSetProperty(hpkg, "one", "1");
1825 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1826 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1828 MsiSetProperty(hpkg, "X", "5.0");
1830 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1831 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1833 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1834 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1836 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1837 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1839 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1840 ok( r == MSICONDITION_FALSE, "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 =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1846 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1848 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1849 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1851 /* feature doesn't exist */
1852 r = MsiEvaluateCondition(hpkg, "&nofeature");
1853 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1855 MsiSetProperty(hpkg, "A", "2");
1856 MsiSetProperty(hpkg, "X", "50");
1858 r = MsiEvaluateCondition(hpkg, "2 <= X");
1859 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1861 r = MsiEvaluateCondition(hpkg, "A <= X");
1862 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1864 r = MsiEvaluateCondition(hpkg, "A <= 50");
1865 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1867 MsiSetProperty(hpkg, "X", "50val");
1869 r = MsiEvaluateCondition(hpkg, "2 <= X");
1870 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1872 r = MsiEvaluateCondition(hpkg, "A <= X");
1873 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1875 MsiSetProperty(hpkg, "A", "7");
1876 MsiSetProperty(hpkg, "X", "50");
1878 r = MsiEvaluateCondition(hpkg, "7 <= X");
1879 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1881 r = MsiEvaluateCondition(hpkg, "A <= X");
1882 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1884 r = MsiEvaluateCondition(hpkg, "A <= 50");
1885 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1887 MsiSetProperty(hpkg, "X", "50val");
1889 r = MsiEvaluateCondition(hpkg, "2 <= X");
1890 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1892 r = MsiEvaluateCondition(hpkg, "A <= X");
1893 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1895 r = MsiEvaluateConditionW(hpkg, cond1);
1896 ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
1897 "wrong return val (%d)\n", r);
1899 r = MsiEvaluateConditionW(hpkg, cond2);
1900 ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
1901 "wrong return val (%d)\n", r);
1903 r = MsiEvaluateConditionW(hpkg, cond3);
1904 ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
1905 "wrong return val (%d)\n", r);
1907 r = MsiEvaluateConditionW(hpkg, cond4);
1908 ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
1909 "wrong return val (%d)\n", r);
1911 MsiCloseHandle( hpkg );
1912 DeleteFile(msifile);
1915 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1923 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1924 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1927 static void test_props(void)
1929 MSIHANDLE hpkg, hdb;
1934 hdb = create_package_db();
1936 "CREATE TABLE `Property` ( "
1937 "`Property` CHAR(255) NOT NULL, "
1938 "`Value` CHAR(255) "
1939 "PRIMARY KEY `Property`)" );
1940 ok( r == ERROR_SUCCESS , "Failed\n" );
1943 "INSERT INTO `Property` "
1944 "(`Property`, `Value`) "
1945 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1946 ok( r == ERROR_SUCCESS , "Failed\n" );
1948 r = package_from_db( hdb, &hpkg );
1949 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1951 skip("Not enough rights to perform tests\n");
1952 DeleteFile(msifile);
1955 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1957 /* test invalid values */
1958 r = MsiGetProperty( 0, NULL, NULL, NULL );
1959 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1961 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1962 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1964 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1965 ok( r == ERROR_SUCCESS, "wrong return val\n");
1967 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1968 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1970 /* test retrieving an empty/nonexistent property */
1972 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1973 ok( r == ERROR_SUCCESS, "wrong return val\n");
1974 ok( sz == 0, "wrong size returned\n");
1976 check_prop_empty( hpkg, "boo");
1979 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1980 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1981 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1982 ok( sz == 0, "wrong size returned\n");
1986 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1987 ok( r == ERROR_SUCCESS, "wrong return val\n");
1988 ok( buffer[0] == 0, "buffer was not changed\n");
1989 ok( sz == 0, "wrong size returned\n");
1991 /* set the property to something */
1992 r = MsiSetProperty( 0, NULL, NULL );
1993 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1995 r = MsiSetProperty( hpkg, NULL, NULL );
1996 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1998 r = MsiSetProperty( hpkg, "", NULL );
1999 ok( r == ERROR_SUCCESS, "wrong return val\n");
2001 /* try set and get some illegal property identifiers */
2002 r = MsiSetProperty( hpkg, "", "asdf" );
2003 ok( r == ERROR_FUNCTION_FAILED, "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");
2011 r = MsiSetProperty( hpkg, "'", "asdf" );
2012 ok( r == ERROR_SUCCESS, "wrong return val\n");
2016 r = MsiGetProperty( hpkg, "'", buffer, &sz );
2017 ok( r == ERROR_SUCCESS, "wrong return val\n");
2018 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
2020 /* set empty values */
2021 r = MsiSetProperty( hpkg, "boo", NULL );
2022 ok( r == ERROR_SUCCESS, "wrong return val\n");
2023 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2025 r = MsiSetProperty( hpkg, "boo", "" );
2026 ok( r == ERROR_SUCCESS, "wrong return val\n");
2027 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2029 /* set a non-empty value */
2030 r = MsiSetProperty( hpkg, "boo", "xyz" );
2031 ok( r == ERROR_SUCCESS, "wrong return val\n");
2035 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2036 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2037 ok( buffer[0] == 0, "buffer was not changed\n");
2038 ok( sz == 3, "wrong size returned\n");
2042 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2043 ok( r == ERROR_SUCCESS, "wrong return val\n");
2044 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
2045 ok( sz == 3, "wrong size returned\n");
2049 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2050 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2051 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
2052 ok( sz == 3, "wrong size returned\n");
2054 r = MsiSetProperty(hpkg, "SourceDir", "foo");
2055 ok( r == ERROR_SUCCESS, "wrong return val\n");
2058 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
2059 ok( r == ERROR_SUCCESS, "wrong return val\n");
2060 ok( !strcmp(buffer,""), "buffer wrong\n");
2061 ok( sz == 0, "wrong size returned\n");
2064 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
2065 ok( r == ERROR_SUCCESS, "wrong return val\n");
2066 ok( !strcmp(buffer,""), "buffer wrong\n");
2067 ok( sz == 0, "wrong size returned\n");
2070 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
2071 ok( r == ERROR_SUCCESS, "wrong return val\n");
2072 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
2073 ok( sz == 3, "wrong size returned\n");
2075 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
2076 ok( r == ERROR_SUCCESS, "wrong return val\n");
2079 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
2080 ok( r == ERROR_SUCCESS, "return wrong\n");
2081 ok( sz == 13, "size wrong (%d)\n", sz);
2084 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
2085 ok( r == ERROR_MORE_DATA, "return wrong\n");
2086 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
2088 r = MsiSetProperty(hpkg, "property", "value");
2089 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2092 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2094 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
2096 r = MsiSetProperty(hpkg, "property", NULL);
2097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2100 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2102 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
2104 MsiCloseHandle( hpkg );
2105 DeleteFile(msifile);
2108 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
2110 MSIHANDLE hview, hrec;
2112 CHAR buffer[MAX_PATH];
2116 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
2117 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
2118 r = MsiViewExecute(hview, 0);
2119 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
2122 while (r == ERROR_SUCCESS && !found)
2124 r = MsiViewFetch(hview, &hrec);
2125 if (r != ERROR_SUCCESS) break;
2128 r = MsiRecordGetString(hrec, 1, buffer, &sz);
2129 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
2132 r = MsiRecordGetString(hrec, 2, buffer, &sz);
2133 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
2137 MsiCloseHandle(hrec);
2140 MsiViewClose(hview);
2141 MsiCloseHandle(hview);
2146 static void test_property_table(void)
2150 MSIHANDLE hpkg, hdb, hrec;
2151 char buffer[MAX_PATH], package[10];
2155 hdb = create_package_db();
2156 ok( hdb, "failed to create package\n");
2158 r = package_from_db(hdb, &hpkg);
2159 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2161 skip("Not enough rights to perform tests\n");
2162 DeleteFile(msifile);
2165 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2167 MsiCloseHandle(hdb);
2169 hdb = MsiGetActiveDatabase(hpkg);
2171 query = "CREATE TABLE `_Property` ( "
2172 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2173 r = run_query(hdb, query);
2174 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2176 MsiCloseHandle(hdb);
2177 MsiCloseHandle(hpkg);
2178 DeleteFile(msifile);
2180 hdb = create_package_db();
2181 ok( hdb, "failed to create package\n");
2183 query = "CREATE TABLE `_Property` ( "
2184 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2185 r = run_query(hdb, query);
2186 ok(r == ERROR_SUCCESS, "failed to create table\n");
2188 query = "ALTER `_Property` ADD `foo` INTEGER";
2189 r = run_query(hdb, query);
2190 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2192 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2193 r = run_query(hdb, query);
2194 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2196 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2197 r = run_query(hdb, query);
2198 ok(r == ERROR_SUCCESS, "failed to add column\n");
2200 sprintf(package, "#%i", hdb);
2201 r = MsiOpenPackage(package, &hpkg);
2202 todo_wine ok(r != ERROR_SUCCESS, "MsiOpenPackage succeeded\n");
2203 if (r == ERROR_SUCCESS)
2204 MsiCloseHandle(hpkg);
2206 r = MsiCloseHandle(hdb);
2207 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
2209 hdb = create_package_db();
2210 ok (hdb, "failed to create package database\n");
2212 r = create_property_table(hdb);
2213 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2215 r = add_property_entry(hdb, "'prop', 'val'");
2216 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2218 r = package_from_db(hdb, &hpkg);
2219 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
2221 MsiCloseHandle(hdb);
2224 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2225 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2226 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2228 hdb = MsiGetActiveDatabase(hpkg);
2230 found = find_prop_in_property(hdb, "prop", "val");
2231 ok(found, "prop should be in the _Property table\n");
2233 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2234 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2236 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2237 r = do_query(hdb, query, &hrec);
2238 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2240 found = find_prop_in_property(hdb, "dantes", "mercedes");
2241 ok(found == FALSE, "dantes should not be in the _Property table\n");
2244 lstrcpy(buffer, "aaa");
2245 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2247 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2249 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2252 found = find_prop_in_property(hdb, "dantes", "mercedes");
2253 ok(found == TRUE, "dantes should be in the _Property table\n");
2255 MsiCloseHandle(hdb);
2256 MsiCloseHandle(hpkg);
2257 DeleteFile(msifile);
2260 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2265 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2266 if( res == ERROR_SUCCESS )
2270 r = MsiViewExecute( htab, hrec );
2271 if( r != ERROR_SUCCESS )
2274 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2277 r = MsiViewClose( htab );
2278 if( r != ERROR_SUCCESS )
2281 r = MsiCloseHandle( htab );
2282 if( r != ERROR_SUCCESS )
2288 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2290 return try_query_param( hdb, szQuery, 0 );
2293 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2298 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2299 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2301 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2304 r = MsiSummaryInfoPersist(summary);
2305 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2307 MsiCloseHandle(summary);
2310 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2315 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2318 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2321 r = MsiSummaryInfoPersist(summary);
2322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2324 MsiCloseHandle(summary);
2327 static void test_msipackage(void)
2329 MSIHANDLE hdb = 0, hpack = 100;
2334 /* NULL szPackagePath */
2335 r = MsiOpenPackage(NULL, &hpack);
2336 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2338 /* empty szPackagePath */
2339 r = MsiOpenPackage("", &hpack);
2340 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2342 skip("Not enough rights to perform tests\n");
2347 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2350 if (r == ERROR_SUCCESS)
2351 MsiCloseHandle(hpack);
2353 /* nonexistent szPackagePath */
2354 r = MsiOpenPackage("nonexistent", &hpack);
2355 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2358 r = MsiOpenPackage(msifile, NULL);
2359 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2363 r = MsiOpenPackage(name, &hpack);
2364 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2366 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2369 /* database exists, but is emtpy */
2370 sprintf(name, "#%d", hdb);
2371 r = MsiOpenPackage(name, &hpack);
2372 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2373 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2375 query = "CREATE TABLE `Property` ( "
2376 "`Property` CHAR(72), `Value` CHAR(0) "
2377 "PRIMARY KEY `Property`)";
2378 r = try_query(hdb, query);
2379 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2381 query = "CREATE TABLE `InstallExecuteSequence` ("
2382 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2383 "PRIMARY KEY `Action`)";
2384 r = try_query(hdb, query);
2385 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2387 /* a few key tables exist */
2388 sprintf(name, "#%d", hdb);
2389 r = MsiOpenPackage(name, &hpack);
2390 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2391 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2393 MsiCloseHandle(hdb);
2394 DeleteFile(msifile);
2396 /* start with a clean database to show what constitutes a valid package */
2397 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2400 sprintf(name, "#%d", hdb);
2402 /* The following summary information props must exist:
2407 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2408 r = MsiOpenPackage(name, &hpack);
2409 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2410 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2412 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2413 r = MsiOpenPackage(name, &hpack);
2414 ok(r == ERROR_SUCCESS,
2415 "Expected ERROR_SUCCESS, got %d\n", r);
2417 MsiCloseHandle(hpack);
2418 MsiCloseHandle(hdb);
2419 DeleteFile(msifile);
2422 static void test_formatrecord2(void)
2424 MSIHANDLE hpkg, hrec ;
2429 r = package_from_db(create_package_db(), &hpkg);
2430 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2432 skip("Not enough rights to perform tests\n");
2433 DeleteFile(msifile);
2436 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2438 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2439 ok( r == ERROR_SUCCESS, "set property failed\n");
2441 hrec = MsiCreateRecord(2);
2442 ok(hrec, "create record failed\n");
2444 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2445 ok( r == ERROR_SUCCESS, "format record failed\n");
2449 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2452 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2453 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2454 r = MsiRecordSetString(hrec, 1, "hoo");
2455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2457 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2458 ok( sz == 3, "size wrong\n");
2459 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2460 ok( r == ERROR_SUCCESS, "format failed\n");
2462 r = MsiRecordSetString(hrec, 0, "x[~]x");
2463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2465 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2466 ok( sz == 3, "size wrong\n");
2467 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2468 ok( r == ERROR_SUCCESS, "format failed\n");
2470 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2472 r = MsiRecordSetString(hrec, 1, "hoo");
2473 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2475 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2476 ok( sz == 3, "size wrong\n");
2477 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2478 ok( r == ERROR_SUCCESS, "format failed\n");
2480 r = MsiRecordSetString(hrec, 0, "[\\[]");
2481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2483 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2484 ok( sz == 1, "size wrong\n");
2485 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2486 ok( r == ERROR_SUCCESS, "format failed\n");
2488 SetEnvironmentVariable("FOO", "BAR");
2489 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2492 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2493 ok( sz == 3, "size wrong\n");
2494 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2495 ok( r == ERROR_SUCCESS, "format failed\n");
2497 r = MsiRecordSetString(hrec, 0, "[[1]]");
2498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2499 r = MsiRecordSetString(hrec, 1, "%FOO");
2500 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2502 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2503 ok( sz == 3, "size wrong\n");
2504 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2505 ok( r == ERROR_SUCCESS, "format failed\n");
2507 MsiCloseHandle( hrec );
2508 MsiCloseHandle( hpkg );
2509 DeleteFile(msifile);
2512 static void test_states(void)
2517 INSTALLSTATE state, action;
2519 static const CHAR msifile2[] = "winetest2-package.msi";
2520 static const CHAR msifile3[] = "winetest3-package.msi";
2521 static const CHAR msifile4[] = "winetest4-package.msi";
2523 if (is_process_limited())
2525 skip("process is limited\n");
2529 hdb = create_package_db();
2530 ok ( hdb, "failed to create package database\n" );
2532 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2533 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2535 r = create_property_table( hdb );
2536 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2538 r = add_property_entry( hdb, "'ProductCode', '{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
2539 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2541 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2542 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2544 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2545 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2547 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2548 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2550 r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
2551 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2553 r = create_install_execute_sequence_table( hdb );
2554 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2556 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2557 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2559 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2560 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2562 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2563 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2565 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2566 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2568 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2569 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2571 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2572 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2574 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2575 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2577 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2578 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2580 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2581 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2583 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2584 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2586 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2587 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2589 r = create_media_table( hdb );
2590 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2592 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2593 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2595 r = create_feature_table( hdb );
2596 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2598 r = create_component_table( hdb );
2599 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2601 /* msidbFeatureAttributesFavorLocal */
2602 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2603 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2605 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2606 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2607 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2609 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2610 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2611 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2613 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2614 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2615 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2617 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2618 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2619 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2621 /* msidbFeatureAttributesFavorSource */
2622 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2623 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2625 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2626 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2627 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2629 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2630 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2631 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2633 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2634 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2635 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2637 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2638 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2639 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2641 /* msidbFeatureAttributesFavorSource */
2642 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2643 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2645 /* msidbFeatureAttributesFavorLocal */
2646 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2647 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2650 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2651 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2653 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2654 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2655 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2657 /* no feature parent:msidbComponentAttributesLocalOnly */
2658 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2659 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2661 /* msidbFeatureAttributesFavorLocal:removed */
2662 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2663 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2665 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2666 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2667 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2669 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2670 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2671 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2673 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2674 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2675 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2677 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2678 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2679 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2681 /* msidbFeatureAttributesFavorSource:removed */
2682 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2683 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2685 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2686 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2687 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2689 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2690 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2691 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2693 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2694 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2695 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2697 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2698 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2699 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2701 /* msidbFeatureAttributesFavorLocal */
2702 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2703 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2705 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2706 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2708 /* msidbFeatureAttributesFavorSource */
2709 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2710 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2712 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2713 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2715 /* msidbFeatureAttributesFavorAdvertise */
2716 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2717 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2719 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2720 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2722 /* msidbFeatureAttributesUIDisallowAbsent */
2723 r = add_feature_entry( hdb, "'eleven', '', '', '', 2, 1, '', 16" );
2724 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2726 r = add_component_entry( hdb, "'psi', '{A06B23B5-746B-427A-8A6E-FD6AC8F46A95}', 'TARGETDIR', 1, '', 'psi_file'" );
2727 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2729 r = create_feature_components_table( hdb );
2730 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2732 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2733 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2735 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2736 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2738 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2739 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2741 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2742 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2744 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2745 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2747 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2748 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2750 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2751 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2753 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2754 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2756 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2757 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2759 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2760 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2762 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2763 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2765 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2766 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2768 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2769 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2771 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2772 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2774 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2775 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2777 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2778 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2780 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2781 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2783 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2784 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2786 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2787 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2789 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2790 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2792 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2793 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2795 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2796 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2798 r = add_feature_components_entry( hdb, "'eleven', 'psi'" );
2799 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2801 r = create_file_table( hdb );
2802 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2804 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2805 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2807 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2808 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2810 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2811 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2813 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2814 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2816 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2817 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2819 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2820 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2822 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2823 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2825 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2826 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2828 /* compressed file */
2829 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2830 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2832 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2833 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2835 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2836 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2838 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2839 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2841 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2842 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2844 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2845 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2847 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2848 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2850 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2851 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2853 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2854 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2856 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2857 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2859 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2860 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2862 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2863 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2865 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2866 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2868 r = add_file_entry( hdb, "'psi_file', 'psi', 'psi.txt', 100, '', '1033', 8192, 1" );
2869 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2871 MsiDatabaseCommit(hdb);
2873 /* these properties must not be in the saved msi file */
2874 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2875 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2877 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2878 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2880 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2881 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2883 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2884 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2886 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2887 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2889 r = package_from_db( hdb, &hpkg );
2890 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2892 skip("Not enough rights to perform tests\n");
2893 DeleteFile(msifile);
2896 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
2898 MsiCloseHandle(hdb);
2900 CopyFileA(msifile, msifile2, FALSE);
2901 CopyFileA(msifile, msifile3, FALSE);
2902 CopyFileA(msifile, msifile4, FALSE);
2906 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2907 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2913 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2914 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2920 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2921 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2922 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2923 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2927 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2928 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2929 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2930 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2934 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2935 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2936 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2937 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2941 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2942 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2943 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2944 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2948 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2949 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2950 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2951 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2955 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2956 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2957 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2958 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2962 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2963 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2964 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2965 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2969 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2970 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2971 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2972 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2976 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
2977 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2978 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2979 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2983 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2984 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2985 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2986 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2990 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2991 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2992 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2993 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2997 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2998 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2999 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3000 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3004 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3005 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3006 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3007 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3011 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3012 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3013 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3014 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3018 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3019 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3020 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3021 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3025 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3026 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3027 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3028 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3032 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3033 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3034 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3035 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3039 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3040 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3041 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3042 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3046 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3047 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3048 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3049 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3053 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3054 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3055 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3056 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3060 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3061 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3062 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3063 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3067 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3068 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3069 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3070 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3074 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3075 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3076 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3077 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3081 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3082 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3083 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3084 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3088 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3089 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3090 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3091 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3095 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3096 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3097 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3098 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3102 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3103 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3104 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3105 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3109 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3110 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3111 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3112 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3116 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3117 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3118 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3119 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3123 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3124 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3125 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3126 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3130 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3131 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3132 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3133 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3135 r = MsiDoAction( hpkg, "CostInitialize");
3136 ok( r == ERROR_SUCCESS, "cost init failed\n");
3140 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3147 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3154 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3161 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3168 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3175 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3177 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3182 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3184 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3185 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3189 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3190 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3191 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3192 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3196 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3197 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3198 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3199 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3203 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3204 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3205 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3206 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3210 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3211 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3212 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3213 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3217 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3219 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3220 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3224 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3225 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3226 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3227 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3231 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3233 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3234 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3238 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3240 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3241 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3245 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3247 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3248 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3252 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3253 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3254 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3255 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3259 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3260 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3261 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3262 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3266 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3268 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3269 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3273 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3274 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3275 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3276 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3280 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3281 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3282 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3283 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3287 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3288 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3289 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3290 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3294 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3295 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3296 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3297 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3301 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3302 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3303 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3304 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3308 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3309 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3310 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3311 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3315 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3316 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3317 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3318 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3322 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3323 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3324 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3325 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3329 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3330 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3331 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3332 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3336 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3337 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3338 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3339 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3343 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3344 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3345 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3346 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3350 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3351 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3352 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3353 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3357 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3358 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3359 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3360 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3364 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3365 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3366 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3367 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3369 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3371 r = MsiDoAction( hpkg, "FileCost");
3372 ok( r == ERROR_SUCCESS, "file cost failed\n");
3374 r = MsiGetFeatureState(hpkg, "one", NULL, NULL);
3375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3378 r = MsiGetFeatureState(hpkg, "one", NULL, &action);
3379 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3380 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3383 r = MsiGetFeatureState( hpkg, "one", &state, NULL);
3384 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3385 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3389 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3391 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3392 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3396 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3398 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3403 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3405 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3410 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3411 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3412 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3413 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3417 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3418 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3419 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3420 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3424 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3425 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3426 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3427 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3431 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3432 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3433 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3434 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3438 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3439 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3440 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3441 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3445 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3446 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3447 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3448 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3452 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3453 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3454 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3455 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3459 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3460 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3461 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3462 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3466 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3467 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3468 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3469 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3473 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3474 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3475 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3476 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3480 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3482 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3483 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3487 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3488 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3489 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3490 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3494 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3495 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3496 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3497 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3501 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3502 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3503 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3504 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3508 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3509 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3510 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3511 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3515 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3516 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3517 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3518 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3522 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3524 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3525 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3529 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3530 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3531 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3532 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3536 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3537 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3538 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3539 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3543 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3545 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3546 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3550 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3551 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3552 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3553 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3557 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3558 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3559 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3560 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3564 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3565 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3566 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3567 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3571 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3572 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3573 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3574 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3578 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3579 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3580 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3581 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3585 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3586 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3587 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3588 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3592 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3593 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3594 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3595 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3599 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3600 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3601 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3602 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3606 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3607 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3608 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3609 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3613 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3614 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3615 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3616 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3618 r = MsiDoAction( hpkg, "CostFinalize");
3619 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3623 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3624 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3625 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3626 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3630 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3631 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3632 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3633 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3637 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3638 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3639 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3640 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3644 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3645 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3646 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3647 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3651 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3652 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3653 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3654 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3658 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3659 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3660 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3661 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3665 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3666 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3667 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3668 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3672 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3673 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3674 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3675 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3679 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3680 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3681 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3682 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3686 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3687 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3688 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3689 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3693 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3694 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3695 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3696 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3700 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3701 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3702 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3703 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3707 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3708 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3709 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3710 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3714 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3715 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3716 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3717 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3721 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3722 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3723 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3724 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3728 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3729 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3730 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3731 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3735 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3736 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3737 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3738 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3742 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3743 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3744 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3745 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3749 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3751 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3752 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3756 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3757 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3758 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3759 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3763 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3764 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3765 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3766 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3770 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3771 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3772 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3773 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3777 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3778 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3779 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3780 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3784 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3785 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3786 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3787 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3791 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3792 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3793 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3794 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3798 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3799 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3800 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3801 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3805 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3806 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3807 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3808 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3812 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3814 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3815 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3819 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3820 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3821 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3822 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3826 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3828 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3829 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3833 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3835 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3836 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3840 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3842 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3843 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3847 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3849 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3850 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3852 MsiCloseHandle( hpkg );
3854 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3856 /* publish the features and components */
3857 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3860 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3861 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3863 /* these properties must not be in the saved msi file */
3864 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3865 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3867 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3868 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3870 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3871 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3873 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3874 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3876 r = package_from_db( hdb, &hpkg );
3877 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
3879 MsiCloseHandle(hdb);
3883 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3884 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3885 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3886 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3890 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3891 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3892 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3893 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3897 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3898 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3899 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3900 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3904 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3905 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3906 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3907 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3911 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3912 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3913 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3914 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3918 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3919 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3920 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3921 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3925 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3926 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3927 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3928 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3932 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3933 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3934 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3935 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3939 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3940 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3941 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3942 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3946 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3947 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3948 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3949 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3953 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3954 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3955 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3956 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3960 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3961 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3962 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3963 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3967 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3968 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3969 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3970 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3974 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3975 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3976 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3977 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3981 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3982 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3983 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3984 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3988 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3989 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3990 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3991 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3995 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3996 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3997 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3998 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4002 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4003 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4004 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4005 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4009 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4010 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4011 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4012 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4016 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4017 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4018 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4019 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4023 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4024 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4025 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4026 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4030 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4031 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4032 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4033 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4037 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4038 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4039 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4040 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4044 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4045 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4046 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4047 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4051 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4052 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4053 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4054 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4058 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4059 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4060 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4061 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4065 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4066 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4067 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4068 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4072 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4073 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4074 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4075 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4079 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4080 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4081 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4082 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4086 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4087 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4088 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4089 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4093 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4094 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4095 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4096 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4100 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4101 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4102 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4103 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4107 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4108 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4109 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4110 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4112 r = MsiDoAction( hpkg, "CostInitialize");
4113 ok( r == ERROR_SUCCESS, "cost init failed\n");
4117 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4119 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4120 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4124 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4126 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4127 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4131 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4133 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4138 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4140 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4145 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4147 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4152 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4154 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4155 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4159 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4161 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4166 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4168 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4173 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4175 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4176 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4180 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4182 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4183 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4187 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4189 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4190 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4194 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4196 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4197 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4201 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4203 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4204 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4208 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4210 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4215 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4217 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4218 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4222 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4224 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4225 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4229 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4231 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4232 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4236 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4238 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4239 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4243 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4245 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4246 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4250 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4252 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4253 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4257 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4259 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4260 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4264 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4266 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4267 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4271 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4273 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4274 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4278 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4280 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4281 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4285 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4286 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4287 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4288 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4292 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4293 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4294 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4295 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4299 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4300 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4301 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4302 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4306 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4307 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4308 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4309 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4313 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4314 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4315 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4316 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4320 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4321 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4322 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4323 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4327 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4328 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4329 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4330 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4334 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4335 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4336 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4337 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4341 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4342 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4343 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4344 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4346 r = MsiDoAction( hpkg, "FileCost");
4347 ok( r == ERROR_SUCCESS, "file cost failed\n");
4351 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4353 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4354 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4358 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4360 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4361 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4365 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4367 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4368 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4372 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4374 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4375 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4379 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4381 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4382 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4386 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4388 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4389 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4393 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4394 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4395 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4396 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4400 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4401 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4402 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4403 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4407 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4408 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4409 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4410 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4414 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4415 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4416 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4417 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4421 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4422 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4423 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4424 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4428 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4429 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4430 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4431 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4435 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4436 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4437 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4438 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4442 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4444 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4445 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4449 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4451 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4452 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4456 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4458 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4459 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4463 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4464 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4465 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4466 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4470 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4472 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4473 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4477 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4478 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4479 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4480 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4484 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4485 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4486 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4487 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4491 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4493 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4494 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4498 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4500 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4501 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4505 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4507 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4508 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4512 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4513 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4514 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4515 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4519 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4520 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4521 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4522 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4526 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4527 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4528 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4529 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4533 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4534 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4535 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4536 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4540 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4541 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4542 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4543 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4547 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4548 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4549 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4550 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4554 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4555 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4556 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4557 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4561 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4562 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4563 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4564 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4566 r = MsiDoAction( hpkg, "CostFinalize");
4567 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4571 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4572 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4573 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4574 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4578 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4579 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4580 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4581 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4585 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4586 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4587 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4588 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4592 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4593 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4594 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4595 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4599 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4600 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4601 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4602 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4606 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4607 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4608 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4609 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4613 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4614 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4615 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4616 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4620 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4621 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4622 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4623 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4627 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4628 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4629 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4630 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4634 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4635 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4636 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4637 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4641 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4642 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4643 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4644 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4648 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4649 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4650 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4651 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4655 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4656 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4657 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4658 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4662 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4663 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4664 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4665 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4669 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4670 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4671 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4672 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4676 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4677 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4678 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4679 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4683 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4684 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4685 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4686 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4690 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4691 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4692 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4693 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4697 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4698 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4699 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4700 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4704 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4705 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4706 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4707 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4711 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4712 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4713 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4714 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4718 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4719 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4720 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4721 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4725 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4726 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4727 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4728 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4732 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4733 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4734 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4735 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4739 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4740 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4741 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4742 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4746 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4747 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4748 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4749 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4753 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4754 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4755 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4756 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4760 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4761 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4762 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4763 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4767 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4768 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4769 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4770 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4774 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4775 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4776 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4777 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4781 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4783 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4784 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4788 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4790 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4791 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4795 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4797 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4798 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4800 MsiCloseHandle(hpkg);
4802 /* uninstall the product */
4803 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4806 /* all features installed locally */
4807 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4808 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4810 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4811 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4813 /* these properties must not be in the saved msi file */
4814 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4815 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4817 r = package_from_db( hdb, &hpkg );
4818 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
4822 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4823 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4824 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4825 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4829 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4830 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4831 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4832 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4836 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4837 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4838 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4839 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4843 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4844 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4845 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4846 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4850 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4851 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4852 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4853 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4857 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4858 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4859 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4860 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4864 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4865 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4866 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4867 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4871 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4872 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4873 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4874 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4878 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4879 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4880 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4881 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4885 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4886 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4887 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4888 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4892 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4893 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4894 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4895 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4899 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4900 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4901 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4902 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4906 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4907 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4913 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4914 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4920 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4921 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4922 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4923 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4927 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4928 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4929 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4930 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4934 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4935 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4936 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4937 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4941 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4942 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4943 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4944 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4948 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4949 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4950 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4951 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4955 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4956 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4957 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4958 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4962 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4963 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4964 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4965 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4969 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4970 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4971 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4972 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4976 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4977 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4978 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4979 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4983 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4984 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4985 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4986 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4990 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4991 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4992 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4993 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4997 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4998 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4999 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5000 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5004 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5005 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5006 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5007 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5011 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5012 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5013 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5014 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5018 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5019 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5020 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5021 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5025 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5026 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5027 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5028 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5032 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5033 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5034 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5035 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5039 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5040 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5041 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5042 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5046 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5047 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5048 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5049 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5051 r = MsiDoAction( hpkg, "CostInitialize");
5052 ok( r == ERROR_SUCCESS, "cost init failed\n");
5056 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5063 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5070 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5077 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5084 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5091 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5098 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5105 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5112 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5119 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5126 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5133 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5140 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5147 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5154 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5161 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5168 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5175 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5177 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5182 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5184 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5185 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5189 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5190 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5191 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5192 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5196 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5197 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5198 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5199 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5203 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5204 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5205 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5206 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5210 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5211 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5212 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5213 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5217 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5219 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5220 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5224 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5225 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5226 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5227 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5231 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5233 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5234 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5238 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5240 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5241 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5245 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5247 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5248 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5252 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5253 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5254 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5255 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5259 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5260 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5261 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5262 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5266 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5268 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5269 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5273 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5274 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5275 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5276 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5280 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5281 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5282 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5283 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5285 r = MsiDoAction( hpkg, "FileCost");
5286 ok( r == ERROR_SUCCESS, "file cost failed\n");
5290 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5297 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5304 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5311 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5318 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5325 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5332 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5339 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5346 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5353 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5360 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5362 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5363 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5367 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5369 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5370 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5374 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5376 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5377 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5381 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5383 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5384 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5388 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5389 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5390 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5391 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5395 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5396 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5397 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5398 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5402 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5403 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5404 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5405 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5409 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5410 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5411 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5412 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5416 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5417 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5418 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5419 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5423 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5424 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5425 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5426 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5430 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5431 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5432 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5433 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5437 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5438 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5439 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5440 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5444 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5445 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5446 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5447 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5451 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5452 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5453 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5454 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5458 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5459 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5460 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5461 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5465 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5466 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5467 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5468 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5472 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5473 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5474 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5475 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5479 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5480 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5481 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5482 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5486 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5487 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5488 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5489 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5493 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5494 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5495 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5496 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5500 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5501 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5502 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5503 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5507 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5508 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5509 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5510 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5514 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5515 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5516 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5517 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5519 r = MsiDoAction( hpkg, "CostFinalize");
5520 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5524 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5526 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5527 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5531 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5533 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5534 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5538 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5540 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5541 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5545 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5547 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5548 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5552 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5554 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5555 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5559 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5561 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5562 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5566 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5568 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5569 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5573 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5575 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5576 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5580 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5581 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5582 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5583 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5587 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5588 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5589 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5590 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5594 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5595 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5596 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5597 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5601 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5602 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5603 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5604 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5608 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5609 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5610 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5611 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5615 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5616 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5617 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5618 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5622 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5623 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5624 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5625 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5629 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5630 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5631 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5632 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5636 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5637 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5638 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5639 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5643 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5644 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5645 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5646 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5650 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5652 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5653 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5657 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5659 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5660 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5664 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5665 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5666 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5667 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5671 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5673 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5674 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5678 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5679 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5680 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5681 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5685 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5687 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5688 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5692 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5693 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5694 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5695 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5699 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5700 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5701 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5702 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5706 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5707 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5708 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5709 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5713 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5714 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5715 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5716 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5720 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5721 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5722 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5723 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5727 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5728 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5729 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5730 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5734 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5735 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5736 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5737 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5741 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5743 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5744 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5748 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5749 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5750 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5751 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5753 MsiCloseHandle(hpkg);
5755 /* uninstall the product */
5756 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5759 /* all features installed from source */
5760 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5763 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5764 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5766 /* this property must not be in the saved msi file */
5767 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5768 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5770 r = package_from_db( hdb, &hpkg );
5771 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
5775 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5776 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5777 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5778 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5782 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5783 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5784 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5785 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5789 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5790 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5791 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5792 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5796 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5797 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5798 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5799 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5803 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5804 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5805 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5806 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5810 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5811 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5812 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5813 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5817 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5818 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5819 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5820 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5824 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5825 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5826 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5827 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5831 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5832 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5833 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5834 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5838 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5839 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5840 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5841 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5845 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5846 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5847 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5848 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5852 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5853 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5854 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5855 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5859 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5860 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5861 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5862 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5866 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5867 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5868 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5869 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5873 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5874 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5875 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5876 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5880 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5881 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5882 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5883 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5887 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5888 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5889 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5890 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5894 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5895 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5896 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5897 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5901 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5902 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5903 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5904 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5908 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5909 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5910 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5911 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5915 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5916 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5917 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5918 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5922 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5923 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5924 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5925 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5929 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5930 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5931 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5932 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5936 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5937 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5938 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5939 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5943 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5944 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5945 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5946 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5950 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5951 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5952 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5953 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5957 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5958 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5959 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5960 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5964 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5965 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5966 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5967 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5971 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5972 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5973 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5974 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5978 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5979 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5980 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5981 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5985 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5986 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5987 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5988 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5992 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5993 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5994 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5995 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5999 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6000 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6001 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6002 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6004 r = MsiDoAction( hpkg, "CostInitialize");
6005 ok( r == ERROR_SUCCESS, "cost init failed\n");
6009 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6011 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6012 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6016 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6018 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6019 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6023 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6025 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6030 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6032 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6037 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6039 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6040 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6044 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6046 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6047 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6051 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6052 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6053 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6054 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6058 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6059 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6060 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6061 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6065 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6067 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6068 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6072 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6073 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6074 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6075 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6079 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6080 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6081 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6082 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6086 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6087 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6088 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6089 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6093 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6095 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6096 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6100 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6102 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6103 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6107 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6108 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6109 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6110 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6114 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6116 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6117 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6121 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6123 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6124 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6128 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6130 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6131 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6135 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6137 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6138 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6142 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6144 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6145 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6149 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6151 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6152 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6156 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6158 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6159 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6163 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6165 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6166 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6170 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6172 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6173 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6177 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6179 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6180 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6184 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6186 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6187 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6191 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6193 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6194 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6198 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6200 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6201 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6205 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6207 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6208 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6212 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6214 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6215 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6219 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6220 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6221 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6222 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6226 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6227 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6228 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6229 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6233 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6234 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6235 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6236 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6238 r = MsiDoAction( hpkg, "FileCost");
6239 ok( r == ERROR_SUCCESS, "file cost failed\n");
6243 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6245 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6246 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6250 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6252 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6253 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6257 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6259 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6260 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6264 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6266 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6267 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6271 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6273 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6274 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6278 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6280 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6281 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6285 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6286 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6287 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6288 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6292 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6293 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6294 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6295 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6299 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6300 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6301 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6302 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6306 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6307 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6308 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6309 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6313 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6314 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6315 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6316 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6320 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6321 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6322 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6323 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6327 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6328 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6329 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6330 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6334 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6335 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6336 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6337 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6341 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6342 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6343 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6344 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6348 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6349 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6350 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6351 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6355 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6356 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6357 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6358 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6362 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6363 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6364 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6365 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6369 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6370 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6371 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6372 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6376 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6377 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6378 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6379 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6383 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6384 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6385 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6386 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6390 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6391 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6392 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6393 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6397 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6398 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6399 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6400 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6404 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6405 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6406 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6407 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6411 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6412 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6413 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6414 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6418 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6419 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6420 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6421 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6425 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6426 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6427 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6428 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6432 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6433 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6434 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6435 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6439 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6440 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6441 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6442 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6446 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6447 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6448 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6449 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6453 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6454 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6455 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6456 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6460 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6461 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6462 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6463 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6467 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6468 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6469 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6470 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6472 r = MsiDoAction( hpkg, "CostFinalize");
6473 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6477 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6478 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6479 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6480 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6484 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6485 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6486 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6487 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6491 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6493 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6494 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6498 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6500 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6501 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6505 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6507 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6508 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6512 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6513 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6514 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6515 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6519 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6520 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6521 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6522 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6526 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6527 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6528 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6529 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6533 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6534 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6535 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6536 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6540 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6541 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6542 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6543 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6547 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6548 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6549 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6550 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6554 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6555 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6556 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6557 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6561 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6562 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6563 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6564 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6568 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6569 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6570 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6571 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6575 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6576 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6577 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6578 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6582 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6583 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6584 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6585 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6589 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6590 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6591 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6592 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6596 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6597 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6598 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6599 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6603 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6604 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6605 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6606 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6610 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6611 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6612 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6613 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6617 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6618 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6619 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6620 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6624 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6625 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6626 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6627 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6631 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6632 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6633 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6634 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6638 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6639 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6640 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6641 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6645 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6646 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6647 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6648 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6652 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6654 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6655 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6659 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6660 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6661 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6662 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6666 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6668 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6669 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6673 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6675 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6676 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6680 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6681 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6682 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6683 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6687 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6688 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6689 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6690 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6694 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6695 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6696 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6697 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6701 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6703 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6704 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6706 MsiCloseHandle(hpkg);
6708 /* reinstall the product */
6709 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6710 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6712 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6713 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6715 /* this property must not be in the saved msi file */
6716 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6717 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6719 r = package_from_db( hdb, &hpkg );
6720 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
6724 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6725 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6726 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6727 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6731 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6732 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6733 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6734 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6738 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6739 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6740 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6741 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6745 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6746 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6747 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6748 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6752 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6753 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6754 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6755 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6759 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6760 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6761 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6762 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6766 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6767 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6768 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6769 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6773 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6774 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6775 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6776 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6780 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6781 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6782 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6783 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6787 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6788 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6789 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6790 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6794 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6795 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6796 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6797 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6801 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6802 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6803 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6804 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6808 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6809 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6810 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6811 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6815 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6816 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6817 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6818 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6822 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6823 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6824 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6825 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6829 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6830 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6831 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6832 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6836 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6837 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6838 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6839 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6843 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6844 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6845 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6846 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6850 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6851 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6852 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6853 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6857 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6858 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6859 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6860 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6864 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6865 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6866 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6867 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6871 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6872 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6873 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6874 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6878 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6879 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6880 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6881 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6885 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6886 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6887 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6888 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6892 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6893 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6894 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6895 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6899 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6900 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6901 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6902 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6906 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6907 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6913 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6914 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6920 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6921 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6922 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6923 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6927 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6928 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6929 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6930 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6934 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6935 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6936 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6937 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6941 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6942 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6943 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6944 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6948 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6949 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6950 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6951 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6953 r = MsiDoAction( hpkg, "CostInitialize");
6954 ok( r == ERROR_SUCCESS, "cost init failed\n");
6958 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6959 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6960 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6961 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6965 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6966 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6967 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6968 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6972 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6973 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6974 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6975 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6979 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6981 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6982 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6986 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6988 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6989 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6993 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6995 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6996 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7000 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7002 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7003 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7007 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7009 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7010 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7014 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7016 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7017 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7021 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7023 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7024 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7028 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7030 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7031 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7035 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7037 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7038 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7042 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7044 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7045 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7049 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7051 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7056 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7063 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7070 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7077 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7084 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7091 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7098 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7105 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7112 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7119 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7126 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7133 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7140 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7147 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7154 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7161 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7168 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7175 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7177 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7182 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7184 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7185 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7187 r = MsiDoAction( hpkg, "FileCost");
7188 ok( r == ERROR_SUCCESS, "file cost failed\n");
7192 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7199 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7206 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7213 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7220 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7227 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7234 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7241 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7248 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7250 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7251 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7255 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7262 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7269 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7276 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7283 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7290 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7297 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7304 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7311 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7318 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7325 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7332 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7339 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7346 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7353 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7360 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7362 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7363 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7367 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7369 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7370 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7374 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7376 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7377 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7381 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7383 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7384 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7388 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7389 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7390 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7391 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7395 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7396 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7397 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7398 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7402 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7403 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7404 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7405 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7409 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7410 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7411 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7412 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7416 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7417 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7418 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7419 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7421 r = MsiDoAction( hpkg, "CostFinalize");
7422 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
7426 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7428 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7429 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7433 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7435 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7436 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7440 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7442 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7443 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7447 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7449 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7450 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7454 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7456 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7457 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7461 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7463 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7464 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7468 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7470 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7471 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7475 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7477 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7478 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7482 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7484 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7485 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7489 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7491 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7492 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7496 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7498 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7499 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7503 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7505 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7506 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7510 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7512 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7513 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7517 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7519 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7520 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7524 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7526 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7527 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7531 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7533 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7534 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7538 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7540 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7541 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7545 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7547 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7548 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7552 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7554 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7555 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7559 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7561 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7562 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7566 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7568 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7569 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7573 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7575 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7576 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7580 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7581 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7582 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7583 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7587 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7588 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7589 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7590 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7594 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7595 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7596 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7597 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7601 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7602 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7603 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7604 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7608 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7609 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7610 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7611 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7615 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7616 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7617 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7618 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7622 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7623 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7624 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7625 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7629 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7630 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7631 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7632 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7636 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7637 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7638 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7639 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7643 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7644 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7645 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7646 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7650 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7652 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7653 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7655 MsiCloseHandle(hpkg);
7657 /* uninstall the product */
7658 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7659 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7661 DeleteFileA(msifile);
7662 DeleteFileA(msifile2);
7663 DeleteFileA(msifile3);
7664 DeleteFileA(msifile4);
7667 static void test_getproperty(void)
7669 MSIHANDLE hPackage = 0;
7671 static CHAR empty[] = "";
7675 r = package_from_db(create_package_db(), &hPackage);
7676 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7678 skip("Not enough rights to perform tests\n");
7679 DeleteFile(msifile);
7682 ok( r == ERROR_SUCCESS, "Failed to create package %u\n", r );
7684 /* set the property */
7685 r = MsiSetProperty(hPackage, "Name", "Value");
7686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7688 /* retrieve the size, NULL pointer */
7690 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7691 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7692 ok( size == 5, "Expected 5, got %d\n", size);
7694 /* retrieve the size, empty string */
7696 r = MsiGetProperty(hPackage, "Name", empty, &size);
7697 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7698 ok( size == 5, "Expected 5, got %d\n", size);
7700 /* don't change size */
7701 r = MsiGetProperty(hPackage, "Name", prop, &size);
7702 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7703 ok( size == 5, "Expected 5, got %d\n", size);
7704 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7706 /* increase the size by 1 */
7708 r = MsiGetProperty(hPackage, "Name", prop, &size);
7709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7710 ok( size == 5, "Expected 5, got %d\n", size);
7711 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7713 r = MsiCloseHandle( hPackage);
7714 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7715 DeleteFile(msifile);
7718 static void test_removefiles(void)
7723 INSTALLSTATE installed, action;
7725 hdb = create_package_db();
7726 ok ( hdb, "failed to create package database\n" );
7728 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7729 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7731 r = create_feature_table( hdb );
7732 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7734 r = create_component_table( hdb );
7735 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7737 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7738 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7740 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7741 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7743 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7744 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7746 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7747 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7749 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7750 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7752 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7753 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7755 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7756 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7758 r = add_component_entry( hdb, "'oxygen', '', 'TARGETDIR', 0, '0', 'oxygen_file'" );
7759 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7761 r = create_feature_components_table( hdb );
7762 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7764 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7765 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7767 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7768 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7770 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7771 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7773 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7774 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7776 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7777 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7779 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7780 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7782 r = add_feature_components_entry( hdb, "'one', 'oxygen'" );
7783 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7785 r = create_file_table( hdb );
7786 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7788 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7789 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7791 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7792 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7794 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7795 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7797 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7798 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7800 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7801 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7803 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7804 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7806 r = add_file_entry( hdb, "'oxygen_file', 'oxygen', 'oxygen.txt', 0, '', '1033', 16384, 1" );
7807 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7809 r = create_remove_file_table( hdb );
7810 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7812 r = package_from_db( hdb, &hpkg );
7813 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7815 skip("Not enough rights to perform tests\n");
7816 DeleteFile(msifile);
7819 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7821 MsiCloseHandle( hdb );
7823 create_test_file( "hydrogen.txt" );
7824 create_test_file( "helium.txt" );
7825 create_test_file( "lithium.txt" );
7826 create_test_file( "beryllium.txt" );
7827 create_test_file( "boron.txt" );
7828 create_test_file( "carbon.txt" );
7829 create_test_file( "oxygen.txt" );
7831 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7832 ok( r == ERROR_SUCCESS, "set property failed\n");
7834 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7836 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7837 ok( r == ERROR_UNKNOWN_COMPONENT, "expected ERROR_UNKNOWN_COMPONENT, got %u\n", r );
7839 r = MsiDoAction( hpkg, "CostInitialize");
7840 ok( r == ERROR_SUCCESS, "cost init failed\n");
7842 r = MsiDoAction( hpkg, "FileCost");
7843 ok( r == ERROR_SUCCESS, "file cost failed\n");
7845 installed = action = 0xdeadbeef;
7846 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7847 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7848 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7849 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7851 r = MsiDoAction( hpkg, "CostFinalize");
7852 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7854 r = MsiDoAction( hpkg, "InstallValidate");
7855 ok( r == ERROR_SUCCESS, "install validate failed\n");
7857 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7858 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7860 installed = action = 0xdeadbeef;
7861 r = MsiGetComponentState( hpkg, "hydrogen", &installed, &action );
7862 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7863 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7864 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7866 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7867 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7869 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7870 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7872 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7873 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7875 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7876 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7878 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7879 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7881 installed = action = 0xdeadbeef;
7882 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7883 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7884 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7885 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7887 r = MsiSetComponentState( hpkg, "oxygen", INSTALLSTATE_ABSENT );
7888 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7890 installed = action = 0xdeadbeef;
7891 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7892 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7893 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7894 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7896 r = MsiDoAction( hpkg, "RemoveFiles");
7897 ok( r == ERROR_SUCCESS, "remove files failed\n");
7899 installed = action = 0xdeadbeef;
7900 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7901 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7902 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7903 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7905 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7906 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7907 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7908 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7909 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7910 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7911 ok(DeleteFileA("oxygen.txt"), "Expected oxygen.txt to exist\n");
7913 MsiCloseHandle( hpkg );
7914 DeleteFileA(msifile);
7917 static void test_appsearch(void)
7922 CHAR prop[MAX_PATH];
7925 hdb = create_package_db();
7926 ok ( hdb, "failed to create package database\n" );
7928 r = create_appsearch_table( hdb );
7929 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7931 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7932 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7934 r = add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" );
7935 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7937 r = create_reglocator_table( hdb );
7938 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7940 r = add_reglocator_entry( hdb, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 );
7941 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7943 r = create_drlocator_table( hdb );
7944 ok( r == ERROR_SUCCESS, "cannot create DrLocator table: %d\n", r );
7946 r = add_drlocator_entry( hdb, "'NewSignature2', 0, 'c:\\windows\\system32', 0" );
7947 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7949 r = create_signature_table( hdb );
7950 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7952 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7953 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7955 r = add_signature_entry( hdb, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" );
7956 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7958 r = package_from_db( hdb, &hpkg );
7959 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7961 skip("Not enough rights to perform tests\n");
7962 DeleteFile(msifile);
7965 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7966 MsiCloseHandle( hdb );
7967 if (r != ERROR_SUCCESS)
7970 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7972 r = MsiDoAction( hpkg, "AppSearch" );
7973 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7975 size = sizeof(prop);
7976 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7977 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7980 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7983 size = sizeof(prop);
7984 r = MsiGetPropertyA( hpkg, "NOTEPAD", prop, &size );
7985 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7988 MsiCloseHandle( hpkg );
7989 DeleteFileA(msifile);
7992 static void test_appsearch_complocator(void)
7994 MSIHANDLE hpkg, hdb;
7995 CHAR path[MAX_PATH];
7996 CHAR prop[MAX_PATH];
8001 if (!(usersid = get_user_sid()))
8004 if (is_process_limited())
8006 skip("process is limited\n");
8010 create_test_file("FileName1");
8011 create_test_file("FileName4");
8012 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
8013 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
8015 create_test_file("FileName2");
8016 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
8017 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
8019 create_test_file("FileName3");
8020 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
8021 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
8023 create_test_file("FileName5");
8024 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
8025 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
8027 create_test_file("FileName6");
8028 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
8029 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
8031 create_test_file("FileName7");
8032 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
8033 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
8035 /* dir is FALSE, but we're pretending it's a directory */
8036 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
8037 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
8039 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8040 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
8041 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
8043 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8044 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
8045 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
8047 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8048 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
8049 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
8051 hdb = create_package_db();
8052 ok(hdb, "Expected a valid database handle\n");
8054 r = create_appsearch_table(hdb);
8055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8057 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8060 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8063 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8066 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8069 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8072 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8075 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8078 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8079 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8081 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8084 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8087 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8088 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8090 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8091 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8093 r = create_complocator_table(hdb);
8094 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8096 /* published component, machine, file, signature, misdbLocatorTypeFile */
8097 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
8098 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8100 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
8101 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
8102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8104 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
8105 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
8106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8108 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
8109 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
8110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8112 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
8113 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
8114 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8116 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
8117 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
8118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8120 /* published component, machine, file, no signature, misdbLocatorTypeFile */
8121 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
8122 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8124 /* unpublished component, no signature, misdbLocatorTypeDir */
8125 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
8126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8128 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
8129 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
8130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8132 /* published component, signature w/ ver, misdbLocatorTypeFile */
8133 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
8134 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8136 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
8137 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
8138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8140 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
8141 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
8142 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8144 r = create_signature_table(hdb);
8145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8147 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
8148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8150 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
8151 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8153 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
8154 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8156 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
8157 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8159 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
8160 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8162 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8163 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8165 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8168 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8169 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8171 r = package_from_db(hdb, &hpkg);
8172 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8174 skip("Not enough rights to perform tests\n");
8177 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8179 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
8180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8182 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8184 r = MsiDoAction(hpkg, "AppSearch");
8185 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8188 sprintf(path, "%s\\FileName1", CURR_DIR);
8189 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8191 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8194 sprintf(path, "%s\\FileName2", CURR_DIR);
8195 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8197 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8200 sprintf(path, "%s\\FileName3", CURR_DIR);
8201 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8202 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8203 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8206 sprintf(path, "%s\\FileName4", CURR_DIR);
8207 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8209 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8212 sprintf(path, "%s\\FileName5", CURR_DIR);
8213 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8214 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8215 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8218 sprintf(path, "%s\\", CURR_DIR);
8219 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8220 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8221 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8224 sprintf(path, "%s\\", CURR_DIR);
8225 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8226 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8227 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8230 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8231 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8232 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
8235 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8236 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8237 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8240 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
8241 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8242 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8243 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8246 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8247 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8248 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8251 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
8252 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8253 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8254 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8256 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
8257 MSIINSTALLCONTEXT_MACHINE, NULL);
8258 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
8259 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
8260 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
8261 MSIINSTALLCONTEXT_USERMANAGED, usersid);
8262 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
8263 MSIINSTALLCONTEXT_MACHINE, NULL);
8264 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
8265 MSIINSTALLCONTEXT_MACHINE, NULL);
8266 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
8267 MSIINSTALLCONTEXT_MACHINE, NULL);
8268 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
8269 MSIINSTALLCONTEXT_MACHINE, NULL);
8270 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
8271 MSIINSTALLCONTEXT_MACHINE, NULL);
8272 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
8273 MSIINSTALLCONTEXT_MACHINE, NULL);
8274 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
8275 MSIINSTALLCONTEXT_MACHINE, NULL);
8277 MsiCloseHandle(hpkg);
8280 DeleteFileA("FileName1");
8281 DeleteFileA("FileName2");
8282 DeleteFileA("FileName3");
8283 DeleteFileA("FileName4");
8284 DeleteFileA("FileName5");
8285 DeleteFileA("FileName6");
8286 DeleteFileA("FileName7");
8287 DeleteFileA("FileName8.dll");
8288 DeleteFileA("FileName9.dll");
8289 DeleteFileA("FileName10.dll");
8290 DeleteFileA(msifile);
8294 static void test_appsearch_reglocator(void)
8296 MSIHANDLE hpkg, hdb;
8297 CHAR path[MAX_PATH], prop[MAX_PATH];
8298 DWORD binary[2], size, val;
8299 BOOL space, version, is_64bit = sizeof(void *) > sizeof(int);
8300 HKEY hklm, classes, hkcu, users;
8301 LPSTR pathdata, pathvar, ptr;
8308 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8311 DeleteFileA("test.dll");
8313 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
8314 if (res == ERROR_ACCESS_DENIED)
8316 skip("Not enough rights to perform tests\n");
8319 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8321 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
8322 (const BYTE *)"regszdata", 10);
8323 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8325 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
8326 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8328 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
8329 (const BYTE *)"regszdata", 10);
8330 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8333 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
8334 ok(res == ERROR_SUCCESS ||
8335 broken(res == ERROR_INVALID_PARAMETER),
8336 "Expected ERROR_SUCCESS, got %d\n", res);
8338 if (res == ERROR_SUCCESS)
8340 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
8341 (const BYTE *)"regszdata", 10);
8342 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8345 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
8346 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8348 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
8349 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8351 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
8352 (const BYTE *)"regszdata", 10);
8353 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8356 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
8357 (const BYTE *)&val, sizeof(DWORD));
8358 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8361 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
8362 (const BYTE *)&val, sizeof(DWORD));
8363 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8365 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
8366 (const BYTE *)"%PATH%", 7);
8367 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8369 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
8370 (const BYTE *)"my%NOVAR%", 10);
8371 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8373 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
8374 (const BYTE *)"one\0two\0", 9);
8375 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8377 binary[0] = 0x1234abcd;
8378 binary[1] = 0x567890ef;
8379 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
8380 (const BYTE *)binary, sizeof(binary));
8381 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8383 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
8384 (const BYTE *)"#regszdata", 11);
8385 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8387 create_test_file("FileName1");
8388 sprintf(path, "%s\\FileName1", CURR_DIR);
8389 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
8390 (const BYTE *)path, lstrlenA(path) + 1);
8391 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8393 sprintf(path, "%s\\FileName2", CURR_DIR);
8394 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
8395 (const BYTE *)path, lstrlenA(path) + 1);
8396 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8398 lstrcpyA(path, CURR_DIR);
8399 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
8400 (const BYTE *)path, lstrlenA(path) + 1);
8401 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8403 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
8404 (const BYTE *)"", 1);
8405 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8407 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8408 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8409 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
8410 (const BYTE *)path, lstrlenA(path) + 1);
8411 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8413 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8414 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8415 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
8416 (const BYTE *)path, lstrlenA(path) + 1);
8417 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8419 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8420 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8421 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
8422 (const BYTE *)path, lstrlenA(path) + 1);
8423 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8425 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
8426 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
8427 (const BYTE *)path, lstrlenA(path) + 1);
8428 ok( res == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", res);
8430 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
8431 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
8432 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
8433 (const BYTE *)path, lstrlenA(path) + 1);
8434 ok( res == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", res);
8436 hdb = create_package_db();
8437 ok(hdb, "Expected a valid database handle\n");
8439 r = create_appsearch_table(hdb);
8440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8442 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8445 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8448 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8451 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8452 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8454 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8455 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8457 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8458 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8460 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8463 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8466 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8469 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8470 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8472 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8475 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8476 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8478 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
8479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8481 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
8482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8484 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
8485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8487 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
8488 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8490 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
8491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8493 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
8494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8496 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
8497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8499 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
8500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8502 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
8503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8505 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
8506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8508 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
8509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8511 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
8512 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8514 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
8515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8517 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
8518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8520 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
8521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8523 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
8524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8526 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
8527 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8529 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
8530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8532 r = create_reglocator_table(hdb);
8533 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8535 type = msidbLocatorTypeRawValue;
8537 type |= msidbLocatorType64bit;
8539 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
8540 r = add_reglocator_entry(hdb, "NewSignature1", 2, "Software\\Wine", "Value1", type);
8541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8543 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
8544 r = add_reglocator_entry(hdb, "NewSignature2", 2, "Software\\Wine", "Value2", type);
8545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8547 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
8548 r = add_reglocator_entry(hdb, "NewSignature3", 2, "Software\\Wine", "Value3", type);
8549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8551 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8552 r = add_reglocator_entry(hdb, "NewSignature4", 2, "Software\\Wine", "Value4", type);
8553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8555 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8556 r = add_reglocator_entry(hdb, "NewSignature5", 2, "Software\\Wine", "Value5", type);
8557 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8559 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
8560 r = add_reglocator_entry(hdb, "NewSignature6", 2, "Software\\Wine", "Value6", type);
8561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8563 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
8564 r = add_reglocator_entry(hdb, "NewSignature7", 2, "Software\\Wine", "Value7", type);
8565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8567 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
8568 r = add_reglocator_entry(hdb, "NewSignature8", 2, "Software\\Wine", "Value8", type);
8569 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8571 type = msidbLocatorTypeFileName;
8573 type |= msidbLocatorType64bit;
8575 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
8576 r = add_reglocator_entry(hdb, "NewSignature9", 2, "Software\\Wine", "Value9", type);
8577 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8579 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
8580 r = add_reglocator_entry(hdb, "NewSignature10", 2, "Software\\Wine", "Value10", type);
8581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8583 /* HKLM, msidbLocatorTypeFileName, no signature */
8584 r = add_reglocator_entry(hdb, "NewSignature11", 2, "Software\\Wine", "Value9", type);
8585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8587 type = msidbLocatorTypeDirectory;
8589 type |= msidbLocatorType64bit;
8591 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
8592 r = add_reglocator_entry(hdb, "NewSignature12", 2, "Software\\Wine", "Value9", type);
8593 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8595 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8596 r = add_reglocator_entry(hdb, "NewSignature13", 2, "Software\\Wine", "Value11", type);
8597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8599 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8600 r = add_reglocator_entry(hdb, "NewSignature14", 2, "Software\\Wine", "Value9", type);
8601 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8603 type = msidbLocatorTypeRawValue;
8605 type |= msidbLocatorType64bit;
8607 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8608 r = add_reglocator_entry(hdb, "NewSignature15", 0, "Software\\Wine", "Value1", type);
8609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8611 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8612 r = add_reglocator_entry(hdb, "NewSignature16", 1, "Software\\Wine", "Value1", type);
8613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8615 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8616 r = add_reglocator_entry(hdb, "NewSignature17", 3, "S-1-5-18\\Software\\Wine", "Value1", type);
8617 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8619 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8620 r = add_reglocator_entry(hdb, "NewSignature18", 2, "Software\\Wine", "", type);
8621 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8623 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8624 r = add_reglocator_entry(hdb, "NewSignature19", 2, "Software\\IDontExist", "", type);
8625 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8627 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8628 r = add_reglocator_entry(hdb, "NewSignature20", 2, "Software\\Wine", "Value12", type);
8629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8631 type = msidbLocatorTypeFileName;
8633 type |= msidbLocatorType64bit;
8635 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8636 r = add_reglocator_entry(hdb, "NewSignature21", 2, "Software\\Wine", "Value13", type);
8637 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8639 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8640 r = add_reglocator_entry(hdb, "NewSignature22", 2, "Software\\Wine", "Value14", type);
8641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8643 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8644 r = add_reglocator_entry(hdb, "NewSignature23", 2, "Software\\Wine", "Value15", type);
8645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8647 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8648 r = add_reglocator_entry(hdb, "NewSignature24", 2, "Software\\Wine", "Value11", type);
8649 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8651 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8652 r = add_reglocator_entry(hdb, "NewSignature25", 2, "Software\\Wine", "Value10", type);
8653 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8655 type = msidbLocatorTypeDirectory;
8657 type |= msidbLocatorType64bit;
8659 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8660 r = add_reglocator_entry(hdb, "NewSignature26", 2, "Software\\Wine", "Value11", type);
8661 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8663 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8664 r = add_reglocator_entry(hdb, "NewSignature27", 2, "Software\\Wine", "Value10", type);
8665 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8667 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8668 r = add_reglocator_entry(hdb, "NewSignature28", 2, "Software\\Wine", "Value10", type);
8669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8671 type = msidbLocatorTypeFileName;
8673 type |= msidbLocatorType64bit;
8675 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8676 r = add_reglocator_entry(hdb, "NewSignature29", 2, "Software\\Wine", "Value16", type);
8677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8679 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8680 r = add_reglocator_entry(hdb, "NewSignature30", 2, "Software\\Wine", "Value17", type);
8681 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8683 r = create_signature_table(hdb);
8684 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8686 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8687 r = add_signature_entry(hdb, str);
8688 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8690 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8691 r = add_signature_entry(hdb, str);
8692 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8694 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8695 r = add_signature_entry(hdb, str);
8696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8698 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8699 r = add_signature_entry(hdb, str);
8700 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8702 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8703 r = add_signature_entry(hdb, str);
8704 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8706 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8707 r = add_signature_entry(hdb, str);
8708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8710 ptr = strrchr(CURR_DIR, '\\') + 1;
8711 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8712 r = add_signature_entry(hdb, path);
8713 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8715 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8716 r = add_signature_entry(hdb, str);
8717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8719 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8720 r = add_signature_entry(hdb, str);
8721 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8723 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8724 r = add_signature_entry(hdb, str);
8725 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8727 r = package_from_db(hdb, &hpkg);
8728 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8730 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8732 r = MsiDoAction(hpkg, "AppSearch");
8733 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8736 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8737 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8738 ok(!lstrcmpA(prop, "regszdata"),
8739 "Expected \"regszdata\", got \"%s\"\n", prop);
8742 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8743 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8744 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8747 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8748 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8749 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8751 memset(&si, 0, sizeof(si));
8752 if (pGetNativeSystemInfo) pGetNativeSystemInfo(&si);
8754 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
8756 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8757 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8758 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8761 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8762 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8764 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8765 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8766 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8767 ok(!lstrcmpA(pathdata, pathvar),
8768 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8770 HeapFree(GetProcessHeap(), 0, pathvar);
8771 HeapFree(GetProcessHeap(), 0, pathdata);
8775 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8776 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8778 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8781 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8785 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8786 "Expected \"\\0one\\0two\\0\\0\"\n");
8790 lstrcpyA(path, "#xCDAB3412EF907856");
8791 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8793 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8796 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8798 ok(!lstrcmpA(prop, "##regszdata"),
8799 "Expected \"##regszdata\", got \"%s\"\n", prop);
8802 sprintf(path, "%s\\FileName1", CURR_DIR);
8803 r = MsiGetPropertyA(hpkg, "SIGPROP9", 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, "SIGPROP10", prop, &size);
8809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8810 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8813 sprintf(path, "%s\\", CURR_DIR);
8814 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8816 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8819 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8820 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8821 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8824 sprintf(path, "%s\\", CURR_DIR);
8825 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8826 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8827 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8830 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8832 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8835 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8836 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8837 ok(!lstrcmpA(prop, "regszdata"),
8838 "Expected \"regszdata\", got \"%s\"\n", prop);
8841 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8843 ok(!lstrcmpA(prop, "regszdata"),
8844 "Expected \"regszdata\", got \"%s\"\n", prop);
8849 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8850 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8851 ok(!lstrcmpA(prop, "regszdata"),
8852 "Expected \"regszdata\", got \"%s\"\n", prop);
8856 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8857 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8858 ok(!lstrcmpA(prop, "defvalue"),
8859 "Expected \"defvalue\", got \"%s\"\n", prop);
8862 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8864 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8867 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8868 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8869 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8874 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8875 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8876 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8877 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8880 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8881 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8882 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8885 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8886 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8887 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8888 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8892 lstrcpyA(path, CURR_DIR);
8893 ptr = strrchr(path, '\\') + 1;
8895 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8896 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8897 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8900 sprintf(path, "%s\\", CURR_DIR);
8901 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8903 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8906 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8907 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8908 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8911 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8913 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8916 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8917 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8918 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8921 sprintf(path, "%s\\FileName1", CURR_DIR);
8922 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8923 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8924 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8927 sprintf(path, "%s\\FileName1", CURR_DIR);
8928 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8929 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8931 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8933 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8935 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8936 RegDeleteValueA(hklm, "Value1");
8937 RegDeleteValueA(hklm, "Value2");
8938 RegDeleteValueA(hklm, "Value3");
8939 RegDeleteValueA(hklm, "Value4");
8940 RegDeleteValueA(hklm, "Value5");
8941 RegDeleteValueA(hklm, "Value6");
8942 RegDeleteValueA(hklm, "Value7");
8943 RegDeleteValueA(hklm, "Value8");
8944 RegDeleteValueA(hklm, "Value9");
8945 RegDeleteValueA(hklm, "Value10");
8946 RegDeleteValueA(hklm, "Value11");
8947 RegDeleteValueA(hklm, "Value12");
8948 RegDeleteValueA(hklm, "Value13");
8949 RegDeleteValueA(hklm, "Value14");
8950 RegDeleteValueA(hklm, "Value15");
8951 RegDeleteValueA(hklm, "Value16");
8952 RegDeleteValueA(hklm, "Value17");
8953 RegDeleteKey(hklm, "");
8956 RegDeleteValueA(classes, "Value1");
8957 RegDeleteKeyA(classes, "");
8958 RegCloseKey(classes);
8960 RegDeleteValueA(hkcu, "Value1");
8961 RegDeleteKeyA(hkcu, "");
8964 RegDeleteValueA(users, "Value1");
8965 RegDeleteKeyA(users, "");
8968 DeleteFileA("FileName1");
8969 DeleteFileA("FileName3.dll");
8970 DeleteFileA("FileName4.dll");
8971 DeleteFileA("FileName5.dll");
8972 MsiCloseHandle(hpkg);
8973 DeleteFileA(msifile);
8976 static void delete_win_ini(LPCSTR file)
8978 CHAR path[MAX_PATH];
8980 GetWindowsDirectoryA(path, MAX_PATH);
8981 lstrcatA(path, "\\");
8982 lstrcatA(path, file);
8987 static void test_appsearch_inilocator(void)
8989 MSIHANDLE hpkg, hdb;
8990 CHAR path[MAX_PATH];
8991 CHAR prop[MAX_PATH];
8999 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9002 DeleteFileA("test.dll");
9004 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
9006 create_test_file("FileName1");
9007 sprintf(path, "%s\\FileName1", CURR_DIR);
9008 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
9010 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
9012 sprintf(path, "%s\\IDontExist", CURR_DIR);
9013 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
9015 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9016 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9017 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
9019 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9020 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9021 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
9023 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9024 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9025 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
9027 hdb = create_package_db();
9028 ok(hdb, "Expected a valid database handle\n");
9030 r = create_appsearch_table(hdb);
9031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9033 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9034 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9036 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9037 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9039 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9042 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9043 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9045 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9046 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9048 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9051 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9052 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9054 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9057 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9060 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9063 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9066 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
9067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9069 r = create_inilocator_table(hdb);
9070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9072 /* msidbLocatorTypeRawValue, field 1 */
9073 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
9074 r = add_inilocator_entry(hdb, str);
9075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9077 /* msidbLocatorTypeRawValue, field 2 */
9078 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
9079 r = add_inilocator_entry(hdb, str);
9080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9082 /* msidbLocatorTypeRawValue, entire field */
9083 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
9084 r = add_inilocator_entry(hdb, str);
9085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9087 /* msidbLocatorTypeFile */
9088 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9089 r = add_inilocator_entry(hdb, str);
9090 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9092 /* msidbLocatorTypeDirectory, file */
9093 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
9094 r = add_inilocator_entry(hdb, str);
9095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9097 /* msidbLocatorTypeDirectory, directory */
9098 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
9099 r = add_inilocator_entry(hdb, str);
9100 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9102 /* msidbLocatorTypeFile, file, no signature */
9103 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9104 r = add_inilocator_entry(hdb, str);
9105 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9107 /* msidbLocatorTypeFile, dir, no signature */
9108 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
9109 r = add_inilocator_entry(hdb, str);
9110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9112 /* msidbLocatorTypeFile, file does not exist */
9113 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
9114 r = add_inilocator_entry(hdb, str);
9115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9117 /* msidbLocatorTypeFile, signature with version */
9118 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
9119 r = add_inilocator_entry(hdb, str);
9120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9122 /* msidbLocatorTypeFile, signature with version, ver > max */
9123 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
9124 r = add_inilocator_entry(hdb, str);
9125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9127 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
9128 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
9129 r = add_inilocator_entry(hdb, str);
9130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9132 r = create_signature_table(hdb);
9133 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9135 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
9136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9138 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
9139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9141 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9142 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9144 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9147 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9150 r = package_from_db(hdb, &hpkg);
9151 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9153 skip("Not enough rights to perform tests\n");
9156 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9158 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9160 r = MsiDoAction(hpkg, "AppSearch");
9161 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9164 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9166 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
9169 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9170 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9171 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
9174 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9176 ok(!lstrcmpA(prop, "keydata,field2"),
9177 "Expected \"keydata,field2\", got \"%s\"\n", prop);
9180 sprintf(path, "%s\\FileName1", CURR_DIR);
9181 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9182 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9183 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9186 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9187 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9188 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9191 sprintf(path, "%s\\", CURR_DIR);
9192 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9194 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9197 sprintf(path, "%s\\", CURR_DIR);
9198 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9199 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9200 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9203 lstrcpyA(path, CURR_DIR);
9204 ptr = strrchr(path, '\\');
9206 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9208 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9211 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9213 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9218 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9219 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9220 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9221 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9224 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9225 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9226 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9229 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9230 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
9231 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9232 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9235 MsiCloseHandle(hpkg);
9238 delete_win_ini("IniFile.ini");
9239 DeleteFileA("FileName1");
9240 DeleteFileA("FileName2.dll");
9241 DeleteFileA("FileName3.dll");
9242 DeleteFileA("FileName4.dll");
9243 DeleteFileA(msifile);
9247 * MSI AppSearch action on DrLocator table always returns absolute paths.
9248 * If a relative path was set, it returns the first absolute path that
9249 * matches or an empty string if it didn't find anything.
9250 * This helper function replicates this behaviour.
9252 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
9257 size = lstrlenA(relative);
9258 drives = GetLogicalDrives();
9259 lstrcpyA(absolute, "A:\\");
9260 for (i = 0; i < 26; absolute[0] = '\0', i++)
9262 if (!(drives & (1 << i)))
9265 absolute[0] = 'A' + i;
9266 if (GetDriveType(absolute) != DRIVE_FIXED)
9269 lstrcpynA(absolute + 3, relative, size + 1);
9270 attr = GetFileAttributesA(absolute);
9271 if (attr != INVALID_FILE_ATTRIBUTES &&
9272 (attr & FILE_ATTRIBUTE_DIRECTORY))
9274 if (absolute[3 + size - 1] != '\\')
9275 lstrcatA(absolute, "\\");
9282 static void test_appsearch_drlocator(void)
9284 MSIHANDLE hpkg, hdb;
9285 CHAR path[MAX_PATH];
9286 CHAR prop[MAX_PATH];
9293 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9296 DeleteFileA("test.dll");
9298 create_test_file("FileName1");
9299 CreateDirectoryA("one", NULL);
9300 CreateDirectoryA("one\\two", NULL);
9301 CreateDirectoryA("one\\two\\three", NULL);
9302 create_test_file("one\\two\\three\\FileName2");
9303 CreateDirectoryA("another", NULL);
9304 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9305 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9306 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9308 hdb = create_package_db();
9309 ok(hdb, "Expected a valid database handle\n");
9311 r = create_appsearch_table(hdb);
9312 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9314 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9315 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9317 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9318 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9320 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9321 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9323 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9326 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9327 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9329 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9330 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9332 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9333 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9335 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9338 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9341 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9342 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9344 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9347 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
9348 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9350 r = create_drlocator_table(hdb);
9351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9353 /* no parent, full path, depth 0, signature */
9354 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
9355 r = add_drlocator_entry(hdb, path);
9356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9358 /* no parent, full path, depth 0, no signature */
9359 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
9360 r = add_drlocator_entry(hdb, path);
9361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9363 /* no parent, relative path, depth 0, no signature */
9364 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
9365 r = add_drlocator_entry(hdb, path);
9366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9368 /* no parent, full path, depth 2, signature */
9369 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
9370 r = add_drlocator_entry(hdb, path);
9371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9373 /* no parent, full path, depth 3, signature */
9374 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
9375 r = add_drlocator_entry(hdb, path);
9376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9378 /* no parent, full path, depth 1, signature is dir */
9379 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
9380 r = add_drlocator_entry(hdb, path);
9381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9383 /* parent is in DrLocator, relative path, depth 0, signature */
9384 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
9385 r = add_drlocator_entry(hdb, path);
9386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9388 /* no parent, full path, depth 0, signature w/ version */
9389 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
9390 r = add_drlocator_entry(hdb, path);
9391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9393 /* no parent, full path, depth 0, signature w/ version, ver > max */
9394 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
9395 r = add_drlocator_entry(hdb, path);
9396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9398 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
9399 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
9400 r = add_drlocator_entry(hdb, path);
9401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9403 /* no parent, relative empty path, depth 0, no signature */
9404 sprintf(path, "'NewSignature11', '', '', 0");
9405 r = add_drlocator_entry(hdb, path);
9406 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9408 r = create_reglocator_table(hdb);
9409 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9412 r = add_reglocator_entry(hdb, "NewSignature12", 2, "htmlfile\\shell\\open\\nonexistent", "", 1);
9413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9415 /* parent is in RegLocator, no path, depth 0, no signature */
9416 sprintf(path, "'NewSignature13', 'NewSignature12', '', 0");
9417 r = add_drlocator_entry(hdb, path);
9418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9420 r = create_signature_table(hdb);
9421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9423 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9424 r = add_signature_entry(hdb, str);
9425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9427 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9428 r = add_signature_entry(hdb, str);
9429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9431 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9432 r = add_signature_entry(hdb, str);
9433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9435 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9436 r = add_signature_entry(hdb, str);
9437 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9439 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9440 r = add_signature_entry(hdb, str);
9441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9443 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9444 r = add_signature_entry(hdb, str);
9445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9447 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9448 r = add_signature_entry(hdb, str);
9449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9451 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9452 r = add_signature_entry(hdb, str);
9453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9455 r = package_from_db(hdb, &hpkg);
9456 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9458 skip("Not enough rights to perform tests\n");
9461 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9463 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9465 r = MsiDoAction(hpkg, "AppSearch");
9466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9469 sprintf(path, "%s\\FileName1", CURR_DIR);
9470 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9472 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9475 sprintf(path, "%s\\", CURR_DIR);
9476 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9478 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9481 search_absolute_directory(path, CURR_DIR + 3);
9482 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9484 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9487 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9488 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9489 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9492 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9493 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9495 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9498 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9500 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9503 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9504 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9506 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9511 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9512 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9514 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9517 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9519 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9522 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9524 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9528 search_absolute_directory(path, "");
9529 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9531 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9534 strcpy(path, "c:\\");
9535 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
9536 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9537 ok(!prop[0], "Expected \"\", got \"%s\"\n", prop);
9539 MsiCloseHandle(hpkg);
9542 DeleteFileA("FileName1");
9543 DeleteFileA("FileName3.dll");
9544 DeleteFileA("FileName4.dll");
9545 DeleteFileA("FileName5.dll");
9546 DeleteFileA("one\\two\\three\\FileName2");
9547 RemoveDirectoryA("one\\two\\three");
9548 RemoveDirectoryA("one\\two");
9549 RemoveDirectoryA("one");
9550 RemoveDirectoryA("another");
9551 DeleteFileA(msifile);
9554 static void test_featureparents(void)
9559 INSTALLSTATE state, action;
9561 hdb = create_package_db();
9562 ok ( hdb, "failed to create package database\n" );
9564 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
9565 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
9567 r = create_feature_table( hdb );
9568 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
9570 r = create_component_table( hdb );
9571 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
9573 r = create_feature_components_table( hdb );
9574 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
9576 r = create_file_table( hdb );
9577 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
9579 /* msidbFeatureAttributesFavorLocal */
9580 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
9581 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9583 /* msidbFeatureAttributesFavorSource */
9584 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
9585 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9587 /* msidbFeatureAttributesFavorLocal */
9588 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
9589 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9591 /* msidbFeatureAttributesUIDisallowAbsent */
9592 r = add_feature_entry( hdb, "'lyra', '', '', '', 2, 1, '', 16" );
9593 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9595 /* disabled because of install level */
9596 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
9597 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9599 /* child feature of disabled feature */
9600 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9601 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9603 /* component of disabled feature (install level) */
9604 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9605 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9607 /* component of disabled child feature (install level) */
9608 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9609 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9611 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9612 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9613 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9615 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9616 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9617 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9619 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9620 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9621 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9623 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9624 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9625 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9627 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9628 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9629 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9631 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9632 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9633 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9635 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9636 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9637 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9639 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9640 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9641 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9643 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9644 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9645 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9647 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9648 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9650 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9651 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9653 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9654 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9656 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9657 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9659 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9660 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9662 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9663 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9665 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9666 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9668 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9669 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9671 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9672 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9674 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9675 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9677 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9678 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9680 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9681 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9683 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9684 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9686 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9687 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9689 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9690 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9692 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9693 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9695 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9696 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9698 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9699 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9701 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9702 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9704 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9705 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9707 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9708 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9710 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9711 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9713 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9714 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9716 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9717 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9719 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9720 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9722 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9723 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9725 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9726 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9728 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9729 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9731 r = package_from_db( hdb, &hpkg );
9732 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9734 skip("Not enough rights to perform tests\n");
9735 DeleteFile(msifile);
9738 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9740 MsiCloseHandle( hdb );
9742 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9744 r = MsiDoAction( hpkg, "CostInitialize");
9745 ok( r == ERROR_SUCCESS, "cost init failed\n");
9747 r = MsiDoAction( hpkg, "FileCost");
9748 ok( r == ERROR_SUCCESS, "file cost failed\n");
9750 r = MsiDoAction( hpkg, "CostFinalize");
9751 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9755 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9756 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9757 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9758 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9762 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9763 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9764 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9765 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9769 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9770 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9771 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9772 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9776 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9777 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9778 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9779 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9783 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9784 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9785 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9786 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9790 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9791 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9792 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9793 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9797 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9798 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9799 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9800 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9804 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9805 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9806 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9807 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9811 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9812 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9813 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9814 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9818 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9819 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9820 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9821 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9825 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9826 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9827 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9828 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9832 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9833 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9834 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9835 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9839 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9840 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9841 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9842 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9846 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9847 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9848 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9849 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9853 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9854 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9855 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9856 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9860 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9861 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9862 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9863 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9867 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9868 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9869 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9870 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9872 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9873 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9875 r = MsiSetFeatureState(hpkg, "lyra", INSTALLSTATE_ABSENT);
9876 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9878 r = MsiSetFeatureState(hpkg, "nosuchfeature", INSTALLSTATE_ABSENT);
9879 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r);
9883 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9884 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9885 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9886 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9890 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9891 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9892 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9893 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9897 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9898 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9899 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9900 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9904 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9905 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9906 ok( state == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", state);
9907 ok( action == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", action);
9911 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9912 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9913 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9914 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9918 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9920 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9921 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9925 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9927 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9928 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9932 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9934 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9935 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9939 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9941 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9942 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9946 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9947 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9948 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9949 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9953 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9955 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9956 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9960 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9961 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9962 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9963 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9967 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9968 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9969 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9970 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9974 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9976 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9977 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9981 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9983 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9984 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9986 MsiCloseHandle(hpkg);
9987 DeleteFileA(msifile);
9990 static void test_installprops(void)
9992 MSIHANDLE hpkg, hdb;
9993 CHAR path[MAX_PATH], buf[MAX_PATH];
9999 REGSAM access = KEY_ALL_ACCESS;
10003 access |= KEY_WOW64_64KEY;
10005 GetCurrentDirectory(MAX_PATH, path);
10006 lstrcat(path, "\\");
10007 lstrcat(path, msifile);
10009 hdb = create_package_db();
10010 ok( hdb, "failed to create database\n");
10012 r = package_from_db(hdb, &hpkg);
10013 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10015 skip("Not enough rights to perform tests\n");
10016 DeleteFile(msifile);
10019 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10021 MsiCloseHandle(hdb);
10024 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
10025 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10026 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10028 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
10029 RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
10034 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10038 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
10042 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
10043 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10044 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10049 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10053 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
10059 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
10060 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10061 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10065 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
10066 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10067 trace("VersionDatabase = %s\n", buf);
10070 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
10071 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10072 trace("VersionMsi = %s\n", buf);
10075 r = MsiGetProperty(hpkg, "Date", buf, &size);
10076 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10077 trace("Date = %s\n", buf);
10080 r = MsiGetProperty(hpkg, "Time", buf, &size);
10081 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10082 trace("Time = %s\n", buf);
10085 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
10086 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10087 trace("PackageCode = %s\n", buf);
10089 langid = GetUserDefaultLangID();
10090 sprintf(path, "%d", langid);
10093 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
10094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10095 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
10097 res = GetSystemMetrics(SM_CXSCREEN);
10099 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
10100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10101 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10103 res = GetSystemMetrics(SM_CYSCREEN);
10105 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
10106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10107 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10109 if (pGetSystemInfo && pSHGetFolderPathA)
10111 pGetSystemInfo(&si);
10112 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
10116 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10117 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10118 ok(buf[0], "property not set\n");
10122 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10123 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10124 ok(buf[0], "property not set\n");
10128 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10129 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10130 GetSystemDirectoryA(path, MAX_PATH);
10131 if (size) buf[size - 1] = 0;
10132 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10136 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10137 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10138 pGetSystemWow64DirectoryA(path, MAX_PATH);
10139 if (size) buf[size - 1] = 0;
10140 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10144 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10145 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10146 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10147 if (size) buf[size - 1] = 0;
10148 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10152 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10153 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10154 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10155 if (size) buf[size - 1] = 0;
10156 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10160 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10161 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10162 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10163 if (size) buf[size - 1] = 0;
10164 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10168 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10169 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10170 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10171 if (size) buf[size - 1] = 0;
10172 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10176 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10177 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10178 ok(buf[0], "property not set\n");
10180 else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
10186 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10187 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10188 ok(!buf[0], "property set\n");
10192 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10193 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10194 ok(!buf[0], "property set\n");
10198 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10199 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10200 ok(!buf[0], "property set\n");
10204 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10205 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10206 GetSystemDirectoryA(path, MAX_PATH);
10207 if (size) buf[size - 1] = 0;
10208 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10212 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10213 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10214 ok(!buf[0], "property set\n");
10218 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10219 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10220 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10221 if (size) buf[size - 1] = 0;
10222 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10226 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10227 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10228 ok(!buf[0], "property set\n");
10232 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10233 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10234 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10235 if (size) buf[size - 1] = 0;
10236 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10240 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10241 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10242 ok(!buf[0], "property set\n");
10248 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10249 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10250 ok(buf[0], "property not set\n");
10254 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10255 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10256 ok(buf[0], "property not set\n");
10260 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10261 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10262 GetSystemDirectoryA(path, MAX_PATH);
10263 if (size) buf[size - 1] = 0;
10264 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10268 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10269 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10270 pGetSystemWow64DirectoryA(path, MAX_PATH);
10271 if (size) buf[size - 1] = 0;
10272 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10276 r = MsiGetProperty(hpkg, "ProgramFilesFolder64", buf, &size);
10277 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10278 ok(!buf[0], "property set\n");
10282 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10283 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10284 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10285 if (size) buf[size - 1] = 0;
10286 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10290 r = MsiGetProperty(hpkg, "CommonFilesFolder64", buf, &size);
10291 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10292 ok(!buf[0], "property set\n");
10296 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10297 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10298 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10299 if (size) buf[size - 1] = 0;
10300 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10304 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10305 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10306 ok(buf[0], "property not set\n");
10311 CloseHandle(hkey1);
10312 CloseHandle(hkey2);
10313 MsiCloseHandle(hpkg);
10314 DeleteFile(msifile);
10317 static void test_launchconditions(void)
10323 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10325 hdb = create_package_db();
10326 ok( hdb, "failed to create package database\n" );
10328 r = create_launchcondition_table( hdb );
10329 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
10331 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
10332 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10334 /* invalid condition */
10335 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
10336 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10338 r = package_from_db( hdb, &hpkg );
10339 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10341 skip("Not enough rights to perform tests\n");
10342 DeleteFile(msifile);
10345 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10347 MsiCloseHandle( hdb );
10349 r = MsiSetProperty( hpkg, "X", "1" );
10350 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10352 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10354 /* invalid conditions are ignored */
10355 r = MsiDoAction( hpkg, "LaunchConditions" );
10356 ok( r == ERROR_SUCCESS, "cost init failed\n" );
10358 /* verify LaunchConditions still does some verification */
10359 r = MsiSetProperty( hpkg, "X", "2" );
10360 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10362 r = MsiDoAction( hpkg, "LaunchConditions" );
10363 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
10365 MsiCloseHandle( hpkg );
10366 DeleteFile( msifile );
10369 static void test_ccpsearch(void)
10371 MSIHANDLE hdb, hpkg;
10372 CHAR prop[MAX_PATH];
10373 DWORD size = MAX_PATH;
10376 hdb = create_package_db();
10377 ok(hdb, "failed to create package database\n");
10379 r = create_ccpsearch_table(hdb);
10380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10382 r = add_ccpsearch_entry(hdb, "'CCP_random'");
10383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10385 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
10386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10388 r = create_reglocator_table(hdb);
10389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10391 r = add_reglocator_entry(hdb, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
10392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10394 r = create_drlocator_table(hdb);
10395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10397 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
10398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10400 r = create_signature_table(hdb);
10401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10403 r = package_from_db(hdb, &hpkg);
10404 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10406 skip("Not enough rights to perform tests\n");
10407 DeleteFile(msifile);
10410 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10412 MsiCloseHandle(hdb);
10414 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10416 r = MsiDoAction(hpkg, "CCPSearch");
10417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10419 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
10420 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10421 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
10423 MsiCloseHandle(hpkg);
10424 DeleteFileA(msifile);
10427 static void test_complocator(void)
10429 MSIHANDLE hdb, hpkg;
10431 CHAR prop[MAX_PATH];
10432 CHAR expected[MAX_PATH];
10433 DWORD size = MAX_PATH;
10435 hdb = create_package_db();
10436 ok(hdb, "failed to create package database\n");
10438 r = create_appsearch_table(hdb);
10439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10441 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
10442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10444 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
10445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10447 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
10448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10450 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
10451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10453 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
10454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10456 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
10457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10459 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
10460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10462 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
10463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10465 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
10466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10468 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
10469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10471 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
10472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10474 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
10475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10477 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
10478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10480 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
10481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10483 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
10484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10486 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
10487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10489 r = create_complocator_table(hdb);
10490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10492 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
10493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10495 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
10496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10498 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
10499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10501 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
10502 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10504 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
10505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10507 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
10508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10510 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
10511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10513 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
10514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10516 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
10517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10519 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
10520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10522 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
10523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10525 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
10526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10528 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
10529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10531 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
10532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10534 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
10535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10537 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
10538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10540 r = create_signature_table(hdb);
10541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10543 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
10544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10546 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
10547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10549 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
10550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10552 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
10553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10555 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
10556 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10558 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
10559 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10561 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
10562 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10564 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
10565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10567 r = package_from_db(hdb, &hpkg);
10568 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10570 skip("Not enough rights to perform tests\n");
10571 DeleteFile(msifile);
10574 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10576 MsiCloseHandle(hdb);
10578 create_test_file("abelisaurus");
10579 create_test_file("bactrosaurus");
10580 create_test_file("camelotia");
10581 create_test_file("diclonius");
10582 create_test_file("echinodon");
10583 create_test_file("falcarius");
10584 create_test_file("gallimimus");
10585 create_test_file("hagryphus");
10586 CreateDirectoryA("iguanodon", NULL);
10587 CreateDirectoryA("jobaria", NULL);
10588 CreateDirectoryA("kakuru", NULL);
10589 CreateDirectoryA("labocania", NULL);
10590 CreateDirectoryA("megaraptor", NULL);
10591 CreateDirectoryA("neosodon", NULL);
10592 CreateDirectoryA("olorotitan", NULL);
10593 CreateDirectoryA("pantydraco", NULL);
10595 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
10596 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
10597 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
10598 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
10599 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
10600 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
10601 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
10602 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
10603 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
10604 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
10605 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
10606 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
10607 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
10608 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
10609 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
10610 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
10612 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10614 r = MsiDoAction(hpkg, "AppSearch");
10615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10618 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
10619 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10621 lstrcpyA(expected, CURR_DIR);
10622 lstrcatA(expected, "\\abelisaurus");
10623 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10624 "Expected %s or empty string, got %s\n", expected, prop);
10627 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
10628 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10629 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10632 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
10633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10634 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10637 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
10638 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10639 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10642 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
10643 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10645 lstrcpyA(expected, CURR_DIR);
10646 lstrcatA(expected, "\\");
10647 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10648 "Expected %s or empty string, got %s\n", expected, prop);
10651 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
10652 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10653 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10656 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
10657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10658 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10661 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
10662 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10663 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10666 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
10667 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10668 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10671 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
10672 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10673 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10676 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
10677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10678 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10681 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
10682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10683 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10686 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
10687 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10689 lstrcpyA(expected, CURR_DIR);
10690 lstrcatA(expected, "\\");
10691 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10692 "Expected %s or empty string, got %s\n", expected, prop);
10695 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
10696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10698 lstrcpyA(expected, CURR_DIR);
10699 lstrcatA(expected, "\\neosodon\\");
10700 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10701 "Expected %s or empty string, got %s\n", expected, prop);
10704 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
10705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10706 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10709 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
10710 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10711 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10713 MsiCloseHandle(hpkg);
10714 DeleteFileA("abelisaurus");
10715 DeleteFileA("bactrosaurus");
10716 DeleteFileA("camelotia");
10717 DeleteFileA("diclonius");
10718 DeleteFileA("echinodon");
10719 DeleteFileA("falcarius");
10720 DeleteFileA("gallimimus");
10721 DeleteFileA("hagryphus");
10722 RemoveDirectoryA("iguanodon");
10723 RemoveDirectoryA("jobaria");
10724 RemoveDirectoryA("kakuru");
10725 RemoveDirectoryA("labocania");
10726 RemoveDirectoryA("megaraptor");
10727 RemoveDirectoryA("neosodon");
10728 RemoveDirectoryA("olorotitan");
10729 RemoveDirectoryA("pantydraco");
10730 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10731 MSIINSTALLCONTEXT_MACHINE, NULL);
10732 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10733 MSIINSTALLCONTEXT_MACHINE, NULL);
10734 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10735 MSIINSTALLCONTEXT_MACHINE, NULL);
10736 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10737 MSIINSTALLCONTEXT_MACHINE, NULL);
10738 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10739 MSIINSTALLCONTEXT_MACHINE, NULL);
10740 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10741 MSIINSTALLCONTEXT_MACHINE, NULL);
10742 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10743 MSIINSTALLCONTEXT_MACHINE, NULL);
10744 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10745 MSIINSTALLCONTEXT_MACHINE, NULL);
10746 DeleteFileA(msifile);
10749 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
10754 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
10755 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10757 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
10758 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10760 r = MsiSummaryInfoPersist(summary);
10761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10763 MsiCloseHandle(summary);
10766 static void test_MsiGetSourcePath(void)
10768 MSIHANDLE hdb, hpkg;
10769 CHAR path[MAX_PATH];
10770 CHAR cwd[MAX_PATH];
10771 CHAR subsrc[MAX_PATH];
10772 CHAR sub2[MAX_PATH];
10776 lstrcpyA(cwd, CURR_DIR);
10777 lstrcatA(cwd, "\\");
10779 lstrcpyA(subsrc, cwd);
10780 lstrcatA(subsrc, "subsource");
10781 lstrcatA(subsrc, "\\");
10783 lstrcpyA(sub2, subsrc);
10784 lstrcatA(sub2, "sub2");
10785 lstrcatA(sub2, "\\");
10787 /* uncompressed source */
10789 hdb = create_package_db();
10790 ok( hdb, "failed to create database\n");
10792 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10794 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10795 ok(r == S_OK, "failed\n");
10797 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10798 ok(r == S_OK, "failed\n");
10800 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
10801 ok(r == S_OK, "failed\n");
10803 r = MsiDatabaseCommit(hdb);
10804 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
10806 r = package_from_db(hdb, &hpkg);
10807 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10809 skip("Not enough rights to perform tests\n");
10810 DeleteFile(msifile);
10813 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10815 MsiCloseHandle(hdb);
10817 /* invalid database handle */
10819 lstrcpyA(path, "kiwi");
10820 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
10821 ok(r == ERROR_INVALID_HANDLE,
10822 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
10823 ok(!lstrcmpA(path, "kiwi"),
10824 "Expected path to be unchanged, got \"%s\"\n", path);
10825 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10827 /* NULL szFolder */
10829 lstrcpyA(path, "kiwi");
10830 r = MsiGetSourcePath(hpkg, NULL, path, &size);
10831 ok(r == ERROR_INVALID_PARAMETER,
10832 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10833 ok(!lstrcmpA(path, "kiwi"),
10834 "Expected path to be unchanged, got \"%s\"\n", path);
10835 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10837 /* empty szFolder */
10839 lstrcpyA(path, "kiwi");
10840 r = MsiGetSourcePath(hpkg, "", path, &size);
10841 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10842 ok(!lstrcmpA(path, "kiwi"),
10843 "Expected path to be unchanged, got \"%s\"\n", path);
10844 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10846 /* try TARGETDIR */
10848 lstrcpyA(path, "kiwi");
10849 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10850 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10851 ok(!lstrcmpA(path, "kiwi"),
10852 "Expected path to be unchanged, got \"%s\"\n", path);
10853 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10856 lstrcpyA(path, "kiwi");
10857 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10859 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10860 ok(size == 0, "Expected 0, got %d\n", size);
10863 lstrcpyA(path, "kiwi");
10864 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10866 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10867 ok(size == 0, "Expected 0, got %d\n", size);
10869 /* try SourceDir */
10871 lstrcpyA(path, "kiwi");
10872 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10873 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10874 ok(!lstrcmpA(path, "kiwi"),
10875 "Expected path to be unchanged, got \"%s\"\n", path);
10876 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10878 /* try SOURCEDIR */
10880 lstrcpyA(path, "kiwi");
10881 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10882 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10883 ok(!lstrcmpA(path, "kiwi"),
10884 "Expected path to be unchanged, got \"%s\"\n", path);
10885 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10887 /* source path does not exist, but the property exists */
10889 lstrcpyA(path, "kiwi");
10890 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10892 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10893 ok(size == 0, "Expected 0, got %d\n", size);
10896 lstrcpyA(path, "kiwi");
10897 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10898 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10899 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10900 ok(size == 0, "Expected 0, got %d\n", size);
10904 lstrcpyA(path, "kiwi");
10905 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10906 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10907 ok(!lstrcmpA(path, "kiwi"),
10908 "Expected path to be unchanged, got \"%s\"\n", path);
10909 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10913 lstrcpyA(path, "kiwi");
10914 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10915 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10916 ok(!lstrcmpA(path, "kiwi"),
10917 "Expected path to be unchanged, got \"%s\"\n", path);
10918 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10920 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10922 r = MsiDoAction(hpkg, "CostInitialize");
10923 ok(r == ERROR_SUCCESS, "cost init failed\n");
10925 /* try TARGETDIR after CostInitialize */
10927 lstrcpyA(path, "kiwi");
10928 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10929 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10930 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10931 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10933 /* try SourceDir after CostInitialize */
10935 lstrcpyA(path, "kiwi");
10936 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10937 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10938 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10939 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10941 /* try SOURCEDIR after CostInitialize */
10943 lstrcpyA(path, "kiwi");
10944 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10945 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10946 ok(!lstrcmpA(path, "kiwi"),
10947 "Expected path to be unchanged, got \"%s\"\n", path);
10948 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10950 /* source path does not exist, but the property exists */
10952 lstrcpyA(path, "kiwi");
10953 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10954 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10957 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10958 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10961 /* try SubDir after CostInitialize */
10963 lstrcpyA(path, "kiwi");
10964 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10965 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10966 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10967 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10969 /* try SubDir2 after CostInitialize */
10971 lstrcpyA(path, "kiwi");
10972 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10973 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10974 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10975 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10977 r = MsiDoAction(hpkg, "ResolveSource");
10978 ok(r == ERROR_SUCCESS, "file cost failed\n");
10980 /* try TARGETDIR after ResolveSource */
10982 lstrcpyA(path, "kiwi");
10983 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10984 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10985 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10986 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10988 /* try SourceDir after ResolveSource */
10990 lstrcpyA(path, "kiwi");
10991 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10992 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10993 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10994 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10996 /* try SOURCEDIR after ResolveSource */
10998 lstrcpyA(path, "kiwi");
10999 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11000 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11001 ok(!lstrcmpA(path, "kiwi"),
11002 "Expected path to be unchanged, got \"%s\"\n", path);
11003 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11005 /* source path does not exist, but the property exists */
11007 lstrcpyA(path, "kiwi");
11008 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11009 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11010 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11011 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11013 /* try SubDir after ResolveSource */
11015 lstrcpyA(path, "kiwi");
11016 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11017 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11018 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11019 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11021 /* try SubDir2 after ResolveSource */
11023 lstrcpyA(path, "kiwi");
11024 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11026 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11027 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11029 r = MsiDoAction(hpkg, "FileCost");
11030 ok(r == ERROR_SUCCESS, "file cost failed\n");
11032 /* try TARGETDIR after FileCost */
11034 lstrcpyA(path, "kiwi");
11035 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11037 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11038 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11040 /* try SourceDir after FileCost */
11042 lstrcpyA(path, "kiwi");
11043 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11044 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11045 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11046 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11048 /* try SOURCEDIR after FileCost */
11050 lstrcpyA(path, "kiwi");
11051 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11052 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11053 ok(!lstrcmpA(path, "kiwi"),
11054 "Expected path to be unchanged, got \"%s\"\n", path);
11055 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11057 /* source path does not exist, but the property exists */
11059 lstrcpyA(path, "kiwi");
11060 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11062 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11063 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11065 /* try SubDir after FileCost */
11067 lstrcpyA(path, "kiwi");
11068 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11070 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11071 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11073 /* try SubDir2 after FileCost */
11075 lstrcpyA(path, "kiwi");
11076 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11078 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11079 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11081 r = MsiDoAction(hpkg, "CostFinalize");
11082 ok(r == ERROR_SUCCESS, "file cost failed\n");
11084 /* try TARGETDIR after CostFinalize */
11086 lstrcpyA(path, "kiwi");
11087 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11088 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11089 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11090 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11092 /* try SourceDir after CostFinalize */
11094 lstrcpyA(path, "kiwi");
11095 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11096 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11097 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11098 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11100 /* try SOURCEDIR after CostFinalize */
11102 lstrcpyA(path, "kiwi");
11103 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11104 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11105 ok(!lstrcmpA(path, "kiwi"),
11106 "Expected path to be unchanged, got \"%s\"\n", path);
11107 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11109 /* source path does not exist, but the property exists */
11111 lstrcpyA(path, "kiwi");
11112 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11113 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11114 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11115 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11117 /* try SubDir after CostFinalize */
11119 lstrcpyA(path, "kiwi");
11120 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11122 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11123 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11125 /* try SubDir2 after CostFinalize */
11127 lstrcpyA(path, "kiwi");
11128 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11129 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11130 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11131 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11133 /* nonexistent directory */
11135 lstrcpyA(path, "kiwi");
11136 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
11137 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11138 ok(!lstrcmpA(path, "kiwi"),
11139 "Expected path to be unchanged, got \"%s\"\n", path);
11140 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11142 /* NULL szPathBuf */
11144 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
11145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11146 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11148 /* NULL pcchPathBuf */
11149 lstrcpyA(path, "kiwi");
11150 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
11151 ok(r == ERROR_INVALID_PARAMETER,
11152 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11153 ok(!lstrcmpA(path, "kiwi"),
11154 "Expected path to be unchanged, got \"%s\"\n", path);
11156 /* pcchPathBuf is 0 */
11158 lstrcpyA(path, "kiwi");
11159 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11160 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11161 ok(!lstrcmpA(path, "kiwi"),
11162 "Expected path to be unchanged, got \"%s\"\n", path);
11163 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11165 /* pcchPathBuf does not have room for NULL terminator */
11166 size = lstrlenA(cwd);
11167 lstrcpyA(path, "kiwi");
11168 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11169 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11170 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
11171 "Expected path with no backslash, got \"%s\"\n", path);
11172 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11174 /* pcchPathBuf has room for NULL terminator */
11175 size = lstrlenA(cwd) + 1;
11176 lstrcpyA(path, "kiwi");
11177 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11179 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11180 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11182 /* remove property */
11183 r = MsiSetProperty(hpkg, "SourceDir", NULL);
11184 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11186 /* try SourceDir again */
11188 lstrcpyA(path, "kiwi");
11189 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11191 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11192 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11194 /* set property to a valid directory */
11195 r = MsiSetProperty(hpkg, "SOURCEDIR", cwd);
11196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11198 /* try SOURCEDIR again */
11200 lstrcpyA(path, "kiwi");
11201 r = MsiGetSourcePath(hpkg, "SOURCEDIR", 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 MsiCloseHandle(hpkg);
11209 /* compressed source */
11211 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11214 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
11216 r = package_from_db(hdb, &hpkg);
11217 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11219 /* try TARGETDIR */
11221 lstrcpyA(path, "kiwi");
11222 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11223 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11224 ok(!lstrcmpA(path, "kiwi"),
11225 "Expected path to be unchanged, got \"%s\"\n", path);
11226 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11228 /* try SourceDir */
11230 lstrcpyA(path, "kiwi");
11231 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11232 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11233 ok(!lstrcmpA(path, "kiwi"),
11234 "Expected path to be unchanged, got \"%s\"\n", path);
11235 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11237 /* try SOURCEDIR */
11239 lstrcpyA(path, "kiwi");
11240 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11241 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11242 ok(!lstrcmpA(path, "kiwi"),
11243 "Expected path to be unchanged, got \"%s\"\n", path);
11244 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11246 /* source path nor the property exist */
11248 lstrcpyA(path, "kiwi");
11249 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11251 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11252 ok(size == 0, "Expected 0, got %d\n", size);
11256 lstrcpyA(path, "kiwi");
11257 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11258 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11259 ok(!lstrcmpA(path, "kiwi"),
11260 "Expected path to be unchanged, got \"%s\"\n", path);
11261 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11265 lstrcpyA(path, "kiwi");
11266 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11267 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11268 ok(!lstrcmpA(path, "kiwi"),
11269 "Expected path to be unchanged, got \"%s\"\n", path);
11270 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11272 r = MsiDoAction(hpkg, "CostInitialize");
11273 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11275 /* try TARGETDIR after CostInitialize */
11277 lstrcpyA(path, "kiwi");
11278 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11279 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11280 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11281 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11283 /* try SourceDir after CostInitialize */
11285 lstrcpyA(path, "kiwi");
11286 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11287 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);
11291 /* try SOURCEDIR after CostInitialize */
11293 lstrcpyA(path, "kiwi");
11294 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11297 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11298 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11299 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11302 /* source path does not exist, but the property exists */
11304 lstrcpyA(path, "kiwi");
11305 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11306 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11309 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11310 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11313 /* try SubDir after CostInitialize */
11315 lstrcpyA(path, "kiwi");
11316 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11317 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11318 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11319 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11321 /* try SubDir2 after CostInitialize */
11323 lstrcpyA(path, "kiwi");
11324 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11325 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11326 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11327 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11329 r = MsiDoAction(hpkg, "ResolveSource");
11330 ok(r == ERROR_SUCCESS, "file cost failed\n");
11332 /* try TARGETDIR after ResolveSource */
11334 lstrcpyA(path, "kiwi");
11335 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11337 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11338 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11340 /* try SourceDir after ResolveSource */
11342 lstrcpyA(path, "kiwi");
11343 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11345 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11346 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11348 /* try SOURCEDIR after ResolveSource */
11350 lstrcpyA(path, "kiwi");
11351 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11355 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11356 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11359 /* source path and the property exist */
11361 lstrcpyA(path, "kiwi");
11362 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11364 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11365 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11367 /* try SubDir after ResolveSource */
11369 lstrcpyA(path, "kiwi");
11370 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11372 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11373 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11375 /* try SubDir2 after ResolveSource */
11377 lstrcpyA(path, "kiwi");
11378 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11380 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11381 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11383 r = MsiDoAction(hpkg, "FileCost");
11384 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11386 /* try TARGETDIR after CostFinalize */
11388 lstrcpyA(path, "kiwi");
11389 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11391 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11392 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11394 /* try SourceDir after CostFinalize */
11396 lstrcpyA(path, "kiwi");
11397 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11399 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11400 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11402 /* try SOURCEDIR after CostFinalize */
11404 lstrcpyA(path, "kiwi");
11405 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11409 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11410 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11413 /* source path and the property exist */
11415 lstrcpyA(path, "kiwi");
11416 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11418 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11419 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11421 /* try SubDir after CostFinalize */
11423 lstrcpyA(path, "kiwi");
11424 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11426 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11427 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11429 /* try SubDir2 after CostFinalize */
11431 lstrcpyA(path, "kiwi");
11432 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11434 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11435 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11437 r = MsiDoAction(hpkg, "CostFinalize");
11438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11440 /* try TARGETDIR after CostFinalize */
11442 lstrcpyA(path, "kiwi");
11443 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11445 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11446 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11448 /* try SourceDir after CostFinalize */
11450 lstrcpyA(path, "kiwi");
11451 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11452 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11453 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11454 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11456 /* try SOURCEDIR after CostFinalize */
11458 lstrcpyA(path, "kiwi");
11459 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11463 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11464 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11467 /* source path and the property exist */
11469 lstrcpyA(path, "kiwi");
11470 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11472 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11473 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11475 /* try SubDir after CostFinalize */
11477 lstrcpyA(path, "kiwi");
11478 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11480 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11481 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11483 /* try SubDir2 after CostFinalize */
11485 lstrcpyA(path, "kiwi");
11486 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11488 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11489 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11491 MsiCloseHandle(hpkg);
11492 DeleteFile(msifile);
11495 static void test_shortlongsource(void)
11497 MSIHANDLE hdb, hpkg;
11498 CHAR path[MAX_PATH];
11499 CHAR cwd[MAX_PATH];
11500 CHAR subsrc[MAX_PATH];
11504 lstrcpyA(cwd, CURR_DIR);
11505 lstrcatA(cwd, "\\");
11507 lstrcpyA(subsrc, cwd);
11508 lstrcatA(subsrc, "long");
11509 lstrcatA(subsrc, "\\");
11511 /* long file names */
11513 hdb = create_package_db();
11514 ok( hdb, "failed to create database\n");
11516 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
11518 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11519 ok(r == S_OK, "failed\n");
11521 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
11522 ok(r == S_OK, "failed\n");
11524 /* CostInitialize:short */
11525 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
11526 ok(r == S_OK, "failed\n");
11528 /* CostInitialize:long */
11529 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
11530 ok(r == S_OK, "failed\n");
11532 /* FileCost:short */
11533 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
11534 ok(r == S_OK, "failed\n");
11536 /* FileCost:long */
11537 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
11538 ok(r == S_OK, "failed\n");
11540 /* CostFinalize:short */
11541 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
11542 ok(r == S_OK, "failed\n");
11544 /* CostFinalize:long */
11545 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
11546 ok(r == S_OK, "failed\n");
11548 MsiDatabaseCommit(hdb);
11550 r = package_from_db(hdb, &hpkg);
11551 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11553 skip("Not enough rights to perform tests\n");
11554 DeleteFile(msifile);
11557 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11559 MsiCloseHandle(hdb);
11561 CreateDirectoryA("one", NULL);
11562 CreateDirectoryA("four", NULL);
11564 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11566 r = MsiDoAction(hpkg, "CostInitialize");
11567 ok(r == ERROR_SUCCESS, "file cost failed\n");
11569 CreateDirectory("five", NULL);
11570 CreateDirectory("eight", NULL);
11572 r = MsiDoAction(hpkg, "FileCost");
11573 ok(r == ERROR_SUCCESS, "file cost failed\n");
11575 CreateDirectory("nine", NULL);
11576 CreateDirectory("twelve", NULL);
11578 r = MsiDoAction(hpkg, "CostFinalize");
11579 ok(r == ERROR_SUCCESS, "file cost failed\n");
11581 /* neither short nor long source directories exist */
11583 lstrcpyA(path, "kiwi");
11584 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11586 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11587 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11589 CreateDirectoryA("short", NULL);
11591 /* short source directory exists */
11593 lstrcpyA(path, "kiwi");
11594 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11595 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11596 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11597 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11599 CreateDirectoryA("long", NULL);
11601 /* both short and long source directories exist */
11603 lstrcpyA(path, "kiwi");
11604 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11605 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11606 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11607 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11609 lstrcpyA(subsrc, cwd);
11610 lstrcatA(subsrc, "two");
11611 lstrcatA(subsrc, "\\");
11613 /* short dir exists before CostInitialize */
11615 lstrcpyA(path, "kiwi");
11616 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11617 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11618 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11619 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11621 lstrcpyA(subsrc, cwd);
11622 lstrcatA(subsrc, "four");
11623 lstrcatA(subsrc, "\\");
11625 /* long dir exists before CostInitialize */
11627 lstrcpyA(path, "kiwi");
11628 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11630 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11631 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11633 lstrcpyA(subsrc, cwd);
11634 lstrcatA(subsrc, "six");
11635 lstrcatA(subsrc, "\\");
11637 /* short dir exists before FileCost */
11639 lstrcpyA(path, "kiwi");
11640 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11642 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11643 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11645 lstrcpyA(subsrc, cwd);
11646 lstrcatA(subsrc, "eight");
11647 lstrcatA(subsrc, "\\");
11649 /* long dir exists before FileCost */
11651 lstrcpyA(path, "kiwi");
11652 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11653 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11654 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11655 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11657 lstrcpyA(subsrc, cwd);
11658 lstrcatA(subsrc, "ten");
11659 lstrcatA(subsrc, "\\");
11661 /* short dir exists before CostFinalize */
11663 lstrcpyA(path, "kiwi");
11664 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11665 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11666 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11667 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11669 lstrcpyA(subsrc, cwd);
11670 lstrcatA(subsrc, "twelve");
11671 lstrcatA(subsrc, "\\");
11673 /* long dir exists before CostFinalize */
11675 lstrcpyA(path, "kiwi");
11676 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11678 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11679 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11681 MsiCloseHandle(hpkg);
11682 RemoveDirectoryA("short");
11683 RemoveDirectoryA("long");
11684 RemoveDirectoryA("one");
11685 RemoveDirectoryA("four");
11686 RemoveDirectoryA("five");
11687 RemoveDirectoryA("eight");
11688 RemoveDirectoryA("nine");
11689 RemoveDirectoryA("twelve");
11691 /* short file names */
11693 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11694 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11696 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
11698 r = package_from_db(hdb, &hpkg);
11699 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11701 MsiCloseHandle(hdb);
11703 CreateDirectoryA("one", NULL);
11704 CreateDirectoryA("four", NULL);
11706 r = MsiDoAction(hpkg, "CostInitialize");
11707 ok(r == ERROR_SUCCESS, "file cost failed\n");
11709 CreateDirectory("five", NULL);
11710 CreateDirectory("eight", NULL);
11712 r = MsiDoAction(hpkg, "FileCost");
11713 ok(r == ERROR_SUCCESS, "file cost failed\n");
11715 CreateDirectory("nine", NULL);
11716 CreateDirectory("twelve", NULL);
11718 r = MsiDoAction(hpkg, "CostFinalize");
11719 ok(r == ERROR_SUCCESS, "file cost failed\n");
11721 lstrcpyA(subsrc, cwd);
11722 lstrcatA(subsrc, "short");
11723 lstrcatA(subsrc, "\\");
11725 /* neither short nor long source directories exist */
11727 lstrcpyA(path, "kiwi");
11728 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11730 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11731 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11733 CreateDirectoryA("short", NULL);
11735 /* short source directory exists */
11737 lstrcpyA(path, "kiwi");
11738 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11739 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11740 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11741 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11743 CreateDirectoryA("long", NULL);
11745 /* both short and long source directories exist */
11747 lstrcpyA(path, "kiwi");
11748 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11749 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11750 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11751 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11753 lstrcpyA(subsrc, cwd);
11754 lstrcatA(subsrc, "one");
11755 lstrcatA(subsrc, "\\");
11757 /* short dir exists before CostInitialize */
11759 lstrcpyA(path, "kiwi");
11760 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11762 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11763 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11765 lstrcpyA(subsrc, cwd);
11766 lstrcatA(subsrc, "three");
11767 lstrcatA(subsrc, "\\");
11769 /* long dir exists before CostInitialize */
11771 lstrcpyA(path, "kiwi");
11772 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11774 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11775 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11777 lstrcpyA(subsrc, cwd);
11778 lstrcatA(subsrc, "five");
11779 lstrcatA(subsrc, "\\");
11781 /* short dir exists before FileCost */
11783 lstrcpyA(path, "kiwi");
11784 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11786 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11787 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11789 lstrcpyA(subsrc, cwd);
11790 lstrcatA(subsrc, "seven");
11791 lstrcatA(subsrc, "\\");
11793 /* long dir exists before FileCost */
11795 lstrcpyA(path, "kiwi");
11796 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11798 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11799 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11801 lstrcpyA(subsrc, cwd);
11802 lstrcatA(subsrc, "nine");
11803 lstrcatA(subsrc, "\\");
11805 /* short dir exists before CostFinalize */
11807 lstrcpyA(path, "kiwi");
11808 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11810 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11811 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11813 lstrcpyA(subsrc, cwd);
11814 lstrcatA(subsrc, "eleven");
11815 lstrcatA(subsrc, "\\");
11817 /* long dir exists before CostFinalize */
11819 lstrcpyA(path, "kiwi");
11820 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11822 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11823 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11825 MsiCloseHandle(hpkg);
11826 RemoveDirectoryA("short");
11827 RemoveDirectoryA("long");
11828 RemoveDirectoryA("one");
11829 RemoveDirectoryA("four");
11830 RemoveDirectoryA("five");
11831 RemoveDirectoryA("eight");
11832 RemoveDirectoryA("nine");
11833 RemoveDirectoryA("twelve");
11834 DeleteFileA(msifile);
11837 static void test_sourcedir(void)
11839 MSIHANDLE hdb, hpkg;
11841 CHAR path[MAX_PATH];
11842 CHAR cwd[MAX_PATH];
11843 CHAR subsrc[MAX_PATH];
11847 lstrcpyA(cwd, CURR_DIR);
11848 lstrcatA(cwd, "\\");
11850 lstrcpyA(subsrc, cwd);
11851 lstrcatA(subsrc, "long");
11852 lstrcatA(subsrc, "\\");
11854 hdb = create_package_db();
11855 ok( hdb, "failed to create database\n");
11857 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11858 ok(r == S_OK, "failed\n");
11860 sprintf(package, "#%u", hdb);
11861 r = MsiOpenPackage(package, &hpkg);
11862 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11864 skip("Not enough rights to perform tests\n");
11867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11869 /* properties only */
11871 /* SourceDir prop */
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 prop */
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 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11889 r = MsiDoAction(hpkg, "CostInitialize");
11890 ok(r == ERROR_SUCCESS, "file cost failed\n");
11892 /* SourceDir after CostInitialize */
11894 lstrcpyA(path, "kiwi");
11895 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11896 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11897 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11898 ok(size == 0, "Expected 0, got %d\n", size);
11900 /* SOURCEDIR after CostInitialize */
11902 lstrcpyA(path, "kiwi");
11903 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11904 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11905 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11906 ok(size == 0, "Expected 0, got %d\n", size);
11908 r = MsiDoAction(hpkg, "FileCost");
11909 ok(r == ERROR_SUCCESS, "file cost failed\n");
11911 /* SourceDir after FileCost */
11913 lstrcpyA(path, "kiwi");
11914 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11915 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11916 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11917 ok(size == 0, "Expected 0, got %d\n", size);
11919 /* SOURCEDIR after FileCost */
11921 lstrcpyA(path, "kiwi");
11922 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11923 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11924 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11925 ok(size == 0, "Expected 0, got %d\n", size);
11927 r = MsiDoAction(hpkg, "CostFinalize");
11928 ok(r == ERROR_SUCCESS, "file cost failed\n");
11930 /* SourceDir after CostFinalize */
11932 lstrcpyA(path, "kiwi");
11933 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11934 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11935 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11936 ok(size == 0, "Expected 0, got %d\n", size);
11938 /* SOURCEDIR after CostFinalize */
11940 lstrcpyA(path, "kiwi");
11941 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11942 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11943 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11944 ok(size == 0, "Expected 0, got %d\n", size);
11947 lstrcpyA(path, "kiwi");
11948 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11949 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11950 ok(!lstrcmpA(path, "kiwi"), "Expected \"kiwi\", got \"%s\"\n", path);
11951 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
11953 /* SOURCEDIR after calling MsiGetSourcePath */
11955 lstrcpyA(path, "kiwi");
11956 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11957 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11959 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11960 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11963 r = MsiDoAction(hpkg, "ResolveSource");
11964 ok(r == ERROR_SUCCESS, "file cost failed\n");
11966 /* SourceDir after ResolveSource */
11968 lstrcpyA(path, "kiwi");
11969 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11970 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11971 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11972 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11974 /* SOURCEDIR after ResolveSource */
11976 lstrcpyA(path, "kiwi");
11977 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11978 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11979 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11980 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11982 /* random casing */
11984 lstrcpyA(path, "kiwi");
11985 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
11986 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);
11990 MsiCloseHandle(hpkg);
11992 /* reset the package state */
11993 sprintf(package, "#%i", hdb);
11994 r = MsiOpenPackage(package, &hpkg);
11995 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11997 /* test how MsiGetSourcePath affects the properties */
11999 /* SourceDir prop */
12001 lstrcpyA(path, "kiwi");
12002 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12003 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12006 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12007 ok(size == 0, "Expected 0, got %d\n", size);
12011 lstrcpyA(path, "kiwi");
12012 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
12013 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12014 ok(!lstrcmpA(path, "kiwi"),
12015 "Expected path to be unchanged, got \"%s\"\n", path);
12016 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12018 /* SourceDir after MsiGetSourcePath */
12020 lstrcpyA(path, "kiwi");
12021 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12025 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12026 ok(size == 0, "Expected 0, got %d\n", size);
12029 /* SOURCEDIR prop */
12031 lstrcpyA(path, "kiwi");
12032 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12033 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12036 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12037 ok(size == 0, "Expected 0, got %d\n", size);
12041 lstrcpyA(path, "kiwi");
12042 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12043 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12044 ok(!lstrcmpA(path, "kiwi"),
12045 "Expected path to be unchanged, got \"%s\"\n", path);
12046 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12048 /* SOURCEDIR prop after MsiGetSourcePath */
12050 lstrcpyA(path, "kiwi");
12051 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12052 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12055 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12056 ok(size == 0, "Expected 0, got %d\n", size);
12059 r = MsiDoAction(hpkg, "CostInitialize");
12060 ok(r == ERROR_SUCCESS, "file cost failed\n");
12062 /* SourceDir after CostInitialize */
12064 lstrcpyA(path, "kiwi");
12065 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12069 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12070 ok(size == 0, "Expected 0, got %d\n", size);
12074 lstrcpyA(path, "kiwi");
12075 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
12076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12077 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12078 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12080 /* SourceDir after MsiGetSourcePath */
12082 lstrcpyA(path, "kiwi");
12083 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12085 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12086 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12088 /* SOURCEDIR after CostInitialize */
12090 lstrcpyA(path, "kiwi");
12091 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12093 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12094 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12096 /* SOURCEDIR source path still does not exist */
12098 lstrcpyA(path, "kiwi");
12099 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12100 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12101 ok(!lstrcmpA(path, "kiwi"),
12102 "Expected path to be unchanged, got \"%s\"\n", path);
12103 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12105 r = MsiDoAction(hpkg, "FileCost");
12106 ok(r == ERROR_SUCCESS, "file cost failed\n");
12108 /* SourceDir after FileCost */
12110 lstrcpyA(path, "kiwi");
12111 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12112 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12113 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12114 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12116 /* SOURCEDIR after FileCost */
12118 lstrcpyA(path, "kiwi");
12119 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12121 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12122 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12124 /* SOURCEDIR source path still does not exist */
12126 lstrcpyA(path, "kiwi");
12127 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12128 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12129 ok(!lstrcmpA(path, "kiwi"),
12130 "Expected path to be unchanged, got \"%s\"\n", path);
12131 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12133 r = MsiDoAction(hpkg, "CostFinalize");
12134 ok(r == ERROR_SUCCESS, "file cost failed\n");
12136 /* SourceDir after CostFinalize */
12138 lstrcpyA(path, "kiwi");
12139 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12140 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12141 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12142 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12144 /* SOURCEDIR after CostFinalize */
12146 lstrcpyA(path, "kiwi");
12147 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12149 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12150 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12152 /* SOURCEDIR source path still does not exist */
12154 lstrcpyA(path, "kiwi");
12155 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12156 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12157 ok(!lstrcmpA(path, "kiwi"),
12158 "Expected path to be unchanged, got \"%s\"\n", path);
12159 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12161 r = MsiDoAction(hpkg, "ResolveSource");
12162 ok(r == ERROR_SUCCESS, "file cost failed\n");
12164 /* SourceDir after ResolveSource */
12166 lstrcpyA(path, "kiwi");
12167 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12169 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12170 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12172 /* SOURCEDIR after ResolveSource */
12174 lstrcpyA(path, "kiwi");
12175 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12176 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12177 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12178 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12180 /* SOURCEDIR source path still does not exist */
12182 lstrcpyA(path, "kiwi");
12183 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12184 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12185 ok(!lstrcmpA(path, "kiwi"),
12186 "Expected path to be unchanged, got \"%s\"\n", path);
12187 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12189 MsiCloseHandle(hpkg);
12192 MsiCloseHandle(hdb);
12193 DeleteFileA(msifile);
12203 static const struct access_res create[16] =
12205 { TRUE, ERROR_SUCCESS, TRUE },
12206 { TRUE, ERROR_SUCCESS, TRUE },
12207 { TRUE, ERROR_SUCCESS, FALSE },
12208 { TRUE, ERROR_SUCCESS, FALSE },
12209 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12210 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12211 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12212 { TRUE, ERROR_SUCCESS, FALSE },
12213 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12214 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12215 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12216 { TRUE, ERROR_SUCCESS, TRUE },
12217 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12218 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12219 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12220 { TRUE, ERROR_SUCCESS, TRUE }
12223 static const struct access_res create_commit[16] =
12225 { TRUE, ERROR_SUCCESS, TRUE },
12226 { TRUE, ERROR_SUCCESS, TRUE },
12227 { TRUE, ERROR_SUCCESS, FALSE },
12228 { TRUE, ERROR_SUCCESS, FALSE },
12229 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12230 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12231 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12232 { TRUE, ERROR_SUCCESS, FALSE },
12233 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12234 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12235 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12236 { TRUE, ERROR_SUCCESS, TRUE },
12237 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12238 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12239 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12240 { TRUE, ERROR_SUCCESS, TRUE }
12243 static const struct access_res create_close[16] =
12245 { TRUE, ERROR_SUCCESS, FALSE },
12246 { TRUE, ERROR_SUCCESS, FALSE },
12247 { TRUE, ERROR_SUCCESS, FALSE },
12248 { TRUE, ERROR_SUCCESS, FALSE },
12249 { TRUE, ERROR_SUCCESS, FALSE },
12250 { TRUE, ERROR_SUCCESS, FALSE },
12251 { TRUE, ERROR_SUCCESS, FALSE },
12252 { TRUE, ERROR_SUCCESS, FALSE },
12253 { TRUE, ERROR_SUCCESS, FALSE },
12254 { TRUE, ERROR_SUCCESS, FALSE },
12255 { TRUE, ERROR_SUCCESS, FALSE },
12256 { TRUE, ERROR_SUCCESS, FALSE },
12257 { TRUE, ERROR_SUCCESS, FALSE },
12258 { TRUE, ERROR_SUCCESS, FALSE },
12259 { TRUE, ERROR_SUCCESS, FALSE },
12260 { TRUE, ERROR_SUCCESS }
12263 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
12265 DWORD access = 0, share = 0;
12270 for (i = 0; i < 4; i++)
12272 if (i == 0) access = 0;
12273 if (i == 1) access = GENERIC_READ;
12274 if (i == 2) access = GENERIC_WRITE;
12275 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
12277 for (j = 0; j < 4; j++)
12279 if (ares[idx].ignore)
12282 if (j == 0) share = 0;
12283 if (j == 1) share = FILE_SHARE_READ;
12284 if (j == 2) share = FILE_SHARE_WRITE;
12285 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
12287 SetLastError(0xdeadbeef);
12288 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
12289 FILE_ATTRIBUTE_NORMAL, 0);
12290 lasterr = GetLastError();
12292 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
12293 "(%d, handle, %d): Expected %d, got %d\n",
12294 line, idx, ares[idx].gothandle,
12295 (hfile != INVALID_HANDLE_VALUE));
12297 ok(lasterr == ares[idx].lasterr, "(%d, lasterr, %d): Expected %d, got %d\n",
12298 line, idx, ares[idx].lasterr, lasterr);
12300 CloseHandle(hfile);
12306 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
12308 static void test_access(void)
12313 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
12314 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12316 test_file_access(msifile, create);
12318 r = MsiDatabaseCommit(hdb);
12319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12321 test_file_access(msifile, create_commit);
12322 MsiCloseHandle(hdb);
12324 test_file_access(msifile, create_close);
12325 DeleteFileA(msifile);
12327 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
12328 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12330 test_file_access(msifile, create);
12332 r = MsiDatabaseCommit(hdb);
12333 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12335 test_file_access(msifile, create_commit);
12336 MsiCloseHandle(hdb);
12338 test_file_access(msifile, create_close);
12339 DeleteFileA(msifile);
12342 static void test_emptypackage(void)
12344 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
12345 MSIHANDLE hview = 0, hrec = 0;
12346 MSICONDITION condition;
12347 CHAR buffer[MAX_PATH];
12351 r = MsiOpenPackageA("", &hpkg);
12352 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12354 skip("Not enough rights to perform tests\n");
12359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12362 hdb = MsiGetActiveDatabase(hpkg);
12365 ok(hdb != 0, "Expected a valid database handle\n");
12368 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
12371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12373 r = MsiViewExecute(hview, 0);
12376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12379 r = MsiViewFetch(hview, &hrec);
12382 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12387 r = MsiRecordGetString(hrec, 1, buffer, &size);
12390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12391 ok(!lstrcmpA(buffer, "_Property"),
12392 "Expected \"_Property\", got \"%s\"\n", buffer);
12395 MsiCloseHandle(hrec);
12397 r = MsiViewFetch(hview, &hrec);
12400 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12404 r = MsiRecordGetString(hrec, 1, buffer, &size);
12407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12408 ok(!lstrcmpA(buffer, "#_FolderCache"),
12409 "Expected \"_Property\", got \"%s\"\n", buffer);
12412 MsiCloseHandle(hrec);
12413 MsiViewClose(hview);
12414 MsiCloseHandle(hview);
12416 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
12419 ok(condition == MSICONDITION_FALSE,
12420 "Expected MSICONDITION_FALSE, got %d\n", condition);
12423 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
12426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12428 r = MsiViewExecute(hview, 0);
12431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12434 /* _Property table is not empty */
12435 r = MsiViewFetch(hview, &hrec);
12438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12441 MsiCloseHandle(hrec);
12442 MsiViewClose(hview);
12443 MsiCloseHandle(hview);
12445 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
12448 ok(condition == MSICONDITION_FALSE,
12449 "Expected MSICONDITION_FALSE, got %d\n", condition);
12452 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
12455 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12457 r = MsiViewExecute(hview, 0);
12460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12463 /* #_FolderCache is not empty */
12464 r = MsiViewFetch(hview, &hrec);
12467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12470 MsiCloseHandle(hrec);
12471 MsiViewClose(hview);
12472 MsiCloseHandle(hview);
12474 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
12477 ok(r == ERROR_BAD_QUERY_SYNTAX,
12478 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12481 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
12484 ok(r == ERROR_BAD_QUERY_SYNTAX,
12485 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12488 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
12491 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
12492 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
12495 MsiCloseHandle(hsuminfo);
12497 r = MsiDatabaseCommit(hdb);
12500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12503 MsiCloseHandle(hdb);
12504 MsiCloseHandle(hpkg);
12507 static void test_MsiGetProductProperty(void)
12509 MSIHANDLE hprod, hdb;
12510 CHAR val[MAX_PATH];
12511 CHAR path[MAX_PATH];
12512 CHAR query[MAX_PATH];
12513 CHAR keypath[MAX_PATH*2];
12514 CHAR prodcode[MAX_PATH];
12515 CHAR prod_squashed[MAX_PATH];
12516 HKEY prodkey, userkey, props;
12520 REGSAM access = KEY_ALL_ACCESS;
12522 GetCurrentDirectoryA(MAX_PATH, path);
12523 lstrcatA(path, "\\");
12525 create_test_guid(prodcode, prod_squashed);
12528 access |= KEY_WOW64_64KEY;
12530 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
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 r = set_summary_info(hdb);
12537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12540 "CREATE TABLE `Directory` ( "
12541 "`Directory` CHAR(255) NOT NULL, "
12542 "`Directory_Parent` CHAR(255), "
12543 "`DefaultDir` CHAR(255) NOT NULL "
12544 "PRIMARY KEY `Directory`)");
12545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12548 "CREATE TABLE `Property` ( "
12549 "`Property` CHAR(72) NOT NULL, "
12550 "`Value` CHAR(255) "
12551 "PRIMARY KEY `Property`)");
12552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12554 sprintf(query, "INSERT INTO `Property` "
12555 "(`Property`, `Value`) "
12556 "VALUES( 'ProductCode', '%s' )", prodcode);
12557 r = run_query(hdb, query);
12558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12560 r = MsiDatabaseCommit(hdb);
12561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12563 MsiCloseHandle(hdb);
12565 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
12566 lstrcatA(keypath, prod_squashed);
12568 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL);
12569 if (res == ERROR_ACCESS_DENIED)
12571 skip("Not enough rights to perform tests\n");
12572 DeleteFile(msifile);
12575 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12577 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
12578 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
12579 lstrcatA(keypath, prod_squashed);
12581 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL);
12582 if (res == ERROR_ACCESS_DENIED)
12584 skip("Not enough rights to perform tests\n");
12585 RegDeleteKeyA(prodkey, "");
12586 RegCloseKey(prodkey);
12589 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12591 res = RegCreateKeyExA(userkey, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
12592 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12594 lstrcpyA(val, path);
12595 lstrcatA(val, "\\");
12596 lstrcatA(val, msifile);
12597 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
12598 (const BYTE *)val, lstrlenA(val) + 1);
12599 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12601 hprod = 0xdeadbeef;
12602 r = MsiOpenProductA(prodcode, &hprod);
12603 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12604 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
12606 /* hProduct is invalid */
12608 lstrcpyA(val, "apple");
12609 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
12610 ok(r == ERROR_INVALID_HANDLE,
12611 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12612 ok(!lstrcmpA(val, "apple"),
12613 "Expected val to be unchanged, got \"%s\"\n", val);
12614 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12616 /* szProperty is NULL */
12618 lstrcpyA(val, "apple");
12619 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
12620 ok(r == ERROR_INVALID_PARAMETER,
12621 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12622 ok(!lstrcmpA(val, "apple"),
12623 "Expected val to be unchanged, got \"%s\"\n", val);
12624 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12626 /* szProperty is empty */
12628 lstrcpyA(val, "apple");
12629 r = MsiGetProductPropertyA(hprod, "", val, &size);
12630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12631 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12632 ok(size == 0, "Expected 0, got %d\n", size);
12634 /* get the property */
12636 lstrcpyA(val, "apple");
12637 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12638 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12639 ok(!lstrcmpA(val, prodcode),
12640 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12641 ok(size == lstrlenA(prodcode),
12642 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12644 /* lpValueBuf is NULL */
12646 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
12647 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12648 ok(size == lstrlenA(prodcode),
12649 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12651 /* pcchValueBuf is NULL */
12652 lstrcpyA(val, "apple");
12653 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
12654 ok(r == ERROR_INVALID_PARAMETER,
12655 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12656 ok(!lstrcmpA(val, "apple"),
12657 "Expected val to be unchanged, got \"%s\"\n", val);
12658 ok(size == lstrlenA(prodcode),
12659 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12661 /* pcchValueBuf is too small */
12663 lstrcpyA(val, "apple");
12664 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12665 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12666 ok(!strncmp(val, prodcode, 3),
12667 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
12668 ok(size == lstrlenA(prodcode),
12669 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12671 /* pcchValueBuf does not leave room for NULL terminator */
12672 size = lstrlenA(prodcode);
12673 lstrcpyA(val, "apple");
12674 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12675 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12676 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
12677 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
12678 ok(size == lstrlenA(prodcode),
12679 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12681 /* pcchValueBuf has enough room for NULL terminator */
12682 size = lstrlenA(prodcode) + 1;
12683 lstrcpyA(val, "apple");
12684 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12686 ok(!lstrcmpA(val, prodcode),
12687 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12688 ok(size == lstrlenA(prodcode),
12689 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12691 /* nonexistent property */
12693 lstrcpyA(val, "apple");
12694 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
12695 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12696 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12697 ok(size == 0, "Expected 0, got %d\n", size);
12699 r = MsiSetPropertyA(hprod, "NewProperty", "value");
12700 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12702 /* non-product property set */
12704 lstrcpyA(val, "apple");
12705 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
12706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12707 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12708 ok(size == 0, "Expected 0, got %d\n", size);
12710 r = MsiSetPropertyA(hprod, "ProductCode", "value");
12711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12713 /* non-product property that is also a product property set */
12715 lstrcpyA(val, "apple");
12716 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12718 ok(!lstrcmpA(val, prodcode),
12719 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12720 ok(size == lstrlenA(prodcode),
12721 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12723 MsiCloseHandle(hprod);
12725 RegDeleteValueA(props, "LocalPackage");
12726 delete_key(props, "", access);
12727 RegCloseKey(props);
12728 delete_key(userkey, "", access);
12729 RegCloseKey(userkey);
12730 delete_key(prodkey, "", access);
12731 RegCloseKey(prodkey);
12732 DeleteFileA(msifile);
12735 static void test_MsiSetProperty(void)
12737 MSIHANDLE hpkg, hdb, hrec;
12738 CHAR buf[MAX_PATH];
12743 r = package_from_db(create_package_db(), &hpkg);
12744 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12746 skip("Not enough rights to perform tests\n");
12747 DeleteFile(msifile);
12750 ok(r == ERROR_SUCCESS, "Expected a valid package %u\n", r);
12752 /* invalid hInstall */
12753 r = MsiSetPropertyA(0, "Prop", "Val");
12754 ok(r == ERROR_INVALID_HANDLE,
12755 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12757 /* invalid hInstall */
12758 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12759 ok(r == ERROR_INVALID_HANDLE,
12760 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12762 /* szName is NULL */
12763 r = MsiSetPropertyA(hpkg, NULL, "Val");
12764 ok(r == ERROR_INVALID_PARAMETER,
12765 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12767 /* both szName and szValue are NULL */
12768 r = MsiSetPropertyA(hpkg, NULL, NULL);
12769 ok(r == ERROR_INVALID_PARAMETER,
12770 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12772 /* szName is empty */
12773 r = MsiSetPropertyA(hpkg, "", "Val");
12774 ok(r == ERROR_FUNCTION_FAILED,
12775 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
12777 /* szName is empty and szValue is NULL */
12778 r = MsiSetPropertyA(hpkg, "", NULL);
12779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12781 /* set a property */
12782 r = MsiSetPropertyA(hpkg, "Prop", "Val");
12783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12785 /* get the property */
12787 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12789 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
12790 ok(size == 3, "Expected 3, got %d\n", size);
12792 /* update the property */
12793 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
12794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12796 /* get the property */
12798 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12799 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12800 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
12801 ok(size == 4, "Expected 4, got %d\n", size);
12803 hdb = MsiGetActiveDatabase(hpkg);
12804 ok(hdb != 0, "Expected a valid database handle\n");
12806 /* set prop is not in the _Property table */
12807 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12808 r = do_query(hdb, query, &hrec);
12809 ok(r == ERROR_BAD_QUERY_SYNTAX,
12810 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12812 /* set prop is not in the Property table */
12813 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12814 r = do_query(hdb, query, &hrec);
12815 ok(r == ERROR_BAD_QUERY_SYNTAX,
12816 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12818 MsiCloseHandle(hdb);
12820 /* szValue is an empty string */
12821 r = MsiSetPropertyA(hpkg, "Prop", "");
12822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12824 /* try to get the property */
12826 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12828 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12829 ok(size == 0, "Expected 0, got %d\n", size);
12831 /* reset the property */
12832 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
12833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12835 /* delete the property */
12836 r = MsiSetPropertyA(hpkg, "Prop", NULL);
12837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12839 /* try to get the property */
12841 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12843 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12844 ok(size == 0, "Expected 0, got %d\n", size);
12846 MsiCloseHandle(hpkg);
12847 DeleteFileA(msifile);
12850 static void test_MsiApplyMultiplePatches(void)
12852 UINT r, type = GetDriveType(NULL);
12854 if (!pMsiApplyMultiplePatchesA) {
12855 win_skip("MsiApplyMultiplePatchesA not found\n");
12859 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
12860 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12862 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
12863 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12865 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
12866 if (type == DRIVE_FIXED)
12867 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12869 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12871 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
12872 if (type == DRIVE_FIXED)
12873 todo_wine ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED, "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
12875 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12877 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
12878 if (type == DRIVE_FIXED)
12879 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12881 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12883 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
12884 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12886 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
12887 if (type == DRIVE_FIXED)
12888 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12890 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12892 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
12893 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12895 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
12896 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12899 static void test_MsiApplyPatch(void)
12903 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
12904 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12906 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
12907 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12910 static void test_MsiEnumComponentCosts(void)
12912 MSIHANDLE hdb, hpkg;
12913 char package[12], drive[3];
12918 hdb = create_package_db();
12919 ok( hdb, "failed to create database\n" );
12921 r = create_property_table( hdb );
12922 ok( r == ERROR_SUCCESS, "cannot create Property table %u\n", r );
12924 r = add_property_entry( hdb, "'ProductCode', '{379B1C47-40C1-42FA-A9BB-BEBB6F1B0172}'" );
12925 ok( r == ERROR_SUCCESS, "cannot add property entry %u\n", r );
12927 r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
12928 ok( r == ERROR_SUCCESS, "cannot add property entry %u\n", r );
12930 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
12931 ok( r == ERROR_SUCCESS, "failed to add directory entry %u\n" , r );
12933 r = create_media_table( hdb );
12934 ok( r == ERROR_SUCCESS, "cannot create Media table %u\n", r );
12936 r = add_media_entry( hdb, "'1', '2', 'cabinet', '', '', ''");
12937 ok( r == ERROR_SUCCESS, "cannot add media entry %u\n", r );
12939 r = create_file_table( hdb );
12940 ok( r == ERROR_SUCCESS, "cannot create File table %u\n", r );
12942 r = add_file_entry( hdb, "'one.txt', 'one', 'one.txt', 4096, '', '', 8192, 1" );
12943 ok( r == ERROR_SUCCESS, "cannot add file %u\n", r );
12945 r = add_file_entry( hdb, "'two.txt', 'two', 'two.txt', 8192, '', '', 8192, 2" );
12946 ok( r == ERROR_SUCCESS, "cannot add file %u\n", r );
12948 r = create_component_table( hdb );
12949 ok( r == ERROR_SUCCESS, "cannot create Component table %u\n", r );
12951 r = add_component_entry( hdb, "'one', '{B2F86B9D-8447-4BC5-8883-750C45AA31CA}', 'TARGETDIR', 0, '', 'one.txt'" );
12952 ok( r == ERROR_SUCCESS, "cannot add component %u\n", r );
12954 r = add_component_entry( hdb, "'two', '{62A09F6E-0B74-4829-BDB7-CAB66F42CCE8}', 'TARGETDIR', 0, '', 'two.txt'" );
12955 ok( r == ERROR_SUCCESS, "cannot add component %u\n", r );
12957 r = create_feature_table( hdb );
12958 ok( r == ERROR_SUCCESS, "cannot create Feature table %u\n", r );
12960 r = add_feature_entry( hdb, "'one', '', '', '', 0, 1, '', 0" );
12961 ok( r == ERROR_SUCCESS, "cannot add feature %u\n", r );
12963 r = add_feature_entry( hdb, "'two', '', '', '', 0, 1, '', 0" );
12964 ok( r == ERROR_SUCCESS, "cannot add feature %u\n", r );
12966 r = create_feature_components_table( hdb );
12967 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table %u\n", r );
12969 r = add_feature_components_entry( hdb, "'one', 'one'" );
12970 ok( r == ERROR_SUCCESS, "cannot add feature/component pair %u\n", r );
12972 r = add_feature_components_entry( hdb, "'two', 'two'" );
12973 ok( r == ERROR_SUCCESS, "cannot add feature/component pair %u\n", r );
12975 r = create_install_execute_sequence_table( hdb );
12976 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table %u\n", r );
12978 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
12979 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r );
12981 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
12982 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r );
12984 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
12985 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r );
12987 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1100'" );
12988 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r );
12990 MsiDatabaseCommit( hdb );
12992 sprintf( package, "#%u", hdb );
12993 r = MsiOpenPackageA( package, &hpkg );
12994 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12996 skip("Not enough rights to perform tests\n");
12999 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13001 r = MsiEnumComponentCostsA( 0, NULL, 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13002 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13004 r = MsiEnumComponentCostsA( hpkg, NULL, 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13005 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13007 r = MsiEnumComponentCostsA( hpkg, NULL, 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13008 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13010 r = MsiEnumComponentCostsA( hpkg, "", 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13011 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13013 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13014 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13016 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, NULL, NULL, NULL, NULL );
13017 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13019 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, NULL, NULL, NULL );
13020 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13022 len = sizeof(drive);
13023 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, NULL, NULL );
13024 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13026 len = sizeof(drive);
13027 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, NULL );
13028 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13030 len = sizeof(drive);
13031 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13032 todo_wine ok( r == ERROR_INVALID_HANDLE_STATE, "Expected ERROR_INVALID_HANDLE_STATE, got %u\n", r );
13034 len = sizeof(drive);
13035 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, NULL, &len, &cost, &temp );
13036 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13038 MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
13040 r = MsiDoAction( hpkg, "CostInitialize" );
13041 ok( r == ERROR_SUCCESS, "CostInitialize failed %u\n", r );
13043 r = MsiDoAction( hpkg, "FileCost" );
13044 ok( r == ERROR_SUCCESS, "FileCost failed %u\n", r );
13046 len = sizeof(drive);
13047 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13048 ok( r == ERROR_FUNCTION_NOT_CALLED, "Expected ERROR_FUNCTION_NOT_CALLED, got %u\n", r );
13050 r = MsiDoAction( hpkg, "CostFinalize" );
13051 ok( r == ERROR_SUCCESS, "CostFinalize failed %u\n", r );
13053 /* contrary to what msdn says InstallValidate must be called too */
13054 len = sizeof(drive);
13055 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13056 todo_wine ok( r == ERROR_FUNCTION_NOT_CALLED, "Expected ERROR_FUNCTION_NOT_CALLED, got %u\n", r );
13058 r = MsiDoAction( hpkg, "InstallValidate" );
13059 ok( r == ERROR_SUCCESS, "InstallValidate failed %u\n", r );
13062 r = MsiEnumComponentCostsA( hpkg, "three", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13063 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %u\n", r );
13066 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13067 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %u\n", r );
13068 ok( len == 2, "expected len == 2, got %u\n", len );
13071 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13072 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %u\n", r );
13073 ok( len == 2, "expected len == 2, got %u\n", len );
13076 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_UNKNOWN, drive, &len, &cost, &temp );
13077 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %u\n", r );
13078 ok( len == 2, "expected len == 2, got %u\n", len );
13080 /* install state doesn't seem to matter */
13081 len = sizeof(drive);
13082 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_UNKNOWN, drive, &len, &cost, &temp );
13083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13085 len = sizeof(drive);
13086 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_ABSENT, drive, &len, &cost, &temp );
13087 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13089 len = sizeof(drive);
13090 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_SOURCE, drive, &len, &cost, &temp );
13091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13093 len = sizeof(drive);
13095 cost = temp = 0xdead;
13096 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13098 ok( len == 2, "expected len == 2, got %u\n", len );
13099 ok( drive[0], "expected a drive\n" );
13100 ok( cost && cost != 0xdead, "expected cost > 0, got %d\n", cost );
13101 ok( !temp, "expected temp == 0, got %d\n", temp );
13103 len = sizeof(drive);
13105 cost = temp = 0xdead;
13106 r = MsiEnumComponentCostsA( hpkg, "", 0, INSTALLSTATE_UNKNOWN, drive, &len, &cost, &temp );
13107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13108 ok( len == 2, "expected len == 2, got %u\n", len );
13109 ok( drive[0], "expected a drive\n" );
13110 ok( !cost, "expected cost == 0, got %d\n", cost );
13111 ok( temp && temp != 0xdead, "expected temp > 0, got %d\n", temp );
13113 /* increased index */
13114 len = sizeof(drive);
13115 r = MsiEnumComponentCostsA( hpkg, "one", 1, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13116 ok( r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %u\n", r );
13118 len = sizeof(drive);
13119 r = MsiEnumComponentCostsA( hpkg, "", 1, INSTALLSTATE_UNKNOWN, drive, &len, &cost, &temp );
13120 ok( r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %u\n", r );
13122 MsiCloseHandle( hpkg );
13124 MsiCloseHandle( hdb );
13125 DeleteFileA( msifile );
13128 START_TEST(package)
13130 STATEMGRSTATUS status;
13133 init_functionpointers();
13135 if (pIsWow64Process)
13136 pIsWow64Process(GetCurrentProcess(), &is_wow64);
13138 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
13140 /* Create a restore point ourselves so we circumvent the multitude of restore points
13141 * that would have been created by all the installation and removal tests.
13143 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
13144 * creation of restore points.
13146 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
13148 memset(&status, 0, sizeof(status));
13149 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
13152 test_createpackage();
13154 test_gettargetpath_bad();
13155 test_settargetpath();
13157 test_property_table();
13160 test_formatrecord2();
13162 test_getproperty();
13163 test_removefiles();
13165 test_appsearch_complocator();
13166 test_appsearch_reglocator();
13167 test_appsearch_inilocator();
13168 test_appsearch_drlocator();
13169 test_featureparents();
13170 test_installprops();
13171 test_launchconditions();
13173 test_complocator();
13174 test_MsiGetSourcePath();
13175 test_shortlongsource();
13178 test_emptypackage();
13179 test_MsiGetProductProperty();
13180 test_MsiSetProperty();
13181 test_MsiApplyMultiplePatches();
13182 test_MsiApplyPatch();
13183 test_MsiEnumComponentCosts();
13185 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
13187 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
13189 remove_restore_point(status.llSequenceNumber);