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 LPSTR get_user_sid(LPSTR *usersid)
119 if (!pConvertSidToStringSidA)
121 win_skip("ConvertSidToStringSidA is not available\n");
126 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
128 GetTokenInformation(token, TokenUser, buf, size, &size);
129 user = (PTOKEN_USER)buf;
130 pConvertSidToStringSidA(user->User.Sid, usersid);
131 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
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 (!get_user_sid(&usersid))
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 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8759 /* Workaround for Win95 */
8761 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8763 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8764 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8767 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8768 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8770 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8771 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8772 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8773 ok(!lstrcmpA(pathdata, pathvar),
8774 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8776 HeapFree(GetProcessHeap(), 0, pathvar);
8777 HeapFree(GetProcessHeap(), 0, pathdata);
8781 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8784 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8787 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8791 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8792 "Expected \"\\0one\\0two\\0\\0\"\n");
8796 lstrcpyA(path, "#xCDAB3412EF907856");
8797 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8799 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8802 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8804 ok(!lstrcmpA(prop, "##regszdata"),
8805 "Expected \"##regszdata\", got \"%s\"\n", prop);
8808 sprintf(path, "%s\\FileName1", CURR_DIR);
8809 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8811 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8814 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8816 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8819 sprintf(path, "%s\\", CURR_DIR);
8820 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8822 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8825 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8826 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8827 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8830 sprintf(path, "%s\\", CURR_DIR);
8831 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8832 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8833 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8836 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8838 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8841 r = MsiGetPropertyA(hpkg, "SIGPROP15", 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);
8847 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8849 ok(!lstrcmpA(prop, "regszdata"),
8850 "Expected \"regszdata\", got \"%s\"\n", prop);
8855 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8856 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8857 ok(!lstrcmpA(prop, "regszdata"),
8858 "Expected \"regszdata\", got \"%s\"\n", prop);
8862 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8864 ok(!lstrcmpA(prop, "defvalue"),
8865 "Expected \"defvalue\", got \"%s\"\n", prop);
8868 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8869 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8870 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8873 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8874 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8875 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8880 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8881 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8882 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8883 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8886 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8887 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8888 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8891 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8892 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8893 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8894 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8898 lstrcpyA(path, CURR_DIR);
8899 ptr = strrchr(path, '\\') + 1;
8901 r = MsiGetPropertyA(hpkg, "SIGPROP24", 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 sprintf(path, "%s\\", CURR_DIR);
8907 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8908 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8909 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8912 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8913 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8914 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8917 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8918 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8919 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8922 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8923 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8924 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8927 sprintf(path, "%s\\FileName1", CURR_DIR);
8928 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8929 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8930 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8933 sprintf(path, "%s\\FileName1", CURR_DIR);
8934 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8935 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8937 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8939 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8941 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8942 RegDeleteValueA(hklm, "Value1");
8943 RegDeleteValueA(hklm, "Value2");
8944 RegDeleteValueA(hklm, "Value3");
8945 RegDeleteValueA(hklm, "Value4");
8946 RegDeleteValueA(hklm, "Value5");
8947 RegDeleteValueA(hklm, "Value6");
8948 RegDeleteValueA(hklm, "Value7");
8949 RegDeleteValueA(hklm, "Value8");
8950 RegDeleteValueA(hklm, "Value9");
8951 RegDeleteValueA(hklm, "Value10");
8952 RegDeleteValueA(hklm, "Value11");
8953 RegDeleteValueA(hklm, "Value12");
8954 RegDeleteValueA(hklm, "Value13");
8955 RegDeleteValueA(hklm, "Value14");
8956 RegDeleteValueA(hklm, "Value15");
8957 RegDeleteValueA(hklm, "Value16");
8958 RegDeleteValueA(hklm, "Value17");
8959 RegDeleteKey(hklm, "");
8962 RegDeleteValueA(classes, "Value1");
8963 RegDeleteKeyA(classes, "");
8964 RegCloseKey(classes);
8966 RegDeleteValueA(hkcu, "Value1");
8967 RegDeleteKeyA(hkcu, "");
8970 RegDeleteValueA(users, "Value1");
8971 RegDeleteKeyA(users, "");
8974 DeleteFileA("FileName1");
8975 DeleteFileA("FileName3.dll");
8976 DeleteFileA("FileName4.dll");
8977 DeleteFileA("FileName5.dll");
8978 MsiCloseHandle(hpkg);
8979 DeleteFileA(msifile);
8982 static void delete_win_ini(LPCSTR file)
8984 CHAR path[MAX_PATH];
8986 GetWindowsDirectoryA(path, MAX_PATH);
8987 lstrcatA(path, "\\");
8988 lstrcatA(path, file);
8993 static void test_appsearch_inilocator(void)
8995 MSIHANDLE hpkg, hdb;
8996 CHAR path[MAX_PATH];
8997 CHAR prop[MAX_PATH];
9005 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9008 DeleteFileA("test.dll");
9010 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
9012 create_test_file("FileName1");
9013 sprintf(path, "%s\\FileName1", CURR_DIR);
9014 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
9016 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
9018 sprintf(path, "%s\\IDontExist", CURR_DIR);
9019 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
9021 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9022 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9023 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
9025 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9026 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9027 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
9029 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9030 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9031 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
9033 hdb = create_package_db();
9034 ok(hdb, "Expected a valid database handle\n");
9036 r = create_appsearch_table(hdb);
9037 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9039 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9042 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9043 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9045 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9046 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9048 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9051 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9052 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9054 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9057 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9060 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9063 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9066 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9069 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9072 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
9073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9075 r = create_inilocator_table(hdb);
9076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9078 /* msidbLocatorTypeRawValue, field 1 */
9079 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
9080 r = add_inilocator_entry(hdb, str);
9081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9083 /* msidbLocatorTypeRawValue, field 2 */
9084 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
9085 r = add_inilocator_entry(hdb, str);
9086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9088 /* msidbLocatorTypeRawValue, entire field */
9089 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
9090 r = add_inilocator_entry(hdb, str);
9091 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9093 /* msidbLocatorTypeFile */
9094 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9095 r = add_inilocator_entry(hdb, str);
9096 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9098 /* msidbLocatorTypeDirectory, file */
9099 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
9100 r = add_inilocator_entry(hdb, str);
9101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9103 /* msidbLocatorTypeDirectory, directory */
9104 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
9105 r = add_inilocator_entry(hdb, str);
9106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9108 /* msidbLocatorTypeFile, file, no signature */
9109 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9110 r = add_inilocator_entry(hdb, str);
9111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9113 /* msidbLocatorTypeFile, dir, no signature */
9114 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
9115 r = add_inilocator_entry(hdb, str);
9116 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9118 /* msidbLocatorTypeFile, file does not exist */
9119 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
9120 r = add_inilocator_entry(hdb, str);
9121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9123 /* msidbLocatorTypeFile, signature with version */
9124 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
9125 r = add_inilocator_entry(hdb, str);
9126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9128 /* msidbLocatorTypeFile, signature with version, ver > max */
9129 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
9130 r = add_inilocator_entry(hdb, str);
9131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9133 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
9134 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
9135 r = add_inilocator_entry(hdb, str);
9136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9138 r = create_signature_table(hdb);
9139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9141 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
9142 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9144 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
9145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9147 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9150 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9151 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9153 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9154 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9156 r = package_from_db(hdb, &hpkg);
9157 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9159 skip("Not enough rights to perform tests\n");
9162 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9164 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9166 r = MsiDoAction(hpkg, "AppSearch");
9167 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9170 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9172 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
9175 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9176 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9177 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
9180 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9182 ok(!lstrcmpA(prop, "keydata,field2"),
9183 "Expected \"keydata,field2\", got \"%s\"\n", prop);
9186 sprintf(path, "%s\\FileName1", CURR_DIR);
9187 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9188 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9189 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9192 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9194 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9197 sprintf(path, "%s\\", CURR_DIR);
9198 r = MsiGetPropertyA(hpkg, "SIGPROP6", 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 sprintf(path, "%s\\", CURR_DIR);
9204 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9205 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9206 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9209 lstrcpyA(path, CURR_DIR);
9210 ptr = strrchr(path, '\\');
9212 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9213 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9214 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9217 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9218 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9219 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9224 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9225 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9226 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9227 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9230 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9231 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9232 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9235 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9236 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
9237 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9238 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9241 MsiCloseHandle(hpkg);
9244 delete_win_ini("IniFile.ini");
9245 DeleteFileA("FileName1");
9246 DeleteFileA("FileName2.dll");
9247 DeleteFileA("FileName3.dll");
9248 DeleteFileA("FileName4.dll");
9249 DeleteFileA(msifile);
9253 * MSI AppSearch action on DrLocator table always returns absolute paths.
9254 * If a relative path was set, it returns the first absolute path that
9255 * matches or an empty string if it didn't find anything.
9256 * This helper function replicates this behaviour.
9258 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
9263 size = lstrlenA(relative);
9264 drives = GetLogicalDrives();
9265 lstrcpyA(absolute, "A:\\");
9266 for (i = 0; i < 26; absolute[0] = '\0', i++)
9268 if (!(drives & (1 << i)))
9271 absolute[0] = 'A' + i;
9272 if (GetDriveType(absolute) != DRIVE_FIXED)
9275 lstrcpynA(absolute + 3, relative, size + 1);
9276 attr = GetFileAttributesA(absolute);
9277 if (attr != INVALID_FILE_ATTRIBUTES &&
9278 (attr & FILE_ATTRIBUTE_DIRECTORY))
9280 if (absolute[3 + size - 1] != '\\')
9281 lstrcatA(absolute, "\\");
9288 static void test_appsearch_drlocator(void)
9290 MSIHANDLE hpkg, hdb;
9291 CHAR path[MAX_PATH];
9292 CHAR prop[MAX_PATH];
9299 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9302 DeleteFileA("test.dll");
9304 create_test_file("FileName1");
9305 CreateDirectoryA("one", NULL);
9306 CreateDirectoryA("one\\two", NULL);
9307 CreateDirectoryA("one\\two\\three", NULL);
9308 create_test_file("one\\two\\three\\FileName2");
9309 CreateDirectoryA("another", NULL);
9310 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9311 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9312 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9314 hdb = create_package_db();
9315 ok(hdb, "Expected a valid database handle\n");
9317 r = create_appsearch_table(hdb);
9318 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9320 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9321 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9323 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9326 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9327 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9329 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9330 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9332 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9333 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9335 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9338 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9341 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9342 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9344 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9347 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9348 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9350 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9353 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
9354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9356 r = create_drlocator_table(hdb);
9357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9359 /* no parent, full path, depth 0, signature */
9360 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
9361 r = add_drlocator_entry(hdb, path);
9362 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9364 /* no parent, full path, depth 0, no signature */
9365 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
9366 r = add_drlocator_entry(hdb, path);
9367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9369 /* no parent, relative path, depth 0, no signature */
9370 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
9371 r = add_drlocator_entry(hdb, path);
9372 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9374 /* no parent, full path, depth 2, signature */
9375 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
9376 r = add_drlocator_entry(hdb, path);
9377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9379 /* no parent, full path, depth 3, signature */
9380 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
9381 r = add_drlocator_entry(hdb, path);
9382 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9384 /* no parent, full path, depth 1, signature is dir */
9385 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
9386 r = add_drlocator_entry(hdb, path);
9387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9389 /* parent is in DrLocator, relative path, depth 0, signature */
9390 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
9391 r = add_drlocator_entry(hdb, path);
9392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9394 /* no parent, full path, depth 0, signature w/ version */
9395 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
9396 r = add_drlocator_entry(hdb, path);
9397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9399 /* no parent, full path, depth 0, signature w/ version, ver > max */
9400 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
9401 r = add_drlocator_entry(hdb, path);
9402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9404 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
9405 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
9406 r = add_drlocator_entry(hdb, path);
9407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9409 /* no parent, relative empty path, depth 0, no signature */
9410 sprintf(path, "'NewSignature11', '', '', 0");
9411 r = add_drlocator_entry(hdb, path);
9412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9414 r = create_reglocator_table(hdb);
9415 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9418 r = add_reglocator_entry(hdb, "NewSignature12", 2, "htmlfile\\shell\\open\\nonexistent", "", 1);
9419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9421 /* parent is in RegLocator, no path, depth 0, no signature */
9422 sprintf(path, "'NewSignature13', 'NewSignature12', '', 0");
9423 r = add_drlocator_entry(hdb, path);
9424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9426 r = create_signature_table(hdb);
9427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9429 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9430 r = add_signature_entry(hdb, str);
9431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9433 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9434 r = add_signature_entry(hdb, str);
9435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9437 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9438 r = add_signature_entry(hdb, str);
9439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9441 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9442 r = add_signature_entry(hdb, str);
9443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9445 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9446 r = add_signature_entry(hdb, str);
9447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9449 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9450 r = add_signature_entry(hdb, str);
9451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9453 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9454 r = add_signature_entry(hdb, str);
9455 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9457 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9458 r = add_signature_entry(hdb, str);
9459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9461 r = package_from_db(hdb, &hpkg);
9462 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9464 skip("Not enough rights to perform tests\n");
9467 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9469 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9471 r = MsiDoAction(hpkg, "AppSearch");
9472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9475 sprintf(path, "%s\\FileName1", CURR_DIR);
9476 r = MsiGetPropertyA(hpkg, "SIGPROP1", 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 sprintf(path, "%s\\", CURR_DIR);
9482 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9484 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9487 search_absolute_directory(path, CURR_DIR + 3);
9488 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9490 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9493 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9495 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9498 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9499 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9501 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9504 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9506 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9509 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9510 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9512 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9517 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9518 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9520 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9523 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9525 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9528 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9530 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9534 search_absolute_directory(path, "");
9535 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9536 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9537 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9540 strcpy(path, "c:\\");
9541 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
9542 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9543 ok(!prop[0], "Expected \"\", got \"%s\"\n", prop);
9545 MsiCloseHandle(hpkg);
9548 DeleteFileA("FileName1");
9549 DeleteFileA("FileName3.dll");
9550 DeleteFileA("FileName4.dll");
9551 DeleteFileA("FileName5.dll");
9552 DeleteFileA("one\\two\\three\\FileName2");
9553 RemoveDirectoryA("one\\two\\three");
9554 RemoveDirectoryA("one\\two");
9555 RemoveDirectoryA("one");
9556 RemoveDirectoryA("another");
9557 DeleteFileA(msifile);
9560 static void test_featureparents(void)
9565 INSTALLSTATE state, action;
9567 hdb = create_package_db();
9568 ok ( hdb, "failed to create package database\n" );
9570 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
9571 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
9573 r = create_feature_table( hdb );
9574 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
9576 r = create_component_table( hdb );
9577 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
9579 r = create_feature_components_table( hdb );
9580 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
9582 r = create_file_table( hdb );
9583 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
9585 /* msidbFeatureAttributesFavorLocal */
9586 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
9587 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9589 /* msidbFeatureAttributesFavorSource */
9590 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
9591 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9593 /* msidbFeatureAttributesFavorLocal */
9594 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
9595 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9597 /* msidbFeatureAttributesUIDisallowAbsent */
9598 r = add_feature_entry( hdb, "'lyra', '', '', '', 2, 1, '', 16" );
9599 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9601 /* disabled because of install level */
9602 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
9603 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9605 /* child feature of disabled feature */
9606 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9607 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9609 /* component of disabled feature (install level) */
9610 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9611 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9613 /* component of disabled child feature (install level) */
9614 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9615 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9617 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9618 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9619 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9621 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9622 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9623 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9625 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9626 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9627 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9629 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9630 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9631 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9633 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9634 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9635 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9637 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9638 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9639 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9641 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9642 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9643 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9645 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9646 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9647 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9649 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9650 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9653 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9654 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9656 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9657 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9659 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9660 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9662 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9663 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9665 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9666 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9668 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9669 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9671 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9672 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9674 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9675 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9677 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9678 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9680 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9681 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9683 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9684 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9686 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9687 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9689 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9690 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9692 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9693 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9695 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9696 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9698 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9699 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9701 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9702 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9704 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9705 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9707 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9708 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9710 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9711 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9713 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9714 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9716 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9717 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9719 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9720 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9722 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9723 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9725 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9726 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9728 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9729 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9731 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9732 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9734 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9735 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9737 r = package_from_db( hdb, &hpkg );
9738 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9740 skip("Not enough rights to perform tests\n");
9741 DeleteFile(msifile);
9744 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9746 MsiCloseHandle( hdb );
9748 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9750 r = MsiDoAction( hpkg, "CostInitialize");
9751 ok( r == ERROR_SUCCESS, "cost init failed\n");
9753 r = MsiDoAction( hpkg, "FileCost");
9754 ok( r == ERROR_SUCCESS, "file cost failed\n");
9756 r = MsiDoAction( hpkg, "CostFinalize");
9757 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9761 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9762 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9763 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9764 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9768 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9769 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9770 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9771 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9775 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9776 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9777 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9778 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9782 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9784 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9785 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9789 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9790 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9791 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9792 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9796 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9797 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9798 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9799 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9803 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9804 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9805 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9806 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9810 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9811 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9812 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9813 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9817 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9818 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9819 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9820 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9824 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9825 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9826 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9827 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9831 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9832 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9833 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9834 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9838 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9839 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9840 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9841 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9845 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9846 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9847 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9848 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9852 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9853 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9854 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9855 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9859 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9860 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9861 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9862 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9866 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9867 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9868 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9869 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9873 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9874 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9875 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9876 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9878 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9879 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9881 r = MsiSetFeatureState(hpkg, "lyra", INSTALLSTATE_ABSENT);
9882 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9884 r = MsiSetFeatureState(hpkg, "nosuchfeature", INSTALLSTATE_ABSENT);
9885 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r);
9889 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9890 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9891 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9892 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9896 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9897 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9898 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9899 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9903 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9904 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9905 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9906 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9910 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9911 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9912 ok( state == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", state);
9913 ok( action == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", action);
9917 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9918 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9919 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9920 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9924 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9925 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9926 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9927 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9931 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9932 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9933 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9934 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9938 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9939 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9940 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9941 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9945 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9947 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9948 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9952 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9953 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9954 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9955 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9959 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9961 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9962 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9966 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9968 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9969 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9973 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9975 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9976 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9980 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9982 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9983 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9987 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9989 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9990 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9992 MsiCloseHandle(hpkg);
9993 DeleteFileA(msifile);
9996 static void test_installprops(void)
9998 MSIHANDLE hpkg, hdb;
9999 CHAR path[MAX_PATH], buf[MAX_PATH];
10005 REGSAM access = KEY_ALL_ACCESS;
10009 access |= KEY_WOW64_64KEY;
10011 GetCurrentDirectory(MAX_PATH, path);
10012 lstrcat(path, "\\");
10013 lstrcat(path, msifile);
10015 hdb = create_package_db();
10016 ok( hdb, "failed to create database\n");
10018 r = package_from_db(hdb, &hpkg);
10019 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10021 skip("Not enough rights to perform tests\n");
10022 DeleteFile(msifile);
10025 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10027 MsiCloseHandle(hdb);
10030 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
10031 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10032 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10034 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
10035 RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
10040 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10044 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
10047 /* win9x doesn't set this */
10051 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
10052 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10053 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10059 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10063 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
10069 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
10070 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10071 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10075 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
10076 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10077 trace("VersionDatabase = %s\n", buf);
10080 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
10081 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10082 trace("VersionMsi = %s\n", buf);
10085 r = MsiGetProperty(hpkg, "Date", buf, &size);
10086 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10087 trace("Date = %s\n", buf);
10090 r = MsiGetProperty(hpkg, "Time", buf, &size);
10091 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10092 trace("Time = %s\n", buf);
10095 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
10096 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10097 trace("PackageCode = %s\n", buf);
10099 langid = GetUserDefaultLangID();
10100 sprintf(path, "%d", langid);
10103 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
10104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10105 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
10107 res = GetSystemMetrics(SM_CXSCREEN);
10109 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
10110 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10111 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10113 res = GetSystemMetrics(SM_CYSCREEN);
10115 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
10116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10117 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10119 if (pGetSystemInfo && pSHGetFolderPathA)
10121 pGetSystemInfo(&si);
10122 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
10126 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10127 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10128 ok(buf[0], "property not set\n");
10132 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10133 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10134 ok(buf[0], "property not set\n");
10138 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10139 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10140 GetSystemDirectoryA(path, MAX_PATH);
10141 if (size) buf[size - 1] = 0;
10142 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10146 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10147 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10148 pGetSystemWow64DirectoryA(path, MAX_PATH);
10149 if (size) buf[size - 1] = 0;
10150 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10154 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10155 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10156 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10157 if (size) buf[size - 1] = 0;
10158 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10162 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10163 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10164 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10165 if (size) buf[size - 1] = 0;
10166 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10170 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10171 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10172 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10173 if (size) buf[size - 1] = 0;
10174 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10178 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10179 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10180 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10181 if (size) buf[size - 1] = 0;
10182 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10186 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10187 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10188 ok(buf[0], "property not set\n");
10190 else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
10196 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10197 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10198 ok(!buf[0], "property set\n");
10202 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10203 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10204 ok(!buf[0], "property set\n");
10208 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10209 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10210 ok(!buf[0], "property set\n");
10214 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10215 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10216 GetSystemDirectoryA(path, MAX_PATH);
10217 if (size) buf[size - 1] = 0;
10218 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10222 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10223 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10224 ok(!buf[0], "property set\n");
10228 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10229 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10230 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10231 if (size) buf[size - 1] = 0;
10232 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10236 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10237 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10238 ok(!buf[0], "property set\n");
10242 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10243 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10244 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10245 if (size) buf[size - 1] = 0;
10246 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10250 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10251 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10252 ok(!buf[0], "property set\n");
10258 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10259 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10260 ok(buf[0], "property not set\n");
10264 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10265 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10266 ok(buf[0], "property not set\n");
10270 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10271 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10272 GetSystemDirectoryA(path, MAX_PATH);
10273 if (size) buf[size - 1] = 0;
10274 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10278 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10279 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10280 pGetSystemWow64DirectoryA(path, MAX_PATH);
10281 if (size) buf[size - 1] = 0;
10282 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10286 r = MsiGetProperty(hpkg, "ProgramFilesFolder64", buf, &size);
10287 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10288 ok(!buf[0], "property set\n");
10292 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10293 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10294 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10295 if (size) buf[size - 1] = 0;
10296 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10300 r = MsiGetProperty(hpkg, "CommonFilesFolder64", buf, &size);
10301 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10302 ok(!buf[0], "property set\n");
10306 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10307 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10308 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10309 if (size) buf[size - 1] = 0;
10310 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10314 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10315 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10316 ok(buf[0], "property not set\n");
10321 CloseHandle(hkey1);
10322 CloseHandle(hkey2);
10323 MsiCloseHandle(hpkg);
10324 DeleteFile(msifile);
10327 static void test_launchconditions(void)
10333 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10335 hdb = create_package_db();
10336 ok( hdb, "failed to create package database\n" );
10338 r = create_launchcondition_table( hdb );
10339 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
10341 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
10342 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10344 /* invalid condition */
10345 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
10346 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10348 r = package_from_db( hdb, &hpkg );
10349 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10351 skip("Not enough rights to perform tests\n");
10352 DeleteFile(msifile);
10355 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10357 MsiCloseHandle( hdb );
10359 r = MsiSetProperty( hpkg, "X", "1" );
10360 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10362 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10364 /* invalid conditions are ignored */
10365 r = MsiDoAction( hpkg, "LaunchConditions" );
10366 ok( r == ERROR_SUCCESS, "cost init failed\n" );
10368 /* verify LaunchConditions still does some verification */
10369 r = MsiSetProperty( hpkg, "X", "2" );
10370 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10372 r = MsiDoAction( hpkg, "LaunchConditions" );
10373 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
10375 MsiCloseHandle( hpkg );
10376 DeleteFile( msifile );
10379 static void test_ccpsearch(void)
10381 MSIHANDLE hdb, hpkg;
10382 CHAR prop[MAX_PATH];
10383 DWORD size = MAX_PATH;
10386 hdb = create_package_db();
10387 ok(hdb, "failed to create package database\n");
10389 r = create_ccpsearch_table(hdb);
10390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10392 r = add_ccpsearch_entry(hdb, "'CCP_random'");
10393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10395 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
10396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10398 r = create_reglocator_table(hdb);
10399 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10401 r = add_reglocator_entry(hdb, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
10402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10404 r = create_drlocator_table(hdb);
10405 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10407 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
10408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10410 r = create_signature_table(hdb);
10411 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10413 r = package_from_db(hdb, &hpkg);
10414 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10416 skip("Not enough rights to perform tests\n");
10417 DeleteFile(msifile);
10420 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10422 MsiCloseHandle(hdb);
10424 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10426 r = MsiDoAction(hpkg, "CCPSearch");
10427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10429 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
10430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10431 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
10433 MsiCloseHandle(hpkg);
10434 DeleteFileA(msifile);
10437 static void test_complocator(void)
10439 MSIHANDLE hdb, hpkg;
10441 CHAR prop[MAX_PATH];
10442 CHAR expected[MAX_PATH];
10443 DWORD size = MAX_PATH;
10445 hdb = create_package_db();
10446 ok(hdb, "failed to create package database\n");
10448 r = create_appsearch_table(hdb);
10449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10451 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
10452 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10454 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
10455 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10457 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
10458 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10460 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
10461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10463 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
10464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10466 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
10467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10469 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
10470 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10472 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
10473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10475 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
10476 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10478 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
10479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10481 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
10482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10484 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
10485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10487 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
10488 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10490 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
10491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10493 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
10494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10496 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
10497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10499 r = create_complocator_table(hdb);
10500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10502 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
10503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10505 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
10506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10508 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
10509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10511 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
10512 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10514 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
10515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10517 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
10518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10520 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
10521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10523 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
10524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10526 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
10527 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10529 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
10530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10532 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
10533 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10535 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
10536 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10538 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
10539 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10541 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
10542 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10544 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
10545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10547 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
10548 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10550 r = create_signature_table(hdb);
10551 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10553 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
10554 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10556 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
10557 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10559 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
10560 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10562 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
10563 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10565 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
10566 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10568 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
10569 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10571 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
10572 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10574 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
10575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10577 r = package_from_db(hdb, &hpkg);
10578 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10580 skip("Not enough rights to perform tests\n");
10581 DeleteFile(msifile);
10584 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10586 MsiCloseHandle(hdb);
10588 create_test_file("abelisaurus");
10589 create_test_file("bactrosaurus");
10590 create_test_file("camelotia");
10591 create_test_file("diclonius");
10592 create_test_file("echinodon");
10593 create_test_file("falcarius");
10594 create_test_file("gallimimus");
10595 create_test_file("hagryphus");
10596 CreateDirectoryA("iguanodon", NULL);
10597 CreateDirectoryA("jobaria", NULL);
10598 CreateDirectoryA("kakuru", NULL);
10599 CreateDirectoryA("labocania", NULL);
10600 CreateDirectoryA("megaraptor", NULL);
10601 CreateDirectoryA("neosodon", NULL);
10602 CreateDirectoryA("olorotitan", NULL);
10603 CreateDirectoryA("pantydraco", NULL);
10605 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
10606 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
10607 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
10608 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
10609 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
10610 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
10611 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
10612 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
10613 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
10614 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
10615 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
10616 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
10617 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
10618 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
10619 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
10620 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
10622 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10624 r = MsiDoAction(hpkg, "AppSearch");
10625 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10628 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
10629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10631 lstrcpyA(expected, CURR_DIR);
10632 lstrcatA(expected, "\\abelisaurus");
10633 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10634 "Expected %s or empty string, got %s\n", expected, prop);
10637 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", 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, "CAMELOTIA", prop, &size);
10643 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10644 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10647 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
10648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10649 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10652 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
10653 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10655 lstrcpyA(expected, CURR_DIR);
10656 lstrcatA(expected, "\\");
10657 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10658 "Expected %s or empty string, got %s\n", expected, prop);
10661 r = MsiGetPropertyA(hpkg, "FALCARIUS", 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, "GALLIMIMUS", 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, "HAGRYPHUS", 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, "IGUANODON", 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, "JOBARIA", 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, "KAKURU", prop, &size);
10687 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10688 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10691 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
10692 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10693 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10696 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
10697 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10699 lstrcpyA(expected, CURR_DIR);
10700 lstrcatA(expected, "\\");
10701 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10702 "Expected %s or empty string, got %s\n", expected, prop);
10705 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
10706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10708 lstrcpyA(expected, CURR_DIR);
10709 lstrcatA(expected, "\\neosodon\\");
10710 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10711 "Expected %s or empty string, got %s\n", expected, prop);
10714 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
10715 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10716 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10719 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
10720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10721 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10723 MsiCloseHandle(hpkg);
10724 DeleteFileA("abelisaurus");
10725 DeleteFileA("bactrosaurus");
10726 DeleteFileA("camelotia");
10727 DeleteFileA("diclonius");
10728 DeleteFileA("echinodon");
10729 DeleteFileA("falcarius");
10730 DeleteFileA("gallimimus");
10731 DeleteFileA("hagryphus");
10732 RemoveDirectoryA("iguanodon");
10733 RemoveDirectoryA("jobaria");
10734 RemoveDirectoryA("kakuru");
10735 RemoveDirectoryA("labocania");
10736 RemoveDirectoryA("megaraptor");
10737 RemoveDirectoryA("neosodon");
10738 RemoveDirectoryA("olorotitan");
10739 RemoveDirectoryA("pantydraco");
10740 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10741 MSIINSTALLCONTEXT_MACHINE, NULL);
10742 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10743 MSIINSTALLCONTEXT_MACHINE, NULL);
10744 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10745 MSIINSTALLCONTEXT_MACHINE, NULL);
10746 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10747 MSIINSTALLCONTEXT_MACHINE, NULL);
10748 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10749 MSIINSTALLCONTEXT_MACHINE, NULL);
10750 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10751 MSIINSTALLCONTEXT_MACHINE, NULL);
10752 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10753 MSIINSTALLCONTEXT_MACHINE, NULL);
10754 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10755 MSIINSTALLCONTEXT_MACHINE, NULL);
10756 DeleteFileA(msifile);
10759 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
10764 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
10765 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10767 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
10768 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10770 r = MsiSummaryInfoPersist(summary);
10771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10773 MsiCloseHandle(summary);
10776 static void test_MsiGetSourcePath(void)
10778 MSIHANDLE hdb, hpkg;
10779 CHAR path[MAX_PATH];
10780 CHAR cwd[MAX_PATH];
10781 CHAR subsrc[MAX_PATH];
10782 CHAR sub2[MAX_PATH];
10786 lstrcpyA(cwd, CURR_DIR);
10787 lstrcatA(cwd, "\\");
10789 lstrcpyA(subsrc, cwd);
10790 lstrcatA(subsrc, "subsource");
10791 lstrcatA(subsrc, "\\");
10793 lstrcpyA(sub2, subsrc);
10794 lstrcatA(sub2, "sub2");
10795 lstrcatA(sub2, "\\");
10797 /* uncompressed source */
10799 hdb = create_package_db();
10800 ok( hdb, "failed to create database\n");
10802 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10804 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10805 ok(r == S_OK, "failed\n");
10807 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10808 ok(r == S_OK, "failed\n");
10810 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
10811 ok(r == S_OK, "failed\n");
10813 r = MsiDatabaseCommit(hdb);
10814 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
10816 r = package_from_db(hdb, &hpkg);
10817 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10819 skip("Not enough rights to perform tests\n");
10820 DeleteFile(msifile);
10823 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10825 MsiCloseHandle(hdb);
10827 /* invalid database handle */
10829 lstrcpyA(path, "kiwi");
10830 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
10831 ok(r == ERROR_INVALID_HANDLE,
10832 "Expected ERROR_INVALID_HANDLE, 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 /* NULL szFolder */
10839 lstrcpyA(path, "kiwi");
10840 r = MsiGetSourcePath(hpkg, NULL, path, &size);
10841 ok(r == ERROR_INVALID_PARAMETER,
10842 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10843 ok(!lstrcmpA(path, "kiwi"),
10844 "Expected path to be unchanged, got \"%s\"\n", path);
10845 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10847 /* empty szFolder */
10849 lstrcpyA(path, "kiwi");
10850 r = MsiGetSourcePath(hpkg, "", path, &size);
10851 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10852 ok(!lstrcmpA(path, "kiwi"),
10853 "Expected path to be unchanged, got \"%s\"\n", path);
10854 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10856 /* try TARGETDIR */
10858 lstrcpyA(path, "kiwi");
10859 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10860 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10861 ok(!lstrcmpA(path, "kiwi"),
10862 "Expected path to be unchanged, got \"%s\"\n", path);
10863 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10866 lstrcpyA(path, "kiwi");
10867 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10868 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10869 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10870 ok(size == 0, "Expected 0, got %d\n", size);
10873 lstrcpyA(path, "kiwi");
10874 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10875 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10876 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10877 ok(size == 0, "Expected 0, got %d\n", size);
10879 /* try SourceDir */
10881 lstrcpyA(path, "kiwi");
10882 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10883 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10884 ok(!lstrcmpA(path, "kiwi"),
10885 "Expected path to be unchanged, got \"%s\"\n", path);
10886 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10888 /* try SOURCEDIR */
10890 lstrcpyA(path, "kiwi");
10891 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10892 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10893 ok(!lstrcmpA(path, "kiwi"),
10894 "Expected path to be unchanged, got \"%s\"\n", path);
10895 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10897 /* source path does not exist, but the property exists */
10899 lstrcpyA(path, "kiwi");
10900 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10901 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10902 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10903 ok(size == 0, "Expected 0, got %d\n", size);
10906 lstrcpyA(path, "kiwi");
10907 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10908 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10909 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10910 ok(size == 0, "Expected 0, got %d\n", size);
10914 lstrcpyA(path, "kiwi");
10915 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10916 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10917 ok(!lstrcmpA(path, "kiwi"),
10918 "Expected path to be unchanged, got \"%s\"\n", path);
10919 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10923 lstrcpyA(path, "kiwi");
10924 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10925 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10926 ok(!lstrcmpA(path, "kiwi"),
10927 "Expected path to be unchanged, got \"%s\"\n", path);
10928 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10930 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10932 r = MsiDoAction(hpkg, "CostInitialize");
10933 ok(r == ERROR_SUCCESS, "cost init failed\n");
10935 /* try TARGETDIR after CostInitialize */
10937 lstrcpyA(path, "kiwi");
10938 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10940 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10941 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10943 /* try SourceDir after CostInitialize */
10945 lstrcpyA(path, "kiwi");
10946 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10948 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10949 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10951 /* try SOURCEDIR after CostInitialize */
10953 lstrcpyA(path, "kiwi");
10954 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10955 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10956 ok(!lstrcmpA(path, "kiwi"),
10957 "Expected path to be unchanged, got \"%s\"\n", path);
10958 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10960 /* source path does not exist, but the property exists */
10962 lstrcpyA(path, "kiwi");
10963 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10964 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10967 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10968 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10971 /* try SubDir after CostInitialize */
10973 lstrcpyA(path, "kiwi");
10974 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10975 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10976 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10977 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10979 /* try SubDir2 after CostInitialize */
10981 lstrcpyA(path, "kiwi");
10982 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10983 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10984 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10985 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10987 r = MsiDoAction(hpkg, "ResolveSource");
10988 ok(r == ERROR_SUCCESS, "file cost failed\n");
10990 /* try TARGETDIR after ResolveSource */
10992 lstrcpyA(path, "kiwi");
10993 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10994 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10995 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10996 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10998 /* try SourceDir after ResolveSource */
11000 lstrcpyA(path, "kiwi");
11001 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11002 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11003 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11004 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11006 /* try SOURCEDIR after ResolveSource */
11008 lstrcpyA(path, "kiwi");
11009 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11010 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11011 ok(!lstrcmpA(path, "kiwi"),
11012 "Expected path to be unchanged, got \"%s\"\n", path);
11013 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11015 /* source path does not exist, but the property exists */
11017 lstrcpyA(path, "kiwi");
11018 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11019 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11020 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11021 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11023 /* try SubDir after ResolveSource */
11025 lstrcpyA(path, "kiwi");
11026 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11028 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11029 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11031 /* try SubDir2 after ResolveSource */
11033 lstrcpyA(path, "kiwi");
11034 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11035 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11036 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11037 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11039 r = MsiDoAction(hpkg, "FileCost");
11040 ok(r == ERROR_SUCCESS, "file cost failed\n");
11042 /* try TARGETDIR after FileCost */
11044 lstrcpyA(path, "kiwi");
11045 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11046 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11047 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11048 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11050 /* try SourceDir after FileCost */
11052 lstrcpyA(path, "kiwi");
11053 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11055 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11056 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11058 /* try SOURCEDIR after FileCost */
11060 lstrcpyA(path, "kiwi");
11061 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11062 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11063 ok(!lstrcmpA(path, "kiwi"),
11064 "Expected path to be unchanged, got \"%s\"\n", path);
11065 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11067 /* source path does not exist, but the property exists */
11069 lstrcpyA(path, "kiwi");
11070 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11072 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11073 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11075 /* try SubDir after FileCost */
11077 lstrcpyA(path, "kiwi");
11078 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11079 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11080 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11081 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11083 /* try SubDir2 after FileCost */
11085 lstrcpyA(path, "kiwi");
11086 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11088 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11089 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11091 r = MsiDoAction(hpkg, "CostFinalize");
11092 ok(r == ERROR_SUCCESS, "file cost failed\n");
11094 /* try TARGETDIR after CostFinalize */
11096 lstrcpyA(path, "kiwi");
11097 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11098 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11099 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11100 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11102 /* try SourceDir after CostFinalize */
11104 lstrcpyA(path, "kiwi");
11105 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11107 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11108 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11110 /* try SOURCEDIR after CostFinalize */
11112 lstrcpyA(path, "kiwi");
11113 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11114 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11115 ok(!lstrcmpA(path, "kiwi"),
11116 "Expected path to be unchanged, got \"%s\"\n", path);
11117 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11119 /* source path does not exist, but the property exists */
11121 lstrcpyA(path, "kiwi");
11122 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11124 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11125 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11127 /* try SubDir after CostFinalize */
11129 lstrcpyA(path, "kiwi");
11130 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11132 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11133 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11135 /* try SubDir2 after CostFinalize */
11137 lstrcpyA(path, "kiwi");
11138 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11140 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11141 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11143 /* nonexistent directory */
11145 lstrcpyA(path, "kiwi");
11146 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
11147 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11148 ok(!lstrcmpA(path, "kiwi"),
11149 "Expected path to be unchanged, got \"%s\"\n", path);
11150 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11152 /* NULL szPathBuf */
11154 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
11155 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11156 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11158 /* NULL pcchPathBuf */
11159 lstrcpyA(path, "kiwi");
11160 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
11161 ok(r == ERROR_INVALID_PARAMETER,
11162 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11163 ok(!lstrcmpA(path, "kiwi"),
11164 "Expected path to be unchanged, got \"%s\"\n", path);
11166 /* pcchPathBuf is 0 */
11168 lstrcpyA(path, "kiwi");
11169 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11170 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11171 ok(!lstrcmpA(path, "kiwi"),
11172 "Expected path to be unchanged, got \"%s\"\n", path);
11173 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11175 /* pcchPathBuf does not have room for NULL terminator */
11176 size = lstrlenA(cwd);
11177 lstrcpyA(path, "kiwi");
11178 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11179 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11180 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
11181 "Expected path with no backslash, got \"%s\"\n", path);
11182 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11184 /* pcchPathBuf has room for NULL terminator */
11185 size = lstrlenA(cwd) + 1;
11186 lstrcpyA(path, "kiwi");
11187 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11188 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11189 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11190 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11192 /* remove property */
11193 r = MsiSetProperty(hpkg, "SourceDir", NULL);
11194 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11196 /* try SourceDir again */
11198 lstrcpyA(path, "kiwi");
11199 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11200 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11201 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11202 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11204 /* set property to a valid directory */
11205 r = MsiSetProperty(hpkg, "SOURCEDIR", cwd);
11206 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11208 /* try SOURCEDIR again */
11210 lstrcpyA(path, "kiwi");
11211 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11212 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11213 ok(!lstrcmpA(path, "kiwi"),
11214 "Expected path to be unchanged, got \"%s\"\n", path);
11215 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11217 MsiCloseHandle(hpkg);
11219 /* compressed source */
11221 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11222 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11224 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
11226 r = package_from_db(hdb, &hpkg);
11227 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11229 /* try TARGETDIR */
11231 lstrcpyA(path, "kiwi");
11232 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11233 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11234 ok(!lstrcmpA(path, "kiwi"),
11235 "Expected path to be unchanged, got \"%s\"\n", path);
11236 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11238 /* try SourceDir */
11240 lstrcpyA(path, "kiwi");
11241 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11242 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11243 ok(!lstrcmpA(path, "kiwi"),
11244 "Expected path to be unchanged, got \"%s\"\n", path);
11245 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11247 /* try SOURCEDIR */
11249 lstrcpyA(path, "kiwi");
11250 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11251 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11252 ok(!lstrcmpA(path, "kiwi"),
11253 "Expected path to be unchanged, got \"%s\"\n", path);
11254 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11256 /* source path nor the property exist */
11258 lstrcpyA(path, "kiwi");
11259 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11260 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11261 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11262 ok(size == 0, "Expected 0, got %d\n", size);
11266 lstrcpyA(path, "kiwi");
11267 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11268 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11269 ok(!lstrcmpA(path, "kiwi"),
11270 "Expected path to be unchanged, got \"%s\"\n", path);
11271 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11275 lstrcpyA(path, "kiwi");
11276 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11277 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11278 ok(!lstrcmpA(path, "kiwi"),
11279 "Expected path to be unchanged, got \"%s\"\n", path);
11280 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11282 r = MsiDoAction(hpkg, "CostInitialize");
11283 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11285 /* try TARGETDIR after CostInitialize */
11287 lstrcpyA(path, "kiwi");
11288 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11289 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11290 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11291 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11293 /* try SourceDir after CostInitialize */
11295 lstrcpyA(path, "kiwi");
11296 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);
11301 /* try SOURCEDIR after CostInitialize */
11303 lstrcpyA(path, "kiwi");
11304 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11307 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11308 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11309 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11312 /* source path does not exist, but the property exists */
11314 lstrcpyA(path, "kiwi");
11315 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11319 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11320 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11323 /* try SubDir after CostInitialize */
11325 lstrcpyA(path, "kiwi");
11326 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11327 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11328 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11329 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11331 /* try SubDir2 after CostInitialize */
11333 lstrcpyA(path, "kiwi");
11334 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11336 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11337 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11339 r = MsiDoAction(hpkg, "ResolveSource");
11340 ok(r == ERROR_SUCCESS, "file cost failed\n");
11342 /* try TARGETDIR after ResolveSource */
11344 lstrcpyA(path, "kiwi");
11345 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11347 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11348 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11350 /* try SourceDir after ResolveSource */
11352 lstrcpyA(path, "kiwi");
11353 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);
11358 /* try SOURCEDIR after ResolveSource */
11360 lstrcpyA(path, "kiwi");
11361 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11365 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11366 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11369 /* source path and the property exist */
11371 lstrcpyA(path, "kiwi");
11372 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11373 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11374 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11375 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11377 /* try SubDir after ResolveSource */
11379 lstrcpyA(path, "kiwi");
11380 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11382 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11383 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11385 /* try SubDir2 after ResolveSource */
11387 lstrcpyA(path, "kiwi");
11388 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11390 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11391 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11393 r = MsiDoAction(hpkg, "FileCost");
11394 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11396 /* try TARGETDIR after CostFinalize */
11398 lstrcpyA(path, "kiwi");
11399 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11400 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11401 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11402 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11404 /* try SourceDir after CostFinalize */
11406 lstrcpyA(path, "kiwi");
11407 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);
11412 /* try SOURCEDIR after CostFinalize */
11414 lstrcpyA(path, "kiwi");
11415 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11419 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11420 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11423 /* source path and the property exist */
11425 lstrcpyA(path, "kiwi");
11426 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11428 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11429 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11431 /* try SubDir after CostFinalize */
11433 lstrcpyA(path, "kiwi");
11434 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11436 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11437 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11439 /* try SubDir2 after CostFinalize */
11441 lstrcpyA(path, "kiwi");
11442 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11444 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11445 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11447 r = MsiDoAction(hpkg, "CostFinalize");
11448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11450 /* try TARGETDIR after CostFinalize */
11452 lstrcpyA(path, "kiwi");
11453 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11455 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11456 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11458 /* try SourceDir after CostFinalize */
11460 lstrcpyA(path, "kiwi");
11461 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);
11466 /* try SOURCEDIR after CostFinalize */
11468 lstrcpyA(path, "kiwi");
11469 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11473 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11474 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11477 /* source path and the property exist */
11479 lstrcpyA(path, "kiwi");
11480 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11482 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11483 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11485 /* try SubDir after CostFinalize */
11487 lstrcpyA(path, "kiwi");
11488 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11490 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11491 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11493 /* try SubDir2 after CostFinalize */
11495 lstrcpyA(path, "kiwi");
11496 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11498 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11499 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11501 MsiCloseHandle(hpkg);
11502 DeleteFile(msifile);
11505 static void test_shortlongsource(void)
11507 MSIHANDLE hdb, hpkg;
11508 CHAR path[MAX_PATH];
11509 CHAR cwd[MAX_PATH];
11510 CHAR subsrc[MAX_PATH];
11514 lstrcpyA(cwd, CURR_DIR);
11515 lstrcatA(cwd, "\\");
11517 lstrcpyA(subsrc, cwd);
11518 lstrcatA(subsrc, "long");
11519 lstrcatA(subsrc, "\\");
11521 /* long file names */
11523 hdb = create_package_db();
11524 ok( hdb, "failed to create database\n");
11526 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
11528 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11529 ok(r == S_OK, "failed\n");
11531 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
11532 ok(r == S_OK, "failed\n");
11534 /* CostInitialize:short */
11535 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
11536 ok(r == S_OK, "failed\n");
11538 /* CostInitialize:long */
11539 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
11540 ok(r == S_OK, "failed\n");
11542 /* FileCost:short */
11543 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
11544 ok(r == S_OK, "failed\n");
11546 /* FileCost:long */
11547 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
11548 ok(r == S_OK, "failed\n");
11550 /* CostFinalize:short */
11551 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
11552 ok(r == S_OK, "failed\n");
11554 /* CostFinalize:long */
11555 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
11556 ok(r == S_OK, "failed\n");
11558 MsiDatabaseCommit(hdb);
11560 r = package_from_db(hdb, &hpkg);
11561 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11563 skip("Not enough rights to perform tests\n");
11564 DeleteFile(msifile);
11567 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11569 MsiCloseHandle(hdb);
11571 CreateDirectoryA("one", NULL);
11572 CreateDirectoryA("four", NULL);
11574 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11576 r = MsiDoAction(hpkg, "CostInitialize");
11577 ok(r == ERROR_SUCCESS, "file cost failed\n");
11579 CreateDirectory("five", NULL);
11580 CreateDirectory("eight", NULL);
11582 r = MsiDoAction(hpkg, "FileCost");
11583 ok(r == ERROR_SUCCESS, "file cost failed\n");
11585 CreateDirectory("nine", NULL);
11586 CreateDirectory("twelve", NULL);
11588 r = MsiDoAction(hpkg, "CostFinalize");
11589 ok(r == ERROR_SUCCESS, "file cost failed\n");
11591 /* neither short nor long source directories exist */
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("short", NULL);
11601 /* short source directory exists */
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 CreateDirectoryA("long", NULL);
11611 /* both short and long source directories exist */
11613 lstrcpyA(path, "kiwi");
11614 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11616 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11617 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11619 lstrcpyA(subsrc, cwd);
11620 lstrcatA(subsrc, "two");
11621 lstrcatA(subsrc, "\\");
11623 /* short dir exists before CostInitialize */
11625 lstrcpyA(path, "kiwi");
11626 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11628 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11629 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11631 lstrcpyA(subsrc, cwd);
11632 lstrcatA(subsrc, "four");
11633 lstrcatA(subsrc, "\\");
11635 /* long dir exists before CostInitialize */
11637 lstrcpyA(path, "kiwi");
11638 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11640 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11641 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11643 lstrcpyA(subsrc, cwd);
11644 lstrcatA(subsrc, "six");
11645 lstrcatA(subsrc, "\\");
11647 /* short dir exists before FileCost */
11649 lstrcpyA(path, "kiwi");
11650 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11652 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11653 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11655 lstrcpyA(subsrc, cwd);
11656 lstrcatA(subsrc, "eight");
11657 lstrcatA(subsrc, "\\");
11659 /* long dir exists before FileCost */
11661 lstrcpyA(path, "kiwi");
11662 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11664 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11665 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11667 lstrcpyA(subsrc, cwd);
11668 lstrcatA(subsrc, "ten");
11669 lstrcatA(subsrc, "\\");
11671 /* short dir exists before CostFinalize */
11673 lstrcpyA(path, "kiwi");
11674 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11676 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11677 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11679 lstrcpyA(subsrc, cwd);
11680 lstrcatA(subsrc, "twelve");
11681 lstrcatA(subsrc, "\\");
11683 /* long dir exists before CostFinalize */
11685 lstrcpyA(path, "kiwi");
11686 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11687 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11688 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11689 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11691 MsiCloseHandle(hpkg);
11692 RemoveDirectoryA("short");
11693 RemoveDirectoryA("long");
11694 RemoveDirectoryA("one");
11695 RemoveDirectoryA("four");
11696 RemoveDirectoryA("five");
11697 RemoveDirectoryA("eight");
11698 RemoveDirectoryA("nine");
11699 RemoveDirectoryA("twelve");
11701 /* short file names */
11703 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11704 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11706 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
11708 r = package_from_db(hdb, &hpkg);
11709 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11711 MsiCloseHandle(hdb);
11713 CreateDirectoryA("one", NULL);
11714 CreateDirectoryA("four", NULL);
11716 r = MsiDoAction(hpkg, "CostInitialize");
11717 ok(r == ERROR_SUCCESS, "file cost failed\n");
11719 CreateDirectory("five", NULL);
11720 CreateDirectory("eight", NULL);
11722 r = MsiDoAction(hpkg, "FileCost");
11723 ok(r == ERROR_SUCCESS, "file cost failed\n");
11725 CreateDirectory("nine", NULL);
11726 CreateDirectory("twelve", NULL);
11728 r = MsiDoAction(hpkg, "CostFinalize");
11729 ok(r == ERROR_SUCCESS, "file cost failed\n");
11731 lstrcpyA(subsrc, cwd);
11732 lstrcatA(subsrc, "short");
11733 lstrcatA(subsrc, "\\");
11735 /* neither short nor long source directories exist */
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("short", NULL);
11745 /* short source directory exists */
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 CreateDirectoryA("long", NULL);
11755 /* both short and long source directories exist */
11757 lstrcpyA(path, "kiwi");
11758 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11759 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11760 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11761 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11763 lstrcpyA(subsrc, cwd);
11764 lstrcatA(subsrc, "one");
11765 lstrcatA(subsrc, "\\");
11767 /* short dir exists before CostInitialize */
11769 lstrcpyA(path, "kiwi");
11770 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11772 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11773 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11775 lstrcpyA(subsrc, cwd);
11776 lstrcatA(subsrc, "three");
11777 lstrcatA(subsrc, "\\");
11779 /* long dir exists before CostInitialize */
11781 lstrcpyA(path, "kiwi");
11782 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11784 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11785 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11787 lstrcpyA(subsrc, cwd);
11788 lstrcatA(subsrc, "five");
11789 lstrcatA(subsrc, "\\");
11791 /* short dir exists before FileCost */
11793 lstrcpyA(path, "kiwi");
11794 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11796 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11797 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11799 lstrcpyA(subsrc, cwd);
11800 lstrcatA(subsrc, "seven");
11801 lstrcatA(subsrc, "\\");
11803 /* long dir exists before FileCost */
11805 lstrcpyA(path, "kiwi");
11806 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11807 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11808 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11809 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11811 lstrcpyA(subsrc, cwd);
11812 lstrcatA(subsrc, "nine");
11813 lstrcatA(subsrc, "\\");
11815 /* short dir exists before CostFinalize */
11817 lstrcpyA(path, "kiwi");
11818 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11819 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11820 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11821 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11823 lstrcpyA(subsrc, cwd);
11824 lstrcatA(subsrc, "eleven");
11825 lstrcatA(subsrc, "\\");
11827 /* long dir exists before CostFinalize */
11829 lstrcpyA(path, "kiwi");
11830 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11832 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11833 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11835 MsiCloseHandle(hpkg);
11836 RemoveDirectoryA("short");
11837 RemoveDirectoryA("long");
11838 RemoveDirectoryA("one");
11839 RemoveDirectoryA("four");
11840 RemoveDirectoryA("five");
11841 RemoveDirectoryA("eight");
11842 RemoveDirectoryA("nine");
11843 RemoveDirectoryA("twelve");
11844 DeleteFileA(msifile);
11847 static void test_sourcedir(void)
11849 MSIHANDLE hdb, hpkg;
11851 CHAR path[MAX_PATH];
11852 CHAR cwd[MAX_PATH];
11853 CHAR subsrc[MAX_PATH];
11857 lstrcpyA(cwd, CURR_DIR);
11858 lstrcatA(cwd, "\\");
11860 lstrcpyA(subsrc, cwd);
11861 lstrcatA(subsrc, "long");
11862 lstrcatA(subsrc, "\\");
11864 hdb = create_package_db();
11865 ok( hdb, "failed to create database\n");
11867 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11868 ok(r == S_OK, "failed\n");
11870 sprintf(package, "#%u", hdb);
11871 r = MsiOpenPackage(package, &hpkg);
11872 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11874 skip("Not enough rights to perform tests\n");
11877 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11879 /* properties only */
11881 /* SourceDir prop */
11883 lstrcpyA(path, "kiwi");
11884 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11885 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11886 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11887 ok(size == 0, "Expected 0, got %d\n", size);
11889 /* SOURCEDIR prop */
11891 lstrcpyA(path, "kiwi");
11892 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11893 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11894 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11895 ok(size == 0, "Expected 0, got %d\n", size);
11897 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11899 r = MsiDoAction(hpkg, "CostInitialize");
11900 ok(r == ERROR_SUCCESS, "file cost failed\n");
11902 /* SourceDir after CostInitialize */
11904 lstrcpyA(path, "kiwi");
11905 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11906 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11907 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11908 ok(size == 0, "Expected 0, got %d\n", size);
11910 /* SOURCEDIR after CostInitialize */
11912 lstrcpyA(path, "kiwi");
11913 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11915 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11916 ok(size == 0, "Expected 0, got %d\n", size);
11918 r = MsiDoAction(hpkg, "FileCost");
11919 ok(r == ERROR_SUCCESS, "file cost failed\n");
11921 /* SourceDir after FileCost */
11923 lstrcpyA(path, "kiwi");
11924 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11925 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11926 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11927 ok(size == 0, "Expected 0, got %d\n", size);
11929 /* SOURCEDIR after FileCost */
11931 lstrcpyA(path, "kiwi");
11932 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11933 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11934 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11935 ok(size == 0, "Expected 0, got %d\n", size);
11937 r = MsiDoAction(hpkg, "CostFinalize");
11938 ok(r == ERROR_SUCCESS, "file cost failed\n");
11940 /* SourceDir after CostFinalize */
11942 lstrcpyA(path, "kiwi");
11943 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11944 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11945 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11946 ok(size == 0, "Expected 0, got %d\n", size);
11948 /* SOURCEDIR after CostFinalize */
11950 lstrcpyA(path, "kiwi");
11951 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11952 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11953 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11954 ok(size == 0, "Expected 0, got %d\n", size);
11957 lstrcpyA(path, "kiwi");
11958 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11959 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11960 ok(!lstrcmpA(path, "kiwi"), "Expected \"kiwi\", got \"%s\"\n", path);
11961 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
11963 /* SOURCEDIR after calling MsiGetSourcePath */
11965 lstrcpyA(path, "kiwi");
11966 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11967 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11969 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11970 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11973 r = MsiDoAction(hpkg, "ResolveSource");
11974 ok(r == ERROR_SUCCESS, "file cost failed\n");
11976 /* SourceDir after ResolveSource */
11978 lstrcpyA(path, "kiwi");
11979 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11981 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11982 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11984 /* SOURCEDIR after ResolveSource */
11986 lstrcpyA(path, "kiwi");
11987 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11988 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11989 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11990 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11992 /* random casing */
11994 lstrcpyA(path, "kiwi");
11995 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
11996 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11997 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11998 ok(size == 0, "Expected 0, got %d\n", size);
12000 MsiCloseHandle(hpkg);
12002 /* reset the package state */
12003 sprintf(package, "#%i", hdb);
12004 r = MsiOpenPackage(package, &hpkg);
12005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12007 /* test how MsiGetSourcePath affects the properties */
12009 /* SourceDir prop */
12011 lstrcpyA(path, "kiwi");
12012 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12013 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12016 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12017 ok(size == 0, "Expected 0, got %d\n", size);
12021 lstrcpyA(path, "kiwi");
12022 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
12023 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12024 ok(!lstrcmpA(path, "kiwi"),
12025 "Expected path to be unchanged, got \"%s\"\n", path);
12026 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12028 /* SourceDir after MsiGetSourcePath */
12030 lstrcpyA(path, "kiwi");
12031 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12035 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12036 ok(size == 0, "Expected 0, got %d\n", size);
12039 /* SOURCEDIR prop */
12041 lstrcpyA(path, "kiwi");
12042 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12043 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12046 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12047 ok(size == 0, "Expected 0, got %d\n", size);
12051 lstrcpyA(path, "kiwi");
12052 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12053 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12054 ok(!lstrcmpA(path, "kiwi"),
12055 "Expected path to be unchanged, got \"%s\"\n", path);
12056 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12058 /* SOURCEDIR prop after MsiGetSourcePath */
12060 lstrcpyA(path, "kiwi");
12061 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12062 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12065 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12066 ok(size == 0, "Expected 0, got %d\n", size);
12069 r = MsiDoAction(hpkg, "CostInitialize");
12070 ok(r == ERROR_SUCCESS, "file cost failed\n");
12072 /* SourceDir after CostInitialize */
12074 lstrcpyA(path, "kiwi");
12075 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12079 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12080 ok(size == 0, "Expected 0, got %d\n", size);
12084 lstrcpyA(path, "kiwi");
12085 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
12086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12087 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12088 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12090 /* SourceDir after MsiGetSourcePath */
12092 lstrcpyA(path, "kiwi");
12093 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12094 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12095 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12096 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12098 /* SOURCEDIR after CostInitialize */
12100 lstrcpyA(path, "kiwi");
12101 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12103 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12104 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12106 /* SOURCEDIR source path still does not exist */
12108 lstrcpyA(path, "kiwi");
12109 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12110 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12111 ok(!lstrcmpA(path, "kiwi"),
12112 "Expected path to be unchanged, got \"%s\"\n", path);
12113 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12115 r = MsiDoAction(hpkg, "FileCost");
12116 ok(r == ERROR_SUCCESS, "file cost failed\n");
12118 /* SourceDir after FileCost */
12120 lstrcpyA(path, "kiwi");
12121 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12122 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12123 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12124 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12126 /* SOURCEDIR after FileCost */
12128 lstrcpyA(path, "kiwi");
12129 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12131 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12132 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12134 /* SOURCEDIR source path still does not exist */
12136 lstrcpyA(path, "kiwi");
12137 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12138 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12139 ok(!lstrcmpA(path, "kiwi"),
12140 "Expected path to be unchanged, got \"%s\"\n", path);
12141 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12143 r = MsiDoAction(hpkg, "CostFinalize");
12144 ok(r == ERROR_SUCCESS, "file cost failed\n");
12146 /* SourceDir after CostFinalize */
12148 lstrcpyA(path, "kiwi");
12149 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12151 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12152 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12154 /* SOURCEDIR after CostFinalize */
12156 lstrcpyA(path, "kiwi");
12157 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12158 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12159 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12160 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12162 /* SOURCEDIR source path still does not exist */
12164 lstrcpyA(path, "kiwi");
12165 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12166 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12167 ok(!lstrcmpA(path, "kiwi"),
12168 "Expected path to be unchanged, got \"%s\"\n", path);
12169 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12171 r = MsiDoAction(hpkg, "ResolveSource");
12172 ok(r == ERROR_SUCCESS, "file cost failed\n");
12174 /* SourceDir after ResolveSource */
12176 lstrcpyA(path, "kiwi");
12177 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12179 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12180 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12182 /* SOURCEDIR after ResolveSource */
12184 lstrcpyA(path, "kiwi");
12185 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12186 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12187 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12188 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12190 /* SOURCEDIR source path still does not exist */
12192 lstrcpyA(path, "kiwi");
12193 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12194 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12195 ok(!lstrcmpA(path, "kiwi"),
12196 "Expected path to be unchanged, got \"%s\"\n", path);
12197 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12199 MsiCloseHandle(hpkg);
12202 MsiCloseHandle(hdb);
12203 DeleteFileA(msifile);
12213 static const struct access_res create[16] =
12215 { TRUE, ERROR_SUCCESS, TRUE },
12216 { TRUE, ERROR_SUCCESS, TRUE },
12217 { TRUE, ERROR_SUCCESS, FALSE },
12218 { TRUE, ERROR_SUCCESS, FALSE },
12219 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12220 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12221 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12222 { TRUE, ERROR_SUCCESS, FALSE },
12223 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12224 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12225 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12226 { TRUE, ERROR_SUCCESS, TRUE },
12227 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12228 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12229 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12230 { TRUE, ERROR_SUCCESS, TRUE }
12233 static const struct access_res create_commit[16] =
12235 { TRUE, ERROR_SUCCESS, TRUE },
12236 { TRUE, ERROR_SUCCESS, TRUE },
12237 { TRUE, ERROR_SUCCESS, FALSE },
12238 { TRUE, ERROR_SUCCESS, FALSE },
12239 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12240 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12241 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12242 { TRUE, ERROR_SUCCESS, FALSE },
12243 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12244 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12245 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12246 { TRUE, ERROR_SUCCESS, TRUE },
12247 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12248 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12249 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12250 { TRUE, ERROR_SUCCESS, TRUE }
12253 static const struct access_res create_close[16] =
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, FALSE },
12261 { TRUE, ERROR_SUCCESS, FALSE },
12262 { TRUE, ERROR_SUCCESS, FALSE },
12263 { TRUE, ERROR_SUCCESS, FALSE },
12264 { TRUE, ERROR_SUCCESS, FALSE },
12265 { TRUE, ERROR_SUCCESS, FALSE },
12266 { TRUE, ERROR_SUCCESS, FALSE },
12267 { TRUE, ERROR_SUCCESS, FALSE },
12268 { TRUE, ERROR_SUCCESS, FALSE },
12269 { TRUE, ERROR_SUCCESS, FALSE },
12270 { TRUE, ERROR_SUCCESS }
12273 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
12275 DWORD access = 0, share = 0;
12280 for (i = 0; i < 4; i++)
12282 if (i == 0) access = 0;
12283 if (i == 1) access = GENERIC_READ;
12284 if (i == 2) access = GENERIC_WRITE;
12285 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
12287 for (j = 0; j < 4; j++)
12289 if (ares[idx].ignore)
12292 if (j == 0) share = 0;
12293 if (j == 1) share = FILE_SHARE_READ;
12294 if (j == 2) share = FILE_SHARE_WRITE;
12295 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
12297 SetLastError(0xdeadbeef);
12298 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
12299 FILE_ATTRIBUTE_NORMAL, 0);
12300 lasterr = GetLastError();
12302 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
12303 "(%d, handle, %d): Expected %d, got %d\n",
12304 line, idx, ares[idx].gothandle,
12305 (hfile != INVALID_HANDLE_VALUE));
12307 ok(lasterr == ares[idx].lasterr ||
12308 lasterr == 0xdeadbeef, /* win9x */
12309 "(%d, lasterr, %d): Expected %d, got %d\n",
12310 line, idx, ares[idx].lasterr, lasterr);
12312 CloseHandle(hfile);
12318 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
12320 static void test_access(void)
12325 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
12326 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12328 test_file_access(msifile, create);
12330 r = MsiDatabaseCommit(hdb);
12331 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12333 test_file_access(msifile, create_commit);
12334 MsiCloseHandle(hdb);
12336 test_file_access(msifile, create_close);
12337 DeleteFileA(msifile);
12339 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
12340 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12342 test_file_access(msifile, create);
12344 r = MsiDatabaseCommit(hdb);
12345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12347 test_file_access(msifile, create_commit);
12348 MsiCloseHandle(hdb);
12350 test_file_access(msifile, create_close);
12351 DeleteFileA(msifile);
12354 static void test_emptypackage(void)
12356 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
12357 MSIHANDLE hview = 0, hrec = 0;
12358 MSICONDITION condition;
12359 CHAR buffer[MAX_PATH];
12363 r = MsiOpenPackageA("", &hpkg);
12364 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12366 skip("Not enough rights to perform tests\n");
12371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12374 hdb = MsiGetActiveDatabase(hpkg);
12377 ok(hdb != 0, "Expected a valid database handle\n");
12380 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
12383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12385 r = MsiViewExecute(hview, 0);
12388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12391 r = MsiViewFetch(hview, &hrec);
12394 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12399 r = MsiRecordGetString(hrec, 1, buffer, &size);
12402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12403 ok(!lstrcmpA(buffer, "_Property"),
12404 "Expected \"_Property\", got \"%s\"\n", buffer);
12407 MsiCloseHandle(hrec);
12409 r = MsiViewFetch(hview, &hrec);
12412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12416 r = MsiRecordGetString(hrec, 1, buffer, &size);
12419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12420 ok(!lstrcmpA(buffer, "#_FolderCache"),
12421 "Expected \"_Property\", got \"%s\"\n", buffer);
12424 MsiCloseHandle(hrec);
12425 MsiViewClose(hview);
12426 MsiCloseHandle(hview);
12428 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
12431 ok(condition == MSICONDITION_FALSE,
12432 "Expected MSICONDITION_FALSE, got %d\n", condition);
12435 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
12438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12440 r = MsiViewExecute(hview, 0);
12443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12446 /* _Property table is not empty */
12447 r = MsiViewFetch(hview, &hrec);
12450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12453 MsiCloseHandle(hrec);
12454 MsiViewClose(hview);
12455 MsiCloseHandle(hview);
12457 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
12460 ok(condition == MSICONDITION_FALSE,
12461 "Expected MSICONDITION_FALSE, got %d\n", condition);
12464 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
12467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12469 r = MsiViewExecute(hview, 0);
12472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12475 /* #_FolderCache is not empty */
12476 r = MsiViewFetch(hview, &hrec);
12479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12482 MsiCloseHandle(hrec);
12483 MsiViewClose(hview);
12484 MsiCloseHandle(hview);
12486 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
12489 ok(r == ERROR_BAD_QUERY_SYNTAX,
12490 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12493 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
12496 ok(r == ERROR_BAD_QUERY_SYNTAX,
12497 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12500 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
12503 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
12504 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
12507 MsiCloseHandle(hsuminfo);
12509 r = MsiDatabaseCommit(hdb);
12512 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12515 MsiCloseHandle(hdb);
12516 MsiCloseHandle(hpkg);
12519 static void test_MsiGetProductProperty(void)
12521 MSIHANDLE hprod, hdb;
12522 CHAR val[MAX_PATH];
12523 CHAR path[MAX_PATH];
12524 CHAR query[MAX_PATH];
12525 CHAR keypath[MAX_PATH*2];
12526 CHAR prodcode[MAX_PATH];
12527 CHAR prod_squashed[MAX_PATH];
12528 HKEY prodkey, userkey, props;
12533 REGSAM access = KEY_ALL_ACCESS;
12535 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
12536 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
12538 win_skip("Different registry keys on Win9x and WinMe\n");
12541 CloseServiceHandle(scm);
12543 GetCurrentDirectoryA(MAX_PATH, path);
12544 lstrcatA(path, "\\");
12546 create_test_guid(prodcode, prod_squashed);
12549 access |= KEY_WOW64_64KEY;
12551 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
12552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12554 r = MsiDatabaseCommit(hdb);
12555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12557 r = set_summary_info(hdb);
12558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12561 "CREATE TABLE `Directory` ( "
12562 "`Directory` CHAR(255) NOT NULL, "
12563 "`Directory_Parent` CHAR(255), "
12564 "`DefaultDir` CHAR(255) NOT NULL "
12565 "PRIMARY KEY `Directory`)");
12566 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12569 "CREATE TABLE `Property` ( "
12570 "`Property` CHAR(72) NOT NULL, "
12571 "`Value` CHAR(255) "
12572 "PRIMARY KEY `Property`)");
12573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12575 sprintf(query, "INSERT INTO `Property` "
12576 "(`Property`, `Value`) "
12577 "VALUES( 'ProductCode', '%s' )", prodcode);
12578 r = run_query(hdb, query);
12579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12581 r = MsiDatabaseCommit(hdb);
12582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12584 MsiCloseHandle(hdb);
12586 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
12587 lstrcatA(keypath, prod_squashed);
12589 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL);
12590 if (res == ERROR_ACCESS_DENIED)
12592 skip("Not enough rights to perform tests\n");
12593 DeleteFile(msifile);
12596 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12598 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
12599 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
12600 lstrcatA(keypath, prod_squashed);
12602 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL);
12603 if (res == ERROR_ACCESS_DENIED)
12605 skip("Not enough rights to perform tests\n");
12606 RegDeleteKeyA(prodkey, "");
12607 RegCloseKey(prodkey);
12610 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12612 res = RegCreateKeyExA(userkey, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
12613 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12615 lstrcpyA(val, path);
12616 lstrcatA(val, "\\");
12617 lstrcatA(val, msifile);
12618 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
12619 (const BYTE *)val, lstrlenA(val) + 1);
12620 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12622 hprod = 0xdeadbeef;
12623 r = MsiOpenProductA(prodcode, &hprod);
12624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12625 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
12627 /* hProduct is invalid */
12629 lstrcpyA(val, "apple");
12630 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
12631 ok(r == ERROR_INVALID_HANDLE,
12632 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12633 ok(!lstrcmpA(val, "apple"),
12634 "Expected val to be unchanged, got \"%s\"\n", val);
12635 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12637 /* szProperty is NULL */
12639 lstrcpyA(val, "apple");
12640 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
12641 ok(r == ERROR_INVALID_PARAMETER,
12642 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12643 ok(!lstrcmpA(val, "apple"),
12644 "Expected val to be unchanged, got \"%s\"\n", val);
12645 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12647 /* szProperty is empty */
12649 lstrcpyA(val, "apple");
12650 r = MsiGetProductPropertyA(hprod, "", val, &size);
12651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12652 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12653 ok(size == 0, "Expected 0, got %d\n", size);
12655 /* get the property */
12657 lstrcpyA(val, "apple");
12658 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12659 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12660 ok(!lstrcmpA(val, prodcode),
12661 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12662 ok(size == lstrlenA(prodcode),
12663 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12665 /* lpValueBuf is NULL */
12667 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
12668 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12669 ok(size == lstrlenA(prodcode),
12670 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12672 /* pcchValueBuf is NULL */
12673 lstrcpyA(val, "apple");
12674 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
12675 ok(r == ERROR_INVALID_PARAMETER,
12676 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12677 ok(!lstrcmpA(val, "apple"),
12678 "Expected val to be unchanged, got \"%s\"\n", val);
12679 ok(size == lstrlenA(prodcode),
12680 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12682 /* pcchValueBuf is too small */
12684 lstrcpyA(val, "apple");
12685 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12686 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12687 ok(!strncmp(val, prodcode, 3),
12688 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
12689 ok(size == lstrlenA(prodcode),
12690 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12692 /* pcchValueBuf does not leave room for NULL terminator */
12693 size = lstrlenA(prodcode);
12694 lstrcpyA(val, "apple");
12695 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12696 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12697 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
12698 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
12699 ok(size == lstrlenA(prodcode),
12700 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12702 /* pcchValueBuf has enough room for NULL terminator */
12703 size = lstrlenA(prodcode) + 1;
12704 lstrcpyA(val, "apple");
12705 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12707 ok(!lstrcmpA(val, prodcode),
12708 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12709 ok(size == lstrlenA(prodcode),
12710 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12712 /* nonexistent property */
12714 lstrcpyA(val, "apple");
12715 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
12716 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12717 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12718 ok(size == 0, "Expected 0, got %d\n", size);
12720 r = MsiSetPropertyA(hprod, "NewProperty", "value");
12721 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12723 /* non-product property set */
12725 lstrcpyA(val, "apple");
12726 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
12727 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12728 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12729 ok(size == 0, "Expected 0, got %d\n", size);
12731 r = MsiSetPropertyA(hprod, "ProductCode", "value");
12732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12734 /* non-product property that is also a product property set */
12736 lstrcpyA(val, "apple");
12737 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12738 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12739 ok(!lstrcmpA(val, prodcode),
12740 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12741 ok(size == lstrlenA(prodcode),
12742 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12744 MsiCloseHandle(hprod);
12746 RegDeleteValueA(props, "LocalPackage");
12747 delete_key(props, "", access);
12748 RegCloseKey(props);
12749 delete_key(userkey, "", access);
12750 RegCloseKey(userkey);
12751 delete_key(prodkey, "", access);
12752 RegCloseKey(prodkey);
12753 DeleteFileA(msifile);
12756 static void test_MsiSetProperty(void)
12758 MSIHANDLE hpkg, hdb, hrec;
12759 CHAR buf[MAX_PATH];
12764 r = package_from_db(create_package_db(), &hpkg);
12765 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12767 skip("Not enough rights to perform tests\n");
12768 DeleteFile(msifile);
12771 ok(r == ERROR_SUCCESS, "Expected a valid package %u\n", r);
12773 /* invalid hInstall */
12774 r = MsiSetPropertyA(0, "Prop", "Val");
12775 ok(r == ERROR_INVALID_HANDLE,
12776 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12778 /* invalid hInstall */
12779 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12780 ok(r == ERROR_INVALID_HANDLE,
12781 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12783 /* szName is NULL */
12784 r = MsiSetPropertyA(hpkg, NULL, "Val");
12785 ok(r == ERROR_INVALID_PARAMETER,
12786 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12788 /* both szName and szValue are NULL */
12789 r = MsiSetPropertyA(hpkg, NULL, NULL);
12790 ok(r == ERROR_INVALID_PARAMETER,
12791 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12793 /* szName is empty */
12794 r = MsiSetPropertyA(hpkg, "", "Val");
12795 ok(r == ERROR_FUNCTION_FAILED,
12796 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
12798 /* szName is empty and szValue is NULL */
12799 r = MsiSetPropertyA(hpkg, "", NULL);
12800 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12802 /* set a property */
12803 r = MsiSetPropertyA(hpkg, "Prop", "Val");
12804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12806 /* get the property */
12808 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12810 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
12811 ok(size == 3, "Expected 3, got %d\n", size);
12813 /* update the property */
12814 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
12815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12817 /* get the property */
12819 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12820 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12821 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
12822 ok(size == 4, "Expected 4, got %d\n", size);
12824 hdb = MsiGetActiveDatabase(hpkg);
12825 ok(hdb != 0, "Expected a valid database handle\n");
12827 /* set prop is not in the _Property table */
12828 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12829 r = do_query(hdb, query, &hrec);
12830 ok(r == ERROR_BAD_QUERY_SYNTAX,
12831 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12833 /* set prop is not in the Property table */
12834 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12835 r = do_query(hdb, query, &hrec);
12836 ok(r == ERROR_BAD_QUERY_SYNTAX,
12837 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12839 MsiCloseHandle(hdb);
12841 /* szValue is an empty string */
12842 r = MsiSetPropertyA(hpkg, "Prop", "");
12843 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12845 /* try to get the property */
12847 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12849 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12850 ok(size == 0, "Expected 0, got %d\n", size);
12852 /* reset the property */
12853 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
12854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12856 /* delete the property */
12857 r = MsiSetPropertyA(hpkg, "Prop", NULL);
12858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12860 /* try to get the property */
12862 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12864 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12865 ok(size == 0, "Expected 0, got %d\n", size);
12867 MsiCloseHandle(hpkg);
12868 DeleteFileA(msifile);
12871 static void test_MsiApplyMultiplePatches(void)
12873 UINT r, type = GetDriveType(NULL);
12875 if (!pMsiApplyMultiplePatchesA) {
12876 win_skip("MsiApplyMultiplePatchesA not found\n");
12880 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
12881 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12883 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
12884 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12886 r = pMsiApplyMultiplePatchesA(";", 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(" ;", NULL, NULL);
12893 if (type == DRIVE_FIXED)
12894 todo_wine ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED, "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
12896 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12898 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
12899 if (type == DRIVE_FIXED)
12900 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12902 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12904 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
12905 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12907 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
12908 if (type == DRIVE_FIXED)
12909 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12911 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12913 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
12914 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12916 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
12917 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12920 static void test_MsiApplyPatch(void)
12924 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
12925 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12927 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
12928 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12931 START_TEST(package)
12933 STATEMGRSTATUS status;
12936 init_functionpointers();
12938 if (pIsWow64Process)
12939 pIsWow64Process(GetCurrentProcess(), &is_wow64);
12941 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
12943 /* Create a restore point ourselves so we circumvent the multitude of restore points
12944 * that would have been created by all the installation and removal tests.
12946 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
12947 * creation of restore points.
12949 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
12951 memset(&status, 0, sizeof(status));
12952 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
12955 test_createpackage();
12957 test_gettargetpath_bad();
12958 test_settargetpath();
12960 test_property_table();
12963 test_formatrecord2();
12965 test_getproperty();
12966 test_removefiles();
12968 test_appsearch_complocator();
12969 test_appsearch_reglocator();
12970 test_appsearch_inilocator();
12971 test_appsearch_drlocator();
12972 test_featureparents();
12973 test_installprops();
12974 test_launchconditions();
12976 test_complocator();
12977 test_MsiGetSourcePath();
12978 test_shortlongsource();
12981 test_emptypackage();
12982 test_MsiGetProductProperty();
12983 test_MsiSetProperty();
12984 test_MsiApplyMultiplePatches();
12985 test_MsiApplyPatch();
12987 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
12989 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
12991 remove_restore_point(status.llSequenceNumber);