2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include <srrestoreptapi.h>
32 #include "wine/test.h"
35 static const char msifile[] = "winetest-package.msi";
36 static char CURR_DIR[MAX_PATH];
38 static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
39 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
40 static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
42 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
43 static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
44 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
45 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
46 static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
47 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
48 static void (WINAPI *pGetSystemInfo)(LPSYSTEM_INFO);
49 static void (WINAPI *pGetNativeSystemInfo)(LPSYSTEM_INFO);
50 static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR, UINT);
52 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
53 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
55 static void init_functionpointers(void)
57 HMODULE hmsi = GetModuleHandleA("msi.dll");
58 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
59 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
60 HMODULE hshell32 = GetModuleHandleA("shell32.dll");
63 #define GET_PROC(mod, func) \
64 p ## func = (void*)GetProcAddress(mod, #func);
66 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
67 GET_PROC(hmsi, MsiGetComponentPathExA);
68 GET_PROC(hshell32, SHGetFolderPathA);
70 GET_PROC(hadvapi32, ConvertSidToStringSidA);
71 GET_PROC(hadvapi32, GetTokenInformation);
72 GET_PROC(hadvapi32, OpenProcessToken);
73 GET_PROC(hadvapi32, RegDeleteKeyExA)
74 GET_PROC(hadvapi32, RegDeleteKeyExW)
75 GET_PROC(hkernel32, IsWow64Process)
76 GET_PROC(hkernel32, GetNativeSystemInfo)
77 GET_PROC(hkernel32, GetSystemInfo)
78 GET_PROC(hkernel32, GetSystemWow64DirectoryA)
80 hsrclient = LoadLibraryA("srclient.dll");
81 GET_PROC(hsrclient, SRRemoveRestorePoint);
82 GET_PROC(hsrclient, SRSetRestorePointA);
86 static BOOL is_process_limited(void)
90 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
92 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
95 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
98 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
100 return (ret && type == TokenElevationTypeLimited);
105 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
107 if (pRegDeleteKeyExA)
108 return pRegDeleteKeyExA( key, subkey, access, 0 );
109 return RegDeleteKeyA( key, subkey );
112 static char *get_user_sid(void)
117 char *usersid = NULL;
119 if (!pConvertSidToStringSidA)
121 win_skip("ConvertSidToStringSidA is not available\n");
124 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
125 GetTokenInformation(token, TokenUser, NULL, size, &size);
127 user = HeapAlloc(GetProcessHeap(), 0, size);
128 GetTokenInformation(token, TokenUser, user, size, &size);
129 pConvertSidToStringSidA(user->User.Sid, &usersid);
130 HeapFree(GetProcessHeap(), 0, user);
136 /* RegDeleteTreeW from dlls/advapi32/registry.c */
137 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM access)
140 DWORD dwMaxSubkeyLen, dwMaxValueLen;
141 DWORD dwMaxLen, dwSize;
142 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
147 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, access, &hSubKey);
151 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
152 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
153 if (ret) goto cleanup;
157 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
158 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
160 /* Name too big: alloc a buffer for it */
161 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
163 ret = ERROR_NOT_ENOUGH_MEMORY;
168 /* Recursively delete all the subkeys */
172 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
173 NULL, NULL, NULL)) break;
175 ret = package_RegDeleteTreeW(hSubKey, lpszName, access);
176 if (ret) goto cleanup;
181 if (pRegDeleteKeyExW)
182 ret = pRegDeleteKeyExW(hKey, lpszSubKey, access, 0);
184 ret = RegDeleteKeyW(hKey, lpszSubKey);
190 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
191 NULL, NULL, NULL, NULL)) break;
193 ret = RegDeleteValueW(hKey, lpszName);
194 if (ret) goto cleanup;
198 if (lpszName != szNameBuf)
199 HeapFree(GetProcessHeap(), 0, lpszName);
201 RegCloseKey(hSubKey);
205 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
210 if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid)))
224 out[17+i*2] = in[n++];
225 out[16+i*2] = in[n++];
230 out[17+i*2] = in[n++];
231 out[16+i*2] = in[n++];
237 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
239 WCHAR guidW[MAX_PATH];
240 WCHAR squashedW[MAX_PATH];
245 hr = CoCreateGuid(&guid);
246 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
248 size = StringFromGUID2(&guid, guidW, MAX_PATH);
249 ok(size == 39, "Expected 39, got %d\n", hr);
251 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
252 squash_guid(guidW, squashedW);
253 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
256 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
257 LPCSTR guid, LPSTR usersid, BOOL dir)
259 WCHAR guidW[MAX_PATH];
260 WCHAR squashedW[MAX_PATH];
261 CHAR squashed[MAX_PATH];
262 CHAR comppath[MAX_PATH];
263 CHAR prodpath[MAX_PATH];
267 REGSAM access = KEY_ALL_ACCESS;
270 access |= KEY_WOW64_64KEY;
272 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
273 squash_guid(guidW, squashedW);
274 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
276 if (context == MSIINSTALLCONTEXT_MACHINE)
278 prod = "3D0DAE300FACA1300AD792060BCDAA92";
280 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
281 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
283 "SOFTWARE\\Classes\\Installer\\"
284 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
286 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
288 prod = "7D2F387510109040002000060BECB6AB";
290 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
291 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
293 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
294 "Installer\\%s\\Installer\\Products\\"
295 "7D2F387510109040002000060BECB6AB", usersid);
297 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
299 prod = "7D2F387510109040002000060BECB6AB";
301 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
302 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
304 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
305 "Installer\\Managed\\%s\\Installer\\Products\\"
306 "7D2F387510109040002000060BECB6AB", usersid);
309 RegCreateKeyExA(HKEY_LOCAL_MACHINE, comppath, 0, NULL, 0, access, NULL, &hkey, NULL);
311 lstrcpyA(path, CURR_DIR);
312 lstrcatA(path, "\\");
313 if (!dir) lstrcatA(path, filename);
315 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
318 RegCreateKeyExA(HKEY_LOCAL_MACHINE, prodpath, 0, NULL, 0, access, NULL, &hkey, NULL);
322 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
324 WCHAR guidW[MAX_PATH];
325 WCHAR squashedW[MAX_PATH];
326 WCHAR substrW[MAX_PATH];
327 CHAR squashed[MAX_PATH];
328 CHAR comppath[MAX_PATH];
329 CHAR prodpath[MAX_PATH];
330 REGSAM access = KEY_ALL_ACCESS;
333 access |= KEY_WOW64_64KEY;
335 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
336 squash_guid(guidW, squashedW);
337 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
339 if (context == MSIINSTALLCONTEXT_MACHINE)
342 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
343 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
345 "SOFTWARE\\Classes\\Installer\\"
346 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
348 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
351 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
352 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
354 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
355 "Installer\\%s\\Installer\\Products\\"
356 "7D2F387510109040002000060BECB6AB", usersid);
358 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
361 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
362 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
364 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
365 "Installer\\Managed\\%s\\Installer\\Products\\"
366 "7D2F387510109040002000060BECB6AB", usersid);
369 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
370 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
372 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
373 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
376 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
381 /* open a select query */
382 r = MsiDatabaseOpenView(hdb, query, &hview);
383 if (r != ERROR_SUCCESS)
385 r = MsiViewExecute(hview, 0);
386 if (r != ERROR_SUCCESS)
388 ret = MsiViewFetch(hview, phrec);
389 r = MsiViewClose(hview);
390 if (r != ERROR_SUCCESS)
392 r = MsiCloseHandle(hview);
393 if (r != ERROR_SUCCESS)
398 static UINT run_query( MSIHANDLE hdb, const char *query )
403 r = MsiDatabaseOpenView(hdb, query, &hview);
404 if( r != ERROR_SUCCESS )
407 r = MsiViewExecute(hview, 0);
408 if( r == ERROR_SUCCESS )
409 r = MsiViewClose(hview);
410 MsiCloseHandle(hview);
414 static UINT create_component_table( MSIHANDLE hdb )
416 return run_query( hdb,
417 "CREATE TABLE `Component` ( "
418 "`Component` CHAR(72) NOT NULL, "
419 "`ComponentId` CHAR(38), "
420 "`Directory_` CHAR(72) NOT NULL, "
421 "`Attributes` SHORT NOT NULL, "
422 "`Condition` CHAR(255), "
423 "`KeyPath` CHAR(72) "
424 "PRIMARY KEY `Component`)" );
427 static UINT create_feature_table( MSIHANDLE hdb )
429 return run_query( hdb,
430 "CREATE TABLE `Feature` ( "
431 "`Feature` CHAR(38) NOT NULL, "
432 "`Feature_Parent` CHAR(38), "
434 "`Description` CHAR(255), "
435 "`Display` SHORT NOT NULL, "
436 "`Level` SHORT NOT NULL, "
437 "`Directory_` CHAR(72), "
438 "`Attributes` SHORT NOT NULL "
439 "PRIMARY KEY `Feature`)" );
442 static UINT create_feature_components_table( MSIHANDLE hdb )
444 return run_query( hdb,
445 "CREATE TABLE `FeatureComponents` ( "
446 "`Feature_` CHAR(38) NOT NULL, "
447 "`Component_` CHAR(72) NOT NULL "
448 "PRIMARY KEY `Feature_`, `Component_` )" );
451 static UINT create_file_table( MSIHANDLE hdb )
453 return run_query( hdb,
454 "CREATE TABLE `File` ("
455 "`File` CHAR(72) NOT NULL, "
456 "`Component_` CHAR(72) NOT NULL, "
457 "`FileName` CHAR(255) NOT NULL, "
458 "`FileSize` LONG NOT NULL, "
459 "`Version` CHAR(72), "
460 "`Language` CHAR(20), "
461 "`Attributes` SHORT, "
462 "`Sequence` SHORT NOT NULL "
463 "PRIMARY KEY `File`)" );
466 static UINT create_remove_file_table( MSIHANDLE hdb )
468 return run_query( hdb,
469 "CREATE TABLE `RemoveFile` ("
470 "`FileKey` CHAR(72) NOT NULL, "
471 "`Component_` CHAR(72) NOT NULL, "
472 "`FileName` CHAR(255) LOCALIZABLE, "
473 "`DirProperty` CHAR(72) NOT NULL, "
474 "`InstallMode` SHORT NOT NULL "
475 "PRIMARY KEY `FileKey`)" );
478 static UINT create_appsearch_table( MSIHANDLE hdb )
480 return run_query( hdb,
481 "CREATE TABLE `AppSearch` ("
482 "`Property` CHAR(72) NOT NULL, "
483 "`Signature_` CHAR(72) NOT NULL "
484 "PRIMARY KEY `Property`, `Signature_`)" );
487 static UINT create_reglocator_table( MSIHANDLE hdb )
489 return run_query( hdb,
490 "CREATE TABLE `RegLocator` ("
491 "`Signature_` CHAR(72) NOT NULL, "
492 "`Root` SHORT NOT NULL, "
493 "`Key` CHAR(255) NOT NULL, "
496 "PRIMARY KEY `Signature_`)" );
499 static UINT create_signature_table( MSIHANDLE hdb )
501 return run_query( hdb,
502 "CREATE TABLE `Signature` ("
503 "`Signature` CHAR(72) NOT NULL, "
504 "`FileName` CHAR(255) NOT NULL, "
505 "`MinVersion` CHAR(20), "
506 "`MaxVersion` CHAR(20), "
511 "`Languages` CHAR(255) "
512 "PRIMARY KEY `Signature`)" );
515 static UINT create_launchcondition_table( MSIHANDLE hdb )
517 return run_query( hdb,
518 "CREATE TABLE `LaunchCondition` ("
519 "`Condition` CHAR(255) NOT NULL, "
520 "`Description` CHAR(255) NOT NULL "
521 "PRIMARY KEY `Condition`)" );
524 static UINT create_property_table( MSIHANDLE hdb )
526 return run_query( hdb,
527 "CREATE TABLE `Property` ("
528 "`Property` CHAR(72) NOT NULL, "
530 "PRIMARY KEY `Property`)" );
533 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
535 return run_query( hdb,
536 "CREATE TABLE `InstallExecuteSequence` ("
537 "`Action` CHAR(72) NOT NULL, "
538 "`Condition` CHAR(255), "
540 "PRIMARY KEY `Action`)" );
543 static UINT create_media_table( MSIHANDLE hdb )
545 return run_query( hdb,
546 "CREATE TABLE `Media` ("
547 "`DiskId` SHORT NOT NULL, "
548 "`LastSequence` SHORT NOT NULL, "
549 "`DiskPrompt` CHAR(64), "
550 "`Cabinet` CHAR(255), "
551 "`VolumeLabel` CHAR(32), "
553 "PRIMARY KEY `DiskId`)" );
556 static UINT create_ccpsearch_table( MSIHANDLE hdb )
558 return run_query( hdb,
559 "CREATE TABLE `CCPSearch` ("
560 "`Signature_` CHAR(72) NOT NULL "
561 "PRIMARY KEY `Signature_`)" );
564 static UINT create_drlocator_table( MSIHANDLE hdb )
566 return run_query( hdb,
567 "CREATE TABLE `DrLocator` ("
568 "`Signature_` CHAR(72) NOT NULL, "
569 "`Parent` CHAR(72), "
572 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
575 static UINT create_complocator_table( MSIHANDLE hdb )
577 return run_query( hdb,
578 "CREATE TABLE `CompLocator` ("
579 "`Signature_` CHAR(72) NOT NULL, "
580 "`ComponentId` CHAR(38) NOT NULL, "
582 "PRIMARY KEY `Signature_`)" );
585 static UINT create_inilocator_table( MSIHANDLE hdb )
587 return run_query( hdb,
588 "CREATE TABLE `IniLocator` ("
589 "`Signature_` CHAR(72) NOT NULL, "
590 "`FileName` CHAR(255) NOT NULL, "
591 "`Section` CHAR(96)NOT NULL, "
592 "`Key` CHAR(128)NOT NULL, "
595 "PRIMARY KEY `Signature_`)" );
598 #define make_add_entry(type, qtext) \
599 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
601 char insert[] = qtext; \
604 sz = strlen(values) + sizeof insert; \
605 query = HeapAlloc(GetProcessHeap(),0,sz); \
606 sprintf(query,insert,values); \
607 r = run_query( hdb, query ); \
608 HeapFree(GetProcessHeap(), 0, query); \
612 make_add_entry(component,
613 "INSERT INTO `Component` "
614 "(`Component`, `ComponentId`, `Directory_`, "
615 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
617 make_add_entry(directory,
618 "INSERT INTO `Directory` "
619 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
621 make_add_entry(feature,
622 "INSERT INTO `Feature` "
623 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
624 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
626 make_add_entry(feature_components,
627 "INSERT INTO `FeatureComponents` "
628 "(`Feature_`, `Component_`) VALUES( %s )")
631 "INSERT INTO `File` "
632 "(`File`, `Component_`, `FileName`, `FileSize`, "
633 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
635 make_add_entry(appsearch,
636 "INSERT INTO `AppSearch` "
637 "(`Property`, `Signature_`) VALUES( %s )")
639 make_add_entry(signature,
640 "INSERT INTO `Signature` "
641 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
642 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
645 make_add_entry(launchcondition,
646 "INSERT INTO `LaunchCondition` "
647 "(`Condition`, `Description`) VALUES( %s )")
649 make_add_entry(property,
650 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
652 make_add_entry(install_execute_sequence,
653 "INSERT INTO `InstallExecuteSequence` "
654 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
656 make_add_entry(media,
657 "INSERT INTO `Media` "
658 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
659 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
661 make_add_entry(ccpsearch,
662 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
664 make_add_entry(drlocator,
665 "INSERT INTO `DrLocator` "
666 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
668 make_add_entry(complocator,
669 "INSERT INTO `CompLocator` "
670 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
672 make_add_entry(inilocator,
673 "INSERT INTO `IniLocator` "
674 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
677 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char *path,
678 const char *name, UINT type )
680 const char insert[] =
681 "INSERT INTO `RegLocator` (`Signature_`, `Root`, `Key`, `Name`, `Type`) "
682 "VALUES( '%s', %u, '%s', '%s', %u )";
686 sz = strlen( sig ) + 10 + strlen( path ) + strlen( name ) + 10 + sizeof( insert );
687 query = HeapAlloc( GetProcessHeap(), 0, sz );
688 sprintf( query, insert, sig, root, path, name, type );
689 r = run_query( hdb, query );
690 HeapFree( GetProcessHeap(), 0, query );
694 static UINT set_summary_info(MSIHANDLE hdb)
699 /* build summary info */
700 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
701 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
703 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
704 "Installation Database");
705 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
707 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
708 "Installation Database");
709 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
711 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
713 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
715 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
717 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
719 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
720 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
721 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
723 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
724 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
726 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
727 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
729 res = MsiSummaryInfoPersist(suminfo);
730 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
732 res = MsiCloseHandle( suminfo);
733 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
739 static MSIHANDLE create_package_db(void)
746 /* create an empty database */
747 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
748 ok( res == ERROR_SUCCESS , "Failed to create database %u\n", res );
749 if( res != ERROR_SUCCESS )
752 res = MsiDatabaseCommit( hdb );
753 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
755 res = set_summary_info(hdb);
756 ok( res == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", res);
758 res = run_query( hdb,
759 "CREATE TABLE `Directory` ( "
760 "`Directory` CHAR(255) NOT NULL, "
761 "`Directory_Parent` CHAR(255), "
762 "`DefaultDir` CHAR(255) NOT NULL "
763 "PRIMARY KEY `Directory`)" );
764 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
769 static UINT package_from_db(MSIHANDLE hdb, MSIHANDLE *handle)
775 sprintf(szPackage, "#%u", hdb);
776 res = MsiOpenPackage(szPackage, &hPackage);
777 if (res != ERROR_SUCCESS)
783 res = MsiCloseHandle(hdb);
784 if (res != ERROR_SUCCESS)
786 MsiCloseHandle(hPackage);
791 return ERROR_SUCCESS;
794 static void create_test_file(const CHAR *name)
799 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
800 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
801 WriteFile(file, name, strlen(name), &written, NULL);
802 WriteFile(file, "\n", strlen("\n"), &written, NULL);
806 typedef struct _tagVS_VERSIONINFO
813 VS_FIXEDFILEINFO Value;
818 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
819 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
821 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
823 VS_VERSIONINFO *pVerInfo;
824 VS_FIXEDFILEINFO *pFixedInfo;
831 GetSystemDirectory(path, MAX_PATH);
832 /* Some dlls can't be updated on Vista/W2K8 */
833 lstrcatA(path, "\\version.dll");
835 CopyFileA(path, name, FALSE);
837 size = GetFileVersionInfoSize(path, &handle);
838 buffer = HeapAlloc(GetProcessHeap(), 0, size);
840 GetFileVersionInfoA(path, 0, size, buffer);
842 pVerInfo = (VS_VERSIONINFO *)buffer;
843 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
844 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
846 pFixedInfo->dwFileVersionMS = ms;
847 pFixedInfo->dwFileVersionLS = ls;
848 pFixedInfo->dwProductVersionMS = ms;
849 pFixedInfo->dwProductVersionLS = ls;
851 resource = BeginUpdateResource(name, FALSE);
855 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
856 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
859 if (!EndUpdateResource(resource, FALSE))
865 HeapFree(GetProcessHeap(), 0, buffer);
869 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
871 RESTOREPOINTINFOA spec;
873 spec.dwEventType = event_type;
874 spec.dwRestorePtType = APPLICATION_INSTALL;
875 spec.llSequenceNumber = status->llSequenceNumber;
876 lstrcpyA(spec.szDescription, "msitest restore point");
878 return pSRSetRestorePointA(&spec, status);
881 static void remove_restore_point(DWORD seq_number)
885 res = pSRRemoveRestorePoint(seq_number);
886 if (res != ERROR_SUCCESS)
887 trace("Failed to remove the restore point : %08x\n", res);
890 static void test_createpackage(void)
892 MSIHANDLE hPackage = 0;
895 res = package_from_db(create_package_db(), &hPackage);
896 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
898 skip("Not enough rights to perform tests\n");
902 ok( res == ERROR_SUCCESS, " Failed to create package %u\n", res );
904 res = MsiCloseHandle( hPackage);
905 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
909 static void test_doaction( void )
914 r = MsiDoAction( -1, NULL );
915 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
917 r = package_from_db(create_package_db(), &hpkg);
918 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
920 skip("Not enough rights to perform tests\n");
924 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
926 r = MsiDoAction(hpkg, NULL);
927 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
929 r = MsiDoAction(0, "boo");
930 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
932 r = MsiDoAction(hpkg, "boo");
933 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
935 MsiCloseHandle( hpkg );
939 static void test_gettargetpath_bad(void)
941 static const WCHAR boo[] = {'b','o','o',0};
942 static const WCHAR empty[] = {0};
949 r = package_from_db(create_package_db(), &hpkg);
950 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
952 skip("Not enough rights to perform tests\n");
956 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
958 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
959 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
961 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
962 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
964 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
965 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
967 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
968 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
970 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
971 ok( r == ERROR_DIRECTORY, "wrong return val\n");
973 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
974 ok( r == ERROR_DIRECTORY, "wrong return val\n");
977 r = MsiGetTargetPath( hpkg, "", buffer, &sz );
978 ok( r == ERROR_DIRECTORY, "wrong return val\n");
980 r = MsiGetTargetPathW( 0, NULL, NULL, NULL );
981 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
983 r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
984 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
986 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
987 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
989 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
990 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
992 r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
993 ok( r == ERROR_DIRECTORY, "wrong return val\n");
995 r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
996 ok( r == ERROR_DIRECTORY, "wrong return val\n");
999 r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
1000 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1002 MsiCloseHandle( hpkg );
1003 DeleteFile(msifile);
1006 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
1012 rec = MsiCreateRecord( 1 );
1013 ok(rec, "MsiCreate record failed\n");
1015 r = MsiRecordSetString( rec, 0, file );
1016 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1019 r = MsiFormatRecord( hpkg, rec, buff, &size );
1020 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1022 MsiCloseHandle( rec );
1025 static void test_settargetpath(void)
1027 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
1033 hdb = create_package_db();
1034 ok ( hdb, "failed to create package database\n" );
1036 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
1037 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
1039 r = create_component_table( hdb );
1040 ok( r == S_OK, "cannot create Component table: %d\n", r );
1042 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1043 ok( r == S_OK, "cannot add dummy component: %d\n", r );
1045 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1046 ok( r == S_OK, "cannot add test component: %d\n", r );
1048 r = create_feature_table( hdb );
1049 ok( r == S_OK, "cannot create Feature table: %d\n", r );
1051 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
1052 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
1054 r = create_feature_components_table( hdb );
1055 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
1057 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
1058 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1060 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
1061 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1063 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
1064 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
1066 r = create_file_table( hdb );
1067 ok( r == S_OK, "cannot create File table: %d\n", r );
1069 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1070 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1072 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1073 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1075 r = package_from_db( hdb, &hpkg );
1076 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1078 skip("Not enough rights to perform tests\n");
1079 DeleteFile(msifile);
1082 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1084 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
1086 r = MsiDoAction( hpkg, "CostInitialize");
1087 ok( r == ERROR_SUCCESS, "cost init failed\n");
1089 r = MsiDoAction( hpkg, "FileCost");
1090 ok( r == ERROR_SUCCESS, "file cost failed\n");
1092 r = MsiDoAction( hpkg, "CostFinalize");
1093 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
1095 r = MsiSetTargetPath( 0, NULL, NULL );
1096 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1098 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1099 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1101 r = MsiSetTargetPath( hpkg, "boo", NULL );
1102 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1104 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
1105 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1107 sz = sizeof tempdir - 1;
1108 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
1109 sprintf( file, "%srootfile.txt", tempdir );
1111 query_file_path( hpkg, "[#RootFile]", buffer );
1112 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1113 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
1115 GetTempFileName( tempdir, "_wt", 0, buffer );
1116 sprintf( tempdir, "%s\\subdir", buffer );
1118 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1119 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1120 "MsiSetTargetPath on file returned %d\n", r );
1122 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1123 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1124 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
1126 DeleteFile( buffer );
1128 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1129 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1131 r = GetFileAttributes( buffer );
1132 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
1134 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1135 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
1137 sz = sizeof buffer - 1;
1138 lstrcat( tempdir, "\\" );
1139 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
1140 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1141 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
1143 sprintf( file, "%srootfile.txt", tempdir );
1144 query_file_path( hpkg, "[#RootFile]", buffer );
1145 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
1147 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
1148 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1150 query_file_path( hpkg, "[#TestFile]", buffer );
1151 ok( !lstrcmpi(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
1152 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
1154 sz = sizeof buffer - 1;
1155 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1156 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1157 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
1159 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two\\three" );
1160 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1162 sz = sizeof buffer - 1;
1163 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1164 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1165 ok( !lstrcmpi(buffer, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer);
1167 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\\\one\\\\two " );
1168 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1170 sz = sizeof buffer - 1;
1171 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1172 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1173 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected \"C:\\one\\two\\\", got %s\n", buffer);
1175 MsiCloseHandle( hpkg );
1178 static void test_condition(void)
1180 static const WCHAR cond1[] = {'\"','a',0x30a,'\"','<','\"',0xe5,'\"',0};
1181 static const WCHAR cond2[] = {'\"','a',0x30a,'\"','>','\"',0xe5,'\"',0};
1182 static const WCHAR cond3[] = {'\"','a',0x30a,'\"','<','>','\"',0xe5,'\"',0};
1183 static const WCHAR cond4[] = {'\"','a',0x30a,'\"','=','\"',0xe5,'\"',0};
1187 r = package_from_db(create_package_db(), &hpkg);
1188 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1190 skip("Not enough rights to perform tests\n");
1191 DeleteFile(msifile);
1194 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1196 r = MsiEvaluateCondition(0, NULL);
1197 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1199 r = MsiEvaluateCondition(hpkg, NULL);
1200 ok( r == MSICONDITION_NONE, "wrong return val\n");
1202 r = MsiEvaluateCondition(hpkg, "");
1203 ok( r == MSICONDITION_NONE, "wrong return val\n");
1205 r = MsiEvaluateCondition(hpkg, "1");
1206 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1208 r = MsiEvaluateCondition(hpkg, "0");
1209 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1211 r = MsiEvaluateCondition(hpkg, "-1");
1212 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1214 r = MsiEvaluateCondition(hpkg, "0 = 0");
1215 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1217 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1218 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1220 r = MsiEvaluateCondition(hpkg, "0 = 1");
1221 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1223 r = MsiEvaluateCondition(hpkg, "0 > 1");
1224 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1226 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1227 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1229 r = MsiEvaluateCondition(hpkg, "1 > 1");
1230 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1232 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1233 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1235 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1236 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1238 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1239 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1241 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1242 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1244 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1245 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1247 r = MsiEvaluateCondition(hpkg, "0 < 1");
1248 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1250 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1251 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1253 r = MsiEvaluateCondition(hpkg, "1 < 1");
1254 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1256 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1257 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1259 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1260 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1262 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1263 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1265 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1266 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1268 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1269 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1271 r = MsiEvaluateCondition(hpkg, "0 >=");
1272 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1274 r = MsiEvaluateCondition(hpkg, " ");
1275 ok( r == MSICONDITION_NONE, "wrong return val\n");
1277 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1278 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1280 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1281 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1283 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1284 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1286 r = MsiEvaluateCondition(hpkg, "not 0");
1287 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1289 r = MsiEvaluateCondition(hpkg, "not LicView");
1290 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1292 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1293 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1295 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1296 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1298 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1299 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1301 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1302 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1304 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1305 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1307 r = MsiEvaluateCondition(hpkg, "\"0\"");
1308 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1310 r = MsiEvaluateCondition(hpkg, "1 and 2");
1311 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1313 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1314 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1316 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1317 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1319 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1320 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1322 r = MsiEvaluateCondition(hpkg, "(0)");
1323 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1325 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1326 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1328 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1329 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1331 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1332 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1334 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1335 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1337 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1338 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1340 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1341 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1343 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1344 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1346 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1347 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1349 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1350 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1352 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1353 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1355 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1356 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1358 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1359 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1361 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1362 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1364 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1365 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1367 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1368 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1370 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1371 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1373 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1374 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1376 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1377 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1379 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1380 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1382 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1383 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1385 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1386 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1388 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1389 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1391 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1392 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1394 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1395 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1397 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1398 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1400 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1401 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1403 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1404 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1406 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1407 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1409 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1410 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1412 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1413 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1415 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1416 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1418 MsiSetProperty(hpkg, "mm", "5" );
1420 r = MsiEvaluateCondition(hpkg, "mm = 5");
1421 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1423 r = MsiEvaluateCondition(hpkg, "mm < 6");
1424 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1426 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1427 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1429 r = MsiEvaluateCondition(hpkg, "mm > 4");
1430 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1432 r = MsiEvaluateCondition(hpkg, "mm < 12");
1433 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1435 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1436 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1438 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1439 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1441 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1442 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1444 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1445 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1447 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1448 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1450 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1451 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1453 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1454 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1456 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1457 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1459 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1460 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1462 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1463 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1465 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1466 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1468 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1469 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1471 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1472 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1474 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1475 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1477 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1478 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1480 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1481 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1483 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1484 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1486 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1487 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1489 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1490 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1492 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1493 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1495 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1496 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1498 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1499 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1501 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1502 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1504 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1505 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1507 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1508 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1510 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1511 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1513 MsiSetProperty(hpkg, "bandalmael", "0" );
1514 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1515 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1517 MsiSetProperty(hpkg, "bandalmael", "" );
1518 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1519 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1521 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1522 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1523 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1525 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1526 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1527 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1529 MsiSetProperty(hpkg, "bandalmael", "0 " );
1530 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1531 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1533 MsiSetProperty(hpkg, "bandalmael", "-0" );
1534 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1535 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1537 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1538 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1539 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1541 MsiSetProperty(hpkg, "bandalmael", "--0" );
1542 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1543 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1545 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1546 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1547 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1549 MsiSetProperty(hpkg, "bandalmael", "-" );
1550 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1551 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1553 MsiSetProperty(hpkg, "bandalmael", "+0" );
1554 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1555 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1557 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1558 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1559 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1560 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1561 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1563 MsiSetProperty(hpkg, "one", "hi");
1564 MsiSetProperty(hpkg, "two", "hithere");
1565 r = MsiEvaluateCondition(hpkg, "one >< two");
1566 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1568 MsiSetProperty(hpkg, "one", "hithere");
1569 MsiSetProperty(hpkg, "two", "hi");
1570 r = MsiEvaluateCondition(hpkg, "one >< two");
1571 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1573 MsiSetProperty(hpkg, "one", "hello");
1574 MsiSetProperty(hpkg, "two", "hi");
1575 r = MsiEvaluateCondition(hpkg, "one >< two");
1576 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1578 MsiSetProperty(hpkg, "one", "hellohithere");
1579 MsiSetProperty(hpkg, "two", "hi");
1580 r = MsiEvaluateCondition(hpkg, "one >< two");
1581 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1583 MsiSetProperty(hpkg, "one", "");
1584 MsiSetProperty(hpkg, "two", "hi");
1585 r = MsiEvaluateCondition(hpkg, "one >< two");
1586 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1588 MsiSetProperty(hpkg, "one", "hi");
1589 MsiSetProperty(hpkg, "two", "");
1590 r = MsiEvaluateCondition(hpkg, "one >< two");
1591 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1593 MsiSetProperty(hpkg, "one", "");
1594 MsiSetProperty(hpkg, "two", "");
1595 r = MsiEvaluateCondition(hpkg, "one >< two");
1596 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1598 MsiSetProperty(hpkg, "one", "1234");
1599 MsiSetProperty(hpkg, "two", "1");
1600 r = MsiEvaluateCondition(hpkg, "one >< two");
1601 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1603 MsiSetProperty(hpkg, "one", "one 1234");
1604 MsiSetProperty(hpkg, "two", "1");
1605 r = MsiEvaluateCondition(hpkg, "one >< two");
1606 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1608 MsiSetProperty(hpkg, "one", "hithere");
1609 MsiSetProperty(hpkg, "two", "hi");
1610 r = MsiEvaluateCondition(hpkg, "one << two");
1611 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1613 MsiSetProperty(hpkg, "one", "hi");
1614 MsiSetProperty(hpkg, "two", "hithere");
1615 r = MsiEvaluateCondition(hpkg, "one << two");
1616 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1618 MsiSetProperty(hpkg, "one", "hi");
1619 MsiSetProperty(hpkg, "two", "hi");
1620 r = MsiEvaluateCondition(hpkg, "one << two");
1621 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1623 MsiSetProperty(hpkg, "one", "abcdhithere");
1624 MsiSetProperty(hpkg, "two", "hi");
1625 r = MsiEvaluateCondition(hpkg, "one << two");
1626 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1628 MsiSetProperty(hpkg, "one", "");
1629 MsiSetProperty(hpkg, "two", "hi");
1630 r = MsiEvaluateCondition(hpkg, "one << two");
1631 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1633 MsiSetProperty(hpkg, "one", "hithere");
1634 MsiSetProperty(hpkg, "two", "");
1635 r = MsiEvaluateCondition(hpkg, "one << two");
1636 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1638 MsiSetProperty(hpkg, "one", "");
1639 MsiSetProperty(hpkg, "two", "");
1640 r = MsiEvaluateCondition(hpkg, "one << two");
1641 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1643 MsiSetProperty(hpkg, "one", "1234");
1644 MsiSetProperty(hpkg, "two", "1");
1645 r = MsiEvaluateCondition(hpkg, "one << two");
1646 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1648 MsiSetProperty(hpkg, "one", "1234 one");
1649 MsiSetProperty(hpkg, "two", "1");
1650 r = MsiEvaluateCondition(hpkg, "one << two");
1651 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1653 MsiSetProperty(hpkg, "one", "hithere");
1654 MsiSetProperty(hpkg, "two", "there");
1655 r = MsiEvaluateCondition(hpkg, "one >> two");
1656 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1658 MsiSetProperty(hpkg, "one", "hithere");
1659 MsiSetProperty(hpkg, "two", "hi");
1660 r = MsiEvaluateCondition(hpkg, "one >> two");
1661 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1663 MsiSetProperty(hpkg, "one", "there");
1664 MsiSetProperty(hpkg, "two", "hithere");
1665 r = MsiEvaluateCondition(hpkg, "one >> two");
1666 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1668 MsiSetProperty(hpkg, "one", "there");
1669 MsiSetProperty(hpkg, "two", "there");
1670 r = MsiEvaluateCondition(hpkg, "one >> two");
1671 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1673 MsiSetProperty(hpkg, "one", "abcdhithere");
1674 MsiSetProperty(hpkg, "two", "hi");
1675 r = MsiEvaluateCondition(hpkg, "one >> two");
1676 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1678 MsiSetProperty(hpkg, "one", "");
1679 MsiSetProperty(hpkg, "two", "there");
1680 r = MsiEvaluateCondition(hpkg, "one >> two");
1681 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1683 MsiSetProperty(hpkg, "one", "there");
1684 MsiSetProperty(hpkg, "two", "");
1685 r = MsiEvaluateCondition(hpkg, "one >> two");
1686 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1688 MsiSetProperty(hpkg, "one", "");
1689 MsiSetProperty(hpkg, "two", "");
1690 r = MsiEvaluateCondition(hpkg, "one >> two");
1691 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1693 MsiSetProperty(hpkg, "one", "1234");
1694 MsiSetProperty(hpkg, "two", "4");
1695 r = MsiEvaluateCondition(hpkg, "one >> two");
1696 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1698 MsiSetProperty(hpkg, "one", "one 1234");
1699 MsiSetProperty(hpkg, "two", "4");
1700 r = MsiEvaluateCondition(hpkg, "one >> two");
1701 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1703 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1705 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1706 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1708 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1709 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1711 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1712 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1714 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1715 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1717 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1718 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1720 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1721 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1723 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1724 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1726 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1727 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1729 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1730 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1732 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1733 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1735 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1736 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1738 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1739 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1741 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1742 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1744 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1745 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1747 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1748 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1750 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1751 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1753 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1754 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1756 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1757 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1759 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1760 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1762 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1763 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1765 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1766 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1768 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1769 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1771 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1772 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1774 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1775 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1777 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1778 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1780 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1781 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1783 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1784 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1786 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1787 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1789 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1790 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1792 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1793 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1795 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1796 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1798 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1799 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1801 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1802 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1804 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1805 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1807 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1808 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1810 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1811 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1813 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1814 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1816 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1817 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1818 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1820 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1821 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1823 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1824 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1826 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1827 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1829 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1830 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1832 MsiSetProperty(hpkg, "one", "1");
1833 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1834 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1836 MsiSetProperty(hpkg, "X", "5.0");
1838 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1839 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1841 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1842 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1844 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1845 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1847 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1848 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1850 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1851 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1853 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1854 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1856 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1857 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1859 /* feature doesn't exist */
1860 r = MsiEvaluateCondition(hpkg, "&nofeature");
1861 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1863 MsiSetProperty(hpkg, "A", "2");
1864 MsiSetProperty(hpkg, "X", "50");
1866 r = MsiEvaluateCondition(hpkg, "2 <= X");
1867 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1869 r = MsiEvaluateCondition(hpkg, "A <= X");
1870 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1872 r = MsiEvaluateCondition(hpkg, "A <= 50");
1873 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1875 MsiSetProperty(hpkg, "X", "50val");
1877 r = MsiEvaluateCondition(hpkg, "2 <= X");
1878 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1880 r = MsiEvaluateCondition(hpkg, "A <= X");
1881 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1883 MsiSetProperty(hpkg, "A", "7");
1884 MsiSetProperty(hpkg, "X", "50");
1886 r = MsiEvaluateCondition(hpkg, "7 <= X");
1887 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1889 r = MsiEvaluateCondition(hpkg, "A <= X");
1890 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1892 r = MsiEvaluateCondition(hpkg, "A <= 50");
1893 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1895 MsiSetProperty(hpkg, "X", "50val");
1897 r = MsiEvaluateCondition(hpkg, "2 <= X");
1898 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1900 r = MsiEvaluateCondition(hpkg, "A <= X");
1901 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1903 r = MsiEvaluateConditionW(hpkg, cond1);
1904 ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
1905 "wrong return val (%d)\n", r);
1907 r = MsiEvaluateConditionW(hpkg, cond2);
1908 ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
1909 "wrong return val (%d)\n", r);
1911 r = MsiEvaluateConditionW(hpkg, cond3);
1912 ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
1913 "wrong return val (%d)\n", r);
1915 r = MsiEvaluateConditionW(hpkg, cond4);
1916 ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
1917 "wrong return val (%d)\n", r);
1919 MsiCloseHandle( hpkg );
1920 DeleteFile(msifile);
1923 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1931 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1932 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1935 static void test_props(void)
1937 MSIHANDLE hpkg, hdb;
1942 hdb = create_package_db();
1944 "CREATE TABLE `Property` ( "
1945 "`Property` CHAR(255) NOT NULL, "
1946 "`Value` CHAR(255) "
1947 "PRIMARY KEY `Property`)" );
1948 ok( r == ERROR_SUCCESS , "Failed\n" );
1951 "INSERT INTO `Property` "
1952 "(`Property`, `Value`) "
1953 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1954 ok( r == ERROR_SUCCESS , "Failed\n" );
1956 r = package_from_db( hdb, &hpkg );
1957 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1959 skip("Not enough rights to perform tests\n");
1960 DeleteFile(msifile);
1963 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1965 /* test invalid values */
1966 r = MsiGetProperty( 0, NULL, NULL, NULL );
1967 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1969 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1970 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1972 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1973 ok( r == ERROR_SUCCESS, "wrong return val\n");
1975 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1976 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1978 /* test retrieving an empty/nonexistent property */
1980 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1981 ok( r == ERROR_SUCCESS, "wrong return val\n");
1982 ok( sz == 0, "wrong size returned\n");
1984 check_prop_empty( hpkg, "boo");
1987 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1988 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1989 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1990 ok( sz == 0, "wrong size returned\n");
1994 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1995 ok( r == ERROR_SUCCESS, "wrong return val\n");
1996 ok( buffer[0] == 0, "buffer was not changed\n");
1997 ok( sz == 0, "wrong size returned\n");
1999 /* set the property to something */
2000 r = MsiSetProperty( 0, NULL, NULL );
2001 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
2003 r = MsiSetProperty( hpkg, NULL, NULL );
2004 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
2006 r = MsiSetProperty( hpkg, "", NULL );
2007 ok( r == ERROR_SUCCESS, "wrong return val\n");
2009 /* try set and get some illegal property identifiers */
2010 r = MsiSetProperty( hpkg, "", "asdf" );
2011 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
2013 r = MsiSetProperty( hpkg, "=", "asdf" );
2014 ok( r == ERROR_SUCCESS, "wrong return val\n");
2016 r = MsiSetProperty( hpkg, " ", "asdf" );
2017 ok( r == ERROR_SUCCESS, "wrong return val\n");
2019 r = MsiSetProperty( hpkg, "'", "asdf" );
2020 ok( r == ERROR_SUCCESS, "wrong return val\n");
2024 r = MsiGetProperty( hpkg, "'", buffer, &sz );
2025 ok( r == ERROR_SUCCESS, "wrong return val\n");
2026 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
2028 /* set empty values */
2029 r = MsiSetProperty( hpkg, "boo", NULL );
2030 ok( r == ERROR_SUCCESS, "wrong return val\n");
2031 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2033 r = MsiSetProperty( hpkg, "boo", "" );
2034 ok( r == ERROR_SUCCESS, "wrong return val\n");
2035 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2037 /* set a non-empty value */
2038 r = MsiSetProperty( hpkg, "boo", "xyz" );
2039 ok( r == ERROR_SUCCESS, "wrong return val\n");
2043 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2044 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2045 ok( buffer[0] == 0, "buffer was not changed\n");
2046 ok( sz == 3, "wrong size returned\n");
2050 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2051 ok( r == ERROR_SUCCESS, "wrong return val\n");
2052 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
2053 ok( sz == 3, "wrong size returned\n");
2057 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2058 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2059 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
2060 ok( sz == 3, "wrong size returned\n");
2062 r = MsiSetProperty(hpkg, "SourceDir", "foo");
2063 ok( r == ERROR_SUCCESS, "wrong return val\n");
2066 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
2067 ok( r == ERROR_SUCCESS, "wrong return val\n");
2068 ok( !strcmp(buffer,""), "buffer wrong\n");
2069 ok( sz == 0, "wrong size returned\n");
2072 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
2073 ok( r == ERROR_SUCCESS, "wrong return val\n");
2074 ok( !strcmp(buffer,""), "buffer wrong\n");
2075 ok( sz == 0, "wrong size returned\n");
2078 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
2079 ok( r == ERROR_SUCCESS, "wrong return val\n");
2080 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
2081 ok( sz == 3, "wrong size returned\n");
2083 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
2084 ok( r == ERROR_SUCCESS, "wrong return val\n");
2087 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
2088 ok( r == ERROR_SUCCESS, "return wrong\n");
2089 ok( sz == 13, "size wrong (%d)\n", sz);
2092 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
2093 ok( r == ERROR_MORE_DATA, "return wrong\n");
2094 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
2096 r = MsiSetProperty(hpkg, "property", "value");
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( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
2104 r = MsiSetProperty(hpkg, "property", NULL);
2105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2108 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2110 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
2112 MsiCloseHandle( hpkg );
2113 DeleteFile(msifile);
2116 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
2118 MSIHANDLE hview, hrec;
2120 CHAR buffer[MAX_PATH];
2124 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
2125 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
2126 r = MsiViewExecute(hview, 0);
2127 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
2130 while (r == ERROR_SUCCESS && !found)
2132 r = MsiViewFetch(hview, &hrec);
2133 if (r != ERROR_SUCCESS) break;
2136 r = MsiRecordGetString(hrec, 1, buffer, &sz);
2137 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
2140 r = MsiRecordGetString(hrec, 2, buffer, &sz);
2141 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
2145 MsiCloseHandle(hrec);
2148 MsiViewClose(hview);
2149 MsiCloseHandle(hview);
2154 static void test_property_table(void)
2158 MSIHANDLE hpkg, hdb, hrec;
2159 char buffer[MAX_PATH], package[10];
2163 hdb = create_package_db();
2164 ok( hdb, "failed to create package\n");
2166 r = package_from_db(hdb, &hpkg);
2167 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2169 skip("Not enough rights to perform tests\n");
2170 DeleteFile(msifile);
2173 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2175 MsiCloseHandle(hdb);
2177 hdb = MsiGetActiveDatabase(hpkg);
2179 query = "CREATE TABLE `_Property` ( "
2180 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2181 r = run_query(hdb, query);
2182 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2184 MsiCloseHandle(hdb);
2185 MsiCloseHandle(hpkg);
2186 DeleteFile(msifile);
2188 hdb = create_package_db();
2189 ok( hdb, "failed to create package\n");
2191 query = "CREATE TABLE `_Property` ( "
2192 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2193 r = run_query(hdb, query);
2194 ok(r == ERROR_SUCCESS, "failed to create table\n");
2196 query = "ALTER `_Property` ADD `foo` INTEGER";
2197 r = run_query(hdb, query);
2198 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2200 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2201 r = run_query(hdb, query);
2202 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2204 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2205 r = run_query(hdb, query);
2206 ok(r == ERROR_SUCCESS, "failed to add column\n");
2208 sprintf(package, "#%i", hdb);
2209 r = MsiOpenPackage(package, &hpkg);
2210 todo_wine ok(r != ERROR_SUCCESS, "MsiOpenPackage succeeded\n");
2211 if (r == ERROR_SUCCESS)
2212 MsiCloseHandle(hpkg);
2214 r = MsiCloseHandle(hdb);
2215 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
2217 hdb = create_package_db();
2218 ok (hdb, "failed to create package database\n");
2220 r = create_property_table(hdb);
2221 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2223 r = add_property_entry(hdb, "'prop', 'val'");
2224 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2226 r = package_from_db(hdb, &hpkg);
2227 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
2229 MsiCloseHandle(hdb);
2232 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2233 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2234 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2236 hdb = MsiGetActiveDatabase(hpkg);
2238 found = find_prop_in_property(hdb, "prop", "val");
2239 ok(found, "prop should be in the _Property table\n");
2241 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2242 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2244 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2245 r = do_query(hdb, query, &hrec);
2246 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2248 found = find_prop_in_property(hdb, "dantes", "mercedes");
2249 ok(found == FALSE, "dantes should not be in the _Property table\n");
2252 lstrcpy(buffer, "aaa");
2253 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2254 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2255 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2257 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2258 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2260 found = find_prop_in_property(hdb, "dantes", "mercedes");
2261 ok(found == TRUE, "dantes should be in the _Property table\n");
2263 MsiCloseHandle(hdb);
2264 MsiCloseHandle(hpkg);
2265 DeleteFile(msifile);
2268 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2273 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2274 if( res == ERROR_SUCCESS )
2278 r = MsiViewExecute( htab, hrec );
2279 if( r != ERROR_SUCCESS )
2282 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2285 r = MsiViewClose( htab );
2286 if( r != ERROR_SUCCESS )
2289 r = MsiCloseHandle( htab );
2290 if( r != ERROR_SUCCESS )
2296 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2298 return try_query_param( hdb, szQuery, 0 );
2301 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2306 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2307 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2309 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2310 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2312 r = MsiSummaryInfoPersist(summary);
2313 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2315 MsiCloseHandle(summary);
2318 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2323 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2326 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2327 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2329 r = MsiSummaryInfoPersist(summary);
2330 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2332 MsiCloseHandle(summary);
2335 static void test_msipackage(void)
2337 MSIHANDLE hdb = 0, hpack = 100;
2342 /* NULL szPackagePath */
2343 r = MsiOpenPackage(NULL, &hpack);
2344 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2346 /* empty szPackagePath */
2347 r = MsiOpenPackage("", &hpack);
2348 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2350 skip("Not enough rights to perform tests\n");
2355 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2358 if (r == ERROR_SUCCESS)
2359 MsiCloseHandle(hpack);
2361 /* nonexistent szPackagePath */
2362 r = MsiOpenPackage("nonexistent", &hpack);
2363 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2366 r = MsiOpenPackage(msifile, NULL);
2367 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2371 r = MsiOpenPackage(name, &hpack);
2372 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2374 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2377 /* database exists, but is emtpy */
2378 sprintf(name, "#%d", hdb);
2379 r = MsiOpenPackage(name, &hpack);
2380 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2381 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2383 query = "CREATE TABLE `Property` ( "
2384 "`Property` CHAR(72), `Value` CHAR(0) "
2385 "PRIMARY KEY `Property`)";
2386 r = try_query(hdb, query);
2387 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2389 query = "CREATE TABLE `InstallExecuteSequence` ("
2390 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2391 "PRIMARY KEY `Action`)";
2392 r = try_query(hdb, query);
2393 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2395 /* a few key tables exist */
2396 sprintf(name, "#%d", hdb);
2397 r = MsiOpenPackage(name, &hpack);
2398 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2399 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2401 MsiCloseHandle(hdb);
2402 DeleteFile(msifile);
2404 /* start with a clean database to show what constitutes a valid package */
2405 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2406 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2408 sprintf(name, "#%d", hdb);
2410 /* The following summary information props must exist:
2415 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2416 r = MsiOpenPackage(name, &hpack);
2417 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2418 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2420 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2421 r = MsiOpenPackage(name, &hpack);
2422 ok(r == ERROR_SUCCESS,
2423 "Expected ERROR_SUCCESS, got %d\n", r);
2425 MsiCloseHandle(hpack);
2426 MsiCloseHandle(hdb);
2427 DeleteFile(msifile);
2430 static void test_formatrecord2(void)
2432 MSIHANDLE hpkg, hrec ;
2437 r = package_from_db(create_package_db(), &hpkg);
2438 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2440 skip("Not enough rights to perform tests\n");
2441 DeleteFile(msifile);
2444 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2446 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2447 ok( r == ERROR_SUCCESS, "set property failed\n");
2449 hrec = MsiCreateRecord(2);
2450 ok(hrec, "create record failed\n");
2452 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2453 ok( r == ERROR_SUCCESS, "format record failed\n");
2457 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2458 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2460 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2461 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2462 r = MsiRecordSetString(hrec, 1, "hoo");
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,"hoo"), "wrong output %s\n",buffer);
2468 ok( r == ERROR_SUCCESS, "format failed\n");
2470 r = MsiRecordSetString(hrec, 0, "x[~]x");
2471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2473 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2474 ok( sz == 3, "size wrong\n");
2475 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2476 ok( r == ERROR_SUCCESS, "format failed\n");
2478 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2479 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2480 r = MsiRecordSetString(hrec, 1, "hoo");
2481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2483 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2484 ok( sz == 3, "size wrong\n");
2485 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2486 ok( r == ERROR_SUCCESS, "format failed\n");
2488 r = MsiRecordSetString(hrec, 0, "[\\[]");
2489 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2491 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2492 ok( sz == 1, "size wrong\n");
2493 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2494 ok( r == ERROR_SUCCESS, "format failed\n");
2496 SetEnvironmentVariable("FOO", "BAR");
2497 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2500 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2501 ok( sz == 3, "size wrong\n");
2502 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2503 ok( r == ERROR_SUCCESS, "format failed\n");
2505 r = MsiRecordSetString(hrec, 0, "[[1]]");
2506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2507 r = MsiRecordSetString(hrec, 1, "%FOO");
2508 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
2510 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2511 ok( sz == 3, "size wrong\n");
2512 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2513 ok( r == ERROR_SUCCESS, "format failed\n");
2515 MsiCloseHandle( hrec );
2516 MsiCloseHandle( hpkg );
2517 DeleteFile(msifile);
2520 static void test_states(void)
2525 INSTALLSTATE state, action;
2527 static const CHAR msifile2[] = "winetest2-package.msi";
2528 static const CHAR msifile3[] = "winetest3-package.msi";
2529 static const CHAR msifile4[] = "winetest4-package.msi";
2531 if (is_process_limited())
2533 skip("process is limited\n");
2537 hdb = create_package_db();
2538 ok ( hdb, "failed to create package database\n" );
2540 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2541 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2543 r = create_property_table( hdb );
2544 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2546 r = add_property_entry( hdb, "'ProductCode', '{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
2547 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2549 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2550 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2552 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2553 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2555 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2556 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2558 r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
2559 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2561 r = create_install_execute_sequence_table( hdb );
2562 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2564 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2565 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2567 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2568 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2570 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2571 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2573 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2574 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2576 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2577 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2579 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2580 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2582 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2583 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2585 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2586 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2588 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2589 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2591 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2592 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2594 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2595 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2597 r = create_media_table( hdb );
2598 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2600 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2601 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2603 r = create_feature_table( hdb );
2604 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2606 r = create_component_table( hdb );
2607 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2609 /* msidbFeatureAttributesFavorLocal */
2610 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2611 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2613 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2614 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2615 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2617 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2618 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2619 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2621 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2622 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2623 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2625 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2626 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2627 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2629 /* msidbFeatureAttributesFavorSource */
2630 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2631 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2633 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2634 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2635 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2637 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2638 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2639 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2641 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2642 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2643 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2645 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2646 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2647 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2649 /* msidbFeatureAttributesFavorSource */
2650 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2651 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2653 /* msidbFeatureAttributesFavorLocal */
2654 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2655 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2658 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2659 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2661 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2662 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2663 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2665 /* no feature parent:msidbComponentAttributesLocalOnly */
2666 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2667 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2669 /* msidbFeatureAttributesFavorLocal:removed */
2670 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2671 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2673 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2674 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2675 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2677 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2678 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2679 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2681 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2682 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2683 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2685 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2686 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2687 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2689 /* msidbFeatureAttributesFavorSource:removed */
2690 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2691 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2693 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2694 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2695 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2697 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2698 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2699 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2701 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2702 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2703 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2705 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2706 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2707 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2709 /* msidbFeatureAttributesFavorLocal */
2710 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2711 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2713 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2714 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2716 /* msidbFeatureAttributesFavorSource */
2717 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2718 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2720 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2721 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2723 /* msidbFeatureAttributesFavorAdvertise */
2724 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2725 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2727 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2728 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2730 /* msidbFeatureAttributesUIDisallowAbsent */
2731 r = add_feature_entry( hdb, "'eleven', '', '', '', 2, 1, '', 16" );
2732 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2734 r = add_component_entry( hdb, "'psi', '{A06B23B5-746B-427A-8A6E-FD6AC8F46A95}', 'TARGETDIR', 1, '', 'psi_file'" );
2735 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2737 r = create_feature_components_table( hdb );
2738 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2740 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2741 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2743 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2744 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2746 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2747 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2749 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2750 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2752 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2753 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2755 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2756 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2758 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2759 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2761 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2762 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2764 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2765 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2767 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2768 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2770 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2771 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2773 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2774 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2776 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2777 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2779 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2780 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2782 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2783 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2785 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2786 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2788 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2789 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2791 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2792 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2794 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2795 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2797 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2798 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2800 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2801 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2803 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2804 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2806 r = add_feature_components_entry( hdb, "'eleven', 'psi'" );
2807 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2809 r = create_file_table( hdb );
2810 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2812 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2813 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2815 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2816 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2818 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2819 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2821 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2822 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2824 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2825 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2827 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2828 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2830 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2831 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2833 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2834 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2836 /* compressed file */
2837 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2838 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2840 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2841 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2843 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2844 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2846 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2847 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2849 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2850 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2852 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2853 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2855 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2856 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2858 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2859 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2861 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2862 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2864 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2865 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2867 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2868 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2870 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2871 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2873 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2874 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2876 r = add_file_entry( hdb, "'psi_file', 'psi', 'psi.txt', 100, '', '1033', 8192, 1" );
2877 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2879 MsiDatabaseCommit(hdb);
2881 /* these properties must not be in the saved msi file */
2882 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2883 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2885 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2886 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2888 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2889 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2891 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2892 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2894 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2895 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2897 r = package_from_db( hdb, &hpkg );
2898 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2900 skip("Not enough rights to perform tests\n");
2901 DeleteFile(msifile);
2904 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
2906 MsiCloseHandle(hdb);
2908 CopyFileA(msifile, msifile2, FALSE);
2909 CopyFileA(msifile, msifile3, FALSE);
2910 CopyFileA(msifile, msifile4, FALSE);
2914 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2915 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2916 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2917 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2921 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2922 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2923 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2924 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2928 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2929 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2930 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2931 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2935 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2936 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2937 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2938 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2942 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2943 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2944 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2945 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2949 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2950 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2951 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2952 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2956 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2957 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2958 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2959 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2963 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2964 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2965 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2966 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2970 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2971 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2972 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2973 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2977 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2978 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2979 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2980 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2984 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
2985 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2986 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2987 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2991 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2992 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2993 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2994 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2998 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2999 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3000 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3001 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3005 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3006 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3007 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3008 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3012 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3013 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3014 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3015 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3019 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3020 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3021 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3022 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3026 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3027 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3028 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3029 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3033 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3034 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3035 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3036 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3040 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3041 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3042 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3043 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3047 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3048 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3049 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3050 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3054 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3055 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3056 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3057 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3061 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3062 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3063 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3064 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3068 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3069 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3070 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3071 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3075 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3076 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3077 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3078 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3082 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3083 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3084 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3085 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3089 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3090 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3091 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3092 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3096 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3097 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3098 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3099 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3103 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3104 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3105 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3106 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3110 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3111 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3112 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3113 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3117 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3118 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3119 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3120 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3124 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3125 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3126 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3127 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3131 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3132 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3133 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3134 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3138 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3139 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3140 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3141 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3143 r = MsiDoAction( hpkg, "CostInitialize");
3144 ok( r == ERROR_SUCCESS, "cost init failed\n");
3148 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3155 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3162 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3164 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3165 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3169 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3171 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3176 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3178 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3183 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3185 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3186 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3190 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3192 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3193 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3197 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3199 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3200 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3204 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3206 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3207 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3211 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3212 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3213 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3214 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3218 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3219 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3220 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3221 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3225 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3226 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3227 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3228 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3232 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3234 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3235 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3239 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3241 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3242 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3246 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3248 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3249 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3253 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3255 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3256 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3260 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3262 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3263 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3267 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3269 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3270 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3274 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3275 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3276 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3277 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3281 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3283 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3284 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3288 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3290 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3291 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3295 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3297 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3298 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3302 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3304 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3305 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3309 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3310 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3311 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3312 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3316 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3318 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3319 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3323 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3325 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3326 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3330 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3332 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3333 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3337 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3339 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3340 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3344 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3346 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3347 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3351 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3353 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3354 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3358 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3360 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3361 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3365 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3367 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3368 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3372 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3374 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3375 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3377 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3379 r = MsiDoAction( hpkg, "FileCost");
3380 ok( r == ERROR_SUCCESS, "file cost failed\n");
3382 r = MsiGetFeatureState(hpkg, "one", NULL, NULL);
3383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3386 r = MsiGetFeatureState(hpkg, "one", NULL, &action);
3387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3388 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3391 r = MsiGetFeatureState( hpkg, "one", &state, NULL);
3392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3393 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3397 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3398 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3399 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3400 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3404 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3405 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3406 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3407 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3411 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3412 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3413 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3414 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3418 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3419 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3420 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3421 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3425 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3426 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3427 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3428 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3432 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3433 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3434 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3435 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3439 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3440 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3441 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3442 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3446 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3447 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3448 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3449 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3453 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3454 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3455 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3456 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3460 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3461 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3462 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3463 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3467 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3468 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3469 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3470 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3474 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3475 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3476 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3477 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3481 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3482 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3483 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3484 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3488 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3489 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3490 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3491 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3495 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3496 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3497 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3498 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3502 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3503 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3504 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3505 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3509 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3510 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3511 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3512 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3516 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3517 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3518 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3519 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3523 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3524 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3525 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3526 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3530 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3531 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3532 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3533 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3537 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3538 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3539 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3540 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3544 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3545 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3546 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3547 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3551 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3552 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3553 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3554 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3558 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3559 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3560 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3561 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3565 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3566 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3567 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3568 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3572 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3573 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3574 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3575 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3579 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3580 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3581 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3582 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3586 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3587 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3588 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3589 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3593 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3594 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3595 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3596 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3600 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3601 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3602 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3603 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3607 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3608 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3609 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3610 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3614 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3615 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3616 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3617 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3621 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3622 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3623 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3624 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3626 r = MsiDoAction( hpkg, "CostFinalize");
3627 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3631 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3632 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3633 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3634 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3638 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3639 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3640 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3641 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3645 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3646 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3647 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3648 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3652 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3654 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3655 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3659 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3660 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3661 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3662 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3666 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3668 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3669 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3673 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3675 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3676 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3680 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3681 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3682 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3683 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3687 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3688 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3689 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3690 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3694 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3695 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3696 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3697 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3701 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3703 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3704 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3708 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3710 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3711 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3715 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3716 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3717 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3718 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3722 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3723 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3724 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3725 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3729 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3730 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3731 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3732 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3736 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3737 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3738 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3739 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3743 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3744 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3745 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3746 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3750 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3751 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3752 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3753 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3757 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3758 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3759 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3760 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3764 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3765 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3766 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3767 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3771 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3772 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3773 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3774 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3778 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3779 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3780 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3781 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3785 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3786 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3787 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3788 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3792 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3793 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3794 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3795 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3799 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3800 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3801 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3802 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3806 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3807 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3808 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3809 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3813 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3814 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3815 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3816 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3820 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3821 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3822 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3823 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3827 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3828 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3829 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3830 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3834 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3835 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3836 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3837 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3841 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3842 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3843 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3844 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3848 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3850 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3851 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3855 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3856 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3857 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3858 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3860 MsiCloseHandle( hpkg );
3862 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3864 /* publish the features and components */
3865 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3866 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3868 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3869 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3871 /* these properties must not be in the saved msi file */
3872 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3873 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3875 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3876 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3878 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3879 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3881 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3882 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3884 r = package_from_db( hdb, &hpkg );
3885 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
3887 MsiCloseHandle(hdb);
3891 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3892 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3893 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3894 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3898 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3899 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3900 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3901 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3905 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3906 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3907 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3908 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3912 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3913 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3914 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3915 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3919 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3920 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3921 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3922 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3926 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3927 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3928 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3929 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3933 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3934 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3935 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3936 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3940 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3941 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3942 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3943 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3947 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3948 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3949 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3950 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3954 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3955 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3956 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3957 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3961 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3962 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3963 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3964 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3968 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3969 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3970 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3971 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3975 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3976 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3977 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3978 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3982 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3983 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3984 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3985 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3989 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3990 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3991 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3992 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3996 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3997 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3998 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3999 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4003 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4004 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4005 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4006 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4010 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4011 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4012 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4013 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4017 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4018 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4019 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4020 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4024 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4025 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4026 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4027 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4031 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4032 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4033 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4034 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4038 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4039 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4040 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4041 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4045 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4046 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4047 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4048 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4052 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4053 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4054 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4055 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4059 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4060 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4061 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4062 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4066 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4067 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4068 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4069 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4073 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4074 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4075 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4076 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4080 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4081 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4082 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4083 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4087 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4088 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4089 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4090 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4094 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4095 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4096 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4097 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4101 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4102 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4103 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4104 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4108 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4109 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4110 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4111 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4115 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4116 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4117 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4118 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4120 r = MsiDoAction( hpkg, "CostInitialize");
4121 ok( r == ERROR_SUCCESS, "cost init failed\n");
4125 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4126 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4127 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4128 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4132 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4133 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4134 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4135 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4139 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4140 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4141 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4142 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4146 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4147 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4148 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4149 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4153 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4155 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4156 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4160 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4161 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4162 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4163 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4167 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4168 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4169 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4170 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4174 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4175 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4176 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4177 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4181 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4182 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4183 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4184 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4188 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4190 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4191 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4195 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4197 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4198 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4202 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4204 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4205 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4209 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4211 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4212 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4216 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4218 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4219 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4223 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4224 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4225 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4226 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4230 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4232 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4233 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4237 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4238 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4239 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4240 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4244 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4245 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4246 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4247 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4251 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4253 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4254 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4258 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4260 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4261 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4265 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4266 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4267 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4268 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4272 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4274 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4275 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4279 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4281 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4282 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4286 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4288 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4289 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4293 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4295 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4296 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4300 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4301 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4302 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4303 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4307 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4308 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4309 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4310 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4314 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4315 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4316 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4317 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4321 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4322 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4323 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4324 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4328 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4329 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4330 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4331 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4335 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4336 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4337 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4338 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4342 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4344 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4345 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4349 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4350 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4351 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4352 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4354 r = MsiDoAction( hpkg, "FileCost");
4355 ok( r == ERROR_SUCCESS, "file cost failed\n");
4359 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4360 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4361 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4362 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4366 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4367 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4368 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4369 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4373 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4374 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4375 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4376 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4380 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4381 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4382 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4383 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4387 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4388 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4389 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4390 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4394 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4395 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4396 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4397 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4401 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4402 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4403 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4404 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4408 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4409 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4410 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4411 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4415 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4416 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4417 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4418 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4422 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4423 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4424 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4425 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4429 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4430 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4431 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4432 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4436 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4437 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4438 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4439 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4443 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4444 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4445 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4446 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4450 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4451 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4452 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4453 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4457 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4458 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4459 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4460 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4464 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4465 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4466 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4467 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4471 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4472 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4473 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4474 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4478 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4479 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4480 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4481 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4485 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4486 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4487 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4488 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4492 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4493 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4494 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4495 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4499 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4500 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4501 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4502 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4506 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4507 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4508 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4509 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4513 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4514 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4515 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4516 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4520 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4521 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4522 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4523 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4527 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4528 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4529 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4530 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4534 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4535 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4536 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4537 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4541 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4542 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4543 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4544 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4548 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4549 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4550 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4551 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4555 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4556 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4557 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4558 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4562 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4563 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4564 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4565 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4569 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4570 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4571 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4572 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4574 r = MsiDoAction( hpkg, "CostFinalize");
4575 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4579 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4580 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4581 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4582 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4586 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4587 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4588 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4589 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4593 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4594 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4595 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4596 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4600 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4601 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4602 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4603 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4607 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4608 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4609 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4610 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4614 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4615 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4616 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4617 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4621 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4622 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4623 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4624 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4628 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4629 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4630 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4631 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4635 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4636 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4637 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4638 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4642 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4643 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4644 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4645 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4649 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4650 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4651 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4652 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4656 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4657 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4658 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4659 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4663 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4664 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4665 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4666 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4670 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4671 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4672 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4673 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4677 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4678 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4679 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4680 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4684 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4685 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4686 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4687 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4691 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4692 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4693 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4694 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4698 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4699 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4700 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4701 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4705 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4706 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4707 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4708 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4712 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4713 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4714 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4715 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4719 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4720 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4721 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4722 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4726 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4727 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4728 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4729 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4733 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4734 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4735 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4736 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4740 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4741 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4742 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4743 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4747 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4748 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4749 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4750 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4754 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4755 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4756 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4757 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4761 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4762 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4763 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4764 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4768 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4769 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4770 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4771 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4775 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4776 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4777 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4778 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4782 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4784 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4785 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4789 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4790 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4791 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4792 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4796 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4797 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4798 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4799 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4803 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4804 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4805 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4806 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4808 MsiCloseHandle(hpkg);
4810 /* uninstall the product */
4811 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4812 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4814 /* all features installed locally */
4815 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4816 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4818 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4819 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4821 /* these properties must not be in the saved msi file */
4822 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4823 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4825 r = package_from_db( hdb, &hpkg );
4826 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
4830 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4831 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4832 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4833 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4837 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4838 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4839 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4840 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4844 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4845 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4846 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4847 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4851 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4852 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4853 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4854 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4858 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4859 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4860 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4861 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4865 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4866 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4867 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4868 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4872 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4873 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4874 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4875 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4879 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4880 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4881 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4882 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4886 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4887 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4888 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4889 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4893 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4894 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4895 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4896 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4900 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4901 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4902 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4903 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4907 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4908 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4909 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4910 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4914 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4915 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4916 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4917 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4921 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4922 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4923 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4924 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4928 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4929 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4930 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4931 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4935 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4936 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4937 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4938 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4942 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4943 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4944 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4945 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4949 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4950 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4951 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4952 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4956 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4957 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4958 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4959 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4963 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4964 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4965 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4966 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4970 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4971 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4972 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4973 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4977 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4978 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4979 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4980 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4984 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4985 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4986 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4987 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4991 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4992 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4993 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4994 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4998 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4999 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5000 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5001 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5005 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5006 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5007 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5008 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5012 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5013 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5014 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5015 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5019 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5020 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5021 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5022 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5026 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5027 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5028 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5029 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5033 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5034 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5035 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5036 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5040 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5041 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5042 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5043 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5047 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5048 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5049 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5050 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5054 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5055 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5056 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5057 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5059 r = MsiDoAction( hpkg, "CostInitialize");
5060 ok( r == ERROR_SUCCESS, "cost init failed\n");
5064 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5065 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5066 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5067 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5071 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5072 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5073 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5074 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5078 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5079 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5080 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5081 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5085 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5086 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5087 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5088 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5092 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5094 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5095 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5099 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5101 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5102 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5106 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5108 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5113 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5115 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5116 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5120 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5122 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5127 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5134 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5141 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5148 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5155 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5162 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5164 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5165 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5169 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5171 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5176 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5178 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5183 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5185 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5186 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5190 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5192 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5193 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5197 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5199 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5200 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5204 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5206 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5207 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5211 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5212 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5213 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5214 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5218 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5219 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5220 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5221 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5225 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5226 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5227 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5228 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5232 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5234 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5235 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5239 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5241 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5242 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5246 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5248 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5249 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5253 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5255 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5256 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5260 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5262 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5263 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5267 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5269 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5270 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5274 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5275 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5276 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5277 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5281 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5283 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5284 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5288 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5290 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5291 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5293 r = MsiDoAction( hpkg, "FileCost");
5294 ok( r == ERROR_SUCCESS, "file cost failed\n");
5298 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5299 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5300 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5301 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5305 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5306 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5307 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5308 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5312 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5313 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5314 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5315 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5319 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5320 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5321 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5322 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5326 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5328 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5329 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5333 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5334 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5335 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5336 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5340 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5342 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5343 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5347 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5349 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5350 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5354 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5356 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5361 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5363 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5368 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5370 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5371 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5375 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5377 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5378 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5382 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5384 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5385 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5389 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5391 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5392 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5396 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5398 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5403 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5405 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5410 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5411 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5412 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5413 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5417 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5418 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5419 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5420 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5424 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5425 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5426 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5427 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5431 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5432 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5433 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5434 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5438 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5439 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5440 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5441 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5445 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5446 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5447 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5448 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5452 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5453 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5454 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5455 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5459 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5460 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5461 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5462 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5466 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5467 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5468 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5469 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5473 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5474 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5475 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5476 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5480 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5482 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5483 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5487 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5488 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5489 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5490 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5494 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5495 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5496 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5497 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5501 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5502 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5503 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5504 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5508 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5509 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5510 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5511 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5515 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5516 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5517 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5518 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5522 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5524 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5525 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5527 r = MsiDoAction( hpkg, "CostFinalize");
5528 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5532 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5534 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5535 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5539 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5541 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5542 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5546 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5548 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5549 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5553 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5555 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5556 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5560 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5562 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5563 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5567 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5569 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5570 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5574 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5576 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5577 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5581 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5583 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5584 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5588 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5589 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5590 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5591 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5595 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5596 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5597 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5598 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5602 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5603 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5604 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5605 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5609 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5610 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5611 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5612 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5616 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5617 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5618 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5619 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5623 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5624 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5625 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5626 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5630 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5631 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5632 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5633 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5637 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5638 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5639 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5640 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5644 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5645 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5646 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5647 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5651 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5652 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5653 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5654 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5658 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5659 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5660 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5661 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5665 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5666 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5667 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5668 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5672 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5673 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5674 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5675 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5679 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5680 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5681 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5682 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5686 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5687 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5688 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5689 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5693 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5694 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5695 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5696 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5700 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5701 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5702 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5703 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5707 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5708 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5709 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5710 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5714 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5715 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5716 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5717 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5721 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5722 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5723 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5724 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5728 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5729 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5730 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5731 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5735 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5736 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5737 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5738 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5742 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5743 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5744 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5745 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5749 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5751 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5752 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5756 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5757 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5758 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5759 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5761 MsiCloseHandle(hpkg);
5763 /* uninstall the product */
5764 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5765 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5767 /* all features installed from source */
5768 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5769 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5771 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5772 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5774 /* this property must not be in the saved msi file */
5775 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5776 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5778 r = package_from_db( hdb, &hpkg );
5779 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
5783 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5784 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5785 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5786 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5790 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5791 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5792 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5793 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5797 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5798 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5799 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5800 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5804 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5805 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5806 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5807 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5811 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5812 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5813 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5814 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5818 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5819 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5820 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5821 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5825 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5826 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5827 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5828 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5832 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5833 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5834 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5835 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5839 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5840 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5841 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5842 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5846 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5847 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5848 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5849 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5853 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5854 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5855 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5856 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5860 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5861 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5862 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5863 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5867 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5868 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5869 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5870 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5874 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5875 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5876 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5877 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5881 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5882 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5883 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5884 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5888 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5889 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5890 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5891 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5895 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5896 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5897 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5898 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5902 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5903 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5904 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5905 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5909 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5910 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5911 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5912 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5916 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5917 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5918 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5919 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5923 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5924 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5925 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5926 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5930 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5931 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5932 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5933 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5937 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5938 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5939 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5940 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5944 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5945 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5946 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5947 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5951 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5952 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5953 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5954 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5958 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5959 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5960 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5961 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5965 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5966 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5967 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5968 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5972 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5973 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5974 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5975 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5979 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5980 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5981 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5982 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5986 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5987 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5988 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5989 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5993 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5994 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5995 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5996 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6000 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6001 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6002 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6003 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6007 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6008 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6009 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6010 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6012 r = MsiDoAction( hpkg, "CostInitialize");
6013 ok( r == ERROR_SUCCESS, "cost init failed\n");
6017 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6018 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6019 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6020 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6024 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6026 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6027 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6031 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6032 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6033 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6034 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6038 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6040 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6041 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6045 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6047 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6048 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6052 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6054 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6059 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6060 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6061 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6062 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6066 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6068 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6069 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6073 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6075 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6076 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6080 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6082 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6083 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6087 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6089 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6090 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6094 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6096 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6097 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6101 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6103 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6104 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6108 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6110 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6111 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6115 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6117 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6118 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6122 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6124 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6125 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6129 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6131 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6132 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6136 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6138 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6139 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6143 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6145 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6146 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6150 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6152 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6153 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6157 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6159 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6160 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6164 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6166 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6167 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6171 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6173 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6174 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6178 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6180 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6181 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6185 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6187 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6192 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6199 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6206 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6213 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6220 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6227 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6234 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6241 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6246 r = MsiDoAction( hpkg, "FileCost");
6247 ok( r == ERROR_SUCCESS, "file cost failed\n");
6251 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6253 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6254 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6258 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6260 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6261 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6265 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6266 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6267 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6268 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6272 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6274 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6275 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6279 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6281 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6282 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6286 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6288 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6289 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6293 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6295 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6296 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6300 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6301 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6302 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6303 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6307 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6308 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6309 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6310 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6314 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6315 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6316 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6317 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6321 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6322 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6323 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6324 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6328 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6329 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6330 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6331 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6335 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6336 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6337 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6338 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6342 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6344 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6345 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6349 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6350 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6351 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6352 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6356 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6357 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6358 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6359 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6363 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6365 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6366 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6370 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6372 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6373 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6377 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6378 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6379 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6380 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6384 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6386 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6387 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6391 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6393 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6394 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6398 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6400 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6401 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6405 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6407 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6408 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6412 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6414 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6415 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6419 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6421 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6422 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6426 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6428 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6429 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6433 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6435 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6436 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6440 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6442 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6443 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6447 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6449 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6450 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6454 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6456 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6457 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6461 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6463 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6464 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6468 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6470 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6471 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6475 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6477 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6478 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6480 r = MsiDoAction( hpkg, "CostFinalize");
6481 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6485 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6486 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6487 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6488 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6492 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6493 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6494 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6495 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6499 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6500 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6501 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6502 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6506 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6507 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6508 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6509 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6513 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6514 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6515 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6516 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6520 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6521 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6522 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6523 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6527 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6528 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6529 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6530 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6534 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6535 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6536 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6537 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6541 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6542 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6543 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6544 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6548 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6549 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6550 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6551 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6555 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6556 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6557 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6558 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6562 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6563 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6564 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6565 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6569 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6570 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6571 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6572 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6576 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6577 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6578 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6579 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6583 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6584 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6585 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6586 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6590 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6591 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6592 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6593 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6597 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6598 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6599 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6600 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6604 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6605 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6606 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6607 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6611 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6612 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6613 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6614 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6618 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6619 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6620 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6621 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6625 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6626 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6627 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6628 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6632 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6633 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6634 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6635 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6639 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6640 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6641 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6642 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6646 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6647 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6648 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6649 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6653 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6654 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6655 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6656 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6660 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6661 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6662 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6663 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6667 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6668 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6669 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6670 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6674 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6676 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6677 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6681 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6683 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6684 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6688 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6690 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6691 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6695 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6696 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6697 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6698 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6702 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6703 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6704 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6705 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6709 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6710 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6711 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6712 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6714 MsiCloseHandle(hpkg);
6716 /* reinstall the product */
6717 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6720 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6721 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6723 /* this property must not be in the saved msi file */
6724 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6725 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6727 r = package_from_db( hdb, &hpkg );
6728 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
6732 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6733 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6734 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6735 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6739 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6740 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6741 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6742 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6746 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6747 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6748 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6749 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6753 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6754 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6755 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6756 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6760 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6761 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6762 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6763 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6767 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6768 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6769 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6770 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6774 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6775 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6776 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6777 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6781 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6782 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6783 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6784 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6788 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6789 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6790 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6791 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6795 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6796 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6797 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6798 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6802 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6803 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6804 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6805 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6809 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6810 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6811 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6812 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6816 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6817 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6818 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6819 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6823 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6824 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6825 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6826 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6830 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6831 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6832 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6833 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6837 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6838 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6839 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6840 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6844 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6845 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6846 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6847 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6851 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6852 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6853 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6854 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6858 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6859 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6860 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6861 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6865 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6866 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6867 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6868 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6872 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6873 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6874 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6875 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6879 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6880 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6881 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6882 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6886 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6887 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6888 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6889 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6893 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6894 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6895 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6896 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6900 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6901 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6902 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6903 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6907 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6908 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6909 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6910 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6914 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6915 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6916 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6917 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6921 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6922 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6923 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6924 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6928 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6929 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6930 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6931 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6935 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6936 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6937 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6938 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6942 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6943 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6944 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6945 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6949 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6950 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6951 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6952 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6956 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6957 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6958 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6959 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6961 r = MsiDoAction( hpkg, "CostInitialize");
6962 ok( r == ERROR_SUCCESS, "cost init failed\n");
6966 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6968 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6969 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6973 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6975 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6976 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6980 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6982 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6983 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6987 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6989 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6990 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6994 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6996 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6997 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7001 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7002 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7003 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7004 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7008 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7009 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7010 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7011 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7015 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7016 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7017 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7018 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7022 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7023 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7024 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7025 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7029 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7030 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7031 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7032 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7036 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7037 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7038 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7039 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7043 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7044 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7045 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7046 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7050 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7051 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7052 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7053 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7057 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7058 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7059 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7060 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7064 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7065 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7066 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7067 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7071 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7072 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7073 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7074 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7078 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7079 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7080 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7081 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7085 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7086 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7087 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7088 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7092 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7094 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7095 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7099 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7101 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7102 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7106 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7108 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7113 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7115 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7116 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7120 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7122 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7127 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7134 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7141 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7148 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7155 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7162 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7164 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7165 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7169 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7171 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7176 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7178 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7183 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7185 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7186 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7190 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7192 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7193 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7195 r = MsiDoAction( hpkg, "FileCost");
7196 ok( r == ERROR_SUCCESS, "file cost failed\n");
7200 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7202 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7203 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7207 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7209 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7210 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7214 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7215 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7216 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7217 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7221 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7222 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7223 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7224 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7228 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7229 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7230 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7231 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7235 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7236 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7237 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7238 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7242 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7243 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7244 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7245 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7249 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7250 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7251 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7252 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7256 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7257 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7258 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7259 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7263 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7264 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7265 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7266 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7270 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7271 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7272 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7273 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7277 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7278 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7279 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7280 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7284 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7285 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7286 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7287 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7291 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7292 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7293 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7294 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7298 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7299 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7300 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7301 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7305 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7306 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7307 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7308 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7312 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7313 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7314 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7315 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7319 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7320 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7321 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7322 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7326 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7328 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7329 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7333 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7334 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7335 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7336 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7340 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7342 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7343 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7347 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7349 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7350 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7354 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7356 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7361 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7363 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7368 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7370 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7371 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7375 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7377 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7378 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7382 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7384 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7385 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7389 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7391 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7392 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7396 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7398 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7403 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7405 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7410 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7411 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7412 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7413 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7417 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7418 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7419 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7420 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7424 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7425 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7426 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7427 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7429 r = MsiDoAction( hpkg, "CostFinalize");
7430 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
7434 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7435 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7436 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7437 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7441 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7442 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7443 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7444 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7448 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7449 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7450 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7451 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7455 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7456 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7457 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7458 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7462 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7464 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7465 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7469 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7470 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7471 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7472 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7476 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7478 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7479 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7483 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7484 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7485 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7486 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7490 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7491 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7492 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7493 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7497 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7499 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7500 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7504 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7505 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7506 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7507 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7511 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7513 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7514 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7518 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7520 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7521 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7525 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7526 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7527 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7528 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7532 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7534 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7535 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7539 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7541 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7542 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7546 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7548 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7549 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7553 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7555 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7556 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7560 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7562 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7563 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7567 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7569 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7570 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7574 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7576 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7577 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7581 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7583 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7584 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7588 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7589 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7590 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7591 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7595 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7596 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7597 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7598 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7602 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7603 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7604 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7605 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7609 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7610 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7611 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7612 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7616 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7617 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7618 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7619 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7623 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7624 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7625 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7626 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7630 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7631 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7632 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7633 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7637 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7638 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7639 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7640 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7644 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7645 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7646 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7647 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7651 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7652 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7653 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7654 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7658 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7659 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7660 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7661 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7663 MsiCloseHandle(hpkg);
7665 /* uninstall the product */
7666 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7667 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7669 DeleteFileA(msifile);
7670 DeleteFileA(msifile2);
7671 DeleteFileA(msifile3);
7672 DeleteFileA(msifile4);
7675 static void test_getproperty(void)
7677 MSIHANDLE hPackage = 0;
7679 static CHAR empty[] = "";
7683 r = package_from_db(create_package_db(), &hPackage);
7684 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7686 skip("Not enough rights to perform tests\n");
7687 DeleteFile(msifile);
7690 ok( r == ERROR_SUCCESS, "Failed to create package %u\n", r );
7692 /* set the property */
7693 r = MsiSetProperty(hPackage, "Name", "Value");
7694 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7696 /* retrieve the size, NULL pointer */
7698 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7699 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7700 ok( size == 5, "Expected 5, got %d\n", size);
7702 /* retrieve the size, empty string */
7704 r = MsiGetProperty(hPackage, "Name", empty, &size);
7705 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7706 ok( size == 5, "Expected 5, got %d\n", size);
7708 /* don't change size */
7709 r = MsiGetProperty(hPackage, "Name", prop, &size);
7710 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7711 ok( size == 5, "Expected 5, got %d\n", size);
7712 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7714 /* increase the size by 1 */
7716 r = MsiGetProperty(hPackage, "Name", prop, &size);
7717 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7718 ok( size == 5, "Expected 5, got %d\n", size);
7719 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7721 r = MsiCloseHandle( hPackage);
7722 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7723 DeleteFile(msifile);
7726 static void test_removefiles(void)
7731 INSTALLSTATE installed, action;
7733 hdb = create_package_db();
7734 ok ( hdb, "failed to create package database\n" );
7736 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7737 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7739 r = create_feature_table( hdb );
7740 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7742 r = create_component_table( hdb );
7743 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7745 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7746 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7748 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7749 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7751 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7752 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7754 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7755 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7757 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7758 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7760 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7761 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7763 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7764 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7766 r = add_component_entry( hdb, "'oxygen', '', 'TARGETDIR', 0, '0', 'oxygen_file'" );
7767 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7769 r = create_feature_components_table( hdb );
7770 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7772 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7773 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7775 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7776 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7778 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7779 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7781 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7782 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7784 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7785 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7787 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7788 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7790 r = add_feature_components_entry( hdb, "'one', 'oxygen'" );
7791 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7793 r = create_file_table( hdb );
7794 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7796 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7797 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7799 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7800 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7802 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7803 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7805 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7806 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7808 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7809 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7811 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7812 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7814 r = add_file_entry( hdb, "'oxygen_file', 'oxygen', 'oxygen.txt', 0, '', '1033', 16384, 1" );
7815 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7817 r = create_remove_file_table( hdb );
7818 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7820 r = package_from_db( hdb, &hpkg );
7821 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7823 skip("Not enough rights to perform tests\n");
7824 DeleteFile(msifile);
7827 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7829 MsiCloseHandle( hdb );
7831 create_test_file( "hydrogen.txt" );
7832 create_test_file( "helium.txt" );
7833 create_test_file( "lithium.txt" );
7834 create_test_file( "beryllium.txt" );
7835 create_test_file( "boron.txt" );
7836 create_test_file( "carbon.txt" );
7837 create_test_file( "oxygen.txt" );
7839 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7840 ok( r == ERROR_SUCCESS, "set property failed\n");
7842 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7844 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7845 ok( r == ERROR_UNKNOWN_COMPONENT, "expected ERROR_UNKNOWN_COMPONENT, got %u\n", r );
7847 r = MsiDoAction( hpkg, "CostInitialize");
7848 ok( r == ERROR_SUCCESS, "cost init failed\n");
7850 r = MsiDoAction( hpkg, "FileCost");
7851 ok( r == ERROR_SUCCESS, "file cost failed\n");
7853 installed = action = 0xdeadbeef;
7854 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7855 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7856 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7857 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7859 r = MsiDoAction( hpkg, "CostFinalize");
7860 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7862 r = MsiDoAction( hpkg, "InstallValidate");
7863 ok( r == ERROR_SUCCESS, "install validate failed\n");
7865 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7866 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7868 installed = action = 0xdeadbeef;
7869 r = MsiGetComponentState( hpkg, "hydrogen", &installed, &action );
7870 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7871 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7872 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7874 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7875 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7877 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7878 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7880 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7881 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7883 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7884 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7886 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7887 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7889 installed = action = 0xdeadbeef;
7890 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7891 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7892 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7893 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7895 r = MsiSetComponentState( hpkg, "oxygen", INSTALLSTATE_ABSENT );
7896 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7898 installed = action = 0xdeadbeef;
7899 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7900 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7901 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7902 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7904 r = MsiDoAction( hpkg, "RemoveFiles");
7905 ok( r == ERROR_SUCCESS, "remove files failed\n");
7907 installed = action = 0xdeadbeef;
7908 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7909 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7910 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7911 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7913 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7914 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7915 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7916 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7917 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7918 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7919 ok(DeleteFileA("oxygen.txt"), "Expected oxygen.txt to exist\n");
7921 MsiCloseHandle( hpkg );
7922 DeleteFileA(msifile);
7925 static void test_appsearch(void)
7930 CHAR prop[MAX_PATH];
7933 hdb = create_package_db();
7934 ok ( hdb, "failed to create package database\n" );
7936 r = create_appsearch_table( hdb );
7937 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7939 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7940 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7942 r = add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" );
7943 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7945 r = create_reglocator_table( hdb );
7946 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7948 r = add_reglocator_entry( hdb, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 );
7949 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7951 r = create_drlocator_table( hdb );
7952 ok( r == ERROR_SUCCESS, "cannot create DrLocator table: %d\n", r );
7954 r = add_drlocator_entry( hdb, "'NewSignature2', 0, 'c:\\windows\\system32', 0" );
7955 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7957 r = create_signature_table( hdb );
7958 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7960 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7961 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7963 r = add_signature_entry( hdb, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" );
7964 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7966 r = package_from_db( hdb, &hpkg );
7967 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7969 skip("Not enough rights to perform tests\n");
7970 DeleteFile(msifile);
7973 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7974 MsiCloseHandle( hdb );
7975 if (r != ERROR_SUCCESS)
7978 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7980 r = MsiDoAction( hpkg, "AppSearch" );
7981 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7983 size = sizeof(prop);
7984 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7985 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7986 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7988 size = sizeof(prop);
7989 r = MsiGetPropertyA( hpkg, "NOTEPAD", prop, &size );
7990 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7993 MsiCloseHandle( hpkg );
7994 DeleteFileA(msifile);
7997 static void test_appsearch_complocator(void)
7999 MSIHANDLE hpkg, hdb;
8000 CHAR path[MAX_PATH];
8001 CHAR prop[MAX_PATH];
8006 if (!(usersid = get_user_sid()))
8009 if (is_process_limited())
8011 skip("process is limited\n");
8015 create_test_file("FileName1");
8016 create_test_file("FileName4");
8017 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
8018 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
8020 create_test_file("FileName2");
8021 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
8022 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
8024 create_test_file("FileName3");
8025 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
8026 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
8028 create_test_file("FileName5");
8029 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
8030 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
8032 create_test_file("FileName6");
8033 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
8034 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
8036 create_test_file("FileName7");
8037 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
8038 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
8040 /* dir is FALSE, but we're pretending it's a directory */
8041 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
8042 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
8044 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8045 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
8046 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
8048 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8049 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
8050 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
8052 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8053 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
8054 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
8056 hdb = create_package_db();
8057 ok(hdb, "Expected a valid database handle\n");
8059 r = create_appsearch_table(hdb);
8060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8062 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8065 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8068 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8071 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8074 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8077 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8078 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8080 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8083 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8086 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8089 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8090 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8092 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8095 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8096 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8098 r = create_complocator_table(hdb);
8099 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8101 /* published component, machine, file, signature, misdbLocatorTypeFile */
8102 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
8103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8105 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
8106 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
8107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8109 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
8110 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
8111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8113 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
8114 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
8115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8117 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
8118 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
8119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8121 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
8122 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
8123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8125 /* published component, machine, file, no signature, misdbLocatorTypeFile */
8126 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
8127 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8129 /* unpublished component, no signature, misdbLocatorTypeDir */
8130 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
8131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8133 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
8134 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
8135 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8137 /* published component, signature w/ ver, misdbLocatorTypeFile */
8138 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
8139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8141 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
8142 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
8143 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8145 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
8146 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
8147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8149 r = create_signature_table(hdb);
8150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8152 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
8153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8155 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
8156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8158 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
8159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8161 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
8162 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8164 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
8165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8167 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8170 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8173 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8176 r = package_from_db(hdb, &hpkg);
8177 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8179 skip("Not enough rights to perform tests\n");
8182 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8184 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
8185 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8187 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8189 r = MsiDoAction(hpkg, "AppSearch");
8190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8193 sprintf(path, "%s\\FileName1", CURR_DIR);
8194 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8195 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8196 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8199 sprintf(path, "%s\\FileName2", CURR_DIR);
8200 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8201 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8202 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8205 sprintf(path, "%s\\FileName3", CURR_DIR);
8206 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8208 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8211 sprintf(path, "%s\\FileName4", CURR_DIR);
8212 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8213 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8214 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8217 sprintf(path, "%s\\FileName5", CURR_DIR);
8218 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8219 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8220 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8223 sprintf(path, "%s\\", CURR_DIR);
8224 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8225 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8226 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8229 sprintf(path, "%s\\", CURR_DIR);
8230 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8231 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8232 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8235 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8236 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8237 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
8240 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8241 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8242 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8245 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
8246 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8247 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8248 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8251 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8252 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8253 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8256 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
8257 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8258 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8259 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8261 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
8262 MSIINSTALLCONTEXT_MACHINE, NULL);
8263 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
8264 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
8265 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
8266 MSIINSTALLCONTEXT_USERMANAGED, usersid);
8267 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
8268 MSIINSTALLCONTEXT_MACHINE, NULL);
8269 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
8270 MSIINSTALLCONTEXT_MACHINE, NULL);
8271 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
8272 MSIINSTALLCONTEXT_MACHINE, NULL);
8273 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
8274 MSIINSTALLCONTEXT_MACHINE, NULL);
8275 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
8276 MSIINSTALLCONTEXT_MACHINE, NULL);
8277 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
8278 MSIINSTALLCONTEXT_MACHINE, NULL);
8279 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
8280 MSIINSTALLCONTEXT_MACHINE, NULL);
8282 MsiCloseHandle(hpkg);
8285 DeleteFileA("FileName1");
8286 DeleteFileA("FileName2");
8287 DeleteFileA("FileName3");
8288 DeleteFileA("FileName4");
8289 DeleteFileA("FileName5");
8290 DeleteFileA("FileName6");
8291 DeleteFileA("FileName7");
8292 DeleteFileA("FileName8.dll");
8293 DeleteFileA("FileName9.dll");
8294 DeleteFileA("FileName10.dll");
8295 DeleteFileA(msifile);
8299 static void test_appsearch_reglocator(void)
8301 MSIHANDLE hpkg, hdb;
8302 CHAR path[MAX_PATH], prop[MAX_PATH];
8303 DWORD binary[2], size, val;
8304 BOOL space, version, is_64bit = sizeof(void *) > sizeof(int);
8305 HKEY hklm, classes, hkcu, users;
8306 LPSTR pathdata, pathvar, ptr;
8313 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8316 DeleteFileA("test.dll");
8318 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
8319 if (res == ERROR_ACCESS_DENIED)
8321 skip("Not enough rights to perform tests\n");
8324 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8326 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
8327 (const BYTE *)"regszdata", 10);
8328 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8330 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
8331 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8333 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
8334 (const BYTE *)"regszdata", 10);
8335 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8338 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
8339 ok(res == ERROR_SUCCESS ||
8340 broken(res == ERROR_INVALID_PARAMETER),
8341 "Expected ERROR_SUCCESS, got %d\n", res);
8343 if (res == ERROR_SUCCESS)
8345 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
8346 (const BYTE *)"regszdata", 10);
8347 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8350 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
8351 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8353 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
8354 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8356 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
8357 (const BYTE *)"regszdata", 10);
8358 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8361 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
8362 (const BYTE *)&val, sizeof(DWORD));
8363 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8366 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
8367 (const BYTE *)&val, sizeof(DWORD));
8368 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8370 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
8371 (const BYTE *)"%PATH%", 7);
8372 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8374 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
8375 (const BYTE *)"my%NOVAR%", 10);
8376 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8378 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
8379 (const BYTE *)"one\0two\0", 9);
8380 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8382 binary[0] = 0x1234abcd;
8383 binary[1] = 0x567890ef;
8384 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
8385 (const BYTE *)binary, sizeof(binary));
8386 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8388 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
8389 (const BYTE *)"#regszdata", 11);
8390 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8392 create_test_file("FileName1");
8393 sprintf(path, "%s\\FileName1", CURR_DIR);
8394 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
8395 (const BYTE *)path, lstrlenA(path) + 1);
8396 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8398 sprintf(path, "%s\\FileName2", CURR_DIR);
8399 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
8400 (const BYTE *)path, lstrlenA(path) + 1);
8401 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8403 lstrcpyA(path, CURR_DIR);
8404 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
8405 (const BYTE *)path, lstrlenA(path) + 1);
8406 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8408 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
8409 (const BYTE *)"", 1);
8410 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8412 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8413 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8414 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
8415 (const BYTE *)path, lstrlenA(path) + 1);
8416 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8418 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8419 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8420 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
8421 (const BYTE *)path, lstrlenA(path) + 1);
8422 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8424 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8425 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8426 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
8427 (const BYTE *)path, lstrlenA(path) + 1);
8428 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8430 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
8431 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
8432 (const BYTE *)path, lstrlenA(path) + 1);
8433 ok( res == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", res);
8435 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
8436 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
8437 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
8438 (const BYTE *)path, lstrlenA(path) + 1);
8439 ok( res == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", res);
8441 hdb = create_package_db();
8442 ok(hdb, "Expected a valid database handle\n");
8444 r = create_appsearch_table(hdb);
8445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8447 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8450 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8453 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8456 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8459 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8462 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8465 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8468 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8471 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8474 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8477 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8480 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8483 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
8484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8486 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
8487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8489 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
8490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8492 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
8493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8495 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
8496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8498 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
8499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8501 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
8502 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8504 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
8505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8507 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
8508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8510 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
8511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8513 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
8514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8516 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
8517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8519 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
8520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8522 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
8523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8525 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
8526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8528 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
8529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8531 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
8532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8534 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
8535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8537 r = create_reglocator_table(hdb);
8538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8540 type = msidbLocatorTypeRawValue;
8542 type |= msidbLocatorType64bit;
8544 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
8545 r = add_reglocator_entry(hdb, "NewSignature1", 2, "Software\\Wine", "Value1", type);
8546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8548 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
8549 r = add_reglocator_entry(hdb, "NewSignature2", 2, "Software\\Wine", "Value2", type);
8550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8552 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
8553 r = add_reglocator_entry(hdb, "NewSignature3", 2, "Software\\Wine", "Value3", type);
8554 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8556 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8557 r = add_reglocator_entry(hdb, "NewSignature4", 2, "Software\\Wine", "Value4", type);
8558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8560 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8561 r = add_reglocator_entry(hdb, "NewSignature5", 2, "Software\\Wine", "Value5", type);
8562 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8564 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
8565 r = add_reglocator_entry(hdb, "NewSignature6", 2, "Software\\Wine", "Value6", type);
8566 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8568 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
8569 r = add_reglocator_entry(hdb, "NewSignature7", 2, "Software\\Wine", "Value7", type);
8570 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8572 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
8573 r = add_reglocator_entry(hdb, "NewSignature8", 2, "Software\\Wine", "Value8", type);
8574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8576 type = msidbLocatorTypeFileName;
8578 type |= msidbLocatorType64bit;
8580 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
8581 r = add_reglocator_entry(hdb, "NewSignature9", 2, "Software\\Wine", "Value9", type);
8582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8584 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
8585 r = add_reglocator_entry(hdb, "NewSignature10", 2, "Software\\Wine", "Value10", type);
8586 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8588 /* HKLM, msidbLocatorTypeFileName, no signature */
8589 r = add_reglocator_entry(hdb, "NewSignature11", 2, "Software\\Wine", "Value9", type);
8590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8592 type = msidbLocatorTypeDirectory;
8594 type |= msidbLocatorType64bit;
8596 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
8597 r = add_reglocator_entry(hdb, "NewSignature12", 2, "Software\\Wine", "Value9", type);
8598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8600 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8601 r = add_reglocator_entry(hdb, "NewSignature13", 2, "Software\\Wine", "Value11", type);
8602 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8604 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8605 r = add_reglocator_entry(hdb, "NewSignature14", 2, "Software\\Wine", "Value9", type);
8606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8608 type = msidbLocatorTypeRawValue;
8610 type |= msidbLocatorType64bit;
8612 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8613 r = add_reglocator_entry(hdb, "NewSignature15", 0, "Software\\Wine", "Value1", type);
8614 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8616 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8617 r = add_reglocator_entry(hdb, "NewSignature16", 1, "Software\\Wine", "Value1", type);
8618 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8620 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8621 r = add_reglocator_entry(hdb, "NewSignature17", 3, "S-1-5-18\\Software\\Wine", "Value1", type);
8622 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8624 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8625 r = add_reglocator_entry(hdb, "NewSignature18", 2, "Software\\Wine", "", type);
8626 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8628 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8629 r = add_reglocator_entry(hdb, "NewSignature19", 2, "Software\\IDontExist", "", type);
8630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8632 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8633 r = add_reglocator_entry(hdb, "NewSignature20", 2, "Software\\Wine", "Value12", type);
8634 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8636 type = msidbLocatorTypeFileName;
8638 type |= msidbLocatorType64bit;
8640 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8641 r = add_reglocator_entry(hdb, "NewSignature21", 2, "Software\\Wine", "Value13", type);
8642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8644 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8645 r = add_reglocator_entry(hdb, "NewSignature22", 2, "Software\\Wine", "Value14", type);
8646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8648 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8649 r = add_reglocator_entry(hdb, "NewSignature23", 2, "Software\\Wine", "Value15", type);
8650 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8652 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8653 r = add_reglocator_entry(hdb, "NewSignature24", 2, "Software\\Wine", "Value11", type);
8654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8656 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8657 r = add_reglocator_entry(hdb, "NewSignature25", 2, "Software\\Wine", "Value10", type);
8658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8660 type = msidbLocatorTypeDirectory;
8662 type |= msidbLocatorType64bit;
8664 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8665 r = add_reglocator_entry(hdb, "NewSignature26", 2, "Software\\Wine", "Value11", type);
8666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8668 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8669 r = add_reglocator_entry(hdb, "NewSignature27", 2, "Software\\Wine", "Value10", type);
8670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8672 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8673 r = add_reglocator_entry(hdb, "NewSignature28", 2, "Software\\Wine", "Value10", type);
8674 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8676 type = msidbLocatorTypeFileName;
8678 type |= msidbLocatorType64bit;
8680 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8681 r = add_reglocator_entry(hdb, "NewSignature29", 2, "Software\\Wine", "Value16", type);
8682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8684 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8685 r = add_reglocator_entry(hdb, "NewSignature30", 2, "Software\\Wine", "Value17", type);
8686 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8688 r = create_signature_table(hdb);
8689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8691 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8692 r = add_signature_entry(hdb, str);
8693 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8695 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8696 r = add_signature_entry(hdb, str);
8697 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8699 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8700 r = add_signature_entry(hdb, str);
8701 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8703 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8704 r = add_signature_entry(hdb, str);
8705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8707 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8708 r = add_signature_entry(hdb, str);
8709 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8711 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8712 r = add_signature_entry(hdb, str);
8713 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8715 ptr = strrchr(CURR_DIR, '\\') + 1;
8716 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8717 r = add_signature_entry(hdb, path);
8718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8720 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8721 r = add_signature_entry(hdb, str);
8722 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8724 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8725 r = add_signature_entry(hdb, str);
8726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8728 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8729 r = add_signature_entry(hdb, str);
8730 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8732 r = package_from_db(hdb, &hpkg);
8733 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8735 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8737 r = MsiDoAction(hpkg, "AppSearch");
8738 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8741 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8742 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8743 ok(!lstrcmpA(prop, "regszdata"),
8744 "Expected \"regszdata\", got \"%s\"\n", prop);
8747 r = MsiGetPropertyA(hpkg, "SIGPROP2", 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);
8752 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8753 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8754 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8756 memset(&si, 0, sizeof(si));
8757 if (pGetNativeSystemInfo) pGetNativeSystemInfo(&si);
8759 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
8761 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8762 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8763 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8766 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8769 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8770 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8772 ok(!lstrcmpA(pathdata, pathvar),
8773 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8775 HeapFree(GetProcessHeap(), 0, pathvar);
8776 HeapFree(GetProcessHeap(), 0, pathdata);
8780 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8781 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8783 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8786 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8787 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8790 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8791 "Expected \"\\0one\\0two\\0\\0\"\n");
8795 lstrcpyA(path, "#xCDAB3412EF907856");
8796 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8798 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8801 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8803 ok(!lstrcmpA(prop, "##regszdata"),
8804 "Expected \"##regszdata\", got \"%s\"\n", prop);
8807 sprintf(path, "%s\\FileName1", CURR_DIR);
8808 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8810 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8813 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8815 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8818 sprintf(path, "%s\\", CURR_DIR);
8819 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8820 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8821 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8824 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8826 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8829 sprintf(path, "%s\\", CURR_DIR);
8830 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8832 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8835 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8836 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8837 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8840 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8841 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8842 ok(!lstrcmpA(prop, "regszdata"),
8843 "Expected \"regszdata\", got \"%s\"\n", prop);
8846 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8847 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8848 ok(!lstrcmpA(prop, "regszdata"),
8849 "Expected \"regszdata\", got \"%s\"\n", prop);
8854 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8855 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8856 ok(!lstrcmpA(prop, "regszdata"),
8857 "Expected \"regszdata\", got \"%s\"\n", prop);
8861 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8862 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8863 ok(!lstrcmpA(prop, "defvalue"),
8864 "Expected \"defvalue\", got \"%s\"\n", prop);
8867 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8868 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8869 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8872 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8873 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8874 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8879 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8880 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8881 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8882 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8885 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8886 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8887 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8890 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8891 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8892 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8893 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8897 lstrcpyA(path, CURR_DIR);
8898 ptr = strrchr(path, '\\') + 1;
8900 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8901 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8902 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8905 sprintf(path, "%s\\", CURR_DIR);
8906 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8907 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8908 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8911 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8913 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8916 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8917 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8918 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8921 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8922 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8923 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8926 sprintf(path, "%s\\FileName1", CURR_DIR);
8927 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8928 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8929 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8932 sprintf(path, "%s\\FileName1", CURR_DIR);
8933 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8934 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8936 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8938 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8940 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8941 RegDeleteValueA(hklm, "Value1");
8942 RegDeleteValueA(hklm, "Value2");
8943 RegDeleteValueA(hklm, "Value3");
8944 RegDeleteValueA(hklm, "Value4");
8945 RegDeleteValueA(hklm, "Value5");
8946 RegDeleteValueA(hklm, "Value6");
8947 RegDeleteValueA(hklm, "Value7");
8948 RegDeleteValueA(hklm, "Value8");
8949 RegDeleteValueA(hklm, "Value9");
8950 RegDeleteValueA(hklm, "Value10");
8951 RegDeleteValueA(hklm, "Value11");
8952 RegDeleteValueA(hklm, "Value12");
8953 RegDeleteValueA(hklm, "Value13");
8954 RegDeleteValueA(hklm, "Value14");
8955 RegDeleteValueA(hklm, "Value15");
8956 RegDeleteValueA(hklm, "Value16");
8957 RegDeleteValueA(hklm, "Value17");
8958 RegDeleteKey(hklm, "");
8961 RegDeleteValueA(classes, "Value1");
8962 RegDeleteKeyA(classes, "");
8963 RegCloseKey(classes);
8965 RegDeleteValueA(hkcu, "Value1");
8966 RegDeleteKeyA(hkcu, "");
8969 RegDeleteValueA(users, "Value1");
8970 RegDeleteKeyA(users, "");
8973 DeleteFileA("FileName1");
8974 DeleteFileA("FileName3.dll");
8975 DeleteFileA("FileName4.dll");
8976 DeleteFileA("FileName5.dll");
8977 MsiCloseHandle(hpkg);
8978 DeleteFileA(msifile);
8981 static void delete_win_ini(LPCSTR file)
8983 CHAR path[MAX_PATH];
8985 GetWindowsDirectoryA(path, MAX_PATH);
8986 lstrcatA(path, "\\");
8987 lstrcatA(path, file);
8992 static void test_appsearch_inilocator(void)
8994 MSIHANDLE hpkg, hdb;
8995 CHAR path[MAX_PATH];
8996 CHAR prop[MAX_PATH];
9004 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9007 DeleteFileA("test.dll");
9009 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
9011 create_test_file("FileName1");
9012 sprintf(path, "%s\\FileName1", CURR_DIR);
9013 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
9015 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
9017 sprintf(path, "%s\\IDontExist", CURR_DIR);
9018 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
9020 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9021 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9022 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
9024 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9025 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9026 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
9028 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9029 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9030 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
9032 hdb = create_package_db();
9033 ok(hdb, "Expected a valid database handle\n");
9035 r = create_appsearch_table(hdb);
9036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9038 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9041 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9044 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9045 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9047 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9048 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9050 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9053 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9056 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9059 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9062 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9065 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9068 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9071 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
9072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9074 r = create_inilocator_table(hdb);
9075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9077 /* msidbLocatorTypeRawValue, field 1 */
9078 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
9079 r = add_inilocator_entry(hdb, str);
9080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9082 /* msidbLocatorTypeRawValue, field 2 */
9083 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
9084 r = add_inilocator_entry(hdb, str);
9085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9087 /* msidbLocatorTypeRawValue, entire field */
9088 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
9089 r = add_inilocator_entry(hdb, str);
9090 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9092 /* msidbLocatorTypeFile */
9093 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9094 r = add_inilocator_entry(hdb, str);
9095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9097 /* msidbLocatorTypeDirectory, file */
9098 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
9099 r = add_inilocator_entry(hdb, str);
9100 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9102 /* msidbLocatorTypeDirectory, directory */
9103 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
9104 r = add_inilocator_entry(hdb, str);
9105 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9107 /* msidbLocatorTypeFile, file, no signature */
9108 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9109 r = add_inilocator_entry(hdb, str);
9110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9112 /* msidbLocatorTypeFile, dir, no signature */
9113 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
9114 r = add_inilocator_entry(hdb, str);
9115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9117 /* msidbLocatorTypeFile, file does not exist */
9118 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
9119 r = add_inilocator_entry(hdb, str);
9120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9122 /* msidbLocatorTypeFile, signature with version */
9123 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
9124 r = add_inilocator_entry(hdb, str);
9125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9127 /* msidbLocatorTypeFile, signature with version, ver > max */
9128 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
9129 r = add_inilocator_entry(hdb, str);
9130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9132 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
9133 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
9134 r = add_inilocator_entry(hdb, str);
9135 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9137 r = create_signature_table(hdb);
9138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9140 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
9141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9143 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
9144 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9146 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9149 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9152 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9155 r = package_from_db(hdb, &hpkg);
9156 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9158 skip("Not enough rights to perform tests\n");
9161 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9163 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9165 r = MsiDoAction(hpkg, "AppSearch");
9166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9169 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9170 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9171 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
9174 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9176 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
9179 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9181 ok(!lstrcmpA(prop, "keydata,field2"),
9182 "Expected \"keydata,field2\", got \"%s\"\n", prop);
9185 sprintf(path, "%s\\FileName1", CURR_DIR);
9186 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9187 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9188 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9191 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9192 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9193 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9196 sprintf(path, "%s\\", CURR_DIR);
9197 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9198 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9199 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9202 sprintf(path, "%s\\", CURR_DIR);
9203 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9204 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9205 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9208 lstrcpyA(path, CURR_DIR);
9209 ptr = strrchr(path, '\\');
9211 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9213 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9216 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9217 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9218 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9223 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9224 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9225 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9226 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9229 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9230 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9231 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9234 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9235 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
9236 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9237 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9240 MsiCloseHandle(hpkg);
9243 delete_win_ini("IniFile.ini");
9244 DeleteFileA("FileName1");
9245 DeleteFileA("FileName2.dll");
9246 DeleteFileA("FileName3.dll");
9247 DeleteFileA("FileName4.dll");
9248 DeleteFileA(msifile);
9252 * MSI AppSearch action on DrLocator table always returns absolute paths.
9253 * If a relative path was set, it returns the first absolute path that
9254 * matches or an empty string if it didn't find anything.
9255 * This helper function replicates this behaviour.
9257 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
9262 size = lstrlenA(relative);
9263 drives = GetLogicalDrives();
9264 lstrcpyA(absolute, "A:\\");
9265 for (i = 0; i < 26; absolute[0] = '\0', i++)
9267 if (!(drives & (1 << i)))
9270 absolute[0] = 'A' + i;
9271 if (GetDriveType(absolute) != DRIVE_FIXED)
9274 lstrcpynA(absolute + 3, relative, size + 1);
9275 attr = GetFileAttributesA(absolute);
9276 if (attr != INVALID_FILE_ATTRIBUTES &&
9277 (attr & FILE_ATTRIBUTE_DIRECTORY))
9279 if (absolute[3 + size - 1] != '\\')
9280 lstrcatA(absolute, "\\");
9287 static void test_appsearch_drlocator(void)
9289 MSIHANDLE hpkg, hdb;
9290 CHAR path[MAX_PATH];
9291 CHAR prop[MAX_PATH];
9298 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9301 DeleteFileA("test.dll");
9303 create_test_file("FileName1");
9304 CreateDirectoryA("one", NULL);
9305 CreateDirectoryA("one\\two", NULL);
9306 CreateDirectoryA("one\\two\\three", NULL);
9307 create_test_file("one\\two\\three\\FileName2");
9308 CreateDirectoryA("another", NULL);
9309 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9310 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9311 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9313 hdb = create_package_db();
9314 ok(hdb, "Expected a valid database handle\n");
9316 r = create_appsearch_table(hdb);
9317 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9319 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9322 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9323 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9325 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9326 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9328 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9329 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9331 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9332 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9334 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9337 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9338 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9340 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9341 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9343 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9346 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9347 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9349 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9350 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9352 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
9353 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9355 r = create_drlocator_table(hdb);
9356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9358 /* no parent, full path, depth 0, signature */
9359 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
9360 r = add_drlocator_entry(hdb, path);
9361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9363 /* no parent, full path, depth 0, no signature */
9364 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
9365 r = add_drlocator_entry(hdb, path);
9366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9368 /* no parent, relative path, depth 0, no signature */
9369 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
9370 r = add_drlocator_entry(hdb, path);
9371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9373 /* no parent, full path, depth 2, signature */
9374 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
9375 r = add_drlocator_entry(hdb, path);
9376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9378 /* no parent, full path, depth 3, signature */
9379 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
9380 r = add_drlocator_entry(hdb, path);
9381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9383 /* no parent, full path, depth 1, signature is dir */
9384 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
9385 r = add_drlocator_entry(hdb, path);
9386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9388 /* parent is in DrLocator, relative path, depth 0, signature */
9389 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
9390 r = add_drlocator_entry(hdb, path);
9391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9393 /* no parent, full path, depth 0, signature w/ version */
9394 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
9395 r = add_drlocator_entry(hdb, path);
9396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9398 /* no parent, full path, depth 0, signature w/ version, ver > max */
9399 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
9400 r = add_drlocator_entry(hdb, path);
9401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9403 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
9404 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
9405 r = add_drlocator_entry(hdb, path);
9406 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9408 /* no parent, relative empty path, depth 0, no signature */
9409 sprintf(path, "'NewSignature11', '', '', 0");
9410 r = add_drlocator_entry(hdb, path);
9411 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9413 r = create_reglocator_table(hdb);
9414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9417 r = add_reglocator_entry(hdb, "NewSignature12", 2, "htmlfile\\shell\\open\\nonexistent", "", 1);
9418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9420 /* parent is in RegLocator, no path, depth 0, no signature */
9421 sprintf(path, "'NewSignature13', 'NewSignature12', '', 0");
9422 r = add_drlocator_entry(hdb, path);
9423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9425 r = create_signature_table(hdb);
9426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9428 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9429 r = add_signature_entry(hdb, str);
9430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9432 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9433 r = add_signature_entry(hdb, str);
9434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9436 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9437 r = add_signature_entry(hdb, str);
9438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9440 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9441 r = add_signature_entry(hdb, str);
9442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9444 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9445 r = add_signature_entry(hdb, str);
9446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9448 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9449 r = add_signature_entry(hdb, str);
9450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9452 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9453 r = add_signature_entry(hdb, str);
9454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9456 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9457 r = add_signature_entry(hdb, str);
9458 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9460 r = package_from_db(hdb, &hpkg);
9461 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9463 skip("Not enough rights to perform tests\n");
9466 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9468 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9470 r = MsiDoAction(hpkg, "AppSearch");
9471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9474 sprintf(path, "%s\\FileName1", CURR_DIR);
9475 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9476 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9477 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9480 sprintf(path, "%s\\", CURR_DIR);
9481 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9483 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9486 search_absolute_directory(path, CURR_DIR + 3);
9487 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9488 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9489 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9492 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9494 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9497 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9498 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9500 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9503 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9505 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9508 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9509 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9511 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9516 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9517 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9519 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9522 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9524 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9527 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9529 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9533 search_absolute_directory(path, "");
9534 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9536 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9539 strcpy(path, "c:\\");
9540 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
9541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9542 ok(!prop[0], "Expected \"\", got \"%s\"\n", prop);
9544 MsiCloseHandle(hpkg);
9547 DeleteFileA("FileName1");
9548 DeleteFileA("FileName3.dll");
9549 DeleteFileA("FileName4.dll");
9550 DeleteFileA("FileName5.dll");
9551 DeleteFileA("one\\two\\three\\FileName2");
9552 RemoveDirectoryA("one\\two\\three");
9553 RemoveDirectoryA("one\\two");
9554 RemoveDirectoryA("one");
9555 RemoveDirectoryA("another");
9556 DeleteFileA(msifile);
9559 static void test_featureparents(void)
9564 INSTALLSTATE state, action;
9566 hdb = create_package_db();
9567 ok ( hdb, "failed to create package database\n" );
9569 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
9570 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
9572 r = create_feature_table( hdb );
9573 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
9575 r = create_component_table( hdb );
9576 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
9578 r = create_feature_components_table( hdb );
9579 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
9581 r = create_file_table( hdb );
9582 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
9584 /* msidbFeatureAttributesFavorLocal */
9585 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
9586 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9588 /* msidbFeatureAttributesFavorSource */
9589 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
9590 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9592 /* msidbFeatureAttributesFavorLocal */
9593 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
9594 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9596 /* msidbFeatureAttributesUIDisallowAbsent */
9597 r = add_feature_entry( hdb, "'lyra', '', '', '', 2, 1, '', 16" );
9598 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9600 /* disabled because of install level */
9601 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
9602 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9604 /* child feature of disabled feature */
9605 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9606 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9608 /* component of disabled feature (install level) */
9609 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9610 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9612 /* component of disabled child feature (install level) */
9613 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9614 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9616 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9617 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9618 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9620 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9621 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9622 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9624 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9625 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9626 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9628 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9629 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9630 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9632 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9633 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9634 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9636 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9637 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9638 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9640 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9641 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9642 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9644 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9645 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9646 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9648 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9649 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9650 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9652 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9653 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9655 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9656 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9658 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9659 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9661 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9662 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9664 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9665 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9667 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9668 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9670 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9671 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9673 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9674 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9676 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9677 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9679 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9680 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9682 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9683 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9685 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9686 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9688 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9689 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9691 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9692 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9694 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9695 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9697 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9698 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9700 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9701 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9703 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9704 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9706 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9707 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9709 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9710 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9712 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9713 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9715 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9716 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9718 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9719 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9721 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9722 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9724 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9725 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9727 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9728 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9730 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9731 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9733 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9734 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9736 r = package_from_db( hdb, &hpkg );
9737 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9739 skip("Not enough rights to perform tests\n");
9740 DeleteFile(msifile);
9743 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9745 MsiCloseHandle( hdb );
9747 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9749 r = MsiDoAction( hpkg, "CostInitialize");
9750 ok( r == ERROR_SUCCESS, "cost init failed\n");
9752 r = MsiDoAction( hpkg, "FileCost");
9753 ok( r == ERROR_SUCCESS, "file cost failed\n");
9755 r = MsiDoAction( hpkg, "CostFinalize");
9756 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9760 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9761 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9762 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9763 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9767 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9768 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9769 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9770 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9774 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9775 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9776 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9777 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9781 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9783 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9784 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9788 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9790 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9791 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9795 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9797 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9798 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9802 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9803 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9804 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9805 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9809 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9810 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9811 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9812 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9816 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9817 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9818 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9819 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9823 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9824 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9825 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9826 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9830 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9831 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9832 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9833 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9837 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9839 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9840 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9844 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9845 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9846 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9847 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9851 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9852 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9853 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9854 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9858 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9859 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9860 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9861 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9865 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9866 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9867 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9868 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9872 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9873 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9874 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9875 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9877 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9878 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9880 r = MsiSetFeatureState(hpkg, "lyra", INSTALLSTATE_ABSENT);
9881 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9883 r = MsiSetFeatureState(hpkg, "nosuchfeature", INSTALLSTATE_ABSENT);
9884 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r);
9888 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9889 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9890 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9891 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9895 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9896 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9897 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9898 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9902 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9903 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9904 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9905 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9909 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9910 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9911 ok( state == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", state);
9912 ok( action == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", action);
9916 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9917 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9918 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9919 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9923 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9924 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9925 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9926 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9930 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9931 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9932 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9933 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9937 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9938 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9939 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9940 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9944 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9945 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9946 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9947 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9951 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9952 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9953 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9954 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9958 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9959 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9960 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9961 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9965 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9966 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9967 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9968 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9972 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9973 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9974 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9975 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9979 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9981 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9982 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9986 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9988 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9989 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9991 MsiCloseHandle(hpkg);
9992 DeleteFileA(msifile);
9995 static void test_installprops(void)
9997 MSIHANDLE hpkg, hdb;
9998 CHAR path[MAX_PATH], buf[MAX_PATH];
10004 REGSAM access = KEY_ALL_ACCESS;
10008 access |= KEY_WOW64_64KEY;
10010 GetCurrentDirectory(MAX_PATH, path);
10011 lstrcat(path, "\\");
10012 lstrcat(path, msifile);
10014 hdb = create_package_db();
10015 ok( hdb, "failed to create database\n");
10017 r = package_from_db(hdb, &hpkg);
10018 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10020 skip("Not enough rights to perform tests\n");
10021 DeleteFile(msifile);
10024 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10026 MsiCloseHandle(hdb);
10029 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
10030 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10031 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10033 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
10034 RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
10039 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10043 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
10047 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
10048 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10049 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10054 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10058 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
10064 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
10065 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10066 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10070 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
10071 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10072 trace("VersionDatabase = %s\n", buf);
10075 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
10076 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10077 trace("VersionMsi = %s\n", buf);
10080 r = MsiGetProperty(hpkg, "Date", buf, &size);
10081 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10082 trace("Date = %s\n", buf);
10085 r = MsiGetProperty(hpkg, "Time", buf, &size);
10086 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10087 trace("Time = %s\n", buf);
10090 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
10091 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10092 trace("PackageCode = %s\n", buf);
10094 langid = GetUserDefaultLangID();
10095 sprintf(path, "%d", langid);
10098 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
10099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10100 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
10102 res = GetSystemMetrics(SM_CXSCREEN);
10104 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
10105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10106 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10108 res = GetSystemMetrics(SM_CYSCREEN);
10110 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
10111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10112 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10114 if (pGetSystemInfo && pSHGetFolderPathA)
10116 pGetSystemInfo(&si);
10117 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
10121 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10122 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10123 ok(buf[0], "property not set\n");
10127 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10128 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10129 ok(buf[0], "property not set\n");
10133 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10134 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10135 GetSystemDirectoryA(path, MAX_PATH);
10136 if (size) buf[size - 1] = 0;
10137 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10141 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10142 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10143 pGetSystemWow64DirectoryA(path, MAX_PATH);
10144 if (size) buf[size - 1] = 0;
10145 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10149 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10150 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10151 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10152 if (size) buf[size - 1] = 0;
10153 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10157 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10158 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10159 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10160 if (size) buf[size - 1] = 0;
10161 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10165 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10166 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10167 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10168 if (size) buf[size - 1] = 0;
10169 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10173 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10174 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10175 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10176 if (size) buf[size - 1] = 0;
10177 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10181 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10182 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10183 ok(buf[0], "property not set\n");
10185 else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
10191 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10192 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10193 ok(!buf[0], "property set\n");
10197 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10198 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10199 ok(!buf[0], "property set\n");
10203 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10204 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10205 ok(!buf[0], "property set\n");
10209 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10210 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10211 GetSystemDirectoryA(path, MAX_PATH);
10212 if (size) buf[size - 1] = 0;
10213 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10217 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10218 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10219 ok(!buf[0], "property set\n");
10223 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10224 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10225 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10226 if (size) buf[size - 1] = 0;
10227 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10231 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10232 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10233 ok(!buf[0], "property set\n");
10237 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10238 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10239 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10240 if (size) buf[size - 1] = 0;
10241 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10245 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10246 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10247 ok(!buf[0], "property set\n");
10253 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10254 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10255 ok(buf[0], "property not set\n");
10259 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10260 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10261 ok(buf[0], "property not set\n");
10265 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10266 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10267 GetSystemDirectoryA(path, MAX_PATH);
10268 if (size) buf[size - 1] = 0;
10269 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10273 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10274 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10275 pGetSystemWow64DirectoryA(path, MAX_PATH);
10276 if (size) buf[size - 1] = 0;
10277 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10281 r = MsiGetProperty(hpkg, "ProgramFilesFolder64", buf, &size);
10282 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10283 ok(!buf[0], "property set\n");
10287 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10288 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10289 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10290 if (size) buf[size - 1] = 0;
10291 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10295 r = MsiGetProperty(hpkg, "CommonFilesFolder64", buf, &size);
10296 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10297 ok(!buf[0], "property set\n");
10301 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10302 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10303 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10304 if (size) buf[size - 1] = 0;
10305 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10309 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10310 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10311 ok(buf[0], "property not set\n");
10316 CloseHandle(hkey1);
10317 CloseHandle(hkey2);
10318 MsiCloseHandle(hpkg);
10319 DeleteFile(msifile);
10322 static void test_launchconditions(void)
10328 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10330 hdb = create_package_db();
10331 ok( hdb, "failed to create package database\n" );
10333 r = create_launchcondition_table( hdb );
10334 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
10336 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
10337 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10339 /* invalid condition */
10340 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
10341 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10343 r = package_from_db( hdb, &hpkg );
10344 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10346 skip("Not enough rights to perform tests\n");
10347 DeleteFile(msifile);
10350 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10352 MsiCloseHandle( hdb );
10354 r = MsiSetProperty( hpkg, "X", "1" );
10355 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10357 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10359 /* invalid conditions are ignored */
10360 r = MsiDoAction( hpkg, "LaunchConditions" );
10361 ok( r == ERROR_SUCCESS, "cost init failed\n" );
10363 /* verify LaunchConditions still does some verification */
10364 r = MsiSetProperty( hpkg, "X", "2" );
10365 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10367 r = MsiDoAction( hpkg, "LaunchConditions" );
10368 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
10370 MsiCloseHandle( hpkg );
10371 DeleteFile( msifile );
10374 static void test_ccpsearch(void)
10376 MSIHANDLE hdb, hpkg;
10377 CHAR prop[MAX_PATH];
10378 DWORD size = MAX_PATH;
10381 hdb = create_package_db();
10382 ok(hdb, "failed to create package database\n");
10384 r = create_ccpsearch_table(hdb);
10385 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10387 r = add_ccpsearch_entry(hdb, "'CCP_random'");
10388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10390 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
10391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10393 r = create_reglocator_table(hdb);
10394 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10396 r = add_reglocator_entry(hdb, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
10397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10399 r = create_drlocator_table(hdb);
10400 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10402 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
10403 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10405 r = create_signature_table(hdb);
10406 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10408 r = package_from_db(hdb, &hpkg);
10409 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10411 skip("Not enough rights to perform tests\n");
10412 DeleteFile(msifile);
10415 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10417 MsiCloseHandle(hdb);
10419 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10421 r = MsiDoAction(hpkg, "CCPSearch");
10422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10424 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
10425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10426 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
10428 MsiCloseHandle(hpkg);
10429 DeleteFileA(msifile);
10432 static void test_complocator(void)
10434 MSIHANDLE hdb, hpkg;
10436 CHAR prop[MAX_PATH];
10437 CHAR expected[MAX_PATH];
10438 DWORD size = MAX_PATH;
10440 hdb = create_package_db();
10441 ok(hdb, "failed to create package database\n");
10443 r = create_appsearch_table(hdb);
10444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10446 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
10447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10449 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
10450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10452 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
10453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10455 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
10456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10458 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
10459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10461 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
10462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10464 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
10465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10467 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
10468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10470 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
10471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10473 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
10474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10476 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
10477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10479 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
10480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10482 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
10483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10485 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
10486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10488 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
10489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10491 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
10492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10494 r = create_complocator_table(hdb);
10495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10497 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
10498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10500 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
10501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10503 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
10504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10506 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
10507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10509 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
10510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10512 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
10513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10515 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
10516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10518 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
10519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10521 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
10522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10524 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
10525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10527 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
10528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10530 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
10531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10533 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
10534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10536 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
10537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10539 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
10540 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10542 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
10543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10545 r = create_signature_table(hdb);
10546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10548 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
10549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10551 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
10552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10554 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
10555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10557 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
10558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10560 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
10561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10563 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
10564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10566 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
10567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10569 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
10570 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10572 r = package_from_db(hdb, &hpkg);
10573 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10575 skip("Not enough rights to perform tests\n");
10576 DeleteFile(msifile);
10579 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10581 MsiCloseHandle(hdb);
10583 create_test_file("abelisaurus");
10584 create_test_file("bactrosaurus");
10585 create_test_file("camelotia");
10586 create_test_file("diclonius");
10587 create_test_file("echinodon");
10588 create_test_file("falcarius");
10589 create_test_file("gallimimus");
10590 create_test_file("hagryphus");
10591 CreateDirectoryA("iguanodon", NULL);
10592 CreateDirectoryA("jobaria", NULL);
10593 CreateDirectoryA("kakuru", NULL);
10594 CreateDirectoryA("labocania", NULL);
10595 CreateDirectoryA("megaraptor", NULL);
10596 CreateDirectoryA("neosodon", NULL);
10597 CreateDirectoryA("olorotitan", NULL);
10598 CreateDirectoryA("pantydraco", NULL);
10600 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
10601 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
10602 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
10603 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
10604 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
10605 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
10606 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
10607 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
10608 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
10609 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
10610 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
10611 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
10612 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
10613 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
10614 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
10615 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
10617 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10619 r = MsiDoAction(hpkg, "AppSearch");
10620 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10623 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
10624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10626 lstrcpyA(expected, CURR_DIR);
10627 lstrcatA(expected, "\\abelisaurus");
10628 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10629 "Expected %s or empty string, got %s\n", expected, prop);
10632 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
10633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10634 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10637 r = MsiGetPropertyA(hpkg, "CAMELOTIA", 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, "DICLONIUS", 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, "ECHINODON", prop, &size);
10648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10650 lstrcpyA(expected, CURR_DIR);
10651 lstrcatA(expected, "\\");
10652 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10653 "Expected %s or empty string, got %s\n", expected, prop);
10656 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
10657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10658 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10661 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", 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, "HAGRYPHUS", 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, "IGUANODON", 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, "JOBARIA", 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, "KAKURU", 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, "LABOCANIA", 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, "MEGARAPTOR", prop, &size);
10692 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10694 lstrcpyA(expected, CURR_DIR);
10695 lstrcatA(expected, "\\");
10696 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10697 "Expected %s or empty string, got %s\n", expected, prop);
10700 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
10701 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10703 lstrcpyA(expected, CURR_DIR);
10704 lstrcatA(expected, "\\neosodon\\");
10705 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10706 "Expected %s or empty string, got %s\n", expected, prop);
10709 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
10710 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10711 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10714 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
10715 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10716 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10718 MsiCloseHandle(hpkg);
10719 DeleteFileA("abelisaurus");
10720 DeleteFileA("bactrosaurus");
10721 DeleteFileA("camelotia");
10722 DeleteFileA("diclonius");
10723 DeleteFileA("echinodon");
10724 DeleteFileA("falcarius");
10725 DeleteFileA("gallimimus");
10726 DeleteFileA("hagryphus");
10727 RemoveDirectoryA("iguanodon");
10728 RemoveDirectoryA("jobaria");
10729 RemoveDirectoryA("kakuru");
10730 RemoveDirectoryA("labocania");
10731 RemoveDirectoryA("megaraptor");
10732 RemoveDirectoryA("neosodon");
10733 RemoveDirectoryA("olorotitan");
10734 RemoveDirectoryA("pantydraco");
10735 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10736 MSIINSTALLCONTEXT_MACHINE, NULL);
10737 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10738 MSIINSTALLCONTEXT_MACHINE, NULL);
10739 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10740 MSIINSTALLCONTEXT_MACHINE, NULL);
10741 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10742 MSIINSTALLCONTEXT_MACHINE, NULL);
10743 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10744 MSIINSTALLCONTEXT_MACHINE, NULL);
10745 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10746 MSIINSTALLCONTEXT_MACHINE, NULL);
10747 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10748 MSIINSTALLCONTEXT_MACHINE, NULL);
10749 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10750 MSIINSTALLCONTEXT_MACHINE, NULL);
10751 DeleteFileA(msifile);
10754 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
10759 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
10760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10762 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
10763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10765 r = MsiSummaryInfoPersist(summary);
10766 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10768 MsiCloseHandle(summary);
10771 static void test_MsiGetSourcePath(void)
10773 MSIHANDLE hdb, hpkg;
10774 CHAR path[MAX_PATH];
10775 CHAR cwd[MAX_PATH];
10776 CHAR subsrc[MAX_PATH];
10777 CHAR sub2[MAX_PATH];
10781 lstrcpyA(cwd, CURR_DIR);
10782 lstrcatA(cwd, "\\");
10784 lstrcpyA(subsrc, cwd);
10785 lstrcatA(subsrc, "subsource");
10786 lstrcatA(subsrc, "\\");
10788 lstrcpyA(sub2, subsrc);
10789 lstrcatA(sub2, "sub2");
10790 lstrcatA(sub2, "\\");
10792 /* uncompressed source */
10794 hdb = create_package_db();
10795 ok( hdb, "failed to create database\n");
10797 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10799 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10800 ok(r == S_OK, "failed\n");
10802 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10803 ok(r == S_OK, "failed\n");
10805 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
10806 ok(r == S_OK, "failed\n");
10808 r = MsiDatabaseCommit(hdb);
10809 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
10811 r = package_from_db(hdb, &hpkg);
10812 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10814 skip("Not enough rights to perform tests\n");
10815 DeleteFile(msifile);
10818 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10820 MsiCloseHandle(hdb);
10822 /* invalid database handle */
10824 lstrcpyA(path, "kiwi");
10825 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
10826 ok(r == ERROR_INVALID_HANDLE,
10827 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
10828 ok(!lstrcmpA(path, "kiwi"),
10829 "Expected path to be unchanged, got \"%s\"\n", path);
10830 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10832 /* NULL szFolder */
10834 lstrcpyA(path, "kiwi");
10835 r = MsiGetSourcePath(hpkg, NULL, path, &size);
10836 ok(r == ERROR_INVALID_PARAMETER,
10837 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10838 ok(!lstrcmpA(path, "kiwi"),
10839 "Expected path to be unchanged, got \"%s\"\n", path);
10840 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10842 /* empty szFolder */
10844 lstrcpyA(path, "kiwi");
10845 r = MsiGetSourcePath(hpkg, "", path, &size);
10846 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10847 ok(!lstrcmpA(path, "kiwi"),
10848 "Expected path to be unchanged, got \"%s\"\n", path);
10849 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10851 /* try TARGETDIR */
10853 lstrcpyA(path, "kiwi");
10854 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10855 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10856 ok(!lstrcmpA(path, "kiwi"),
10857 "Expected path to be unchanged, got \"%s\"\n", path);
10858 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10861 lstrcpyA(path, "kiwi");
10862 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10864 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10865 ok(size == 0, "Expected 0, got %d\n", size);
10868 lstrcpyA(path, "kiwi");
10869 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10871 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10872 ok(size == 0, "Expected 0, got %d\n", size);
10874 /* try SourceDir */
10876 lstrcpyA(path, "kiwi");
10877 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10878 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10879 ok(!lstrcmpA(path, "kiwi"),
10880 "Expected path to be unchanged, got \"%s\"\n", path);
10881 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10883 /* try SOURCEDIR */
10885 lstrcpyA(path, "kiwi");
10886 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10887 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10888 ok(!lstrcmpA(path, "kiwi"),
10889 "Expected path to be unchanged, got \"%s\"\n", path);
10890 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10892 /* source path does not exist, but the property exists */
10894 lstrcpyA(path, "kiwi");
10895 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10896 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10897 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10898 ok(size == 0, "Expected 0, got %d\n", size);
10901 lstrcpyA(path, "kiwi");
10902 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10903 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10904 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10905 ok(size == 0, "Expected 0, got %d\n", size);
10909 lstrcpyA(path, "kiwi");
10910 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10911 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10912 ok(!lstrcmpA(path, "kiwi"),
10913 "Expected path to be unchanged, got \"%s\"\n", path);
10914 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10918 lstrcpyA(path, "kiwi");
10919 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10920 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10921 ok(!lstrcmpA(path, "kiwi"),
10922 "Expected path to be unchanged, got \"%s\"\n", path);
10923 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10925 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10927 r = MsiDoAction(hpkg, "CostInitialize");
10928 ok(r == ERROR_SUCCESS, "cost init failed\n");
10930 /* try TARGETDIR after CostInitialize */
10932 lstrcpyA(path, "kiwi");
10933 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10934 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10935 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10936 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10938 /* try SourceDir after CostInitialize */
10940 lstrcpyA(path, "kiwi");
10941 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10942 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10943 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10944 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10946 /* try SOURCEDIR after CostInitialize */
10948 lstrcpyA(path, "kiwi");
10949 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10950 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10951 ok(!lstrcmpA(path, "kiwi"),
10952 "Expected path to be unchanged, got \"%s\"\n", path);
10953 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10955 /* source path does not exist, but the property exists */
10957 lstrcpyA(path, "kiwi");
10958 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10959 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10962 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10963 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10966 /* try SubDir after CostInitialize */
10968 lstrcpyA(path, "kiwi");
10969 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10970 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10971 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10972 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10974 /* try SubDir2 after CostInitialize */
10976 lstrcpyA(path, "kiwi");
10977 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10978 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10979 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10980 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10982 r = MsiDoAction(hpkg, "ResolveSource");
10983 ok(r == ERROR_SUCCESS, "file cost failed\n");
10985 /* try TARGETDIR after ResolveSource */
10987 lstrcpyA(path, "kiwi");
10988 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10989 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10990 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10991 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10993 /* try SourceDir after ResolveSource */
10995 lstrcpyA(path, "kiwi");
10996 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10997 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10998 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10999 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11001 /* try SOURCEDIR after ResolveSource */
11003 lstrcpyA(path, "kiwi");
11004 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11005 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11006 ok(!lstrcmpA(path, "kiwi"),
11007 "Expected path to be unchanged, got \"%s\"\n", path);
11008 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11010 /* source path does not exist, but the property exists */
11012 lstrcpyA(path, "kiwi");
11013 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11015 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11016 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11018 /* try SubDir after ResolveSource */
11020 lstrcpyA(path, "kiwi");
11021 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11023 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11024 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11026 /* try SubDir2 after ResolveSource */
11028 lstrcpyA(path, "kiwi");
11029 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11030 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11031 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11032 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11034 r = MsiDoAction(hpkg, "FileCost");
11035 ok(r == ERROR_SUCCESS, "file cost failed\n");
11037 /* try TARGETDIR after FileCost */
11039 lstrcpyA(path, "kiwi");
11040 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11042 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11043 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11045 /* try SourceDir after FileCost */
11047 lstrcpyA(path, "kiwi");
11048 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11050 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11051 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11053 /* try SOURCEDIR after FileCost */
11055 lstrcpyA(path, "kiwi");
11056 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11057 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11058 ok(!lstrcmpA(path, "kiwi"),
11059 "Expected path to be unchanged, got \"%s\"\n", path);
11060 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11062 /* source path does not exist, but the property exists */
11064 lstrcpyA(path, "kiwi");
11065 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11067 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11068 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11070 /* try SubDir after FileCost */
11072 lstrcpyA(path, "kiwi");
11073 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11074 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11075 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11076 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11078 /* try SubDir2 after FileCost */
11080 lstrcpyA(path, "kiwi");
11081 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11083 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11084 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11086 r = MsiDoAction(hpkg, "CostFinalize");
11087 ok(r == ERROR_SUCCESS, "file cost failed\n");
11089 /* try TARGETDIR after CostFinalize */
11091 lstrcpyA(path, "kiwi");
11092 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11094 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11095 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11097 /* try SourceDir after CostFinalize */
11099 lstrcpyA(path, "kiwi");
11100 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11102 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11103 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11105 /* try SOURCEDIR after CostFinalize */
11107 lstrcpyA(path, "kiwi");
11108 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11109 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11110 ok(!lstrcmpA(path, "kiwi"),
11111 "Expected path to be unchanged, got \"%s\"\n", path);
11112 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11114 /* source path does not exist, but the property exists */
11116 lstrcpyA(path, "kiwi");
11117 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11119 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11120 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11122 /* try SubDir after CostFinalize */
11124 lstrcpyA(path, "kiwi");
11125 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11127 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11128 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11130 /* try SubDir2 after CostFinalize */
11132 lstrcpyA(path, "kiwi");
11133 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11134 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11135 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11136 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11138 /* nonexistent directory */
11140 lstrcpyA(path, "kiwi");
11141 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
11142 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11143 ok(!lstrcmpA(path, "kiwi"),
11144 "Expected path to be unchanged, got \"%s\"\n", path);
11145 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11147 /* NULL szPathBuf */
11149 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
11150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11151 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11153 /* NULL pcchPathBuf */
11154 lstrcpyA(path, "kiwi");
11155 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
11156 ok(r == ERROR_INVALID_PARAMETER,
11157 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11158 ok(!lstrcmpA(path, "kiwi"),
11159 "Expected path to be unchanged, got \"%s\"\n", path);
11161 /* pcchPathBuf is 0 */
11163 lstrcpyA(path, "kiwi");
11164 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11165 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11166 ok(!lstrcmpA(path, "kiwi"),
11167 "Expected path to be unchanged, got \"%s\"\n", path);
11168 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11170 /* pcchPathBuf does not have room for NULL terminator */
11171 size = lstrlenA(cwd);
11172 lstrcpyA(path, "kiwi");
11173 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11174 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11175 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
11176 "Expected path with no backslash, got \"%s\"\n", path);
11177 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11179 /* pcchPathBuf has room for NULL terminator */
11180 size = lstrlenA(cwd) + 1;
11181 lstrcpyA(path, "kiwi");
11182 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11183 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11184 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11185 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11187 /* remove property */
11188 r = MsiSetProperty(hpkg, "SourceDir", NULL);
11189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11191 /* try SourceDir again */
11193 lstrcpyA(path, "kiwi");
11194 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11195 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11196 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11197 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11199 /* set property to a valid directory */
11200 r = MsiSetProperty(hpkg, "SOURCEDIR", cwd);
11201 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11203 /* try SOURCEDIR again */
11205 lstrcpyA(path, "kiwi");
11206 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11207 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11208 ok(!lstrcmpA(path, "kiwi"),
11209 "Expected path to be unchanged, got \"%s\"\n", path);
11210 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11212 MsiCloseHandle(hpkg);
11214 /* compressed source */
11216 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11217 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11219 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
11221 r = package_from_db(hdb, &hpkg);
11222 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11224 /* try TARGETDIR */
11226 lstrcpyA(path, "kiwi");
11227 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11228 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11229 ok(!lstrcmpA(path, "kiwi"),
11230 "Expected path to be unchanged, got \"%s\"\n", path);
11231 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11233 /* try SourceDir */
11235 lstrcpyA(path, "kiwi");
11236 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11237 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11238 ok(!lstrcmpA(path, "kiwi"),
11239 "Expected path to be unchanged, got \"%s\"\n", path);
11240 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11242 /* try SOURCEDIR */
11244 lstrcpyA(path, "kiwi");
11245 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11246 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11247 ok(!lstrcmpA(path, "kiwi"),
11248 "Expected path to be unchanged, got \"%s\"\n", path);
11249 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11251 /* source path nor the property exist */
11253 lstrcpyA(path, "kiwi");
11254 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11255 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11256 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11257 ok(size == 0, "Expected 0, got %d\n", size);
11261 lstrcpyA(path, "kiwi");
11262 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11263 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11264 ok(!lstrcmpA(path, "kiwi"),
11265 "Expected path to be unchanged, got \"%s\"\n", path);
11266 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11270 lstrcpyA(path, "kiwi");
11271 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11272 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11273 ok(!lstrcmpA(path, "kiwi"),
11274 "Expected path to be unchanged, got \"%s\"\n", path);
11275 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11277 r = MsiDoAction(hpkg, "CostInitialize");
11278 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11280 /* try TARGETDIR after CostInitialize */
11282 lstrcpyA(path, "kiwi");
11283 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11284 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11285 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11286 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11288 /* try SourceDir after CostInitialize */
11290 lstrcpyA(path, "kiwi");
11291 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11293 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11294 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11296 /* try SOURCEDIR after CostInitialize */
11298 lstrcpyA(path, "kiwi");
11299 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11303 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11304 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11307 /* source path does not exist, but the property exists */
11309 lstrcpyA(path, "kiwi");
11310 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11314 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11315 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11318 /* try SubDir after CostInitialize */
11320 lstrcpyA(path, "kiwi");
11321 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11323 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11324 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11326 /* try SubDir2 after CostInitialize */
11328 lstrcpyA(path, "kiwi");
11329 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11330 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11331 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11332 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11334 r = MsiDoAction(hpkg, "ResolveSource");
11335 ok(r == ERROR_SUCCESS, "file cost failed\n");
11337 /* try TARGETDIR after ResolveSource */
11339 lstrcpyA(path, "kiwi");
11340 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11341 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11342 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11343 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11345 /* try SourceDir after ResolveSource */
11347 lstrcpyA(path, "kiwi");
11348 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11349 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11350 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11351 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11353 /* try SOURCEDIR after ResolveSource */
11355 lstrcpyA(path, "kiwi");
11356 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11360 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11361 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11364 /* source path and the property exist */
11366 lstrcpyA(path, "kiwi");
11367 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11368 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11369 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11370 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11372 /* try SubDir after ResolveSource */
11374 lstrcpyA(path, "kiwi");
11375 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11377 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11378 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11380 /* try SubDir2 after ResolveSource */
11382 lstrcpyA(path, "kiwi");
11383 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11384 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11385 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11386 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11388 r = MsiDoAction(hpkg, "FileCost");
11389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11391 /* try TARGETDIR after CostFinalize */
11393 lstrcpyA(path, "kiwi");
11394 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11396 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11397 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11399 /* try SourceDir after CostFinalize */
11401 lstrcpyA(path, "kiwi");
11402 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11403 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11404 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11405 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11407 /* try SOURCEDIR after CostFinalize */
11409 lstrcpyA(path, "kiwi");
11410 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11414 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11415 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11418 /* source path and the property exist */
11420 lstrcpyA(path, "kiwi");
11421 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11423 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11424 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11426 /* try SubDir after CostFinalize */
11428 lstrcpyA(path, "kiwi");
11429 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11431 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11432 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11434 /* try SubDir2 after CostFinalize */
11436 lstrcpyA(path, "kiwi");
11437 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11439 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11440 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11442 r = MsiDoAction(hpkg, "CostFinalize");
11443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11445 /* try TARGETDIR after CostFinalize */
11447 lstrcpyA(path, "kiwi");
11448 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11450 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11451 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11453 /* try SourceDir after CostFinalize */
11455 lstrcpyA(path, "kiwi");
11456 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11458 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11459 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11461 /* try SOURCEDIR after CostFinalize */
11463 lstrcpyA(path, "kiwi");
11464 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11468 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11469 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11472 /* source path and the property exist */
11474 lstrcpyA(path, "kiwi");
11475 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11476 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11477 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11478 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11480 /* try SubDir after CostFinalize */
11482 lstrcpyA(path, "kiwi");
11483 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11485 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11486 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11488 /* try SubDir2 after CostFinalize */
11490 lstrcpyA(path, "kiwi");
11491 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11493 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11494 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11496 MsiCloseHandle(hpkg);
11497 DeleteFile(msifile);
11500 static void test_shortlongsource(void)
11502 MSIHANDLE hdb, hpkg;
11503 CHAR path[MAX_PATH];
11504 CHAR cwd[MAX_PATH];
11505 CHAR subsrc[MAX_PATH];
11509 lstrcpyA(cwd, CURR_DIR);
11510 lstrcatA(cwd, "\\");
11512 lstrcpyA(subsrc, cwd);
11513 lstrcatA(subsrc, "long");
11514 lstrcatA(subsrc, "\\");
11516 /* long file names */
11518 hdb = create_package_db();
11519 ok( hdb, "failed to create database\n");
11521 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
11523 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11524 ok(r == S_OK, "failed\n");
11526 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
11527 ok(r == S_OK, "failed\n");
11529 /* CostInitialize:short */
11530 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
11531 ok(r == S_OK, "failed\n");
11533 /* CostInitialize:long */
11534 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
11535 ok(r == S_OK, "failed\n");
11537 /* FileCost:short */
11538 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
11539 ok(r == S_OK, "failed\n");
11541 /* FileCost:long */
11542 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
11543 ok(r == S_OK, "failed\n");
11545 /* CostFinalize:short */
11546 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
11547 ok(r == S_OK, "failed\n");
11549 /* CostFinalize:long */
11550 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
11551 ok(r == S_OK, "failed\n");
11553 MsiDatabaseCommit(hdb);
11555 r = package_from_db(hdb, &hpkg);
11556 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11558 skip("Not enough rights to perform tests\n");
11559 DeleteFile(msifile);
11562 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11564 MsiCloseHandle(hdb);
11566 CreateDirectoryA("one", NULL);
11567 CreateDirectoryA("four", NULL);
11569 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11571 r = MsiDoAction(hpkg, "CostInitialize");
11572 ok(r == ERROR_SUCCESS, "file cost failed\n");
11574 CreateDirectory("five", NULL);
11575 CreateDirectory("eight", NULL);
11577 r = MsiDoAction(hpkg, "FileCost");
11578 ok(r == ERROR_SUCCESS, "file cost failed\n");
11580 CreateDirectory("nine", NULL);
11581 CreateDirectory("twelve", NULL);
11583 r = MsiDoAction(hpkg, "CostFinalize");
11584 ok(r == ERROR_SUCCESS, "file cost failed\n");
11586 /* neither short nor long source directories exist */
11588 lstrcpyA(path, "kiwi");
11589 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11591 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11592 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11594 CreateDirectoryA("short", NULL);
11596 /* short source directory exists */
11598 lstrcpyA(path, "kiwi");
11599 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11600 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11601 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11602 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11604 CreateDirectoryA("long", NULL);
11606 /* both short and long source directories exist */
11608 lstrcpyA(path, "kiwi");
11609 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11610 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11611 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11612 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11614 lstrcpyA(subsrc, cwd);
11615 lstrcatA(subsrc, "two");
11616 lstrcatA(subsrc, "\\");
11618 /* short dir exists before CostInitialize */
11620 lstrcpyA(path, "kiwi");
11621 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11622 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11623 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11624 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11626 lstrcpyA(subsrc, cwd);
11627 lstrcatA(subsrc, "four");
11628 lstrcatA(subsrc, "\\");
11630 /* long dir exists before CostInitialize */
11632 lstrcpyA(path, "kiwi");
11633 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11634 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11635 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11636 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11638 lstrcpyA(subsrc, cwd);
11639 lstrcatA(subsrc, "six");
11640 lstrcatA(subsrc, "\\");
11642 /* short dir exists before FileCost */
11644 lstrcpyA(path, "kiwi");
11645 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11647 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11648 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11650 lstrcpyA(subsrc, cwd);
11651 lstrcatA(subsrc, "eight");
11652 lstrcatA(subsrc, "\\");
11654 /* long dir exists before FileCost */
11656 lstrcpyA(path, "kiwi");
11657 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11659 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11660 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11662 lstrcpyA(subsrc, cwd);
11663 lstrcatA(subsrc, "ten");
11664 lstrcatA(subsrc, "\\");
11666 /* short dir exists before CostFinalize */
11668 lstrcpyA(path, "kiwi");
11669 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11671 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11672 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11674 lstrcpyA(subsrc, cwd);
11675 lstrcatA(subsrc, "twelve");
11676 lstrcatA(subsrc, "\\");
11678 /* long dir exists before CostFinalize */
11680 lstrcpyA(path, "kiwi");
11681 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11683 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11684 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11686 MsiCloseHandle(hpkg);
11687 RemoveDirectoryA("short");
11688 RemoveDirectoryA("long");
11689 RemoveDirectoryA("one");
11690 RemoveDirectoryA("four");
11691 RemoveDirectoryA("five");
11692 RemoveDirectoryA("eight");
11693 RemoveDirectoryA("nine");
11694 RemoveDirectoryA("twelve");
11696 /* short file names */
11698 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11701 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
11703 r = package_from_db(hdb, &hpkg);
11704 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11706 MsiCloseHandle(hdb);
11708 CreateDirectoryA("one", NULL);
11709 CreateDirectoryA("four", NULL);
11711 r = MsiDoAction(hpkg, "CostInitialize");
11712 ok(r == ERROR_SUCCESS, "file cost failed\n");
11714 CreateDirectory("five", NULL);
11715 CreateDirectory("eight", NULL);
11717 r = MsiDoAction(hpkg, "FileCost");
11718 ok(r == ERROR_SUCCESS, "file cost failed\n");
11720 CreateDirectory("nine", NULL);
11721 CreateDirectory("twelve", NULL);
11723 r = MsiDoAction(hpkg, "CostFinalize");
11724 ok(r == ERROR_SUCCESS, "file cost failed\n");
11726 lstrcpyA(subsrc, cwd);
11727 lstrcatA(subsrc, "short");
11728 lstrcatA(subsrc, "\\");
11730 /* neither short nor long source directories exist */
11732 lstrcpyA(path, "kiwi");
11733 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11735 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11736 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11738 CreateDirectoryA("short", NULL);
11740 /* short source directory exists */
11742 lstrcpyA(path, "kiwi");
11743 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11744 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11745 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11746 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11748 CreateDirectoryA("long", NULL);
11750 /* both short and long source directories exist */
11752 lstrcpyA(path, "kiwi");
11753 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11755 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11756 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11758 lstrcpyA(subsrc, cwd);
11759 lstrcatA(subsrc, "one");
11760 lstrcatA(subsrc, "\\");
11762 /* short dir exists before CostInitialize */
11764 lstrcpyA(path, "kiwi");
11765 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11766 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11767 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11768 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11770 lstrcpyA(subsrc, cwd);
11771 lstrcatA(subsrc, "three");
11772 lstrcatA(subsrc, "\\");
11774 /* long dir exists before CostInitialize */
11776 lstrcpyA(path, "kiwi");
11777 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11779 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11780 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11782 lstrcpyA(subsrc, cwd);
11783 lstrcatA(subsrc, "five");
11784 lstrcatA(subsrc, "\\");
11786 /* short dir exists before FileCost */
11788 lstrcpyA(path, "kiwi");
11789 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11790 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11791 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11792 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11794 lstrcpyA(subsrc, cwd);
11795 lstrcatA(subsrc, "seven");
11796 lstrcatA(subsrc, "\\");
11798 /* long dir exists before FileCost */
11800 lstrcpyA(path, "kiwi");
11801 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11803 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11804 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11806 lstrcpyA(subsrc, cwd);
11807 lstrcatA(subsrc, "nine");
11808 lstrcatA(subsrc, "\\");
11810 /* short dir exists before CostFinalize */
11812 lstrcpyA(path, "kiwi");
11813 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11815 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11816 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11818 lstrcpyA(subsrc, cwd);
11819 lstrcatA(subsrc, "eleven");
11820 lstrcatA(subsrc, "\\");
11822 /* long dir exists before CostFinalize */
11824 lstrcpyA(path, "kiwi");
11825 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11826 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11827 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11828 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11830 MsiCloseHandle(hpkg);
11831 RemoveDirectoryA("short");
11832 RemoveDirectoryA("long");
11833 RemoveDirectoryA("one");
11834 RemoveDirectoryA("four");
11835 RemoveDirectoryA("five");
11836 RemoveDirectoryA("eight");
11837 RemoveDirectoryA("nine");
11838 RemoveDirectoryA("twelve");
11839 DeleteFileA(msifile);
11842 static void test_sourcedir(void)
11844 MSIHANDLE hdb, hpkg;
11846 CHAR path[MAX_PATH];
11847 CHAR cwd[MAX_PATH];
11848 CHAR subsrc[MAX_PATH];
11852 lstrcpyA(cwd, CURR_DIR);
11853 lstrcatA(cwd, "\\");
11855 lstrcpyA(subsrc, cwd);
11856 lstrcatA(subsrc, "long");
11857 lstrcatA(subsrc, "\\");
11859 hdb = create_package_db();
11860 ok( hdb, "failed to create database\n");
11862 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11863 ok(r == S_OK, "failed\n");
11865 sprintf(package, "#%u", hdb);
11866 r = MsiOpenPackage(package, &hpkg);
11867 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11869 skip("Not enough rights to perform tests\n");
11872 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11874 /* properties only */
11876 /* SourceDir prop */
11878 lstrcpyA(path, "kiwi");
11879 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11880 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11881 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11882 ok(size == 0, "Expected 0, got %d\n", size);
11884 /* SOURCEDIR prop */
11886 lstrcpyA(path, "kiwi");
11887 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11888 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11889 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11890 ok(size == 0, "Expected 0, got %d\n", size);
11892 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11894 r = MsiDoAction(hpkg, "CostInitialize");
11895 ok(r == ERROR_SUCCESS, "file cost failed\n");
11897 /* SourceDir after CostInitialize */
11899 lstrcpyA(path, "kiwi");
11900 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11901 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11902 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11903 ok(size == 0, "Expected 0, got %d\n", size);
11905 /* SOURCEDIR after CostInitialize */
11907 lstrcpyA(path, "kiwi");
11908 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11909 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11910 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11911 ok(size == 0, "Expected 0, got %d\n", size);
11913 r = MsiDoAction(hpkg, "FileCost");
11914 ok(r == ERROR_SUCCESS, "file cost failed\n");
11916 /* SourceDir after FileCost */
11918 lstrcpyA(path, "kiwi");
11919 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11920 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11921 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11922 ok(size == 0, "Expected 0, got %d\n", size);
11924 /* SOURCEDIR after FileCost */
11926 lstrcpyA(path, "kiwi");
11927 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11928 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11929 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11930 ok(size == 0, "Expected 0, got %d\n", size);
11932 r = MsiDoAction(hpkg, "CostFinalize");
11933 ok(r == ERROR_SUCCESS, "file cost failed\n");
11935 /* SourceDir after CostFinalize */
11937 lstrcpyA(path, "kiwi");
11938 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11940 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11941 ok(size == 0, "Expected 0, got %d\n", size);
11943 /* SOURCEDIR after CostFinalize */
11945 lstrcpyA(path, "kiwi");
11946 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11948 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11949 ok(size == 0, "Expected 0, got %d\n", size);
11952 lstrcpyA(path, "kiwi");
11953 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11954 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11955 ok(!lstrcmpA(path, "kiwi"), "Expected \"kiwi\", got \"%s\"\n", path);
11956 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
11958 /* SOURCEDIR after calling MsiGetSourcePath */
11960 lstrcpyA(path, "kiwi");
11961 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11962 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11964 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11965 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11968 r = MsiDoAction(hpkg, "ResolveSource");
11969 ok(r == ERROR_SUCCESS, "file cost failed\n");
11971 /* SourceDir after ResolveSource */
11973 lstrcpyA(path, "kiwi");
11974 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11975 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11976 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11977 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11979 /* SOURCEDIR after ResolveSource */
11981 lstrcpyA(path, "kiwi");
11982 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11983 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11984 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11985 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11987 /* random casing */
11989 lstrcpyA(path, "kiwi");
11990 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
11991 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11992 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11993 ok(size == 0, "Expected 0, got %d\n", size);
11995 MsiCloseHandle(hpkg);
11997 /* reset the package state */
11998 sprintf(package, "#%i", hdb);
11999 r = MsiOpenPackage(package, &hpkg);
12000 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12002 /* test how MsiGetSourcePath affects the properties */
12004 /* SourceDir prop */
12006 lstrcpyA(path, "kiwi");
12007 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12008 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12011 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12012 ok(size == 0, "Expected 0, got %d\n", size);
12016 lstrcpyA(path, "kiwi");
12017 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
12018 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12019 ok(!lstrcmpA(path, "kiwi"),
12020 "Expected path to be unchanged, got \"%s\"\n", path);
12021 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12023 /* SourceDir after MsiGetSourcePath */
12025 lstrcpyA(path, "kiwi");
12026 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12030 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12031 ok(size == 0, "Expected 0, got %d\n", size);
12034 /* SOURCEDIR prop */
12036 lstrcpyA(path, "kiwi");
12037 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12038 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12041 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12042 ok(size == 0, "Expected 0, got %d\n", size);
12046 lstrcpyA(path, "kiwi");
12047 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12048 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12049 ok(!lstrcmpA(path, "kiwi"),
12050 "Expected path to be unchanged, got \"%s\"\n", path);
12051 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12053 /* SOURCEDIR prop after MsiGetSourcePath */
12055 lstrcpyA(path, "kiwi");
12056 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12060 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12061 ok(size == 0, "Expected 0, got %d\n", size);
12064 r = MsiDoAction(hpkg, "CostInitialize");
12065 ok(r == ERROR_SUCCESS, "file cost failed\n");
12067 /* SourceDir after CostInitialize */
12069 lstrcpyA(path, "kiwi");
12070 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12074 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12075 ok(size == 0, "Expected 0, got %d\n", size);
12079 lstrcpyA(path, "kiwi");
12080 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
12081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12082 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12083 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12085 /* SourceDir after MsiGetSourcePath */
12087 lstrcpyA(path, "kiwi");
12088 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12090 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12091 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12093 /* SOURCEDIR after CostInitialize */
12095 lstrcpyA(path, "kiwi");
12096 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12098 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12099 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12101 /* SOURCEDIR source path still does not exist */
12103 lstrcpyA(path, "kiwi");
12104 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12105 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12106 ok(!lstrcmpA(path, "kiwi"),
12107 "Expected path to be unchanged, got \"%s\"\n", path);
12108 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12110 r = MsiDoAction(hpkg, "FileCost");
12111 ok(r == ERROR_SUCCESS, "file cost failed\n");
12113 /* SourceDir after FileCost */
12115 lstrcpyA(path, "kiwi");
12116 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12117 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12118 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12119 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12121 /* SOURCEDIR after FileCost */
12123 lstrcpyA(path, "kiwi");
12124 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12126 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12127 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12129 /* SOURCEDIR source path still does not exist */
12131 lstrcpyA(path, "kiwi");
12132 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12133 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12134 ok(!lstrcmpA(path, "kiwi"),
12135 "Expected path to be unchanged, got \"%s\"\n", path);
12136 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12138 r = MsiDoAction(hpkg, "CostFinalize");
12139 ok(r == ERROR_SUCCESS, "file cost failed\n");
12141 /* SourceDir after CostFinalize */
12143 lstrcpyA(path, "kiwi");
12144 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12146 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12147 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12149 /* SOURCEDIR after CostFinalize */
12151 lstrcpyA(path, "kiwi");
12152 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12154 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12155 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12157 /* SOURCEDIR source path still does not exist */
12159 lstrcpyA(path, "kiwi");
12160 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12161 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12162 ok(!lstrcmpA(path, "kiwi"),
12163 "Expected path to be unchanged, got \"%s\"\n", path);
12164 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12166 r = MsiDoAction(hpkg, "ResolveSource");
12167 ok(r == ERROR_SUCCESS, "file cost failed\n");
12169 /* SourceDir after ResolveSource */
12171 lstrcpyA(path, "kiwi");
12172 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12173 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12174 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12175 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12177 /* SOURCEDIR after ResolveSource */
12179 lstrcpyA(path, "kiwi");
12180 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12182 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12183 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12185 /* SOURCEDIR source path still does not exist */
12187 lstrcpyA(path, "kiwi");
12188 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12189 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12190 ok(!lstrcmpA(path, "kiwi"),
12191 "Expected path to be unchanged, got \"%s\"\n", path);
12192 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12194 MsiCloseHandle(hpkg);
12197 MsiCloseHandle(hdb);
12198 DeleteFileA(msifile);
12208 static const struct access_res create[16] =
12210 { TRUE, ERROR_SUCCESS, TRUE },
12211 { TRUE, ERROR_SUCCESS, TRUE },
12212 { TRUE, ERROR_SUCCESS, FALSE },
12213 { TRUE, ERROR_SUCCESS, FALSE },
12214 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12215 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12216 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12217 { TRUE, ERROR_SUCCESS, FALSE },
12218 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12219 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12220 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12221 { TRUE, ERROR_SUCCESS, TRUE },
12222 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12223 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12224 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12225 { TRUE, ERROR_SUCCESS, TRUE }
12228 static const struct access_res create_commit[16] =
12230 { TRUE, ERROR_SUCCESS, TRUE },
12231 { TRUE, ERROR_SUCCESS, TRUE },
12232 { TRUE, ERROR_SUCCESS, FALSE },
12233 { TRUE, ERROR_SUCCESS, FALSE },
12234 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12235 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12236 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12237 { TRUE, ERROR_SUCCESS, FALSE },
12238 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12239 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12240 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12241 { TRUE, ERROR_SUCCESS, TRUE },
12242 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12243 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12244 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12245 { TRUE, ERROR_SUCCESS, TRUE }
12248 static const struct access_res create_close[16] =
12250 { TRUE, ERROR_SUCCESS, FALSE },
12251 { TRUE, ERROR_SUCCESS, FALSE },
12252 { TRUE, ERROR_SUCCESS, FALSE },
12253 { TRUE, ERROR_SUCCESS, FALSE },
12254 { TRUE, ERROR_SUCCESS, FALSE },
12255 { TRUE, ERROR_SUCCESS, FALSE },
12256 { TRUE, ERROR_SUCCESS, FALSE },
12257 { TRUE, ERROR_SUCCESS, FALSE },
12258 { TRUE, ERROR_SUCCESS, FALSE },
12259 { TRUE, ERROR_SUCCESS, FALSE },
12260 { TRUE, ERROR_SUCCESS, 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 }
12268 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
12270 DWORD access = 0, share = 0;
12275 for (i = 0; i < 4; i++)
12277 if (i == 0) access = 0;
12278 if (i == 1) access = GENERIC_READ;
12279 if (i == 2) access = GENERIC_WRITE;
12280 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
12282 for (j = 0; j < 4; j++)
12284 if (ares[idx].ignore)
12287 if (j == 0) share = 0;
12288 if (j == 1) share = FILE_SHARE_READ;
12289 if (j == 2) share = FILE_SHARE_WRITE;
12290 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
12292 SetLastError(0xdeadbeef);
12293 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
12294 FILE_ATTRIBUTE_NORMAL, 0);
12295 lasterr = GetLastError();
12297 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
12298 "(%d, handle, %d): Expected %d, got %d\n",
12299 line, idx, ares[idx].gothandle,
12300 (hfile != INVALID_HANDLE_VALUE));
12302 ok(lasterr == ares[idx].lasterr, "(%d, lasterr, %d): Expected %d, got %d\n",
12303 line, idx, ares[idx].lasterr, lasterr);
12305 CloseHandle(hfile);
12311 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
12313 static void test_access(void)
12318 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
12319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12321 test_file_access(msifile, create);
12323 r = MsiDatabaseCommit(hdb);
12324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12326 test_file_access(msifile, create_commit);
12327 MsiCloseHandle(hdb);
12329 test_file_access(msifile, create_close);
12330 DeleteFileA(msifile);
12332 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
12333 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12335 test_file_access(msifile, create);
12337 r = MsiDatabaseCommit(hdb);
12338 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12340 test_file_access(msifile, create_commit);
12341 MsiCloseHandle(hdb);
12343 test_file_access(msifile, create_close);
12344 DeleteFileA(msifile);
12347 static void test_emptypackage(void)
12349 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
12350 MSIHANDLE hview = 0, hrec = 0;
12351 MSICONDITION condition;
12352 CHAR buffer[MAX_PATH];
12356 r = MsiOpenPackageA("", &hpkg);
12357 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12359 skip("Not enough rights to perform tests\n");
12364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12367 hdb = MsiGetActiveDatabase(hpkg);
12370 ok(hdb != 0, "Expected a valid database handle\n");
12373 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
12376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12378 r = MsiViewExecute(hview, 0);
12381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12384 r = MsiViewFetch(hview, &hrec);
12387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12392 r = MsiRecordGetString(hrec, 1, buffer, &size);
12395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12396 ok(!lstrcmpA(buffer, "_Property"),
12397 "Expected \"_Property\", got \"%s\"\n", buffer);
12400 MsiCloseHandle(hrec);
12402 r = MsiViewFetch(hview, &hrec);
12405 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12409 r = MsiRecordGetString(hrec, 1, buffer, &size);
12412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12413 ok(!lstrcmpA(buffer, "#_FolderCache"),
12414 "Expected \"_Property\", got \"%s\"\n", buffer);
12417 MsiCloseHandle(hrec);
12418 MsiViewClose(hview);
12419 MsiCloseHandle(hview);
12421 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
12424 ok(condition == MSICONDITION_FALSE,
12425 "Expected MSICONDITION_FALSE, got %d\n", condition);
12428 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
12431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12433 r = MsiViewExecute(hview, 0);
12436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12439 /* _Property table is not empty */
12440 r = MsiViewFetch(hview, &hrec);
12443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12446 MsiCloseHandle(hrec);
12447 MsiViewClose(hview);
12448 MsiCloseHandle(hview);
12450 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
12453 ok(condition == MSICONDITION_FALSE,
12454 "Expected MSICONDITION_FALSE, got %d\n", condition);
12457 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
12460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12462 r = MsiViewExecute(hview, 0);
12465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12468 /* #_FolderCache is not empty */
12469 r = MsiViewFetch(hview, &hrec);
12472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12475 MsiCloseHandle(hrec);
12476 MsiViewClose(hview);
12477 MsiCloseHandle(hview);
12479 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
12482 ok(r == ERROR_BAD_QUERY_SYNTAX,
12483 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12486 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
12489 ok(r == ERROR_BAD_QUERY_SYNTAX,
12490 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12493 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
12496 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
12497 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
12500 MsiCloseHandle(hsuminfo);
12502 r = MsiDatabaseCommit(hdb);
12505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12508 MsiCloseHandle(hdb);
12509 MsiCloseHandle(hpkg);
12512 static void test_MsiGetProductProperty(void)
12514 MSIHANDLE hprod, hdb;
12515 CHAR val[MAX_PATH];
12516 CHAR path[MAX_PATH];
12517 CHAR query[MAX_PATH];
12518 CHAR keypath[MAX_PATH*2];
12519 CHAR prodcode[MAX_PATH];
12520 CHAR prod_squashed[MAX_PATH];
12521 HKEY prodkey, userkey, props;
12525 REGSAM access = KEY_ALL_ACCESS;
12527 GetCurrentDirectoryA(MAX_PATH, path);
12528 lstrcatA(path, "\\");
12530 create_test_guid(prodcode, prod_squashed);
12533 access |= KEY_WOW64_64KEY;
12535 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
12536 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12538 r = MsiDatabaseCommit(hdb);
12539 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12541 r = set_summary_info(hdb);
12542 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12545 "CREATE TABLE `Directory` ( "
12546 "`Directory` CHAR(255) NOT NULL, "
12547 "`Directory_Parent` CHAR(255), "
12548 "`DefaultDir` CHAR(255) NOT NULL "
12549 "PRIMARY KEY `Directory`)");
12550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12553 "CREATE TABLE `Property` ( "
12554 "`Property` CHAR(72) NOT NULL, "
12555 "`Value` CHAR(255) "
12556 "PRIMARY KEY `Property`)");
12557 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12559 sprintf(query, "INSERT INTO `Property` "
12560 "(`Property`, `Value`) "
12561 "VALUES( 'ProductCode', '%s' )", prodcode);
12562 r = run_query(hdb, query);
12563 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12565 r = MsiDatabaseCommit(hdb);
12566 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12568 MsiCloseHandle(hdb);
12570 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
12571 lstrcatA(keypath, prod_squashed);
12573 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL);
12574 if (res == ERROR_ACCESS_DENIED)
12576 skip("Not enough rights to perform tests\n");
12577 DeleteFile(msifile);
12580 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12582 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
12583 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
12584 lstrcatA(keypath, prod_squashed);
12586 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL);
12587 if (res == ERROR_ACCESS_DENIED)
12589 skip("Not enough rights to perform tests\n");
12590 RegDeleteKeyA(prodkey, "");
12591 RegCloseKey(prodkey);
12594 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12596 res = RegCreateKeyExA(userkey, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
12597 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12599 lstrcpyA(val, path);
12600 lstrcatA(val, "\\");
12601 lstrcatA(val, msifile);
12602 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
12603 (const BYTE *)val, lstrlenA(val) + 1);
12604 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12606 hprod = 0xdeadbeef;
12607 r = MsiOpenProductA(prodcode, &hprod);
12608 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12609 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
12611 /* hProduct is invalid */
12613 lstrcpyA(val, "apple");
12614 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
12615 ok(r == ERROR_INVALID_HANDLE,
12616 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12617 ok(!lstrcmpA(val, "apple"),
12618 "Expected val to be unchanged, got \"%s\"\n", val);
12619 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12621 /* szProperty is NULL */
12623 lstrcpyA(val, "apple");
12624 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
12625 ok(r == ERROR_INVALID_PARAMETER,
12626 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12627 ok(!lstrcmpA(val, "apple"),
12628 "Expected val to be unchanged, got \"%s\"\n", val);
12629 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12631 /* szProperty is empty */
12633 lstrcpyA(val, "apple");
12634 r = MsiGetProductPropertyA(hprod, "", val, &size);
12635 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12636 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12637 ok(size == 0, "Expected 0, got %d\n", size);
12639 /* get the property */
12641 lstrcpyA(val, "apple");
12642 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12643 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12644 ok(!lstrcmpA(val, prodcode),
12645 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12646 ok(size == lstrlenA(prodcode),
12647 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12649 /* lpValueBuf is NULL */
12651 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
12652 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12653 ok(size == lstrlenA(prodcode),
12654 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12656 /* pcchValueBuf is NULL */
12657 lstrcpyA(val, "apple");
12658 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
12659 ok(r == ERROR_INVALID_PARAMETER,
12660 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12661 ok(!lstrcmpA(val, "apple"),
12662 "Expected val to be unchanged, got \"%s\"\n", val);
12663 ok(size == lstrlenA(prodcode),
12664 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12666 /* pcchValueBuf is too small */
12668 lstrcpyA(val, "apple");
12669 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12670 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12671 ok(!strncmp(val, prodcode, 3),
12672 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
12673 ok(size == lstrlenA(prodcode),
12674 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12676 /* pcchValueBuf does not leave room for NULL terminator */
12677 size = lstrlenA(prodcode);
12678 lstrcpyA(val, "apple");
12679 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12680 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12681 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
12682 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
12683 ok(size == lstrlenA(prodcode),
12684 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12686 /* pcchValueBuf has enough room for NULL terminator */
12687 size = lstrlenA(prodcode) + 1;
12688 lstrcpyA(val, "apple");
12689 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12690 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12691 ok(!lstrcmpA(val, prodcode),
12692 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12693 ok(size == lstrlenA(prodcode),
12694 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12696 /* nonexistent property */
12698 lstrcpyA(val, "apple");
12699 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
12700 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12701 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12702 ok(size == 0, "Expected 0, got %d\n", size);
12704 r = MsiSetPropertyA(hprod, "NewProperty", "value");
12705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12707 /* non-product property set */
12709 lstrcpyA(val, "apple");
12710 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
12711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12712 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12713 ok(size == 0, "Expected 0, got %d\n", size);
12715 r = MsiSetPropertyA(hprod, "ProductCode", "value");
12716 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12718 /* non-product property that is also a product property set */
12720 lstrcpyA(val, "apple");
12721 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12722 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12723 ok(!lstrcmpA(val, prodcode),
12724 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12725 ok(size == lstrlenA(prodcode),
12726 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12728 MsiCloseHandle(hprod);
12730 RegDeleteValueA(props, "LocalPackage");
12731 delete_key(props, "", access);
12732 RegCloseKey(props);
12733 delete_key(userkey, "", access);
12734 RegCloseKey(userkey);
12735 delete_key(prodkey, "", access);
12736 RegCloseKey(prodkey);
12737 DeleteFileA(msifile);
12740 static void test_MsiSetProperty(void)
12742 MSIHANDLE hpkg, hdb, hrec;
12743 CHAR buf[MAX_PATH];
12748 r = package_from_db(create_package_db(), &hpkg);
12749 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12751 skip("Not enough rights to perform tests\n");
12752 DeleteFile(msifile);
12755 ok(r == ERROR_SUCCESS, "Expected a valid package %u\n", r);
12757 /* invalid hInstall */
12758 r = MsiSetPropertyA(0, "Prop", "Val");
12759 ok(r == ERROR_INVALID_HANDLE,
12760 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12762 /* invalid hInstall */
12763 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12764 ok(r == ERROR_INVALID_HANDLE,
12765 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12767 /* szName is NULL */
12768 r = MsiSetPropertyA(hpkg, NULL, "Val");
12769 ok(r == ERROR_INVALID_PARAMETER,
12770 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12772 /* both szName and szValue are NULL */
12773 r = MsiSetPropertyA(hpkg, NULL, NULL);
12774 ok(r == ERROR_INVALID_PARAMETER,
12775 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12777 /* szName is empty */
12778 r = MsiSetPropertyA(hpkg, "", "Val");
12779 ok(r == ERROR_FUNCTION_FAILED,
12780 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
12782 /* szName is empty and szValue is NULL */
12783 r = MsiSetPropertyA(hpkg, "", NULL);
12784 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12786 /* set a property */
12787 r = MsiSetPropertyA(hpkg, "Prop", "Val");
12788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12790 /* get the property */
12792 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12794 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
12795 ok(size == 3, "Expected 3, got %d\n", size);
12797 /* update the property */
12798 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
12799 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12801 /* get the property */
12803 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12805 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
12806 ok(size == 4, "Expected 4, got %d\n", size);
12808 hdb = MsiGetActiveDatabase(hpkg);
12809 ok(hdb != 0, "Expected a valid database handle\n");
12811 /* set prop is not in the _Property table */
12812 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12813 r = do_query(hdb, query, &hrec);
12814 ok(r == ERROR_BAD_QUERY_SYNTAX,
12815 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12817 /* set prop is not in the Property table */
12818 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12819 r = do_query(hdb, query, &hrec);
12820 ok(r == ERROR_BAD_QUERY_SYNTAX,
12821 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12823 MsiCloseHandle(hdb);
12825 /* szValue is an empty string */
12826 r = MsiSetPropertyA(hpkg, "Prop", "");
12827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12829 /* try to get the property */
12831 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12832 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12833 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12834 ok(size == 0, "Expected 0, got %d\n", size);
12836 /* reset the property */
12837 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
12838 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12840 /* delete the property */
12841 r = MsiSetPropertyA(hpkg, "Prop", NULL);
12842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12844 /* try to get the property */
12846 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12847 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12848 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12849 ok(size == 0, "Expected 0, got %d\n", size);
12851 MsiCloseHandle(hpkg);
12852 DeleteFileA(msifile);
12855 static void test_MsiApplyMultiplePatches(void)
12857 UINT r, type = GetDriveType(NULL);
12859 if (!pMsiApplyMultiplePatchesA) {
12860 win_skip("MsiApplyMultiplePatchesA not found\n");
12864 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
12865 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12867 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
12868 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12870 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
12871 if (type == DRIVE_FIXED)
12872 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12874 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12876 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
12877 if (type == DRIVE_FIXED)
12878 todo_wine ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED, "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
12880 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12882 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
12883 if (type == DRIVE_FIXED)
12884 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12886 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12888 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
12889 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12891 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
12892 if (type == DRIVE_FIXED)
12893 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12895 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12897 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
12898 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12900 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
12901 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12904 static void test_MsiApplyPatch(void)
12908 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
12909 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12911 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
12912 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12915 static void test_MsiEnumComponentCosts(void)
12917 MSIHANDLE hdb, hpkg;
12918 char package[12], drive[3];
12923 hdb = create_package_db();
12924 ok( hdb, "failed to create database\n" );
12926 r = create_property_table( hdb );
12927 ok( r == ERROR_SUCCESS, "cannot create Property table %u\n", r );
12929 r = add_property_entry( hdb, "'ProductCode', '{379B1C47-40C1-42FA-A9BB-BEBB6F1B0172}'" );
12930 ok( r == ERROR_SUCCESS, "cannot add property entry %u\n", r );
12932 r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
12933 ok( r == ERROR_SUCCESS, "cannot add property entry %u\n", r );
12935 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
12936 ok( r == ERROR_SUCCESS, "failed to add directory entry %u\n" , r );
12938 r = create_media_table( hdb );
12939 ok( r == ERROR_SUCCESS, "cannot create Media table %u\n", r );
12941 r = add_media_entry( hdb, "'1', '2', 'cabinet', '', '', ''");
12942 ok( r == ERROR_SUCCESS, "cannot add media entry %u\n", r );
12944 r = create_file_table( hdb );
12945 ok( r == ERROR_SUCCESS, "cannot create File table %u\n", r );
12947 r = add_file_entry( hdb, "'one.txt', 'one', 'one.txt', 4096, '', '', 8192, 1" );
12948 ok( r == ERROR_SUCCESS, "cannot add file %u\n", r );
12950 r = create_component_table( hdb );
12951 ok( r == ERROR_SUCCESS, "cannot create Component table %u\n", r );
12953 r = add_component_entry( hdb, "'one', '{B2F86B9D-8447-4BC5-8883-750C45AA31CA}', 'TARGETDIR', 0, '', 'one.txt'" );
12954 ok( r == ERROR_SUCCESS, "cannot add component %u\n", r );
12956 r = add_component_entry( hdb, "'two', '{62A09F6E-0B74-4829-BDB7-CAB66F42CCE8}', 'TARGETDIR', 0, '', ''" );
12957 ok( r == ERROR_SUCCESS, "cannot add component %u\n", r );
12959 r = create_feature_table( hdb );
12960 ok( r == ERROR_SUCCESS, "cannot create Feature table %u\n", r );
12962 r = add_feature_entry( hdb, "'one', '', '', '', 0, 1, '', 0" );
12963 ok( r == ERROR_SUCCESS, "cannot add feature %u\n", r );
12965 r = add_feature_entry( hdb, "'two', '', '', '', 0, 1, '', 0" );
12966 ok( r == ERROR_SUCCESS, "cannot add feature %u\n", r );
12968 r = create_feature_components_table( hdb );
12969 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table %u\n", r );
12971 r = add_feature_components_entry( hdb, "'one', 'one'" );
12972 ok( r == ERROR_SUCCESS, "cannot add feature/component pair %u\n", r );
12974 r = add_feature_components_entry( hdb, "'two', 'two'" );
12975 ok( r == ERROR_SUCCESS, "cannot add feature/component pair %u\n", r );
12977 r = create_install_execute_sequence_table( hdb );
12978 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table %u\n", r );
12980 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
12981 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r );
12983 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
12984 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r );
12986 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
12987 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r );
12989 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1100'" );
12990 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry %u\n", r );
12992 MsiDatabaseCommit( hdb );
12994 sprintf( package, "#%u", hdb );
12995 r = MsiOpenPackageA( package, &hpkg );
12996 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12998 skip("Not enough rights to perform tests\n");
13001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13003 r = MsiEnumComponentCostsA( 0, NULL, 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13004 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13006 r = MsiEnumComponentCostsA( hpkg, NULL, 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13007 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13009 r = MsiEnumComponentCostsA( hpkg, NULL, 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13010 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13012 r = MsiEnumComponentCostsA( hpkg, "", 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13013 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13015 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_UNKNOWN, NULL, NULL, NULL, NULL );
13016 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13018 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, NULL, NULL, NULL, NULL );
13019 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13021 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, NULL, NULL, NULL );
13022 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13024 len = sizeof(drive);
13025 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, NULL, NULL );
13026 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13028 len = sizeof(drive);
13029 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, NULL );
13030 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13032 len = sizeof(drive);
13033 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13034 todo_wine ok( r == ERROR_INVALID_HANDLE_STATE, "Expected ERROR_INVALID_HANDLE_STATE, got %u\n", r );
13036 len = sizeof(drive);
13037 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, NULL, &len, &cost, &temp );
13038 ok( r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r );
13040 MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
13042 r = MsiDoAction( hpkg, "CostInitialize" );
13043 ok( r == ERROR_SUCCESS, "CostInitialize failed %u\n", r );
13045 r = MsiDoAction( hpkg, "FileCost" );
13046 ok( r == ERROR_SUCCESS, "FileCost failed %u\n", r );
13048 len = sizeof(drive);
13049 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13050 ok( r == ERROR_FUNCTION_NOT_CALLED, "Expected ERROR_FUNCTION_NOT_CALLED, got %u\n", r );
13052 r = MsiDoAction( hpkg, "CostFinalize" );
13053 ok( r == ERROR_SUCCESS, "CostFinalize failed %u\n", r );
13055 /* contrary to what msdn says InstallValidate must be called too */
13056 len = sizeof(drive);
13057 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13058 todo_wine ok( r == ERROR_FUNCTION_NOT_CALLED, "Expected ERROR_FUNCTION_NOT_CALLED, got %u\n", r );
13060 r = MsiDoAction( hpkg, "InstallValidate" );
13061 ok( r == ERROR_SUCCESS, "InstallValidate failed %u\n", r );
13064 r = MsiEnumComponentCostsA( hpkg, "three", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13065 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %u\n", r );
13068 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13069 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %u\n", r );
13070 ok( len == 2, "expected len == 2, got %u\n", len );
13073 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13074 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %u\n", r );
13075 ok( len == 2, "expected len == 2, got %u\n", len );
13078 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_UNKNOWN, drive, &len, &cost, &temp );
13079 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %u\n", r );
13080 ok( len == 2, "expected len == 2, got %u\n", len );
13082 /* install state doesn't seem to matter */
13083 len = sizeof(drive);
13084 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_UNKNOWN, drive, &len, &cost, &temp );
13085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13087 len = sizeof(drive);
13088 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_ABSENT, drive, &len, &cost, &temp );
13089 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13091 len = sizeof(drive);
13092 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_SOURCE, drive, &len, &cost, &temp );
13093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13095 len = sizeof(drive);
13097 cost = temp = 0xdead;
13098 r = MsiEnumComponentCostsA( hpkg, "one", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13100 ok( len == 2, "expected len == 2, got %u\n", len );
13101 ok( drive[0], "expected a drive\n" );
13102 ok( cost && cost != 0xdead, "expected cost > 0, got %d\n", cost );
13103 ok( !temp, "expected temp == 0, got %d\n", temp );
13105 len = sizeof(drive);
13107 cost = temp = 0xdead;
13108 r = MsiEnumComponentCostsA( hpkg, "two", 0, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13110 ok( len == 2, "expected len == 2, got %u\n", len );
13111 ok( drive[0], "expected a drive\n" );
13112 ok( !cost, "expected cost == 0, got %d\n", cost );
13113 ok( !temp, "expected temp == 0, got %d\n", temp );
13115 len = sizeof(drive);
13117 cost = temp = 0xdead;
13118 r = MsiEnumComponentCostsA( hpkg, "", 0, INSTALLSTATE_UNKNOWN, drive, &len, &cost, &temp );
13119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
13120 ok( len == 2, "expected len == 2, got %u\n", len );
13121 ok( drive[0], "expected a drive\n" );
13122 ok( !cost, "expected cost == 0, got %d\n", cost );
13123 ok( temp && temp != 0xdead, "expected temp > 0, got %d\n", temp );
13125 /* increased index */
13126 len = sizeof(drive);
13127 r = MsiEnumComponentCostsA( hpkg, "one", 1, INSTALLSTATE_LOCAL, drive, &len, &cost, &temp );
13128 ok( r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %u\n", r );
13130 len = sizeof(drive);
13131 r = MsiEnumComponentCostsA( hpkg, "", 1, INSTALLSTATE_UNKNOWN, drive, &len, &cost, &temp );
13132 ok( r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %u\n", r );
13134 MsiCloseHandle( hpkg );
13136 MsiCloseHandle( hdb );
13137 DeleteFileA( msifile );
13140 START_TEST(package)
13142 STATEMGRSTATUS status;
13145 init_functionpointers();
13147 if (pIsWow64Process)
13148 pIsWow64Process(GetCurrentProcess(), &is_wow64);
13150 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
13152 /* Create a restore point ourselves so we circumvent the multitude of restore points
13153 * that would have been created by all the installation and removal tests.
13155 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
13156 * creation of restore points.
13158 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
13160 memset(&status, 0, sizeof(status));
13161 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
13164 test_createpackage();
13166 test_gettargetpath_bad();
13167 test_settargetpath();
13169 test_property_table();
13172 test_formatrecord2();
13174 test_getproperty();
13175 test_removefiles();
13177 test_appsearch_complocator();
13178 test_appsearch_reglocator();
13179 test_appsearch_inilocator();
13180 test_appsearch_drlocator();
13181 test_featureparents();
13182 test_installprops();
13183 test_launchconditions();
13185 test_complocator();
13186 test_MsiGetSourcePath();
13187 test_shortlongsource();
13190 test_emptypackage();
13191 test_MsiGetProductProperty();
13192 test_MsiSetProperty();
13193 test_MsiApplyMultiplePatches();
13194 test_MsiApplyPatch();
13195 test_MsiEnumComponentCosts();
13197 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
13199 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
13201 remove_restore_point(status.llSequenceNumber);