2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include <srrestoreptapi.h>
32 #include "wine/test.h"
35 static const char msifile[] = "winetest-package.msi";
36 static char CURR_DIR[MAX_PATH];
38 static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
39 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
40 static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
42 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
43 static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
44 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
45 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
46 static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
47 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
48 static void (WINAPI *pGetSystemInfo)(LPSYSTEM_INFO);
49 static void (WINAPI *pGetNativeSystemInfo)(LPSYSTEM_INFO);
50 static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR, UINT);
52 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
53 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
55 static void init_functionpointers(void)
57 HMODULE hmsi = GetModuleHandleA("msi.dll");
58 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
59 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
60 HMODULE hshell32 = GetModuleHandleA("shell32.dll");
63 #define GET_PROC(mod, func) \
64 p ## func = (void*)GetProcAddress(mod, #func);
66 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
67 GET_PROC(hmsi, MsiGetComponentPathExA);
68 GET_PROC(hshell32, SHGetFolderPathA);
70 GET_PROC(hadvapi32, ConvertSidToStringSidA);
71 GET_PROC(hadvapi32, GetTokenInformation);
72 GET_PROC(hadvapi32, OpenProcessToken);
73 GET_PROC(hadvapi32, RegDeleteKeyExA)
74 GET_PROC(hadvapi32, RegDeleteKeyExW)
75 GET_PROC(hkernel32, IsWow64Process)
76 GET_PROC(hkernel32, GetNativeSystemInfo)
77 GET_PROC(hkernel32, GetSystemInfo)
78 GET_PROC(hkernel32, GetSystemWow64DirectoryA)
80 hsrclient = LoadLibraryA("srclient.dll");
81 GET_PROC(hsrclient, SRRemoveRestorePoint);
82 GET_PROC(hsrclient, SRSetRestorePointA);
86 static BOOL is_process_limited(void)
90 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
92 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
95 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
98 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
100 return (ret && type == TokenElevationTypeLimited);
105 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
107 if (pRegDeleteKeyExA)
108 return pRegDeleteKeyExA( key, subkey, access, 0 );
109 return RegDeleteKeyA( key, subkey );
112 static LPSTR get_user_sid(LPSTR *usersid)
119 if (!pConvertSidToStringSidA)
121 win_skip("ConvertSidToStringSidA is not available\n");
126 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
128 GetTokenInformation(token, TokenUser, buf, size, &size);
129 user = (PTOKEN_USER)buf;
130 pConvertSidToStringSidA(user->User.Sid, usersid);
131 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
136 /* RegDeleteTreeW from dlls/advapi32/registry.c */
137 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM access)
140 DWORD dwMaxSubkeyLen, dwMaxValueLen;
141 DWORD dwMaxLen, dwSize;
142 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
147 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, access, &hSubKey);
151 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
152 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
153 if (ret) goto cleanup;
157 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
158 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
160 /* Name too big: alloc a buffer for it */
161 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
163 ret = ERROR_NOT_ENOUGH_MEMORY;
168 /* Recursively delete all the subkeys */
172 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
173 NULL, NULL, NULL)) break;
175 ret = package_RegDeleteTreeW(hSubKey, lpszName, access);
176 if (ret) goto cleanup;
181 if (pRegDeleteKeyExW)
182 ret = pRegDeleteKeyExW(hKey, lpszSubKey, access, 0);
184 ret = RegDeleteKeyW(hKey, lpszSubKey);
190 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
191 NULL, NULL, NULL, NULL)) break;
193 ret = RegDeleteValueW(hKey, lpszName);
194 if (ret) goto cleanup;
198 if (lpszName != szNameBuf)
199 HeapFree(GetProcessHeap(), 0, lpszName);
201 RegCloseKey(hSubKey);
205 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
210 if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid)))
224 out[17+i*2] = in[n++];
225 out[16+i*2] = in[n++];
230 out[17+i*2] = in[n++];
231 out[16+i*2] = in[n++];
237 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
239 WCHAR guidW[MAX_PATH];
240 WCHAR squashedW[MAX_PATH];
245 hr = CoCreateGuid(&guid);
246 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
248 size = StringFromGUID2(&guid, guidW, MAX_PATH);
249 ok(size == 39, "Expected 39, got %d\n", hr);
251 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
252 squash_guid(guidW, squashedW);
253 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
256 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
257 LPCSTR guid, LPSTR usersid, BOOL dir)
259 WCHAR guidW[MAX_PATH];
260 WCHAR squashedW[MAX_PATH];
261 CHAR squashed[MAX_PATH];
262 CHAR comppath[MAX_PATH];
263 CHAR prodpath[MAX_PATH];
267 REGSAM access = KEY_ALL_ACCESS;
270 access |= KEY_WOW64_64KEY;
272 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
273 squash_guid(guidW, squashedW);
274 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
276 if (context == MSIINSTALLCONTEXT_MACHINE)
278 prod = "3D0DAE300FACA1300AD792060BCDAA92";
280 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
281 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
283 "SOFTWARE\\Classes\\Installer\\"
284 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
286 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
288 prod = "7D2F387510109040002000060BECB6AB";
290 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
291 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
293 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
294 "Installer\\%s\\Installer\\Products\\"
295 "7D2F387510109040002000060BECB6AB", usersid);
297 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
299 prod = "7D2F387510109040002000060BECB6AB";
301 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
302 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
304 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
305 "Installer\\Managed\\%s\\Installer\\Products\\"
306 "7D2F387510109040002000060BECB6AB", usersid);
309 RegCreateKeyExA(HKEY_LOCAL_MACHINE, comppath, 0, NULL, 0, access, NULL, &hkey, NULL);
311 lstrcpyA(path, CURR_DIR);
312 lstrcatA(path, "\\");
313 if (!dir) lstrcatA(path, filename);
315 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
318 RegCreateKeyExA(HKEY_LOCAL_MACHINE, prodpath, 0, NULL, 0, access, NULL, &hkey, NULL);
322 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
324 WCHAR guidW[MAX_PATH];
325 WCHAR squashedW[MAX_PATH];
326 WCHAR substrW[MAX_PATH];
327 CHAR squashed[MAX_PATH];
328 CHAR comppath[MAX_PATH];
329 CHAR prodpath[MAX_PATH];
330 REGSAM access = KEY_ALL_ACCESS;
333 access |= KEY_WOW64_64KEY;
335 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
336 squash_guid(guidW, squashedW);
337 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
339 if (context == MSIINSTALLCONTEXT_MACHINE)
342 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
343 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
345 "SOFTWARE\\Classes\\Installer\\"
346 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
348 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
351 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
352 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
354 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
355 "Installer\\%s\\Installer\\Products\\"
356 "7D2F387510109040002000060BECB6AB", usersid);
358 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
361 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
362 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
364 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
365 "Installer\\Managed\\%s\\Installer\\Products\\"
366 "7D2F387510109040002000060BECB6AB", usersid);
369 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
370 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
372 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
373 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
376 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
381 /* open a select query */
382 r = MsiDatabaseOpenView(hdb, query, &hview);
383 if (r != ERROR_SUCCESS)
385 r = MsiViewExecute(hview, 0);
386 if (r != ERROR_SUCCESS)
388 ret = MsiViewFetch(hview, phrec);
389 r = MsiViewClose(hview);
390 if (r != ERROR_SUCCESS)
392 r = MsiCloseHandle(hview);
393 if (r != ERROR_SUCCESS)
398 static UINT run_query( MSIHANDLE hdb, const char *query )
403 r = MsiDatabaseOpenView(hdb, query, &hview);
404 if( r != ERROR_SUCCESS )
407 r = MsiViewExecute(hview, 0);
408 if( r == ERROR_SUCCESS )
409 r = MsiViewClose(hview);
410 MsiCloseHandle(hview);
414 static UINT create_component_table( MSIHANDLE hdb )
416 return run_query( hdb,
417 "CREATE TABLE `Component` ( "
418 "`Component` CHAR(72) NOT NULL, "
419 "`ComponentId` CHAR(38), "
420 "`Directory_` CHAR(72) NOT NULL, "
421 "`Attributes` SHORT NOT NULL, "
422 "`Condition` CHAR(255), "
423 "`KeyPath` CHAR(72) "
424 "PRIMARY KEY `Component`)" );
427 static UINT create_feature_table( MSIHANDLE hdb )
429 return run_query( hdb,
430 "CREATE TABLE `Feature` ( "
431 "`Feature` CHAR(38) NOT NULL, "
432 "`Feature_Parent` CHAR(38), "
434 "`Description` CHAR(255), "
435 "`Display` SHORT NOT NULL, "
436 "`Level` SHORT NOT NULL, "
437 "`Directory_` CHAR(72), "
438 "`Attributes` SHORT NOT NULL "
439 "PRIMARY KEY `Feature`)" );
442 static UINT create_feature_components_table( MSIHANDLE hdb )
444 return run_query( hdb,
445 "CREATE TABLE `FeatureComponents` ( "
446 "`Feature_` CHAR(38) NOT NULL, "
447 "`Component_` CHAR(72) NOT NULL "
448 "PRIMARY KEY `Feature_`, `Component_` )" );
451 static UINT create_file_table( MSIHANDLE hdb )
453 return run_query( hdb,
454 "CREATE TABLE `File` ("
455 "`File` CHAR(72) NOT NULL, "
456 "`Component_` CHAR(72) NOT NULL, "
457 "`FileName` CHAR(255) NOT NULL, "
458 "`FileSize` LONG NOT NULL, "
459 "`Version` CHAR(72), "
460 "`Language` CHAR(20), "
461 "`Attributes` SHORT, "
462 "`Sequence` SHORT NOT NULL "
463 "PRIMARY KEY `File`)" );
466 static UINT create_remove_file_table( MSIHANDLE hdb )
468 return run_query( hdb,
469 "CREATE TABLE `RemoveFile` ("
470 "`FileKey` CHAR(72) NOT NULL, "
471 "`Component_` CHAR(72) NOT NULL, "
472 "`FileName` CHAR(255) LOCALIZABLE, "
473 "`DirProperty` CHAR(72) NOT NULL, "
474 "`InstallMode` SHORT NOT NULL "
475 "PRIMARY KEY `FileKey`)" );
478 static UINT create_appsearch_table( MSIHANDLE hdb )
480 return run_query( hdb,
481 "CREATE TABLE `AppSearch` ("
482 "`Property` CHAR(72) NOT NULL, "
483 "`Signature_` CHAR(72) NOT NULL "
484 "PRIMARY KEY `Property`, `Signature_`)" );
487 static UINT create_reglocator_table( MSIHANDLE hdb )
489 return run_query( hdb,
490 "CREATE TABLE `RegLocator` ("
491 "`Signature_` CHAR(72) NOT NULL, "
492 "`Root` SHORT NOT NULL, "
493 "`Key` CHAR(255) NOT NULL, "
496 "PRIMARY KEY `Signature_`)" );
499 static UINT create_signature_table( MSIHANDLE hdb )
501 return run_query( hdb,
502 "CREATE TABLE `Signature` ("
503 "`Signature` CHAR(72) NOT NULL, "
504 "`FileName` CHAR(255) NOT NULL, "
505 "`MinVersion` CHAR(20), "
506 "`MaxVersion` CHAR(20), "
511 "`Languages` CHAR(255) "
512 "PRIMARY KEY `Signature`)" );
515 static UINT create_launchcondition_table( MSIHANDLE hdb )
517 return run_query( hdb,
518 "CREATE TABLE `LaunchCondition` ("
519 "`Condition` CHAR(255) NOT NULL, "
520 "`Description` CHAR(255) NOT NULL "
521 "PRIMARY KEY `Condition`)" );
524 static UINT create_property_table( MSIHANDLE hdb )
526 return run_query( hdb,
527 "CREATE TABLE `Property` ("
528 "`Property` CHAR(72) NOT NULL, "
530 "PRIMARY KEY `Property`)" );
533 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
535 return run_query( hdb,
536 "CREATE TABLE `InstallExecuteSequence` ("
537 "`Action` CHAR(72) NOT NULL, "
538 "`Condition` CHAR(255), "
540 "PRIMARY KEY `Action`)" );
543 static UINT create_media_table( MSIHANDLE hdb )
545 return run_query( hdb,
546 "CREATE TABLE `Media` ("
547 "`DiskId` SHORT NOT NULL, "
548 "`LastSequence` SHORT NOT NULL, "
549 "`DiskPrompt` CHAR(64), "
550 "`Cabinet` CHAR(255), "
551 "`VolumeLabel` CHAR(32), "
553 "PRIMARY KEY `DiskId`)" );
556 static UINT create_ccpsearch_table( MSIHANDLE hdb )
558 return run_query( hdb,
559 "CREATE TABLE `CCPSearch` ("
560 "`Signature_` CHAR(72) NOT NULL "
561 "PRIMARY KEY `Signature_`)" );
564 static UINT create_drlocator_table( MSIHANDLE hdb )
566 return run_query( hdb,
567 "CREATE TABLE `DrLocator` ("
568 "`Signature_` CHAR(72) NOT NULL, "
569 "`Parent` CHAR(72), "
572 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
575 static UINT create_complocator_table( MSIHANDLE hdb )
577 return run_query( hdb,
578 "CREATE TABLE `CompLocator` ("
579 "`Signature_` CHAR(72) NOT NULL, "
580 "`ComponentId` CHAR(38) NOT NULL, "
582 "PRIMARY KEY `Signature_`)" );
585 static UINT create_inilocator_table( MSIHANDLE hdb )
587 return run_query( hdb,
588 "CREATE TABLE `IniLocator` ("
589 "`Signature_` CHAR(72) NOT NULL, "
590 "`FileName` CHAR(255) NOT NULL, "
591 "`Section` CHAR(96)NOT NULL, "
592 "`Key` CHAR(128)NOT NULL, "
595 "PRIMARY KEY `Signature_`)" );
598 #define make_add_entry(type, qtext) \
599 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
601 char insert[] = qtext; \
604 sz = strlen(values) + sizeof insert; \
605 query = HeapAlloc(GetProcessHeap(),0,sz); \
606 sprintf(query,insert,values); \
607 r = run_query( hdb, query ); \
608 HeapFree(GetProcessHeap(), 0, query); \
612 make_add_entry(component,
613 "INSERT INTO `Component` "
614 "(`Component`, `ComponentId`, `Directory_`, "
615 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
617 make_add_entry(directory,
618 "INSERT INTO `Directory` "
619 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
621 make_add_entry(feature,
622 "INSERT INTO `Feature` "
623 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
624 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
626 make_add_entry(feature_components,
627 "INSERT INTO `FeatureComponents` "
628 "(`Feature_`, `Component_`) VALUES( %s )")
631 "INSERT INTO `File` "
632 "(`File`, `Component_`, `FileName`, `FileSize`, "
633 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
635 make_add_entry(appsearch,
636 "INSERT INTO `AppSearch` "
637 "(`Property`, `Signature_`) VALUES( %s )")
639 make_add_entry(signature,
640 "INSERT INTO `Signature` "
641 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
642 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
645 make_add_entry(launchcondition,
646 "INSERT INTO `LaunchCondition` "
647 "(`Condition`, `Description`) VALUES( %s )")
649 make_add_entry(property,
650 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
652 make_add_entry(install_execute_sequence,
653 "INSERT INTO `InstallExecuteSequence` "
654 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
656 make_add_entry(media,
657 "INSERT INTO `Media` "
658 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
659 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
661 make_add_entry(ccpsearch,
662 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
664 make_add_entry(drlocator,
665 "INSERT INTO `DrLocator` "
666 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
668 make_add_entry(complocator,
669 "INSERT INTO `CompLocator` "
670 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
672 make_add_entry(inilocator,
673 "INSERT INTO `IniLocator` "
674 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
677 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char *path,
678 const char *name, UINT type )
680 const char insert[] =
681 "INSERT INTO `RegLocator` (`Signature_`, `Root`, `Key`, `Name`, `Type`) "
682 "VALUES( '%s', %u, '%s', '%s', %u )";
686 sz = strlen( sig ) + 10 + strlen( path ) + strlen( name ) + 10 + sizeof( insert );
687 query = HeapAlloc( GetProcessHeap(), 0, sz );
688 sprintf( query, insert, sig, root, path, name, type );
689 r = run_query( hdb, query );
690 HeapFree( GetProcessHeap(), 0, query );
694 static UINT set_summary_info(MSIHANDLE hdb)
699 /* build summary info */
700 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
701 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
703 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
704 "Installation Database");
705 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
707 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
708 "Installation Database");
709 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
711 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
713 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
715 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
717 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
719 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
720 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
721 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
723 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
724 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
726 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
727 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
729 res = MsiSummaryInfoPersist(suminfo);
730 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
732 res = MsiCloseHandle( suminfo);
733 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
739 static MSIHANDLE create_package_db(void)
746 /* create an empty database */
747 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
748 ok( res == ERROR_SUCCESS , "Failed to create database %u\n", res );
749 if( res != ERROR_SUCCESS )
752 res = MsiDatabaseCommit( hdb );
753 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
755 res = set_summary_info(hdb);
757 res = run_query( hdb,
758 "CREATE TABLE `Directory` ( "
759 "`Directory` CHAR(255) NOT NULL, "
760 "`Directory_Parent` CHAR(255), "
761 "`DefaultDir` CHAR(255) NOT NULL "
762 "PRIMARY KEY `Directory`)" );
763 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
768 static UINT package_from_db(MSIHANDLE hdb, MSIHANDLE *handle)
774 sprintf(szPackage, "#%u", hdb);
775 res = MsiOpenPackage(szPackage, &hPackage);
776 if (res != ERROR_SUCCESS)
782 res = MsiCloseHandle(hdb);
783 if (res != ERROR_SUCCESS)
785 MsiCloseHandle(hPackage);
790 return ERROR_SUCCESS;
793 static void create_test_file(const CHAR *name)
798 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
799 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
800 WriteFile(file, name, strlen(name), &written, NULL);
801 WriteFile(file, "\n", strlen("\n"), &written, NULL);
805 typedef struct _tagVS_VERSIONINFO
812 VS_FIXEDFILEINFO Value;
817 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
818 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
820 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
822 VS_VERSIONINFO *pVerInfo;
823 VS_FIXEDFILEINFO *pFixedInfo;
830 GetSystemDirectory(path, MAX_PATH);
831 /* Some dlls can't be updated on Vista/W2K8 */
832 lstrcatA(path, "\\version.dll");
834 CopyFileA(path, name, FALSE);
836 size = GetFileVersionInfoSize(path, &handle);
837 buffer = HeapAlloc(GetProcessHeap(), 0, size);
839 GetFileVersionInfoA(path, 0, size, buffer);
841 pVerInfo = (VS_VERSIONINFO *)buffer;
842 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
843 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
845 pFixedInfo->dwFileVersionMS = ms;
846 pFixedInfo->dwFileVersionLS = ls;
847 pFixedInfo->dwProductVersionMS = ms;
848 pFixedInfo->dwProductVersionLS = ls;
850 resource = BeginUpdateResource(name, FALSE);
854 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
855 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
858 if (!EndUpdateResource(resource, FALSE))
864 HeapFree(GetProcessHeap(), 0, buffer);
868 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
870 RESTOREPOINTINFOA spec;
872 spec.dwEventType = event_type;
873 spec.dwRestorePtType = APPLICATION_INSTALL;
874 spec.llSequenceNumber = status->llSequenceNumber;
875 lstrcpyA(spec.szDescription, "msitest restore point");
877 return pSRSetRestorePointA(&spec, status);
880 static void remove_restore_point(DWORD seq_number)
884 res = pSRRemoveRestorePoint(seq_number);
885 if (res != ERROR_SUCCESS)
886 trace("Failed to remove the restore point : %08x\n", res);
889 static void test_createpackage(void)
891 MSIHANDLE hPackage = 0;
894 res = package_from_db(create_package_db(), &hPackage);
895 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
897 skip("Not enough rights to perform tests\n");
901 ok( res == ERROR_SUCCESS, " Failed to create package %u\n", res );
903 res = MsiCloseHandle( hPackage);
904 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
908 static void test_doaction( void )
913 r = MsiDoAction( -1, NULL );
914 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
916 r = package_from_db(create_package_db(), &hpkg);
917 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
919 skip("Not enough rights to perform tests\n");
923 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
925 r = MsiDoAction(hpkg, NULL);
926 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
928 r = MsiDoAction(0, "boo");
929 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
931 r = MsiDoAction(hpkg, "boo");
932 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
934 MsiCloseHandle( hpkg );
938 static void test_gettargetpath_bad(void)
940 static const WCHAR boo[] = {'b','o','o',0};
941 static const WCHAR empty[] = {0};
948 r = package_from_db(create_package_db(), &hpkg);
949 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
951 skip("Not enough rights to perform tests\n");
955 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
957 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
958 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
960 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
961 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
963 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
964 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
966 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
967 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
969 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
970 ok( r == ERROR_DIRECTORY, "wrong return val\n");
972 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
973 ok( r == ERROR_DIRECTORY, "wrong return val\n");
976 r = MsiGetTargetPath( hpkg, "", buffer, &sz );
977 ok( r == ERROR_DIRECTORY, "wrong return val\n");
979 r = MsiGetTargetPathW( 0, NULL, NULL, NULL );
980 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
982 r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
983 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
985 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
986 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
988 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
989 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
991 r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
992 ok( r == ERROR_DIRECTORY, "wrong return val\n");
994 r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
995 ok( r == ERROR_DIRECTORY, "wrong return val\n");
998 r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
999 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1001 MsiCloseHandle( hpkg );
1002 DeleteFile(msifile);
1005 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
1011 rec = MsiCreateRecord( 1 );
1012 ok(rec, "MsiCreate record failed\n");
1014 r = MsiRecordSetString( rec, 0, file );
1015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1018 r = MsiFormatRecord( hpkg, rec, buff, &size );
1019 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1021 MsiCloseHandle( rec );
1024 static void test_settargetpath(void)
1026 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
1032 hdb = create_package_db();
1033 ok ( hdb, "failed to create package database\n" );
1035 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
1036 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
1038 r = create_component_table( hdb );
1039 ok( r == S_OK, "cannot create Component table: %d\n", r );
1041 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1042 ok( r == S_OK, "cannot add dummy component: %d\n", r );
1044 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1045 ok( r == S_OK, "cannot add test component: %d\n", r );
1047 r = create_feature_table( hdb );
1048 ok( r == S_OK, "cannot create Feature table: %d\n", r );
1050 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
1051 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
1053 r = create_feature_components_table( hdb );
1054 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
1056 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
1057 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1059 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
1060 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1062 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
1063 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
1065 r = create_file_table( hdb );
1066 ok( r == S_OK, "cannot create File table: %d\n", r );
1068 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1069 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1071 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1072 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1074 r = package_from_db( hdb, &hpkg );
1075 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1077 skip("Not enough rights to perform tests\n");
1078 DeleteFile(msifile);
1081 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1083 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
1085 r = MsiDoAction( hpkg, "CostInitialize");
1086 ok( r == ERROR_SUCCESS, "cost init failed\n");
1088 r = MsiDoAction( hpkg, "FileCost");
1089 ok( r == ERROR_SUCCESS, "file cost failed\n");
1091 r = MsiDoAction( hpkg, "CostFinalize");
1092 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
1094 r = MsiSetTargetPath( 0, NULL, NULL );
1095 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1097 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1098 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1100 r = MsiSetTargetPath( hpkg, "boo", NULL );
1101 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1103 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
1104 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1106 sz = sizeof tempdir - 1;
1107 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
1108 sprintf( file, "%srootfile.txt", tempdir );
1110 query_file_path( hpkg, "[#RootFile]", buffer );
1111 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1112 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
1114 GetTempFileName( tempdir, "_wt", 0, buffer );
1115 sprintf( tempdir, "%s\\subdir", buffer );
1117 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1118 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1119 "MsiSetTargetPath on file returned %d\n", r );
1121 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1122 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1123 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
1125 DeleteFile( buffer );
1127 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1128 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1130 r = GetFileAttributes( buffer );
1131 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
1133 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1134 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
1136 sz = sizeof buffer - 1;
1137 lstrcat( tempdir, "\\" );
1138 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
1139 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1140 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
1142 sprintf( file, "%srootfile.txt", tempdir );
1143 query_file_path( hpkg, "[#RootFile]", buffer );
1144 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
1146 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
1147 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1149 query_file_path( hpkg, "[#TestFile]", buffer );
1150 ok( !lstrcmpi(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
1151 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
1153 sz = sizeof buffer - 1;
1154 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1155 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1156 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
1158 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two\\three" );
1159 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1161 sz = sizeof buffer - 1;
1162 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1163 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1164 ok( !lstrcmpi(buffer, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer);
1166 MsiCloseHandle( hpkg );
1169 static void test_condition(void)
1171 static const WCHAR cond1[] = {'\"','a',0x30a,'\"','<','\"',0xe5,'\"',0};
1172 static const WCHAR cond2[] = {'\"','a',0x30a,'\"','>','\"',0xe5,'\"',0};
1173 static const WCHAR cond3[] = {'\"','a',0x30a,'\"','<','>','\"',0xe5,'\"',0};
1174 static const WCHAR cond4[] = {'\"','a',0x30a,'\"','=','\"',0xe5,'\"',0};
1178 r = package_from_db(create_package_db(), &hpkg);
1179 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1181 skip("Not enough rights to perform tests\n");
1182 DeleteFile(msifile);
1185 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1187 r = MsiEvaluateCondition(0, NULL);
1188 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1190 r = MsiEvaluateCondition(hpkg, NULL);
1191 ok( r == MSICONDITION_NONE, "wrong return val\n");
1193 r = MsiEvaluateCondition(hpkg, "");
1194 ok( r == MSICONDITION_NONE, "wrong return val\n");
1196 r = MsiEvaluateCondition(hpkg, "1");
1197 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1199 r = MsiEvaluateCondition(hpkg, "0");
1200 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1202 r = MsiEvaluateCondition(hpkg, "-1");
1203 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1205 r = MsiEvaluateCondition(hpkg, "0 = 0");
1206 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1208 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1209 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1211 r = MsiEvaluateCondition(hpkg, "0 = 1");
1212 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1214 r = MsiEvaluateCondition(hpkg, "0 > 1");
1215 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1217 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1218 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1220 r = MsiEvaluateCondition(hpkg, "1 > 1");
1221 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1223 r = MsiEvaluateCondition(hpkg, "1 ~> 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, "0 ~>= 1");
1230 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1232 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1233 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1235 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1236 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1238 r = MsiEvaluateCondition(hpkg, "0 < 1");
1239 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1241 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1242 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1244 r = MsiEvaluateCondition(hpkg, "1 < 1");
1245 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1247 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1248 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1250 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1251 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1253 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1254 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1256 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1257 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1259 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1260 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1262 r = MsiEvaluateCondition(hpkg, "0 >=");
1263 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1265 r = MsiEvaluateCondition(hpkg, " ");
1266 ok( r == MSICONDITION_NONE, "wrong return val\n");
1268 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1269 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1271 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1272 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1274 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1275 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1277 r = MsiEvaluateCondition(hpkg, "not 0");
1278 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1280 r = MsiEvaluateCondition(hpkg, "not LicView");
1281 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1283 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1284 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1286 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1287 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1289 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1290 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1292 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1293 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1295 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1296 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1298 r = MsiEvaluateCondition(hpkg, "\"0\"");
1299 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1301 r = MsiEvaluateCondition(hpkg, "1 and 2");
1302 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1304 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1305 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1307 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1308 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1310 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1311 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1313 r = MsiEvaluateCondition(hpkg, "(0)");
1314 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1316 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1317 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1319 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1320 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1322 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1323 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1325 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1326 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1328 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1329 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1331 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1332 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1334 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1335 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1337 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1338 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1340 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1341 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1343 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1344 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1346 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1347 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1349 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1350 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1352 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1353 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1355 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1356 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1358 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1359 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1361 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1362 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1364 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1365 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1367 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1368 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1370 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1371 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1373 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1374 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1376 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1377 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1379 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1380 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1382 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1383 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1385 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1386 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1388 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1389 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1391 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1392 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1394 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1395 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1397 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1398 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1400 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1401 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1403 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1404 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1406 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1407 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1409 MsiSetProperty(hpkg, "mm", "5" );
1411 r = MsiEvaluateCondition(hpkg, "mm = 5");
1412 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1414 r = MsiEvaluateCondition(hpkg, "mm < 6");
1415 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1417 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1418 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1420 r = MsiEvaluateCondition(hpkg, "mm > 4");
1421 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1423 r = MsiEvaluateCondition(hpkg, "mm < 12");
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, "0 = \"\"");
1430 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1432 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1433 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1435 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1436 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1438 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1439 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1441 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1442 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1444 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1445 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1447 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1448 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1450 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1451 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1453 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1454 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1456 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1457 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1459 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1460 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1462 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1463 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1465 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1466 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1468 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1469 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1471 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1472 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1474 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1475 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1477 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1478 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1480 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1481 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1483 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1484 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1486 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1487 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1489 r = MsiEvaluateCondition(hpkg, "bandalmael<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_FALSE, "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_TRUE, "wrong return val\n");
1504 MsiSetProperty(hpkg, "bandalmael", "0" );
1505 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1506 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1508 MsiSetProperty(hpkg, "bandalmael", "" );
1509 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1510 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1512 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1513 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1514 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1516 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1517 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1518 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1520 MsiSetProperty(hpkg, "bandalmael", "0 " );
1521 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1522 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1524 MsiSetProperty(hpkg, "bandalmael", "-0" );
1525 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1526 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1528 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1529 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1530 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1532 MsiSetProperty(hpkg, "bandalmael", "--0" );
1533 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1534 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1536 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1537 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1538 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1540 MsiSetProperty(hpkg, "bandalmael", "-" );
1541 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1542 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1544 MsiSetProperty(hpkg, "bandalmael", "+0" );
1545 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1546 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1548 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1549 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1550 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1551 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1552 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1554 MsiSetProperty(hpkg, "one", "hi");
1555 MsiSetProperty(hpkg, "two", "hithere");
1556 r = MsiEvaluateCondition(hpkg, "one >< two");
1557 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1559 MsiSetProperty(hpkg, "one", "hithere");
1560 MsiSetProperty(hpkg, "two", "hi");
1561 r = MsiEvaluateCondition(hpkg, "one >< two");
1562 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1564 MsiSetProperty(hpkg, "one", "hello");
1565 MsiSetProperty(hpkg, "two", "hi");
1566 r = MsiEvaluateCondition(hpkg, "one >< two");
1567 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1569 MsiSetProperty(hpkg, "one", "hellohithere");
1570 MsiSetProperty(hpkg, "two", "hi");
1571 r = MsiEvaluateCondition(hpkg, "one >< two");
1572 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1574 MsiSetProperty(hpkg, "one", "");
1575 MsiSetProperty(hpkg, "two", "hi");
1576 r = MsiEvaluateCondition(hpkg, "one >< two");
1577 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1579 MsiSetProperty(hpkg, "one", "hi");
1580 MsiSetProperty(hpkg, "two", "");
1581 r = MsiEvaluateCondition(hpkg, "one >< two");
1582 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1584 MsiSetProperty(hpkg, "one", "");
1585 MsiSetProperty(hpkg, "two", "");
1586 r = MsiEvaluateCondition(hpkg, "one >< two");
1587 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1589 MsiSetProperty(hpkg, "one", "1234");
1590 MsiSetProperty(hpkg, "two", "1");
1591 r = MsiEvaluateCondition(hpkg, "one >< two");
1592 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1594 MsiSetProperty(hpkg, "one", "one 1234");
1595 MsiSetProperty(hpkg, "two", "1");
1596 r = MsiEvaluateCondition(hpkg, "one >< two");
1597 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1599 MsiSetProperty(hpkg, "one", "hithere");
1600 MsiSetProperty(hpkg, "two", "hi");
1601 r = MsiEvaluateCondition(hpkg, "one << two");
1602 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1604 MsiSetProperty(hpkg, "one", "hi");
1605 MsiSetProperty(hpkg, "two", "hithere");
1606 r = MsiEvaluateCondition(hpkg, "one << two");
1607 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1609 MsiSetProperty(hpkg, "one", "hi");
1610 MsiSetProperty(hpkg, "two", "hi");
1611 r = MsiEvaluateCondition(hpkg, "one << two");
1612 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1614 MsiSetProperty(hpkg, "one", "abcdhithere");
1615 MsiSetProperty(hpkg, "two", "hi");
1616 r = MsiEvaluateCondition(hpkg, "one << two");
1617 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1619 MsiSetProperty(hpkg, "one", "");
1620 MsiSetProperty(hpkg, "two", "hi");
1621 r = MsiEvaluateCondition(hpkg, "one << two");
1622 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1624 MsiSetProperty(hpkg, "one", "hithere");
1625 MsiSetProperty(hpkg, "two", "");
1626 r = MsiEvaluateCondition(hpkg, "one << two");
1627 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1629 MsiSetProperty(hpkg, "one", "");
1630 MsiSetProperty(hpkg, "two", "");
1631 r = MsiEvaluateCondition(hpkg, "one << two");
1632 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1634 MsiSetProperty(hpkg, "one", "1234");
1635 MsiSetProperty(hpkg, "two", "1");
1636 r = MsiEvaluateCondition(hpkg, "one << two");
1637 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1639 MsiSetProperty(hpkg, "one", "1234 one");
1640 MsiSetProperty(hpkg, "two", "1");
1641 r = MsiEvaluateCondition(hpkg, "one << two");
1642 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1644 MsiSetProperty(hpkg, "one", "hithere");
1645 MsiSetProperty(hpkg, "two", "there");
1646 r = MsiEvaluateCondition(hpkg, "one >> two");
1647 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1649 MsiSetProperty(hpkg, "one", "hithere");
1650 MsiSetProperty(hpkg, "two", "hi");
1651 r = MsiEvaluateCondition(hpkg, "one >> two");
1652 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1654 MsiSetProperty(hpkg, "one", "there");
1655 MsiSetProperty(hpkg, "two", "hithere");
1656 r = MsiEvaluateCondition(hpkg, "one >> two");
1657 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1659 MsiSetProperty(hpkg, "one", "there");
1660 MsiSetProperty(hpkg, "two", "there");
1661 r = MsiEvaluateCondition(hpkg, "one >> two");
1662 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1664 MsiSetProperty(hpkg, "one", "abcdhithere");
1665 MsiSetProperty(hpkg, "two", "hi");
1666 r = MsiEvaluateCondition(hpkg, "one >> two");
1667 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1669 MsiSetProperty(hpkg, "one", "");
1670 MsiSetProperty(hpkg, "two", "there");
1671 r = MsiEvaluateCondition(hpkg, "one >> two");
1672 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1674 MsiSetProperty(hpkg, "one", "there");
1675 MsiSetProperty(hpkg, "two", "");
1676 r = MsiEvaluateCondition(hpkg, "one >> two");
1677 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1679 MsiSetProperty(hpkg, "one", "");
1680 MsiSetProperty(hpkg, "two", "");
1681 r = MsiEvaluateCondition(hpkg, "one >> two");
1682 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1684 MsiSetProperty(hpkg, "one", "1234");
1685 MsiSetProperty(hpkg, "two", "4");
1686 r = MsiEvaluateCondition(hpkg, "one >> two");
1687 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1689 MsiSetProperty(hpkg, "one", "one 1234");
1690 MsiSetProperty(hpkg, "two", "4");
1691 r = MsiEvaluateCondition(hpkg, "one >> two");
1692 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1694 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1696 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1697 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1699 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1700 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1702 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1703 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
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_TRUE, "wrong return val (%d)\n", r);
1711 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1712 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1714 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1715 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1717 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1718 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1720 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1721 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1723 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1724 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1726 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1727 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1729 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1730 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1732 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1733 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1735 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1736 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1738 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1739 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1741 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1742 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1744 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1745 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1747 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1748 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1750 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1751 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1753 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1754 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1756 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1757 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1759 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1760 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1762 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1763 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1765 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1766 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1768 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
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 < \"azAZ_\"");
1775 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1777 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1778 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1780 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1781 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1783 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
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}\"");
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\"");
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 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1808 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1809 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1811 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1812 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1814 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1815 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1817 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1818 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1820 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1821 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1823 MsiSetProperty(hpkg, "one", "1");
1824 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1825 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1827 MsiSetProperty(hpkg, "X", "5.0");
1829 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1830 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1832 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1833 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1835 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1836 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1838 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1839 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1841 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1842 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1844 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1845 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1847 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1848 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1850 /* feature doesn't exist */
1851 r = MsiEvaluateCondition(hpkg, "&nofeature");
1852 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1854 MsiSetProperty(hpkg, "A", "2");
1855 MsiSetProperty(hpkg, "X", "50");
1857 r = MsiEvaluateCondition(hpkg, "2 <= X");
1858 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1860 r = MsiEvaluateCondition(hpkg, "A <= X");
1861 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1863 r = MsiEvaluateCondition(hpkg, "A <= 50");
1864 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1866 MsiSetProperty(hpkg, "X", "50val");
1868 r = MsiEvaluateCondition(hpkg, "2 <= X");
1869 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1871 r = MsiEvaluateCondition(hpkg, "A <= X");
1872 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1874 MsiSetProperty(hpkg, "A", "7");
1875 MsiSetProperty(hpkg, "X", "50");
1877 r = MsiEvaluateCondition(hpkg, "7 <= X");
1878 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1880 r = MsiEvaluateCondition(hpkg, "A <= X");
1881 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1883 r = MsiEvaluateCondition(hpkg, "A <= 50");
1884 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1886 MsiSetProperty(hpkg, "X", "50val");
1888 r = MsiEvaluateCondition(hpkg, "2 <= X");
1889 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1891 r = MsiEvaluateCondition(hpkg, "A <= X");
1892 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1894 r = MsiEvaluateConditionW(hpkg, cond1);
1895 ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
1896 "wrong return val (%d)\n", r);
1898 r = MsiEvaluateConditionW(hpkg, cond2);
1899 ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
1900 "wrong return val (%d)\n", r);
1902 r = MsiEvaluateConditionW(hpkg, cond3);
1903 ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
1904 "wrong return val (%d)\n", r);
1906 r = MsiEvaluateConditionW(hpkg, cond4);
1907 ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
1908 "wrong return val (%d)\n", r);
1910 MsiCloseHandle( hpkg );
1911 DeleteFile(msifile);
1914 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1922 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1923 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1926 static void test_props(void)
1928 MSIHANDLE hpkg, hdb;
1933 hdb = create_package_db();
1935 "CREATE TABLE `Property` ( "
1936 "`Property` CHAR(255) NOT NULL, "
1937 "`Value` CHAR(255) "
1938 "PRIMARY KEY `Property`)" );
1939 ok( r == ERROR_SUCCESS , "Failed\n" );
1942 "INSERT INTO `Property` "
1943 "(`Property`, `Value`) "
1944 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1945 ok( r == ERROR_SUCCESS , "Failed\n" );
1947 r = package_from_db( hdb, &hpkg );
1948 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1950 skip("Not enough rights to perform tests\n");
1951 DeleteFile(msifile);
1954 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1956 /* test invalid values */
1957 r = MsiGetProperty( 0, NULL, NULL, NULL );
1958 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1960 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1961 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1963 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1964 ok( r == ERROR_SUCCESS, "wrong return val\n");
1966 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1967 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1969 /* test retrieving an empty/nonexistent property */
1971 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1972 ok( r == ERROR_SUCCESS, "wrong return val\n");
1973 ok( sz == 0, "wrong size returned\n");
1975 check_prop_empty( hpkg, "boo");
1978 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1979 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1980 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1981 ok( sz == 0, "wrong size returned\n");
1985 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1986 ok( r == ERROR_SUCCESS, "wrong return val\n");
1987 ok( buffer[0] == 0, "buffer was not changed\n");
1988 ok( sz == 0, "wrong size returned\n");
1990 /* set the property to something */
1991 r = MsiSetProperty( 0, NULL, NULL );
1992 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1994 r = MsiSetProperty( hpkg, NULL, NULL );
1995 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1997 r = MsiSetProperty( hpkg, "", NULL );
1998 ok( r == ERROR_SUCCESS, "wrong return val\n");
2000 /* try set and get some illegal property identifiers */
2001 r = MsiSetProperty( hpkg, "", "asdf" );
2002 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
2004 r = MsiSetProperty( hpkg, "=", "asdf" );
2005 ok( r == ERROR_SUCCESS, "wrong return val\n");
2007 r = MsiSetProperty( hpkg, " ", "asdf" );
2008 ok( r == ERROR_SUCCESS, "wrong return val\n");
2010 r = MsiSetProperty( hpkg, "'", "asdf" );
2011 ok( r == ERROR_SUCCESS, "wrong return val\n");
2015 r = MsiGetProperty( hpkg, "'", buffer, &sz );
2016 ok( r == ERROR_SUCCESS, "wrong return val\n");
2017 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
2019 /* set empty values */
2020 r = MsiSetProperty( hpkg, "boo", NULL );
2021 ok( r == ERROR_SUCCESS, "wrong return val\n");
2022 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2024 r = MsiSetProperty( hpkg, "boo", "" );
2025 ok( r == ERROR_SUCCESS, "wrong return val\n");
2026 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2028 /* set a non-empty value */
2029 r = MsiSetProperty( hpkg, "boo", "xyz" );
2030 ok( r == ERROR_SUCCESS, "wrong return val\n");
2034 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2035 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2036 ok( buffer[0] == 0, "buffer was not changed\n");
2037 ok( sz == 3, "wrong size returned\n");
2041 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2042 ok( r == ERROR_SUCCESS, "wrong return val\n");
2043 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
2044 ok( sz == 3, "wrong size returned\n");
2048 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2049 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2050 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
2051 ok( sz == 3, "wrong size returned\n");
2053 r = MsiSetProperty(hpkg, "SourceDir", "foo");
2054 ok( r == ERROR_SUCCESS, "wrong return val\n");
2057 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
2058 ok( r == ERROR_SUCCESS, "wrong return val\n");
2059 ok( !strcmp(buffer,""), "buffer wrong\n");
2060 ok( sz == 0, "wrong size returned\n");
2063 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
2064 ok( r == ERROR_SUCCESS, "wrong return val\n");
2065 ok( !strcmp(buffer,""), "buffer wrong\n");
2066 ok( sz == 0, "wrong size returned\n");
2069 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
2070 ok( r == ERROR_SUCCESS, "wrong return val\n");
2071 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
2072 ok( sz == 3, "wrong size returned\n");
2074 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
2075 ok( r == ERROR_SUCCESS, "wrong return val\n");
2078 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
2079 ok( r == ERROR_SUCCESS, "return wrong\n");
2080 ok( sz == 13, "size wrong (%d)\n", sz);
2083 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
2084 ok( r == ERROR_MORE_DATA, "return wrong\n");
2085 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
2087 r = MsiSetProperty(hpkg, "property", "value");
2088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2091 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2093 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
2095 r = MsiSetProperty(hpkg, "property", NULL);
2096 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2099 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2101 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
2103 MsiCloseHandle( hpkg );
2104 DeleteFile(msifile);
2107 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
2109 MSIHANDLE hview, hrec;
2111 CHAR buffer[MAX_PATH];
2115 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
2116 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
2117 r = MsiViewExecute(hview, 0);
2118 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
2121 while (r == ERROR_SUCCESS && !found)
2123 r = MsiViewFetch(hview, &hrec);
2124 if (r != ERROR_SUCCESS) break;
2127 r = MsiRecordGetString(hrec, 1, buffer, &sz);
2128 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
2131 r = MsiRecordGetString(hrec, 2, buffer, &sz);
2132 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
2136 MsiCloseHandle(hrec);
2139 MsiViewClose(hview);
2140 MsiCloseHandle(hview);
2145 static void test_property_table(void)
2149 MSIHANDLE hpkg, hdb, hrec;
2150 char buffer[MAX_PATH], package[10];
2154 hdb = create_package_db();
2155 ok( hdb, "failed to create package\n");
2157 r = package_from_db(hdb, &hpkg);
2158 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2160 skip("Not enough rights to perform tests\n");
2161 DeleteFile(msifile);
2164 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2166 MsiCloseHandle(hdb);
2168 hdb = MsiGetActiveDatabase(hpkg);
2170 query = "CREATE TABLE `_Property` ( "
2171 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2172 r = run_query(hdb, query);
2173 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2175 MsiCloseHandle(hdb);
2176 MsiCloseHandle(hpkg);
2177 DeleteFile(msifile);
2179 hdb = create_package_db();
2180 ok( hdb, "failed to create package\n");
2182 query = "CREATE TABLE `_Property` ( "
2183 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2184 r = run_query(hdb, query);
2185 ok(r == ERROR_SUCCESS, "failed to create table\n");
2187 query = "ALTER `_Property` ADD `foo` INTEGER";
2188 r = run_query(hdb, query);
2189 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2191 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2192 r = run_query(hdb, query);
2193 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2195 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2196 r = run_query(hdb, query);
2197 ok(r == ERROR_SUCCESS, "failed to add column\n");
2199 sprintf(package, "#%i", hdb);
2200 r = MsiOpenPackage(package, &hpkg);
2201 todo_wine ok(r != ERROR_SUCCESS, "MsiOpenPackage succeeded\n");
2202 if (r == ERROR_SUCCESS)
2203 MsiCloseHandle(hpkg);
2205 r = MsiCloseHandle(hdb);
2206 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
2208 hdb = create_package_db();
2209 ok (hdb, "failed to create package database\n");
2211 r = create_property_table(hdb);
2212 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2214 r = add_property_entry(hdb, "'prop', 'val'");
2215 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2217 r = package_from_db(hdb, &hpkg);
2218 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
2220 MsiCloseHandle(hdb);
2223 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2224 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2225 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2227 hdb = MsiGetActiveDatabase(hpkg);
2229 found = find_prop_in_property(hdb, "prop", "val");
2230 ok(found, "prop should be in the _Property table\n");
2232 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2233 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2235 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2236 r = do_query(hdb, query, &hrec);
2237 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2239 found = find_prop_in_property(hdb, "dantes", "mercedes");
2240 ok(found == FALSE, "dantes should not be in the _Property table\n");
2243 lstrcpy(buffer, "aaa");
2244 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2245 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2246 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2248 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2251 found = find_prop_in_property(hdb, "dantes", "mercedes");
2252 ok(found == TRUE, "dantes should be in the _Property table\n");
2254 MsiCloseHandle(hdb);
2255 MsiCloseHandle(hpkg);
2256 DeleteFile(msifile);
2259 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2264 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2265 if( res == ERROR_SUCCESS )
2269 r = MsiViewExecute( htab, hrec );
2270 if( r != ERROR_SUCCESS )
2273 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2276 r = MsiViewClose( htab );
2277 if( r != ERROR_SUCCESS )
2280 r = MsiCloseHandle( htab );
2281 if( r != ERROR_SUCCESS )
2287 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2289 return try_query_param( hdb, szQuery, 0 );
2292 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2297 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2298 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2300 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2301 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2303 r = MsiSummaryInfoPersist(summary);
2304 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2306 MsiCloseHandle(summary);
2309 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2314 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2315 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2317 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2318 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2320 r = MsiSummaryInfoPersist(summary);
2321 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2323 MsiCloseHandle(summary);
2326 static void test_msipackage(void)
2328 MSIHANDLE hdb = 0, hpack = 100;
2333 /* NULL szPackagePath */
2334 r = MsiOpenPackage(NULL, &hpack);
2335 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2337 /* empty szPackagePath */
2338 r = MsiOpenPackage("", &hpack);
2339 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2341 skip("Not enough rights to perform tests\n");
2346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2349 if (r == ERROR_SUCCESS)
2350 MsiCloseHandle(hpack);
2352 /* nonexistent szPackagePath */
2353 r = MsiOpenPackage("nonexistent", &hpack);
2354 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2357 r = MsiOpenPackage(msifile, NULL);
2358 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2362 r = MsiOpenPackage(name, &hpack);
2363 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2365 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2368 /* database exists, but is emtpy */
2369 sprintf(name, "#%d", hdb);
2370 r = MsiOpenPackage(name, &hpack);
2371 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2372 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2374 query = "CREATE TABLE `Property` ( "
2375 "`Property` CHAR(72), `Value` CHAR(0) "
2376 "PRIMARY KEY `Property`)";
2377 r = try_query(hdb, query);
2378 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2380 query = "CREATE TABLE `InstallExecuteSequence` ("
2381 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2382 "PRIMARY KEY `Action`)";
2383 r = try_query(hdb, query);
2384 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2386 /* a few key tables exist */
2387 sprintf(name, "#%d", hdb);
2388 r = MsiOpenPackage(name, &hpack);
2389 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2390 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2392 MsiCloseHandle(hdb);
2393 DeleteFile(msifile);
2395 /* start with a clean database to show what constitutes a valid package */
2396 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2399 sprintf(name, "#%d", hdb);
2401 /* The following summary information props must exist:
2406 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2407 r = MsiOpenPackage(name, &hpack);
2408 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2409 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2411 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2412 r = MsiOpenPackage(name, &hpack);
2413 ok(r == ERROR_SUCCESS,
2414 "Expected ERROR_SUCCESS, got %d\n", r);
2416 MsiCloseHandle(hpack);
2417 MsiCloseHandle(hdb);
2418 DeleteFile(msifile);
2421 static void test_formatrecord2(void)
2423 MSIHANDLE hpkg, hrec ;
2428 r = package_from_db(create_package_db(), &hpkg);
2429 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2431 skip("Not enough rights to perform tests\n");
2432 DeleteFile(msifile);
2435 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2437 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2438 ok( r == ERROR_SUCCESS, "set property failed\n");
2440 hrec = MsiCreateRecord(2);
2441 ok(hrec, "create record failed\n");
2443 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2444 ok( r == ERROR_SUCCESS, "format record failed\n");
2448 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2450 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2451 r = MsiRecordSetString(hrec, 1, "hoo");
2453 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2454 ok( sz == 3, "size wrong\n");
2455 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2456 ok( r == ERROR_SUCCESS, "format failed\n");
2458 r = MsiRecordSetString(hrec, 0, "x[~]x");
2460 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2461 ok( sz == 3, "size wrong\n");
2462 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2463 ok( r == ERROR_SUCCESS, "format failed\n");
2465 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2466 r = MsiRecordSetString(hrec, 1, "hoo");
2468 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2469 ok( sz == 3, "size wrong\n");
2470 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2471 ok( r == ERROR_SUCCESS, "format failed\n");
2473 r = MsiRecordSetString(hrec, 0, "[\\[]");
2475 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2476 ok( sz == 1, "size wrong\n");
2477 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2478 ok( r == ERROR_SUCCESS, "format failed\n");
2480 SetEnvironmentVariable("FOO", "BAR");
2481 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2483 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2484 ok( sz == 3, "size wrong\n");
2485 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2486 ok( r == ERROR_SUCCESS, "format failed\n");
2488 r = MsiRecordSetString(hrec, 0, "[[1]]");
2489 r = MsiRecordSetString(hrec, 1, "%FOO");
2491 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2492 ok( sz == 3, "size wrong\n");
2493 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2494 ok( r == ERROR_SUCCESS, "format failed\n");
2496 MsiCloseHandle( hrec );
2497 MsiCloseHandle( hpkg );
2498 DeleteFile(msifile);
2501 static void test_states(void)
2506 INSTALLSTATE state, action;
2508 static const CHAR msifile2[] = "winetest2-package.msi";
2509 static const CHAR msifile3[] = "winetest3-package.msi";
2510 static const CHAR msifile4[] = "winetest4-package.msi";
2512 if (is_process_limited())
2514 skip("process is limited\n");
2518 hdb = create_package_db();
2519 ok ( hdb, "failed to create package database\n" );
2521 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2522 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2524 r = create_property_table( hdb );
2525 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2527 r = add_property_entry( hdb, "'ProductCode', '{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
2528 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2530 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2531 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2533 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2534 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2536 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2537 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2539 r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
2540 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2542 r = create_install_execute_sequence_table( hdb );
2543 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2545 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2546 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2548 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2549 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2551 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2552 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2554 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2555 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2557 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2558 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2560 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2561 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2563 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2564 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2566 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2567 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2569 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2570 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2572 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2573 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2575 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2576 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2578 r = create_media_table( hdb );
2579 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2581 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2582 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2584 r = create_feature_table( hdb );
2585 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2587 r = create_component_table( hdb );
2588 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2590 /* msidbFeatureAttributesFavorLocal */
2591 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2592 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2594 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2595 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2596 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2598 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2599 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2600 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2602 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2603 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2604 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2606 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2607 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2608 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2610 /* msidbFeatureAttributesFavorSource */
2611 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2612 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2614 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2615 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2616 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2618 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2619 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2620 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2622 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2623 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2624 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2626 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2627 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2628 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2630 /* msidbFeatureAttributesFavorSource */
2631 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2632 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2634 /* msidbFeatureAttributesFavorLocal */
2635 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2636 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2639 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2640 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2642 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2643 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2644 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2646 /* no feature parent:msidbComponentAttributesLocalOnly */
2647 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2648 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2650 /* msidbFeatureAttributesFavorLocal:removed */
2651 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2652 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2654 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2655 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2656 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2658 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2659 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2660 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2662 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2663 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2664 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2666 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2667 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2668 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2670 /* msidbFeatureAttributesFavorSource:removed */
2671 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2672 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2674 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2675 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2676 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2678 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2679 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2680 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2682 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2683 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2684 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2686 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2687 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2688 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2690 /* msidbFeatureAttributesFavorLocal */
2691 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2692 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2694 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2695 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2697 /* msidbFeatureAttributesFavorSource */
2698 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2699 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2701 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2702 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2704 /* msidbFeatureAttributesFavorAdvertise */
2705 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2706 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2708 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2709 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2711 /* msidbFeatureAttributesUIDisallowAbsent */
2712 r = add_feature_entry( hdb, "'eleven', '', '', '', 2, 1, '', 16" );
2713 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2715 r = add_component_entry( hdb, "'psi', '{A06B23B5-746B-427A-8A6E-FD6AC8F46A95}', 'TARGETDIR', 1, '', 'psi_file'" );
2716 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2718 r = create_feature_components_table( hdb );
2719 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2721 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2722 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2724 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2725 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2727 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2728 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2730 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2731 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2733 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2734 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2736 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2737 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2739 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2740 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2742 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2743 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2745 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2746 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2748 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2749 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2751 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2752 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2754 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2755 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2757 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2758 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2760 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2761 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2763 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2764 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2766 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2767 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2769 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2770 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2772 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2773 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2775 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2776 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2778 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2779 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2781 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2782 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2784 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2785 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2787 r = add_feature_components_entry( hdb, "'eleven', 'psi'" );
2788 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2790 r = create_file_table( hdb );
2791 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2793 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2794 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2796 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2797 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2799 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2800 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2802 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2803 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2805 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2806 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2808 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2809 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2811 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2812 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2814 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2815 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2817 /* compressed file */
2818 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2819 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2821 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2822 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2824 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2825 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2827 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2828 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2830 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2831 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2833 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2834 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2836 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2837 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2839 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2840 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2842 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2843 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2845 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2846 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2848 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2849 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2851 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2852 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2854 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2855 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2857 r = add_file_entry( hdb, "'psi_file', 'psi', 'psi.txt', 100, '', '1033', 8192, 1" );
2858 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2860 MsiDatabaseCommit(hdb);
2862 /* these properties must not be in the saved msi file */
2863 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2864 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2866 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2867 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2869 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2870 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2872 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2873 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2875 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2876 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2878 r = package_from_db( hdb, &hpkg );
2879 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2881 skip("Not enough rights to perform tests\n");
2882 DeleteFile(msifile);
2885 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
2887 MsiCloseHandle(hdb);
2889 CopyFileA(msifile, msifile2, FALSE);
2890 CopyFileA(msifile, msifile3, FALSE);
2891 CopyFileA(msifile, msifile4, FALSE);
2895 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2896 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2897 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2898 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2902 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2903 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2904 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2905 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2909 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2910 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2911 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2912 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2916 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2917 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2918 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2919 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2923 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2924 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2925 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2926 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2930 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2931 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2932 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2933 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2937 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2938 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2939 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2940 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2944 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2945 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2946 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2947 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2951 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2952 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2953 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2954 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2958 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2959 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2960 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2961 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2965 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
2966 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2967 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2968 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2972 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2973 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2974 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2975 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2979 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2980 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2981 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2982 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2986 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2987 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2988 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2989 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2993 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2994 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2995 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2996 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3000 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3001 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3002 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3003 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3007 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3008 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3009 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3010 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3014 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3015 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3016 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3017 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3021 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3022 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3023 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3024 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3028 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3029 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3030 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3031 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3035 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3036 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3037 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3038 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3042 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3043 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3044 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3045 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3049 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3050 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3051 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3052 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3056 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3057 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3058 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3059 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3063 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3064 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3065 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3066 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3070 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3071 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3072 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3073 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3077 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3078 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3079 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3080 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3084 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3085 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3086 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3087 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3091 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3092 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3093 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3094 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3098 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3099 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3100 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3101 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3105 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3106 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3107 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3108 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3112 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3113 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3114 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3115 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3119 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3120 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3121 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3122 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3124 r = MsiDoAction( hpkg, "CostInitialize");
3125 ok( r == ERROR_SUCCESS, "cost init failed\n");
3129 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3131 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3132 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3136 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3138 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3139 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3143 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3145 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3146 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3150 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3152 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3153 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3157 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3159 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3160 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3164 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3166 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3167 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3171 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3173 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3174 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3178 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3180 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3181 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3185 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3187 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3192 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3199 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3206 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3213 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3220 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3227 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3234 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3241 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3248 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3250 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3251 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3255 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3262 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3269 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3276 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3283 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3290 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3297 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3304 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3311 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3318 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3325 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3332 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3339 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3346 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3353 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3358 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3360 r = MsiDoAction( hpkg, "FileCost");
3361 ok( r == ERROR_SUCCESS, "file cost failed\n");
3363 r = MsiGetFeatureState(hpkg, "one", NULL, NULL);
3364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3367 r = MsiGetFeatureState(hpkg, "one", NULL, &action);
3368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3369 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3372 r = MsiGetFeatureState( hpkg, "one", &state, NULL);
3373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3374 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3378 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3379 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3380 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3381 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3385 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3386 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3387 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3388 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3392 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3393 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3394 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3395 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3399 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3400 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3401 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3402 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3406 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3407 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3408 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3409 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3413 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3414 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3415 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3416 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3420 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3421 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3422 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3423 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3427 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3428 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3429 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3430 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3434 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3435 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3436 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3437 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3441 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3442 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3443 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3444 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3448 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3449 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3450 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3451 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3455 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3456 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3457 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3458 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3462 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3464 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3465 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3469 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3470 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3471 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3472 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3476 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3478 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3479 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3483 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3484 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3485 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3486 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3490 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3491 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3492 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3493 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3497 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3499 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3500 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3504 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3505 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3506 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3507 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3511 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3513 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3514 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3518 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3520 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3521 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3525 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3526 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3527 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3528 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3532 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3534 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3535 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3539 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3541 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3542 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3546 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3548 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3549 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3553 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3555 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3556 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3560 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3562 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3563 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3567 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3569 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3570 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3574 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3576 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3577 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3581 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3583 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3584 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3588 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3589 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3590 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3591 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3595 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3596 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3597 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3598 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3602 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3603 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3604 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3605 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3607 r = MsiDoAction( hpkg, "CostFinalize");
3608 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3612 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3613 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3614 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3615 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3619 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3620 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3621 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3622 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3626 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3627 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3628 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3629 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3633 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3634 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3635 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3636 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3640 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3641 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3642 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3643 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3647 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3648 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3649 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3650 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3654 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3655 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3656 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3657 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3661 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3662 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3663 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3664 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3668 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3669 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3670 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3671 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3675 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3676 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3677 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3678 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3682 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3683 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3684 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3685 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3689 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3690 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3691 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3692 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3696 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3697 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3698 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3699 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3703 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3704 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3705 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3706 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3710 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3711 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3712 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3713 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3717 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3718 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3719 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3720 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3724 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3725 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3726 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3727 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3731 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3732 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3733 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3734 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3738 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3739 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3740 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3741 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3745 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3746 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3747 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3748 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3752 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3753 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3754 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3755 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3759 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3760 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3761 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3762 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3766 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3767 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3768 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3769 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3773 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3774 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3775 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3776 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3780 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3781 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3782 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3783 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3787 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3788 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3789 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3790 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3794 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3795 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3796 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3797 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3801 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3802 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3803 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3804 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3808 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3809 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3810 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3811 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3815 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3816 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3817 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3818 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3822 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3823 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3824 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3825 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3829 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3830 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3831 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3832 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3836 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3837 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3838 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3839 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3841 MsiCloseHandle( hpkg );
3843 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3845 /* publish the features and components */
3846 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3847 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3849 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3850 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3852 /* these properties must not be in the saved msi file */
3853 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3854 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3856 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3857 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3859 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3860 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3862 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3863 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3865 r = package_from_db( hdb, &hpkg );
3866 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
3868 MsiCloseHandle(hdb);
3872 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3873 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3874 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3875 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3879 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3880 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3881 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3882 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3886 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3887 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3888 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3889 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3893 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3894 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3895 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3896 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3900 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3901 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3902 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3903 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3907 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3908 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3909 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3910 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3914 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3915 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3916 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3917 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3921 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3922 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3923 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3924 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3928 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3929 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3930 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3931 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3935 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3936 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3937 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3938 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3942 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3943 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3944 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3945 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3949 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3950 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3951 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3952 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3956 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3957 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3958 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3959 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3963 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3964 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3965 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3966 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3970 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3971 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3972 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3973 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3977 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3978 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3979 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3980 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3984 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3985 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3986 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3987 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3991 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3992 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3993 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3994 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3998 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3999 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4000 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4001 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4005 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4006 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4007 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4008 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4012 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4013 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4014 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4015 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4019 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4020 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4021 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4022 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4026 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4027 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4028 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4029 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4033 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4034 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4035 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4036 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4040 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4041 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4042 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4043 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4047 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4048 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4049 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4050 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4054 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4055 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4056 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4057 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4061 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4062 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4063 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4064 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4068 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4069 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4070 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4071 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4075 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4076 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4077 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4078 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4082 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4083 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4084 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4085 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4089 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4090 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4091 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4092 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4096 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4097 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4098 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4099 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4101 r = MsiDoAction( hpkg, "CostInitialize");
4102 ok( r == ERROR_SUCCESS, "cost init failed\n");
4106 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4108 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4113 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4115 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4116 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4120 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4122 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4127 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4134 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4141 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4148 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4155 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4162 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4164 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4165 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4169 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4171 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4176 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4178 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4183 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4185 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4186 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4190 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4192 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4193 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4197 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4199 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4200 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4204 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4206 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4207 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4211 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4212 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4213 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4214 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4218 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4219 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4220 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4221 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4225 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4226 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4227 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4228 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4232 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4234 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4235 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4239 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4241 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4242 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4246 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4248 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4249 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4253 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4255 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4256 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4260 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4262 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4263 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4267 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4269 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4270 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4274 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4275 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4276 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4277 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4281 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4283 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4284 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4288 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4290 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4291 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4295 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4297 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4298 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4302 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4304 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4305 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4309 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4310 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4311 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4312 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4316 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4318 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4319 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4323 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4325 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4326 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4330 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4332 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4333 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4335 r = MsiDoAction( hpkg, "FileCost");
4336 ok( r == ERROR_SUCCESS, "file cost failed\n");
4340 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4342 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4343 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4347 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4349 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4350 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4354 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4356 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4361 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4363 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4368 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4370 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4371 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4375 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4377 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4378 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4382 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4384 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4385 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4389 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4391 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4392 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4396 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4398 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4403 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4405 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4410 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4411 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4412 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4413 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4417 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4418 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4419 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4420 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4424 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4425 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4426 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4427 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4431 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4432 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4433 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4434 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4438 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4439 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4440 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4441 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4445 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4446 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4447 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4448 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4452 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4453 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4454 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4455 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4459 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4460 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4461 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4462 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4466 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4467 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4468 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4469 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4473 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4474 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4475 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4476 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4480 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4482 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4483 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4487 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4488 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4489 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4490 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4494 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4495 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4496 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4497 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4501 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4502 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4503 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4504 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4508 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4509 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4510 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4511 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4515 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4516 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4517 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4518 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4522 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4524 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4525 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4529 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4530 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4531 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4532 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4536 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4537 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4538 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4539 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4543 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4545 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4546 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4550 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4551 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4552 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4553 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4555 r = MsiDoAction( hpkg, "CostFinalize");
4556 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4560 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4562 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4563 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4567 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4569 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4570 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4574 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4576 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4577 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4581 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4583 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4584 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4588 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4589 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4590 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4591 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4595 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4596 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4597 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4598 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4602 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4603 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4604 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4605 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4609 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4610 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4611 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4612 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4616 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4617 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4618 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4619 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4623 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4624 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4625 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4626 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4630 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4631 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4632 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4633 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4637 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4638 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4639 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4640 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4644 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4645 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4646 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4647 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4651 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4652 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4653 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4654 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4658 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4659 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4660 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4661 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4665 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4666 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4667 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4668 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4672 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4673 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4674 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4675 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4679 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4680 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4681 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4682 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4686 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4687 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4688 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4689 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4693 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4694 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4695 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4696 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4700 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4701 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4702 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4703 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4707 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4708 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4709 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4710 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4714 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4715 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4716 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4717 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4721 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4722 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4723 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4724 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4728 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4729 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4730 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4731 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4735 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4736 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4737 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4738 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4742 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4743 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4744 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4745 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4749 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4751 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4752 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4756 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4757 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4758 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4759 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4763 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4764 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4765 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4766 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4770 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4771 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4772 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4773 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4777 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4778 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4779 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4780 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4784 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4785 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4786 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4787 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4789 MsiCloseHandle(hpkg);
4791 /* uninstall the product */
4792 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4795 /* all features installed locally */
4796 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4799 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4800 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4802 /* these properties must not be in the saved msi file */
4803 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4804 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4806 r = package_from_db( hdb, &hpkg );
4807 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
4811 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4812 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4813 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4814 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4818 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4819 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4820 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4821 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4825 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4826 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4827 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4828 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4832 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4833 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4834 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4835 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4839 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4840 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4841 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4842 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4846 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4847 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4848 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4849 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4853 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4854 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4855 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4856 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4860 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4861 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4862 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4863 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4867 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4868 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4869 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4870 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4874 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4875 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4876 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4877 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4881 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4882 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4883 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4884 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4888 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4889 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4890 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4891 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4895 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4896 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4897 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4898 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4902 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4903 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4904 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4905 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4909 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4910 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4911 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4912 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4916 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4917 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4918 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4919 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4923 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4924 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4925 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4926 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4930 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4931 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4932 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4933 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4937 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4938 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4939 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4940 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4944 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4945 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4946 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4947 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4951 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4952 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4953 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4954 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4958 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4959 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4960 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4961 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4965 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4966 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4967 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4968 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4972 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4973 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4974 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4975 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4979 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4980 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4981 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4982 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4986 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4987 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4988 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4989 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4993 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4994 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4995 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4996 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5000 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5001 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5002 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5003 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5007 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5008 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5009 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5010 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5014 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5015 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5016 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5017 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5021 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5022 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5023 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5024 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5028 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5029 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5030 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5031 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5035 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5036 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5037 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5038 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5040 r = MsiDoAction( hpkg, "CostInitialize");
5041 ok( r == ERROR_SUCCESS, "cost init failed\n");
5045 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5047 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5048 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5052 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5054 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5059 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5060 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5061 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5062 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5066 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5068 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5069 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5073 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5075 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5076 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5080 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5082 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5083 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5087 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5089 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5090 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5094 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5096 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5097 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5101 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5103 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5104 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5108 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5110 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5111 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5115 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5117 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5118 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5122 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5124 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5125 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5129 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5131 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5132 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5136 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5138 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5139 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5143 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5145 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5146 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5150 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5152 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5153 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5157 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5159 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5160 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5164 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5166 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5167 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5171 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5173 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5174 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5178 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5180 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5181 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5185 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5187 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5192 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5199 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5206 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5213 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5220 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5227 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5234 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5241 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5248 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5250 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5251 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5255 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5262 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5269 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5274 r = MsiDoAction( hpkg, "FileCost");
5275 ok( r == ERROR_SUCCESS, "file cost failed\n");
5279 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5281 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5282 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5286 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5288 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5289 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5293 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5295 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5296 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5300 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5301 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5302 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5303 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5307 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5308 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5309 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5310 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5314 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5315 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5316 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5317 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5321 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5322 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5323 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5324 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5328 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5329 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5330 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5331 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5335 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5336 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5337 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5338 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5342 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5344 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5345 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5349 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5350 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5351 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5352 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5356 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5357 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5358 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5359 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5363 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5365 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5366 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5370 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5372 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5373 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5377 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5378 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5379 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5380 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5384 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5386 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5387 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5391 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5393 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5394 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5398 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5400 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5401 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5405 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5407 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5408 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5412 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5414 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5415 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5419 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5421 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5422 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5426 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5428 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5429 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5433 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5435 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5436 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5440 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5442 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5443 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5447 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5449 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5450 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5454 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5456 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5457 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5461 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5463 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5464 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5468 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5470 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5471 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5475 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5477 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5478 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5482 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5484 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5485 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5489 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5491 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5492 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5496 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5498 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5499 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5503 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5505 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5506 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5508 r = MsiDoAction( hpkg, "CostFinalize");
5509 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5513 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5514 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5515 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5516 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5520 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5521 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5522 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5523 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5527 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5528 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5529 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5530 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5534 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5535 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5536 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5537 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5541 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5542 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5543 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5544 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5548 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5549 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5550 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5551 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5555 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5556 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5557 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5558 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5562 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5563 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5564 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5565 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5569 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5570 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5571 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5572 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5576 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5577 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5578 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5579 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5583 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5584 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5585 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5586 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5590 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5591 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5592 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5593 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5597 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5598 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5599 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5600 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5604 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5605 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5606 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5607 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5611 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5612 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5613 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5614 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5618 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5619 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5620 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5621 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5625 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5626 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5627 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5628 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5632 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5633 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5634 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5635 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5639 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5640 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5641 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5642 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5646 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5647 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5648 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5649 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5653 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5654 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5655 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5656 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5660 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5661 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5662 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5663 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5667 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5668 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5669 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5670 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5674 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5676 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5677 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5681 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5683 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5684 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5688 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5690 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5691 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5695 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5696 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5697 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5698 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5702 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5703 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5704 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5705 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5709 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5710 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5711 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5712 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5716 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5717 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5718 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5719 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5723 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5724 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5725 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5726 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5730 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5731 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5732 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5733 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5737 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5738 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5739 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5740 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5742 MsiCloseHandle(hpkg);
5744 /* uninstall the product */
5745 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5746 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5748 /* all features installed from source */
5749 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5750 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5752 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5753 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5755 /* this property must not be in the saved msi file */
5756 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5757 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5759 r = package_from_db( hdb, &hpkg );
5760 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
5764 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5765 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5766 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5767 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5771 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5772 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5773 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5774 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5778 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5779 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5780 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5781 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5785 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5786 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5787 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5788 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5792 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5793 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5794 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5795 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5799 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5800 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5801 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5802 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5806 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5807 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5808 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5809 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5813 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5814 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5815 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5816 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5820 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5821 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5822 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5823 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5827 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5828 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5829 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5830 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5834 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5835 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5836 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5837 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5841 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5842 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5843 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5844 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5848 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5849 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5850 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5851 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5855 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5856 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5857 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5858 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5862 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5863 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5864 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5865 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5869 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5870 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5871 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5872 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5876 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5877 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5878 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5879 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5883 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5884 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5885 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5886 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5890 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5891 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5892 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5893 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5897 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5898 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5899 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5900 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5904 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5905 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5906 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5907 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5911 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5912 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5913 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5914 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5918 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5919 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5920 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5921 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5925 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5926 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5927 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5928 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5932 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5933 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5934 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5935 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5939 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5940 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5941 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5942 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5946 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5947 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5948 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5949 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5953 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5954 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5955 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5956 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5960 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5961 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5962 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5963 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5967 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5968 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5969 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5970 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5974 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5975 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5976 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5977 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5981 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5982 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5983 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5984 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5988 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5989 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5990 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5991 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5993 r = MsiDoAction( hpkg, "CostInitialize");
5994 ok( r == ERROR_SUCCESS, "cost init failed\n");
5998 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5999 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6000 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6001 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6005 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6006 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6007 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6008 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6012 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6013 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6014 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6015 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6019 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6020 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6021 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6022 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6026 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6027 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6028 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6029 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6033 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6034 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6035 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6036 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6040 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6041 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6042 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6043 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6047 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6048 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6049 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6050 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6054 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6056 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6057 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6061 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6063 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6064 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6068 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6070 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6071 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6075 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6077 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6078 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6082 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6084 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6089 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6091 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6092 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6096 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6098 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6099 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6103 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6105 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6106 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6110 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6112 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6113 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6117 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6119 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6120 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6124 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6126 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6127 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6131 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6133 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6138 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6140 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6145 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6147 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6152 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6154 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6155 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6159 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6161 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6166 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6168 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6173 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6175 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6176 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6180 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6182 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6183 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6187 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6189 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6190 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6194 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6196 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6197 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6201 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6203 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6204 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6208 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6210 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6215 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6217 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6218 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6222 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6224 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6225 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6227 r = MsiDoAction( hpkg, "FileCost");
6228 ok( r == ERROR_SUCCESS, "file cost failed\n");
6232 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6234 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6235 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6239 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6241 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6242 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6246 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6248 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6249 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6253 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6255 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6256 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6260 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6262 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6263 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6267 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6269 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6270 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6274 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6275 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6276 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6277 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6281 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6283 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6284 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6288 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6290 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6291 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6295 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6297 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6298 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6302 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6304 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6305 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6309 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6310 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6311 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6312 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6316 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6318 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6319 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6323 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6325 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6326 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6330 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6332 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6333 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6337 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6339 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6340 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6344 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6346 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6347 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6351 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6353 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6354 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6358 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6360 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6361 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6365 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6367 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6368 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6372 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6374 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6375 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6379 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6381 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6382 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6386 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6388 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6389 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6393 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6394 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6395 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6396 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6400 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6401 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6402 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6403 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6407 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6408 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6409 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6410 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6414 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6415 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6416 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6417 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6421 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6422 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6423 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6424 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6428 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6429 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6430 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6431 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6435 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6436 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6437 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6438 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6442 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6444 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6445 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6449 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6451 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6452 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6456 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6458 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6459 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6461 r = MsiDoAction( hpkg, "CostFinalize");
6462 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6466 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6467 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6468 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6469 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6473 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6474 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6475 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6476 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6480 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6482 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6483 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6487 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6488 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6489 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6490 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6494 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6495 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6496 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6497 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6501 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6502 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6503 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6504 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6508 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6509 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6510 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6511 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6515 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6516 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6517 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6518 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6522 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6524 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6525 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6529 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6530 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6531 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6532 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6536 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6537 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6538 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6539 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6543 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6545 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6546 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6550 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6551 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6552 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6553 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6557 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6558 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6559 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6560 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6564 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6565 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6566 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6567 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6571 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6572 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6573 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6574 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6578 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6579 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6580 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6581 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6585 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6586 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6587 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6588 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6592 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6593 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6594 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6595 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6599 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6600 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6601 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6602 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6606 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6607 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6608 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6609 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6613 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6614 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6615 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6616 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6620 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6621 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6622 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6623 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6627 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6628 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6629 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6630 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6634 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6635 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6636 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6637 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6641 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6642 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6643 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6644 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6648 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6649 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6650 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6651 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6655 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6656 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6657 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6658 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6662 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6663 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6664 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6665 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6669 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6670 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6671 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6672 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6676 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6677 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6678 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6679 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6683 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6684 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6685 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6686 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6690 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6691 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6692 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6693 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6695 MsiCloseHandle(hpkg);
6697 /* reinstall the product */
6698 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6701 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6702 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6704 /* this property must not be in the saved msi file */
6705 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6706 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6708 r = package_from_db( hdb, &hpkg );
6709 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
6713 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6714 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6715 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6716 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6720 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6721 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6722 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6723 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6727 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6728 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6729 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6730 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6734 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6735 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6736 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6737 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6741 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6742 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6743 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6744 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6748 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6749 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6750 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6751 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6755 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6756 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6757 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6758 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6762 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6763 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6764 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6765 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6769 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6770 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6771 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6772 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6776 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6777 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6778 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6779 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6783 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6784 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6785 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6786 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6790 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6791 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6792 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6793 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6797 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6798 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6799 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6800 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6804 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6805 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6806 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6807 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6811 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6812 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6813 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6814 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6818 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6819 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6820 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6821 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6825 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6826 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6827 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6828 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6832 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6833 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6834 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6835 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6839 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6840 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6841 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6842 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6846 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6847 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6848 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6849 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6853 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6854 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6855 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6856 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6860 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6861 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6862 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6863 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6867 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6868 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6869 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6870 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6874 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6875 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6876 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6877 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6881 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6882 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6883 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6884 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6888 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6889 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6890 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6891 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6895 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6896 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6897 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6898 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6902 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6903 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6904 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6905 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6909 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6910 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6911 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6912 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6916 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6917 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6918 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6919 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6923 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6924 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6925 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6926 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6930 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6931 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6932 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6933 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6937 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6938 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6939 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6940 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6942 r = MsiDoAction( hpkg, "CostInitialize");
6943 ok( r == ERROR_SUCCESS, "cost init failed\n");
6947 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6949 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6950 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6954 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6956 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6957 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6961 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6963 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6964 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6968 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6970 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6971 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6975 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6977 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6978 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6982 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6983 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6984 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6985 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6989 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6990 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6991 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6992 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6996 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6997 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6998 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6999 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7003 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7004 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7005 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7006 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7010 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7011 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7012 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7013 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7017 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7018 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7019 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7020 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7024 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7026 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7027 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7031 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7032 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7033 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7034 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7038 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7040 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7041 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7045 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7047 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7048 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7052 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7054 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7059 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7060 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7061 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7062 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7066 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7068 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7069 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7073 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7075 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7076 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7080 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7082 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7083 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7087 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7089 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7090 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7094 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7096 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7097 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7101 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7103 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7104 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7108 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7110 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7111 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7115 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7117 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7118 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7122 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7124 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7125 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7129 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7131 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7132 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7136 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7138 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7139 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7143 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7145 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7146 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7150 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7152 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7153 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7157 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7159 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7160 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7164 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7166 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7167 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7171 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7173 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7174 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7176 r = MsiDoAction( hpkg, "FileCost");
7177 ok( r == ERROR_SUCCESS, "file cost failed\n");
7181 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7182 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7183 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7184 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7188 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7190 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7191 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7195 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7197 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7198 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7202 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7204 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7205 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7209 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7211 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7212 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7216 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7218 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7219 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7223 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7224 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7225 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7226 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7230 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7232 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7233 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7237 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7238 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7239 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7240 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7244 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7245 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7246 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7247 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7251 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7253 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7254 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7258 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7260 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7261 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7265 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7266 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7267 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7268 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7272 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7274 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7275 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7279 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7281 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7282 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7286 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7288 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7289 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7293 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7295 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7296 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7300 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7301 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7302 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7303 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7307 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7308 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7309 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7310 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7314 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7315 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7316 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7317 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7321 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7322 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7323 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7324 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7328 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7329 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7330 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7331 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7335 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7336 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7337 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7338 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7342 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7344 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7345 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7349 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7350 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7351 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7352 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7356 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7357 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7358 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7359 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7363 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7365 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7366 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7370 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7372 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7373 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7377 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7378 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7379 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7380 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7384 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7386 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7387 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7391 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7393 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7394 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7398 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7400 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7401 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7405 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7407 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7408 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7410 r = MsiDoAction( hpkg, "CostFinalize");
7411 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
7415 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7416 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7417 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7418 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7422 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7423 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7424 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7425 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7429 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7430 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7431 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7432 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7436 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7437 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7438 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7439 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7443 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7444 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7445 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7446 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7450 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7451 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7452 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7453 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7457 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7458 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7459 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7460 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7464 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7465 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7466 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7467 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7471 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7472 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7473 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7474 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7478 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7479 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7480 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7481 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7485 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7486 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7487 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7488 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7492 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7493 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7494 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7495 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7499 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7500 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7501 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7502 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7506 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7507 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7508 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7509 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7513 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7514 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7515 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7516 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7520 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7521 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7522 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7523 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7527 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7528 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7529 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7530 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7534 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7535 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7536 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7537 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7541 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7542 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7543 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7544 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7548 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7549 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7550 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7551 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7555 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7556 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7557 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7558 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7562 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7563 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7564 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7565 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7569 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7570 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7571 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7572 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7576 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7577 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7578 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7579 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7583 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7584 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7585 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7586 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7590 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7591 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7592 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7593 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7597 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7598 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7599 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7600 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7604 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7605 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7606 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7607 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7611 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7612 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7613 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7614 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7618 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7619 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7620 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7621 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7625 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7626 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7627 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7628 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7632 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7633 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7634 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7635 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7639 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7640 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7641 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7642 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7644 MsiCloseHandle(hpkg);
7646 /* uninstall the product */
7647 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7650 DeleteFileA(msifile);
7651 DeleteFileA(msifile2);
7652 DeleteFileA(msifile3);
7653 DeleteFileA(msifile4);
7656 static void test_getproperty(void)
7658 MSIHANDLE hPackage = 0;
7660 static CHAR empty[] = "";
7664 r = package_from_db(create_package_db(), &hPackage);
7665 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7667 skip("Not enough rights to perform tests\n");
7668 DeleteFile(msifile);
7671 ok( r == ERROR_SUCCESS, "Failed to create package %u\n", r );
7673 /* set the property */
7674 r = MsiSetProperty(hPackage, "Name", "Value");
7675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7677 /* retrieve the size, NULL pointer */
7679 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7680 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7681 ok( size == 5, "Expected 5, got %d\n", size);
7683 /* retrieve the size, empty string */
7685 r = MsiGetProperty(hPackage, "Name", empty, &size);
7686 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7687 ok( size == 5, "Expected 5, got %d\n", size);
7689 /* don't change size */
7690 r = MsiGetProperty(hPackage, "Name", prop, &size);
7691 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7692 ok( size == 5, "Expected 5, got %d\n", size);
7693 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7695 /* increase the size by 1 */
7697 r = MsiGetProperty(hPackage, "Name", prop, &size);
7698 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7699 ok( size == 5, "Expected 5, got %d\n", size);
7700 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7702 r = MsiCloseHandle( hPackage);
7703 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7704 DeleteFile(msifile);
7707 static void test_removefiles(void)
7712 INSTALLSTATE installed, action;
7714 hdb = create_package_db();
7715 ok ( hdb, "failed to create package database\n" );
7717 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7718 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7720 r = create_feature_table( hdb );
7721 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7723 r = create_component_table( hdb );
7724 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7726 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7727 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7729 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7730 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7732 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7733 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7735 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7736 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7738 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7739 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7741 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7742 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7744 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7745 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7747 r = add_component_entry( hdb, "'oxygen', '', 'TARGETDIR', 0, '0', 'oxygen_file'" );
7748 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7750 r = create_feature_components_table( hdb );
7751 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7753 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7754 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7756 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7757 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7759 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7760 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7762 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7763 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7765 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7766 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7768 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7769 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7771 r = add_feature_components_entry( hdb, "'one', 'oxygen'" );
7772 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7774 r = create_file_table( hdb );
7775 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7777 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7778 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7780 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7781 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7783 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7784 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7786 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7787 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7789 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7790 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7792 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7793 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7795 r = add_file_entry( hdb, "'oxygen_file', 'oxygen', 'oxygen.txt', 0, '', '1033', 16384, 1" );
7796 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7798 r = create_remove_file_table( hdb );
7799 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7801 r = package_from_db( hdb, &hpkg );
7802 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7804 skip("Not enough rights to perform tests\n");
7805 DeleteFile(msifile);
7808 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7810 MsiCloseHandle( hdb );
7812 create_test_file( "hydrogen.txt" );
7813 create_test_file( "helium.txt" );
7814 create_test_file( "lithium.txt" );
7815 create_test_file( "beryllium.txt" );
7816 create_test_file( "boron.txt" );
7817 create_test_file( "carbon.txt" );
7818 create_test_file( "oxygen.txt" );
7820 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7821 ok( r == ERROR_SUCCESS, "set property failed\n");
7823 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7825 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7826 ok( r == ERROR_UNKNOWN_COMPONENT, "expected ERROR_UNKNOWN_COMPONENT, got %u\n", r );
7828 r = MsiDoAction( hpkg, "CostInitialize");
7829 ok( r == ERROR_SUCCESS, "cost init failed\n");
7831 r = MsiDoAction( hpkg, "FileCost");
7832 ok( r == ERROR_SUCCESS, "file cost failed\n");
7834 installed = action = 0xdeadbeef;
7835 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7836 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7837 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7838 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7840 r = MsiDoAction( hpkg, "CostFinalize");
7841 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7843 r = MsiDoAction( hpkg, "InstallValidate");
7844 ok( r == ERROR_SUCCESS, "install validate failed\n");
7846 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7847 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7849 installed = action = 0xdeadbeef;
7850 r = MsiGetComponentState( hpkg, "hydrogen", &installed, &action );
7851 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7853 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7854 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7857 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7858 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7860 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7861 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7863 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7864 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7866 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7867 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7869 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7870 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7872 installed = action = 0xdeadbeef;
7873 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7874 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7875 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7876 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7878 r = MsiSetComponentState( hpkg, "oxygen", INSTALLSTATE_ABSENT );
7879 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7881 installed = action = 0xdeadbeef;
7882 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7883 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7884 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7885 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7887 r = MsiDoAction( hpkg, "RemoveFiles");
7888 ok( r == ERROR_SUCCESS, "remove files failed\n");
7890 installed = action = 0xdeadbeef;
7891 r = MsiGetComponentState( hpkg, "oxygen", &installed, &action );
7892 ok( r == ERROR_SUCCESS, "failed to get component state %u\n", r );
7893 ok( installed == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed );
7894 ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
7896 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7897 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7898 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7899 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7900 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7901 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7902 ok(DeleteFileA("oxygen.txt"), "Expected oxygen.txt to exist\n");
7904 MsiCloseHandle( hpkg );
7905 DeleteFileA(msifile);
7908 static void test_appsearch(void)
7913 CHAR prop[MAX_PATH];
7916 hdb = create_package_db();
7917 ok ( hdb, "failed to create package database\n" );
7919 r = create_appsearch_table( hdb );
7920 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7922 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7923 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7925 r = add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" );
7926 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7928 r = create_reglocator_table( hdb );
7929 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7931 r = add_reglocator_entry( hdb, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 );
7932 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7934 r = create_drlocator_table( hdb );
7935 ok( r == ERROR_SUCCESS, "cannot create DrLocator table: %d\n", r );
7937 r = add_drlocator_entry( hdb, "'NewSignature2', 0, 'c:\\windows\\system32', 0" );
7938 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7940 r = create_signature_table( hdb );
7941 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7943 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7944 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7946 r = add_signature_entry( hdb, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" );
7947 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7949 r = package_from_db( hdb, &hpkg );
7950 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7952 skip("Not enough rights to perform tests\n");
7953 DeleteFile(msifile);
7956 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7957 MsiCloseHandle( hdb );
7958 if (r != ERROR_SUCCESS)
7961 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7963 r = MsiDoAction( hpkg, "AppSearch" );
7964 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7966 size = sizeof(prop);
7967 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7968 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7971 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7974 size = sizeof(prop);
7975 r = MsiGetPropertyA( hpkg, "NOTEPAD", prop, &size );
7976 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7979 MsiCloseHandle( hpkg );
7980 DeleteFileA(msifile);
7983 static void test_appsearch_complocator(void)
7985 MSIHANDLE hpkg, hdb;
7986 CHAR path[MAX_PATH];
7987 CHAR prop[MAX_PATH];
7992 if (!get_user_sid(&usersid))
7995 if (is_process_limited())
7997 skip("process is limited\n");
8001 create_test_file("FileName1");
8002 create_test_file("FileName4");
8003 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
8004 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
8006 create_test_file("FileName2");
8007 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
8008 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
8010 create_test_file("FileName3");
8011 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
8012 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
8014 create_test_file("FileName5");
8015 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
8016 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
8018 create_test_file("FileName6");
8019 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
8020 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
8022 create_test_file("FileName7");
8023 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
8024 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
8026 /* dir is FALSE, but we're pretending it's a directory */
8027 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
8028 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
8030 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8031 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
8032 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
8034 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8035 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
8036 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
8038 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8039 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
8040 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
8042 hdb = create_package_db();
8043 ok(hdb, "Expected a valid database handle\n");
8045 r = create_appsearch_table(hdb);
8046 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8048 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8051 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8052 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8054 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8057 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8060 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8063 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8066 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8069 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8072 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8075 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8078 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8079 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8081 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8084 r = create_complocator_table(hdb);
8085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8087 /* published component, machine, file, signature, misdbLocatorTypeFile */
8088 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
8089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8091 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
8092 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
8093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8095 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
8096 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
8097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8099 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
8100 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
8101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8103 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
8104 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
8105 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8107 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
8108 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
8109 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8111 /* published component, machine, file, no signature, misdbLocatorTypeFile */
8112 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
8113 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8115 /* unpublished component, no signature, misdbLocatorTypeDir */
8116 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
8117 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8119 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
8120 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
8121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8123 /* published component, signature w/ ver, misdbLocatorTypeFile */
8124 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
8125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8127 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
8128 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
8129 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8131 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
8132 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
8133 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8135 r = create_signature_table(hdb);
8136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8138 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
8139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8141 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
8142 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8144 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
8145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8147 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
8148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8150 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
8151 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8153 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8154 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8156 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8157 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8159 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8160 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8162 r = package_from_db(hdb, &hpkg);
8163 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8165 skip("Not enough rights to perform tests\n");
8168 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8170 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
8171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8173 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8175 r = MsiDoAction(hpkg, "AppSearch");
8176 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8179 sprintf(path, "%s\\FileName1", CURR_DIR);
8180 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8182 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8185 sprintf(path, "%s\\FileName2", CURR_DIR);
8186 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8187 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8188 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8191 sprintf(path, "%s\\FileName3", CURR_DIR);
8192 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8194 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8197 sprintf(path, "%s\\FileName4", CURR_DIR);
8198 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8199 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8200 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8203 sprintf(path, "%s\\FileName5", CURR_DIR);
8204 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8205 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8206 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8209 sprintf(path, "%s\\", CURR_DIR);
8210 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8211 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8212 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8215 sprintf(path, "%s\\", CURR_DIR);
8216 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8217 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8218 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8221 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8222 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8223 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
8226 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8227 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8228 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8231 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
8232 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8233 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8234 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8237 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8238 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8239 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8242 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
8243 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8245 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8247 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
8248 MSIINSTALLCONTEXT_MACHINE, NULL);
8249 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
8250 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
8251 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
8252 MSIINSTALLCONTEXT_USERMANAGED, usersid);
8253 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
8254 MSIINSTALLCONTEXT_MACHINE, NULL);
8255 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
8256 MSIINSTALLCONTEXT_MACHINE, NULL);
8257 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
8258 MSIINSTALLCONTEXT_MACHINE, NULL);
8259 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
8260 MSIINSTALLCONTEXT_MACHINE, NULL);
8261 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
8262 MSIINSTALLCONTEXT_MACHINE, NULL);
8263 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
8264 MSIINSTALLCONTEXT_MACHINE, NULL);
8265 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
8266 MSIINSTALLCONTEXT_MACHINE, NULL);
8268 MsiCloseHandle(hpkg);
8271 DeleteFileA("FileName1");
8272 DeleteFileA("FileName2");
8273 DeleteFileA("FileName3");
8274 DeleteFileA("FileName4");
8275 DeleteFileA("FileName5");
8276 DeleteFileA("FileName6");
8277 DeleteFileA("FileName7");
8278 DeleteFileA("FileName8.dll");
8279 DeleteFileA("FileName9.dll");
8280 DeleteFileA("FileName10.dll");
8281 DeleteFileA(msifile);
8285 static void test_appsearch_reglocator(void)
8287 MSIHANDLE hpkg, hdb;
8288 CHAR path[MAX_PATH], prop[MAX_PATH];
8289 DWORD binary[2], size, val;
8290 BOOL space, version, is_64bit = sizeof(void *) > sizeof(int);
8291 HKEY hklm, classes, hkcu, users;
8292 LPSTR pathdata, pathvar, ptr;
8299 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8302 DeleteFileA("test.dll");
8304 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
8305 if (res == ERROR_ACCESS_DENIED)
8307 skip("Not enough rights to perform tests\n");
8310 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8312 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
8313 (const BYTE *)"regszdata", 10);
8314 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8316 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
8317 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8319 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
8320 (const BYTE *)"regszdata", 10);
8321 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8324 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
8325 ok(res == ERROR_SUCCESS ||
8326 broken(res == ERROR_INVALID_PARAMETER),
8327 "Expected ERROR_SUCCESS, got %d\n", res);
8329 if (res == ERROR_SUCCESS)
8331 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
8332 (const BYTE *)"regszdata", 10);
8333 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8336 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
8337 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8339 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
8340 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8342 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
8343 (const BYTE *)"regszdata", 10);
8344 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8347 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
8348 (const BYTE *)&val, sizeof(DWORD));
8349 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8352 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
8353 (const BYTE *)&val, sizeof(DWORD));
8354 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8356 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
8357 (const BYTE *)"%PATH%", 7);
8358 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8360 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
8361 (const BYTE *)"my%NOVAR%", 10);
8362 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8364 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
8365 (const BYTE *)"one\0two\0", 9);
8366 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8368 binary[0] = 0x1234abcd;
8369 binary[1] = 0x567890ef;
8370 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
8371 (const BYTE *)binary, sizeof(binary));
8372 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8374 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
8375 (const BYTE *)"#regszdata", 11);
8376 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8378 create_test_file("FileName1");
8379 sprintf(path, "%s\\FileName1", CURR_DIR);
8380 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
8381 (const BYTE *)path, lstrlenA(path) + 1);
8382 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8384 sprintf(path, "%s\\FileName2", CURR_DIR);
8385 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
8386 (const BYTE *)path, lstrlenA(path) + 1);
8387 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8389 lstrcpyA(path, CURR_DIR);
8390 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
8391 (const BYTE *)path, lstrlenA(path) + 1);
8392 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8394 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
8395 (const BYTE *)"", 1);
8396 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8398 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8399 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8400 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
8401 (const BYTE *)path, lstrlenA(path) + 1);
8402 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8404 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8405 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8406 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
8407 (const BYTE *)path, lstrlenA(path) + 1);
8408 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8410 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8411 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8412 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
8413 (const BYTE *)path, lstrlenA(path) + 1);
8414 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8416 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
8417 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
8418 (const BYTE *)path, lstrlenA(path) + 1);
8420 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
8421 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
8422 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
8423 (const BYTE *)path, lstrlenA(path) + 1);
8425 hdb = create_package_db();
8426 ok(hdb, "Expected a valid database handle\n");
8428 r = create_appsearch_table(hdb);
8429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8431 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8434 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8437 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8440 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8443 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8446 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8449 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8452 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8455 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8458 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8461 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8464 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8467 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
8468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8470 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
8471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8473 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
8474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8476 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
8477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8479 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
8480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8482 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
8483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8485 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
8486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8488 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
8489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8491 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
8492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8494 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
8495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8497 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
8498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8500 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
8501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8503 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
8504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8506 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
8507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8509 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
8510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8512 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
8513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8515 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
8516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8518 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
8519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8521 r = create_reglocator_table(hdb);
8522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8524 type = msidbLocatorTypeRawValue;
8526 type |= msidbLocatorType64bit;
8528 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
8529 r = add_reglocator_entry(hdb, "NewSignature1", 2, "Software\\Wine", "Value1", type);
8530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8532 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
8533 r = add_reglocator_entry(hdb, "NewSignature2", 2, "Software\\Wine", "Value2", type);
8534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8536 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
8537 r = add_reglocator_entry(hdb, "NewSignature3", 2, "Software\\Wine", "Value3", type);
8538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8540 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8541 r = add_reglocator_entry(hdb, "NewSignature4", 2, "Software\\Wine", "Value4", type);
8542 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8544 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8545 r = add_reglocator_entry(hdb, "NewSignature5", 2, "Software\\Wine", "Value5", type);
8546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8548 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
8549 r = add_reglocator_entry(hdb, "NewSignature6", 2, "Software\\Wine", "Value6", type);
8550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8552 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
8553 r = add_reglocator_entry(hdb, "NewSignature7", 2, "Software\\Wine", "Value7", type);
8554 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8556 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
8557 r = add_reglocator_entry(hdb, "NewSignature8", 2, "Software\\Wine", "Value8", type);
8558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8560 type = msidbLocatorTypeFileName;
8562 type |= msidbLocatorType64bit;
8564 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
8565 r = add_reglocator_entry(hdb, "NewSignature9", 2, "Software\\Wine", "Value9", type);
8566 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8568 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
8569 r = add_reglocator_entry(hdb, "NewSignature10", 2, "Software\\Wine", "Value10", type);
8570 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8572 /* HKLM, msidbLocatorTypeFileName, no signature */
8573 r = add_reglocator_entry(hdb, "NewSignature11", 2, "Software\\Wine", "Value9", type);
8574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8576 type = msidbLocatorTypeDirectory;
8578 type |= msidbLocatorType64bit;
8580 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
8581 r = add_reglocator_entry(hdb, "NewSignature12", 2, "Software\\Wine", "Value9", type);
8582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8584 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8585 r = add_reglocator_entry(hdb, "NewSignature13", 2, "Software\\Wine", "Value11", type);
8586 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8588 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8589 r = add_reglocator_entry(hdb, "NewSignature14", 2, "Software\\Wine", "Value9", type);
8590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8592 type = msidbLocatorTypeRawValue;
8594 type |= msidbLocatorType64bit;
8596 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8597 r = add_reglocator_entry(hdb, "NewSignature15", 0, "Software\\Wine", "Value1", type);
8598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8600 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8601 r = add_reglocator_entry(hdb, "NewSignature16", 1, "Software\\Wine", "Value1", type);
8602 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8604 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8605 r = add_reglocator_entry(hdb, "NewSignature17", 3, "S-1-5-18\\Software\\Wine", "Value1", type);
8606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8608 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8609 r = add_reglocator_entry(hdb, "NewSignature18", 2, "Software\\Wine", "", type);
8610 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8612 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8613 r = add_reglocator_entry(hdb, "NewSignature19", 2, "Software\\IDontExist", "", type);
8614 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8616 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8617 r = add_reglocator_entry(hdb, "NewSignature20", 2, "Software\\Wine", "Value12", type);
8618 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8620 type = msidbLocatorTypeFileName;
8622 type |= msidbLocatorType64bit;
8624 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8625 r = add_reglocator_entry(hdb, "NewSignature21", 2, "Software\\Wine", "Value13", type);
8626 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8628 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8629 r = add_reglocator_entry(hdb, "NewSignature22", 2, "Software\\Wine", "Value14", type);
8630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8632 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8633 r = add_reglocator_entry(hdb, "NewSignature23", 2, "Software\\Wine", "Value15", type);
8634 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8636 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8637 r = add_reglocator_entry(hdb, "NewSignature24", 2, "Software\\Wine", "Value11", type);
8638 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8640 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8641 r = add_reglocator_entry(hdb, "NewSignature25", 2, "Software\\Wine", "Value10", type);
8642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8644 type = msidbLocatorTypeDirectory;
8646 type |= msidbLocatorType64bit;
8648 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8649 r = add_reglocator_entry(hdb, "NewSignature26", 2, "Software\\Wine", "Value11", type);
8650 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8652 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8653 r = add_reglocator_entry(hdb, "NewSignature27", 2, "Software\\Wine", "Value10", type);
8654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8656 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8657 r = add_reglocator_entry(hdb, "NewSignature28", 2, "Software\\Wine", "Value10", type);
8658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8660 type = msidbLocatorTypeFileName;
8662 type |= msidbLocatorType64bit;
8664 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8665 r = add_reglocator_entry(hdb, "NewSignature29", 2, "Software\\Wine", "Value16", type);
8666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8668 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8669 r = add_reglocator_entry(hdb, "NewSignature30", 2, "Software\\Wine", "Value17", type);
8670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8672 r = create_signature_table(hdb);
8673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8675 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8676 r = add_signature_entry(hdb, str);
8677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8679 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8680 r = add_signature_entry(hdb, str);
8681 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8683 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8684 r = add_signature_entry(hdb, str);
8685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8687 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8688 r = add_signature_entry(hdb, str);
8689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8691 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8692 r = add_signature_entry(hdb, str);
8693 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8695 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8696 r = add_signature_entry(hdb, str);
8697 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8699 ptr = strrchr(CURR_DIR, '\\') + 1;
8700 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8701 r = add_signature_entry(hdb, path);
8702 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8704 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8705 r = add_signature_entry(hdb, str);
8706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8708 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8709 r = add_signature_entry(hdb, str);
8710 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8712 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8713 r = add_signature_entry(hdb, str);
8714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8716 r = package_from_db(hdb, &hpkg);
8717 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8719 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8721 r = MsiDoAction(hpkg, "AppSearch");
8722 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8725 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8727 ok(!lstrcmpA(prop, "regszdata"),
8728 "Expected \"regszdata\", got \"%s\"\n", prop);
8731 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8733 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8736 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8737 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8738 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8740 memset(&si, 0, sizeof(si));
8741 if (pGetNativeSystemInfo) pGetNativeSystemInfo(&si);
8743 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
8745 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8746 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8748 /* Workaround for Win95 */
8750 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8752 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8753 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8756 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8759 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8760 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8762 ok(!lstrcmpA(pathdata, pathvar),
8763 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8765 HeapFree(GetProcessHeap(), 0, pathvar);
8766 HeapFree(GetProcessHeap(), 0, pathdata);
8770 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8773 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8776 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8777 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8780 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8781 "Expected \"\\0one\\0two\\0\\0\"\n");
8785 lstrcpyA(path, "#xCDAB3412EF907856");
8786 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8787 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8788 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8791 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8793 ok(!lstrcmpA(prop, "##regszdata"),
8794 "Expected \"##regszdata\", got \"%s\"\n", prop);
8797 sprintf(path, "%s\\FileName1", CURR_DIR);
8798 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8799 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8800 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8803 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8805 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8808 sprintf(path, "%s\\", CURR_DIR);
8809 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8811 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8814 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8816 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8819 sprintf(path, "%s\\", CURR_DIR);
8820 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8822 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8825 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8826 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8827 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8830 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8832 ok(!lstrcmpA(prop, "regszdata"),
8833 "Expected \"regszdata\", got \"%s\"\n", prop);
8836 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8838 ok(!lstrcmpA(prop, "regszdata"),
8839 "Expected \"regszdata\", got \"%s\"\n", prop);
8844 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8846 ok(!lstrcmpA(prop, "regszdata"),
8847 "Expected \"regszdata\", got \"%s\"\n", prop);
8851 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8853 ok(!lstrcmpA(prop, "defvalue"),
8854 "Expected \"defvalue\", got \"%s\"\n", prop);
8857 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8859 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8862 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8864 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8869 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8870 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8871 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8872 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8875 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8876 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8877 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8880 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8881 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8882 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8883 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8887 lstrcpyA(path, CURR_DIR);
8888 ptr = strrchr(path, '\\') + 1;
8890 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8892 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8895 sprintf(path, "%s\\", CURR_DIR);
8896 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8897 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8898 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8901 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8903 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8906 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8907 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8908 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8911 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8913 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8916 sprintf(path, "%s\\FileName1", CURR_DIR);
8917 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8918 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8919 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8922 sprintf(path, "%s\\FileName1", CURR_DIR);
8923 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8924 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8926 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8928 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8930 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8931 RegDeleteValueA(hklm, "Value1");
8932 RegDeleteValueA(hklm, "Value2");
8933 RegDeleteValueA(hklm, "Value3");
8934 RegDeleteValueA(hklm, "Value4");
8935 RegDeleteValueA(hklm, "Value5");
8936 RegDeleteValueA(hklm, "Value6");
8937 RegDeleteValueA(hklm, "Value7");
8938 RegDeleteValueA(hklm, "Value8");
8939 RegDeleteValueA(hklm, "Value9");
8940 RegDeleteValueA(hklm, "Value10");
8941 RegDeleteValueA(hklm, "Value11");
8942 RegDeleteValueA(hklm, "Value12");
8943 RegDeleteValueA(hklm, "Value13");
8944 RegDeleteValueA(hklm, "Value14");
8945 RegDeleteValueA(hklm, "Value15");
8946 RegDeleteValueA(hklm, "Value16");
8947 RegDeleteValueA(hklm, "Value17");
8948 RegDeleteKey(hklm, "");
8951 RegDeleteValueA(classes, "Value1");
8952 RegDeleteKeyA(classes, "");
8953 RegCloseKey(classes);
8955 RegDeleteValueA(hkcu, "Value1");
8956 RegDeleteKeyA(hkcu, "");
8959 RegDeleteValueA(users, "Value1");
8960 RegDeleteKeyA(users, "");
8963 DeleteFileA("FileName1");
8964 DeleteFileA("FileName3.dll");
8965 DeleteFileA("FileName4.dll");
8966 DeleteFileA("FileName5.dll");
8967 MsiCloseHandle(hpkg);
8968 DeleteFileA(msifile);
8971 static void delete_win_ini(LPCSTR file)
8973 CHAR path[MAX_PATH];
8975 GetWindowsDirectoryA(path, MAX_PATH);
8976 lstrcatA(path, "\\");
8977 lstrcatA(path, file);
8982 static void test_appsearch_inilocator(void)
8984 MSIHANDLE hpkg, hdb;
8985 CHAR path[MAX_PATH];
8986 CHAR prop[MAX_PATH];
8994 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8997 DeleteFileA("test.dll");
8999 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
9001 create_test_file("FileName1");
9002 sprintf(path, "%s\\FileName1", CURR_DIR);
9003 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
9005 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
9007 sprintf(path, "%s\\IDontExist", CURR_DIR);
9008 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
9010 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9011 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9012 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
9014 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9015 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9016 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
9018 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9019 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9020 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
9022 hdb = create_package_db();
9023 ok(hdb, "Expected a valid database handle\n");
9025 r = create_appsearch_table(hdb);
9026 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9028 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9029 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9031 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9034 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9035 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9037 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9038 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9040 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9043 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9044 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9046 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9049 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9050 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9052 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9053 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9055 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9056 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9058 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9059 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9061 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
9062 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9064 r = create_inilocator_table(hdb);
9065 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9067 /* msidbLocatorTypeRawValue, field 1 */
9068 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
9069 r = add_inilocator_entry(hdb, str);
9070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9072 /* msidbLocatorTypeRawValue, field 2 */
9073 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
9074 r = add_inilocator_entry(hdb, str);
9075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9077 /* msidbLocatorTypeRawValue, entire field */
9078 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
9079 r = add_inilocator_entry(hdb, str);
9080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9082 /* msidbLocatorTypeFile */
9083 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9084 r = add_inilocator_entry(hdb, str);
9085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9087 /* msidbLocatorTypeDirectory, file */
9088 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
9089 r = add_inilocator_entry(hdb, str);
9090 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9092 /* msidbLocatorTypeDirectory, directory */
9093 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
9094 r = add_inilocator_entry(hdb, str);
9095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9097 /* msidbLocatorTypeFile, file, no signature */
9098 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9099 r = add_inilocator_entry(hdb, str);
9100 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9102 /* msidbLocatorTypeFile, dir, no signature */
9103 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
9104 r = add_inilocator_entry(hdb, str);
9105 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9107 /* msidbLocatorTypeFile, file does not exist */
9108 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
9109 r = add_inilocator_entry(hdb, str);
9110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9112 /* msidbLocatorTypeFile, signature with version */
9113 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
9114 r = add_inilocator_entry(hdb, str);
9115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9117 /* msidbLocatorTypeFile, signature with version, ver > max */
9118 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 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, sig->name ignored */
9123 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
9124 r = add_inilocator_entry(hdb, str);
9125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9127 r = create_signature_table(hdb);
9128 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9130 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
9131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9133 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
9134 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9136 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9137 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9139 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9140 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9142 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9143 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9145 r = package_from_db(hdb, &hpkg);
9146 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9148 skip("Not enough rights to perform tests\n");
9151 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9153 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9155 r = MsiDoAction(hpkg, "AppSearch");
9156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9159 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9160 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9161 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
9164 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9166 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
9169 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9170 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9171 ok(!lstrcmpA(prop, "keydata,field2"),
9172 "Expected \"keydata,field2\", got \"%s\"\n", prop);
9175 sprintf(path, "%s\\FileName1", CURR_DIR);
9176 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9178 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9181 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9182 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9183 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9186 sprintf(path, "%s\\", CURR_DIR);
9187 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9188 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9189 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9192 sprintf(path, "%s\\", CURR_DIR);
9193 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9194 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9195 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9198 lstrcpyA(path, CURR_DIR);
9199 ptr = strrchr(path, '\\');
9201 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9202 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9203 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9206 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9208 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9213 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9214 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9215 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9216 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9219 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9220 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9221 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9224 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9225 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
9226 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9227 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9230 MsiCloseHandle(hpkg);
9233 delete_win_ini("IniFile.ini");
9234 DeleteFileA("FileName1");
9235 DeleteFileA("FileName2.dll");
9236 DeleteFileA("FileName3.dll");
9237 DeleteFileA("FileName4.dll");
9238 DeleteFileA(msifile);
9242 * MSI AppSearch action on DrLocator table always returns absolute paths.
9243 * If a relative path was set, it returns the first absolute path that
9244 * matches or an empty string if it didn't find anything.
9245 * This helper function replicates this behaviour.
9247 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
9252 size = lstrlenA(relative);
9253 drives = GetLogicalDrives();
9254 lstrcpyA(absolute, "A:\\");
9255 for (i = 0; i < 26; absolute[0] = '\0', i++)
9257 if (!(drives & (1 << i)))
9260 absolute[0] = 'A' + i;
9261 if (GetDriveType(absolute) != DRIVE_FIXED)
9264 lstrcpynA(absolute + 3, relative, size + 1);
9265 attr = GetFileAttributesA(absolute);
9266 if (attr != INVALID_FILE_ATTRIBUTES &&
9267 (attr & FILE_ATTRIBUTE_DIRECTORY))
9269 if (absolute[3 + size - 1] != '\\')
9270 lstrcatA(absolute, "\\");
9277 static void test_appsearch_drlocator(void)
9279 MSIHANDLE hpkg, hdb;
9280 CHAR path[MAX_PATH];
9281 CHAR prop[MAX_PATH];
9288 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9291 DeleteFileA("test.dll");
9293 create_test_file("FileName1");
9294 CreateDirectoryA("one", NULL);
9295 CreateDirectoryA("one\\two", NULL);
9296 CreateDirectoryA("one\\two\\three", NULL);
9297 create_test_file("one\\two\\three\\FileName2");
9298 CreateDirectoryA("another", NULL);
9299 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9300 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9301 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9303 hdb = create_package_db();
9304 ok(hdb, "Expected a valid database handle\n");
9306 r = create_appsearch_table(hdb);
9307 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9309 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9310 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9312 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9313 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9315 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9318 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9321 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9324 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9325 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9327 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9328 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9330 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9331 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9333 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9334 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9336 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9337 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9339 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9340 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9342 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
9343 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9345 r = create_drlocator_table(hdb);
9346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9348 /* no parent, full path, depth 0, signature */
9349 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
9350 r = add_drlocator_entry(hdb, path);
9351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9353 /* no parent, full path, depth 0, no signature */
9354 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
9355 r = add_drlocator_entry(hdb, path);
9356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9358 /* no parent, relative path, depth 0, no signature */
9359 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
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 2, signature */
9364 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
9365 r = add_drlocator_entry(hdb, path);
9366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9368 /* no parent, full path, depth 3, signature */
9369 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
9370 r = add_drlocator_entry(hdb, path);
9371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9373 /* no parent, full path, depth 1, signature is dir */
9374 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
9375 r = add_drlocator_entry(hdb, path);
9376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9378 /* parent is in DrLocator, relative path, depth 0, signature */
9379 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
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 0, signature w/ version */
9384 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
9385 r = add_drlocator_entry(hdb, path);
9386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9388 /* no parent, full path, depth 0, signature w/ version, ver > max */
9389 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
9390 r = add_drlocator_entry(hdb, path);
9391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9393 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
9394 sprintf(path, "'NewSignature10', '', '%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, relative empty path, depth 0, no signature */
9399 sprintf(path, "'NewSignature11', '', '', 0");
9400 r = add_drlocator_entry(hdb, path);
9401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9403 r = create_reglocator_table(hdb);
9404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9407 r = add_reglocator_entry(hdb, "NewSignature12", 2, "htmlfile\\shell\\open\\nonexistent", "", 1);
9408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9410 /* parent is in RegLocator, no path, depth 0, no signature */
9411 sprintf(path, "'NewSignature13', 'NewSignature12', '', 0");
9412 r = add_drlocator_entry(hdb, path);
9413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9415 r = create_signature_table(hdb);
9416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9418 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9419 r = add_signature_entry(hdb, str);
9420 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9422 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9423 r = add_signature_entry(hdb, str);
9424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9426 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9427 r = add_signature_entry(hdb, str);
9428 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9430 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9431 r = add_signature_entry(hdb, str);
9432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9434 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9435 r = add_signature_entry(hdb, str);
9436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9438 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9439 r = add_signature_entry(hdb, str);
9440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9442 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9443 r = add_signature_entry(hdb, str);
9444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9446 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9447 r = add_signature_entry(hdb, str);
9448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9450 r = package_from_db(hdb, &hpkg);
9451 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9453 skip("Not enough rights to perform tests\n");
9456 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9458 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9460 r = MsiDoAction(hpkg, "AppSearch");
9461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9464 sprintf(path, "%s\\FileName1", CURR_DIR);
9465 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9467 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9470 sprintf(path, "%s\\", CURR_DIR);
9471 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9473 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9476 search_absolute_directory(path, CURR_DIR + 3);
9477 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9479 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9482 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9484 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9487 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9488 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9490 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9493 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9495 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9498 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9499 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9501 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9506 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9507 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9509 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9512 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9514 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9517 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9519 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9523 search_absolute_directory(path, "");
9524 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9526 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9529 strcpy(path, "c:\\");
9530 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
9531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9532 ok(!prop[0], "Expected \"\", got \"%s\"\n", prop);
9534 MsiCloseHandle(hpkg);
9537 DeleteFileA("FileName1");
9538 DeleteFileA("FileName3.dll");
9539 DeleteFileA("FileName4.dll");
9540 DeleteFileA("FileName5.dll");
9541 DeleteFileA("one\\two\\three\\FileName2");
9542 RemoveDirectoryA("one\\two\\three");
9543 RemoveDirectoryA("one\\two");
9544 RemoveDirectoryA("one");
9545 RemoveDirectoryA("another");
9546 DeleteFileA(msifile);
9549 static void test_featureparents(void)
9554 INSTALLSTATE state, action;
9556 hdb = create_package_db();
9557 ok ( hdb, "failed to create package database\n" );
9559 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
9560 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
9562 r = create_feature_table( hdb );
9563 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
9565 r = create_component_table( hdb );
9566 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
9568 r = create_feature_components_table( hdb );
9569 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
9571 r = create_file_table( hdb );
9572 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
9574 /* msidbFeatureAttributesFavorLocal */
9575 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
9576 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9578 /* msidbFeatureAttributesFavorSource */
9579 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
9580 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9582 /* msidbFeatureAttributesFavorLocal */
9583 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
9584 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9586 /* msidbFeatureAttributesUIDisallowAbsent */
9587 r = add_feature_entry( hdb, "'lyra', '', '', '', 2, 1, '', 16" );
9588 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9590 /* disabled because of install level */
9591 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
9592 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9594 /* child feature of disabled feature */
9595 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9596 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9598 /* component of disabled feature (install level) */
9599 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9600 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9602 /* component of disabled child feature (install level) */
9603 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9604 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9606 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9607 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9608 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9610 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9611 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9612 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9614 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9615 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9616 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9618 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9619 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9620 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9622 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9623 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9624 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9626 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9627 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9628 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9630 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9631 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9632 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9634 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9635 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9636 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9638 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9639 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9641 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9642 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9644 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9645 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9647 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9648 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9650 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9651 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9653 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9654 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9656 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9657 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9659 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9660 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9662 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9663 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9665 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9666 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9668 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9669 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9671 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9672 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9674 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9675 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9677 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9678 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9680 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9681 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9683 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9684 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9686 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9687 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9689 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9690 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9692 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9693 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9695 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9696 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9698 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9699 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9701 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9702 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9704 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9705 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9707 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9708 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9710 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9711 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9713 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9714 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9716 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9717 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9719 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9720 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9722 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9723 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9725 r = package_from_db( hdb, &hpkg );
9726 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9728 skip("Not enough rights to perform tests\n");
9729 DeleteFile(msifile);
9732 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9734 MsiCloseHandle( hdb );
9736 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9738 r = MsiDoAction( hpkg, "CostInitialize");
9739 ok( r == ERROR_SUCCESS, "cost init failed\n");
9741 r = MsiDoAction( hpkg, "FileCost");
9742 ok( r == ERROR_SUCCESS, "file cost failed\n");
9744 r = MsiDoAction( hpkg, "CostFinalize");
9745 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9749 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9751 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9752 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9756 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9757 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9758 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9759 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9763 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9764 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9765 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9766 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9770 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9771 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9772 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9773 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9777 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9778 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9779 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9780 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9784 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9785 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9786 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9787 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9791 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9792 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9793 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9794 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9798 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9799 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9800 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9801 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9805 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9806 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9807 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9808 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9812 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9814 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9815 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9819 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9820 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9821 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9822 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9826 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9828 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9829 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9833 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9835 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9836 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9840 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9842 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9843 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9847 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9849 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9850 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9854 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9855 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9856 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9857 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9861 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9863 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9864 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9866 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9867 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9869 r = MsiSetFeatureState(hpkg, "lyra", INSTALLSTATE_ABSENT);
9870 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9872 r = MsiSetFeatureState(hpkg, "nosuchfeature", INSTALLSTATE_ABSENT);
9873 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r);
9877 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9879 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9880 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9884 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9886 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9887 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9891 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9893 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9894 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9898 r = MsiGetFeatureState(hpkg, "lyra", &state, &action);
9899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9900 ok( state == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", state);
9901 ok( action == INSTALLSTATE_ABSENT, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", action);
9905 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9906 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9907 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9908 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9912 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9913 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9914 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9915 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9919 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9920 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9921 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9922 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9926 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9927 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9928 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9929 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9933 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9934 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9935 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9936 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9940 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9941 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9942 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9943 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9947 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9949 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9950 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9954 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9956 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9957 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9961 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9963 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9964 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9968 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9970 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9971 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9975 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9977 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9978 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9980 MsiCloseHandle(hpkg);
9981 DeleteFileA(msifile);
9984 static void test_installprops(void)
9986 MSIHANDLE hpkg, hdb;
9987 CHAR path[MAX_PATH], buf[MAX_PATH];
9993 REGSAM access = KEY_ALL_ACCESS;
9997 access |= KEY_WOW64_64KEY;
9999 GetCurrentDirectory(MAX_PATH, path);
10000 lstrcat(path, "\\");
10001 lstrcat(path, msifile);
10003 hdb = create_package_db();
10004 ok( hdb, "failed to create database\n");
10006 r = package_from_db(hdb, &hpkg);
10007 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10009 skip("Not enough rights to perform tests\n");
10010 DeleteFile(msifile);
10013 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10015 MsiCloseHandle(hdb);
10018 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
10019 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10020 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10022 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
10023 RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
10028 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10032 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
10035 /* win9x doesn't set this */
10039 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
10040 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10041 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10047 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
10051 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
10057 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
10058 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10059 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
10063 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
10064 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10065 trace("VersionDatabase = %s\n", buf);
10068 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
10069 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10070 trace("VersionMsi = %s\n", buf);
10073 r = MsiGetProperty(hpkg, "Date", buf, &size);
10074 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10075 trace("Date = %s\n", buf);
10078 r = MsiGetProperty(hpkg, "Time", buf, &size);
10079 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10080 trace("Time = %s\n", buf);
10083 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
10084 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10085 trace("PackageCode = %s\n", buf);
10087 langid = GetUserDefaultLangID();
10088 sprintf(path, "%d", langid);
10091 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
10092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
10093 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
10095 res = GetSystemMetrics(SM_CXSCREEN);
10097 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
10098 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10100 res = GetSystemMetrics(SM_CYSCREEN);
10102 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
10103 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10105 if (pGetSystemInfo && pSHGetFolderPathA)
10107 pGetSystemInfo(&si);
10108 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
10112 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10113 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10114 ok(buf[0], "property not set\n");
10118 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10119 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10120 ok(buf[0], "property not set\n");
10124 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10125 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10126 GetSystemDirectoryA(path, MAX_PATH);
10127 if (size) buf[size - 1] = 0;
10128 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10132 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10133 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10134 pGetSystemWow64DirectoryA(path, MAX_PATH);
10135 if (size) buf[size - 1] = 0;
10136 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10140 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10141 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10142 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10143 if (size) buf[size - 1] = 0;
10144 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10148 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10149 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10150 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10151 if (size) buf[size - 1] = 0;
10152 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10156 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10157 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10158 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10159 if (size) buf[size - 1] = 0;
10160 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10164 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10165 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10166 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10167 if (size) buf[size - 1] = 0;
10168 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10172 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10173 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10174 ok(buf[0], "property not set\n");
10176 else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
10182 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10183 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10184 ok(!buf[0], "property set\n");
10188 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10189 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10190 ok(!buf[0], "property set\n");
10194 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10195 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10196 ok(!buf[0], "property set\n");
10200 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10201 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10202 GetSystemDirectoryA(path, MAX_PATH);
10203 if (size) buf[size - 1] = 0;
10204 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10208 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10209 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10210 ok(!buf[0], "property set\n");
10214 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10215 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10216 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10217 if (size) buf[size - 1] = 0;
10218 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10222 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10223 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10224 ok(!buf[0], "property set\n");
10228 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10229 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10230 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10231 if (size) buf[size - 1] = 0;
10232 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10236 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10237 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10238 ok(!buf[0], "property set\n");
10244 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10245 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10246 ok(buf[0], "property not set\n");
10250 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10251 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10252 ok(buf[0], "property not set\n");
10256 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10257 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10258 GetSystemDirectoryA(path, MAX_PATH);
10259 if (size) buf[size - 1] = 0;
10260 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10264 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10265 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10266 pGetSystemWow64DirectoryA(path, MAX_PATH);
10267 if (size) buf[size - 1] = 0;
10268 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10272 r = MsiGetProperty(hpkg, "ProgramFilesFolder64", buf, &size);
10273 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10274 ok(!buf[0], "property set\n");
10278 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10279 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10280 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10281 if (size) buf[size - 1] = 0;
10282 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10286 r = MsiGetProperty(hpkg, "CommonFilesFolder64", buf, &size);
10287 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10288 ok(!buf[0], "property set\n");
10292 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10293 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10294 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10295 if (size) buf[size - 1] = 0;
10296 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10300 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10301 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10302 ok(buf[0], "property not set\n");
10307 CloseHandle(hkey1);
10308 CloseHandle(hkey2);
10309 MsiCloseHandle(hpkg);
10310 DeleteFile(msifile);
10313 static void test_launchconditions(void)
10319 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10321 hdb = create_package_db();
10322 ok( hdb, "failed to create package database\n" );
10324 r = create_launchcondition_table( hdb );
10325 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
10327 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
10328 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10330 /* invalid condition */
10331 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
10332 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10334 r = package_from_db( hdb, &hpkg );
10335 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10337 skip("Not enough rights to perform tests\n");
10338 DeleteFile(msifile);
10341 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10343 MsiCloseHandle( hdb );
10345 r = MsiSetProperty( hpkg, "X", "1" );
10346 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10348 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10350 /* invalid conditions are ignored */
10351 r = MsiDoAction( hpkg, "LaunchConditions" );
10352 ok( r == ERROR_SUCCESS, "cost init failed\n" );
10354 /* verify LaunchConditions still does some verification */
10355 r = MsiSetProperty( hpkg, "X", "2" );
10356 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10358 r = MsiDoAction( hpkg, "LaunchConditions" );
10359 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
10361 MsiCloseHandle( hpkg );
10362 DeleteFile( msifile );
10365 static void test_ccpsearch(void)
10367 MSIHANDLE hdb, hpkg;
10368 CHAR prop[MAX_PATH];
10369 DWORD size = MAX_PATH;
10372 hdb = create_package_db();
10373 ok(hdb, "failed to create package database\n");
10375 r = create_ccpsearch_table(hdb);
10376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10378 r = add_ccpsearch_entry(hdb, "'CCP_random'");
10379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10381 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
10382 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10384 r = create_reglocator_table(hdb);
10385 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10387 r = add_reglocator_entry(hdb, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
10388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10390 r = create_drlocator_table(hdb);
10391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10393 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
10394 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10396 r = create_signature_table(hdb);
10397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10399 r = package_from_db(hdb, &hpkg);
10400 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10402 skip("Not enough rights to perform tests\n");
10403 DeleteFile(msifile);
10406 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10408 MsiCloseHandle(hdb);
10410 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10412 r = MsiDoAction(hpkg, "CCPSearch");
10413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10415 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
10416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10417 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
10419 MsiCloseHandle(hpkg);
10420 DeleteFileA(msifile);
10423 static void test_complocator(void)
10425 MSIHANDLE hdb, hpkg;
10427 CHAR prop[MAX_PATH];
10428 CHAR expected[MAX_PATH];
10429 DWORD size = MAX_PATH;
10431 hdb = create_package_db();
10432 ok(hdb, "failed to create package database\n");
10434 r = create_appsearch_table(hdb);
10435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10437 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
10438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10440 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
10441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10443 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
10444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10446 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
10447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10449 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
10450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10452 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
10453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10455 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
10456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10458 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
10459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10461 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
10462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10464 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
10465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10467 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
10468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10470 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
10471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10473 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
10474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10476 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
10477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10479 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
10480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10482 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
10483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10485 r = create_complocator_table(hdb);
10486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10488 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
10489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10491 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
10492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10494 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
10495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10497 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
10498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10500 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
10501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10503 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
10504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10506 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
10507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10509 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
10510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10512 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
10513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10515 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
10516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10518 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
10519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10521 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
10522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10524 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
10525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10527 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
10528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10530 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
10531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10533 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
10534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10536 r = create_signature_table(hdb);
10537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10539 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
10540 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10542 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
10543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10545 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
10546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10548 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
10549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10551 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
10552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10554 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
10555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10557 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
10558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10560 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
10561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10563 r = package_from_db(hdb, &hpkg);
10564 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10566 skip("Not enough rights to perform tests\n");
10567 DeleteFile(msifile);
10570 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10572 MsiCloseHandle(hdb);
10574 create_test_file("abelisaurus");
10575 create_test_file("bactrosaurus");
10576 create_test_file("camelotia");
10577 create_test_file("diclonius");
10578 create_test_file("echinodon");
10579 create_test_file("falcarius");
10580 create_test_file("gallimimus");
10581 create_test_file("hagryphus");
10582 CreateDirectoryA("iguanodon", NULL);
10583 CreateDirectoryA("jobaria", NULL);
10584 CreateDirectoryA("kakuru", NULL);
10585 CreateDirectoryA("labocania", NULL);
10586 CreateDirectoryA("megaraptor", NULL);
10587 CreateDirectoryA("neosodon", NULL);
10588 CreateDirectoryA("olorotitan", NULL);
10589 CreateDirectoryA("pantydraco", NULL);
10591 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
10592 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
10593 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
10594 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
10595 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
10596 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
10597 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
10598 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
10599 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
10600 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
10601 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
10602 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
10603 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
10604 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
10605 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
10606 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
10608 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10610 r = MsiDoAction(hpkg, "AppSearch");
10611 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10614 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
10615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10617 lstrcpyA(expected, CURR_DIR);
10618 lstrcatA(expected, "\\abelisaurus");
10619 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10620 "Expected %s or empty string, got %s\n", expected, prop);
10623 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
10624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10625 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10628 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
10629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10630 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10633 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
10634 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10635 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10638 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
10639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10641 lstrcpyA(expected, CURR_DIR);
10642 lstrcatA(expected, "\\");
10643 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10644 "Expected %s or empty string, got %s\n", expected, prop);
10647 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
10648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10649 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10652 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
10653 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10654 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10657 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
10658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10659 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10662 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
10663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10664 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10667 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
10668 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10669 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10672 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
10673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10674 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10677 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
10678 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10679 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10682 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
10683 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10685 lstrcpyA(expected, CURR_DIR);
10686 lstrcatA(expected, "\\");
10687 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10688 "Expected %s or empty string, got %s\n", expected, prop);
10691 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
10692 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10694 lstrcpyA(expected, CURR_DIR);
10695 lstrcatA(expected, "\\neosodon\\");
10696 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10697 "Expected %s or empty string, got %s\n", expected, prop);
10700 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
10701 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10702 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10705 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
10706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10707 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10709 MsiCloseHandle(hpkg);
10710 DeleteFileA("abelisaurus");
10711 DeleteFileA("bactrosaurus");
10712 DeleteFileA("camelotia");
10713 DeleteFileA("diclonius");
10714 DeleteFileA("echinodon");
10715 DeleteFileA("falcarius");
10716 DeleteFileA("gallimimus");
10717 DeleteFileA("hagryphus");
10718 RemoveDirectoryA("iguanodon");
10719 RemoveDirectoryA("jobaria");
10720 RemoveDirectoryA("kakuru");
10721 RemoveDirectoryA("labocania");
10722 RemoveDirectoryA("megaraptor");
10723 RemoveDirectoryA("neosodon");
10724 RemoveDirectoryA("olorotitan");
10725 RemoveDirectoryA("pantydraco");
10726 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10727 MSIINSTALLCONTEXT_MACHINE, NULL);
10728 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10729 MSIINSTALLCONTEXT_MACHINE, NULL);
10730 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10731 MSIINSTALLCONTEXT_MACHINE, NULL);
10732 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10733 MSIINSTALLCONTEXT_MACHINE, NULL);
10734 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10735 MSIINSTALLCONTEXT_MACHINE, NULL);
10736 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10737 MSIINSTALLCONTEXT_MACHINE, NULL);
10738 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10739 MSIINSTALLCONTEXT_MACHINE, NULL);
10740 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10741 MSIINSTALLCONTEXT_MACHINE, NULL);
10742 DeleteFileA(msifile);
10745 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
10750 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
10751 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10753 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
10754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10756 r = MsiSummaryInfoPersist(summary);
10757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10759 MsiCloseHandle(summary);
10762 static void test_MsiGetSourcePath(void)
10764 MSIHANDLE hdb, hpkg;
10765 CHAR path[MAX_PATH];
10766 CHAR cwd[MAX_PATH];
10767 CHAR subsrc[MAX_PATH];
10768 CHAR sub2[MAX_PATH];
10772 lstrcpyA(cwd, CURR_DIR);
10773 lstrcatA(cwd, "\\");
10775 lstrcpyA(subsrc, cwd);
10776 lstrcatA(subsrc, "subsource");
10777 lstrcatA(subsrc, "\\");
10779 lstrcpyA(sub2, subsrc);
10780 lstrcatA(sub2, "sub2");
10781 lstrcatA(sub2, "\\");
10783 /* uncompressed source */
10785 hdb = create_package_db();
10786 ok( hdb, "failed to create database\n");
10788 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10790 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10791 ok(r == S_OK, "failed\n");
10793 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10794 ok(r == S_OK, "failed\n");
10796 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
10797 ok(r == S_OK, "failed\n");
10799 r = MsiDatabaseCommit(hdb);
10800 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
10802 r = package_from_db(hdb, &hpkg);
10803 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10805 skip("Not enough rights to perform tests\n");
10806 DeleteFile(msifile);
10809 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10811 MsiCloseHandle(hdb);
10813 /* invalid database handle */
10815 lstrcpyA(path, "kiwi");
10816 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
10817 ok(r == ERROR_INVALID_HANDLE,
10818 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
10819 ok(!lstrcmpA(path, "kiwi"),
10820 "Expected path to be unchanged, got \"%s\"\n", path);
10821 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10823 /* NULL szFolder */
10825 lstrcpyA(path, "kiwi");
10826 r = MsiGetSourcePath(hpkg, NULL, path, &size);
10827 ok(r == ERROR_INVALID_PARAMETER,
10828 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10829 ok(!lstrcmpA(path, "kiwi"),
10830 "Expected path to be unchanged, got \"%s\"\n", path);
10831 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10833 /* empty szFolder */
10835 lstrcpyA(path, "kiwi");
10836 r = MsiGetSourcePath(hpkg, "", path, &size);
10837 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, 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 /* try TARGETDIR */
10844 lstrcpyA(path, "kiwi");
10845 r = MsiGetSourcePath(hpkg, "TARGETDIR", 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);
10852 lstrcpyA(path, "kiwi");
10853 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10855 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10856 ok(size == 0, "Expected 0, got %d\n", size);
10859 lstrcpyA(path, "kiwi");
10860 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10861 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10862 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10863 ok(size == 0, "Expected 0, got %d\n", size);
10865 /* try SourceDir */
10867 lstrcpyA(path, "kiwi");
10868 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10869 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10870 ok(!lstrcmpA(path, "kiwi"),
10871 "Expected path to be unchanged, got \"%s\"\n", path);
10872 ok(size == MAX_PATH, "Expected size to be unchanged, 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 /* source path does not exist, but the property exists */
10885 lstrcpyA(path, "kiwi");
10886 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10887 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10888 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10889 ok(size == 0, "Expected 0, got %d\n", size);
10892 lstrcpyA(path, "kiwi");
10893 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10895 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10896 ok(size == 0, "Expected 0, got %d\n", size);
10900 lstrcpyA(path, "kiwi");
10901 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10902 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10903 ok(!lstrcmpA(path, "kiwi"),
10904 "Expected path to be unchanged, got \"%s\"\n", path);
10905 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10909 lstrcpyA(path, "kiwi");
10910 r = MsiGetSourcePath(hpkg, "SubDir2", 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);
10916 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10918 r = MsiDoAction(hpkg, "CostInitialize");
10919 ok(r == ERROR_SUCCESS, "cost init failed\n");
10921 /* try TARGETDIR after CostInitialize */
10923 lstrcpyA(path, "kiwi");
10924 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10925 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10926 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10927 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10929 /* try SourceDir after CostInitialize */
10931 lstrcpyA(path, "kiwi");
10932 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10933 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10934 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10935 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10937 /* try SOURCEDIR after CostInitialize */
10939 lstrcpyA(path, "kiwi");
10940 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10941 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10942 ok(!lstrcmpA(path, "kiwi"),
10943 "Expected path to be unchanged, got \"%s\"\n", path);
10944 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10946 /* source path does not exist, but the property exists */
10948 lstrcpyA(path, "kiwi");
10949 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10953 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10954 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10957 /* try SubDir after CostInitialize */
10959 lstrcpyA(path, "kiwi");
10960 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10961 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10962 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10963 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10965 /* try SubDir2 after CostInitialize */
10967 lstrcpyA(path, "kiwi");
10968 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10969 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10970 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10971 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10973 r = MsiDoAction(hpkg, "ResolveSource");
10974 ok(r == ERROR_SUCCESS, "file cost failed\n");
10976 /* try TARGETDIR after ResolveSource */
10978 lstrcpyA(path, "kiwi");
10979 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10981 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10982 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10984 /* try SourceDir after ResolveSource */
10986 lstrcpyA(path, "kiwi");
10987 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10988 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10989 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10990 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10992 /* try SOURCEDIR after ResolveSource */
10994 lstrcpyA(path, "kiwi");
10995 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10996 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10997 ok(!lstrcmpA(path, "kiwi"),
10998 "Expected path to be unchanged, got \"%s\"\n", path);
10999 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11001 /* source path does not exist, but the property exists */
11003 lstrcpyA(path, "kiwi");
11004 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11006 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11007 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11009 /* try SubDir after ResolveSource */
11011 lstrcpyA(path, "kiwi");
11012 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11013 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11014 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11015 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11017 /* try SubDir2 after ResolveSource */
11019 lstrcpyA(path, "kiwi");
11020 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11021 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11022 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11023 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11025 r = MsiDoAction(hpkg, "FileCost");
11026 ok(r == ERROR_SUCCESS, "file cost failed\n");
11028 /* try TARGETDIR after FileCost */
11030 lstrcpyA(path, "kiwi");
11031 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11033 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11034 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11036 /* try SourceDir after FileCost */
11038 lstrcpyA(path, "kiwi");
11039 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11041 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11042 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11044 /* try SOURCEDIR after FileCost */
11046 lstrcpyA(path, "kiwi");
11047 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11048 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11049 ok(!lstrcmpA(path, "kiwi"),
11050 "Expected path to be unchanged, got \"%s\"\n", path);
11051 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11053 /* source path does not exist, but the property exists */
11055 lstrcpyA(path, "kiwi");
11056 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11058 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11059 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11061 /* try SubDir after FileCost */
11063 lstrcpyA(path, "kiwi");
11064 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11065 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11066 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11067 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11069 /* try SubDir2 after FileCost */
11071 lstrcpyA(path, "kiwi");
11072 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11074 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11075 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11077 r = MsiDoAction(hpkg, "CostFinalize");
11078 ok(r == ERROR_SUCCESS, "file cost failed\n");
11080 /* try TARGETDIR after CostFinalize */
11082 lstrcpyA(path, "kiwi");
11083 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11085 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11086 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11088 /* try SourceDir after CostFinalize */
11090 lstrcpyA(path, "kiwi");
11091 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11093 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11094 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11096 /* try SOURCEDIR after CostFinalize */
11098 lstrcpyA(path, "kiwi");
11099 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11100 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11101 ok(!lstrcmpA(path, "kiwi"),
11102 "Expected path to be unchanged, got \"%s\"\n", path);
11103 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11105 /* source path does not exist, but the property exists */
11107 lstrcpyA(path, "kiwi");
11108 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11109 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11110 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11111 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11113 /* try SubDir after CostFinalize */
11115 lstrcpyA(path, "kiwi");
11116 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11117 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11118 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11119 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11121 /* try SubDir2 after CostFinalize */
11123 lstrcpyA(path, "kiwi");
11124 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11126 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11127 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11129 /* nonexistent directory */
11131 lstrcpyA(path, "kiwi");
11132 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
11133 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11134 ok(!lstrcmpA(path, "kiwi"),
11135 "Expected path to be unchanged, got \"%s\"\n", path);
11136 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11138 /* NULL szPathBuf */
11140 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
11141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11142 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11144 /* NULL pcchPathBuf */
11145 lstrcpyA(path, "kiwi");
11146 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
11147 ok(r == ERROR_INVALID_PARAMETER,
11148 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11149 ok(!lstrcmpA(path, "kiwi"),
11150 "Expected path to be unchanged, got \"%s\"\n", path);
11152 /* pcchPathBuf is 0 */
11154 lstrcpyA(path, "kiwi");
11155 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11156 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11157 ok(!lstrcmpA(path, "kiwi"),
11158 "Expected path to be unchanged, got \"%s\"\n", path);
11159 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11161 /* pcchPathBuf does not have room for NULL terminator */
11162 size = lstrlenA(cwd);
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(!strncmp(path, cwd, lstrlenA(cwd) - 1),
11167 "Expected path with no backslash, got \"%s\"\n", path);
11168 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11170 /* pcchPathBuf has room for NULL terminator */
11171 size = lstrlenA(cwd) + 1;
11172 lstrcpyA(path, "kiwi");
11173 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11175 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11176 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11178 /* remove property */
11179 r = MsiSetProperty(hpkg, "SourceDir", NULL);
11180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11182 /* try SourceDir again */
11184 lstrcpyA(path, "kiwi");
11185 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11186 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11187 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11188 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11190 /* set property to a valid directory */
11191 r = MsiSetProperty(hpkg, "SOURCEDIR", cwd);
11192 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11194 /* try SOURCEDIR again */
11196 lstrcpyA(path, "kiwi");
11197 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11198 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11199 ok(!lstrcmpA(path, "kiwi"),
11200 "Expected path to be unchanged, got \"%s\"\n", path);
11201 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11203 MsiCloseHandle(hpkg);
11205 /* compressed source */
11207 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11210 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
11212 r = package_from_db(hdb, &hpkg);
11213 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11215 /* try TARGETDIR */
11217 lstrcpyA(path, "kiwi");
11218 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11219 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11220 ok(!lstrcmpA(path, "kiwi"),
11221 "Expected path to be unchanged, got \"%s\"\n", path);
11222 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11224 /* try SourceDir */
11226 lstrcpyA(path, "kiwi");
11227 r = MsiGetSourcePath(hpkg, "SourceDir", 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 /* source path nor the property exist */
11244 lstrcpyA(path, "kiwi");
11245 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11247 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11248 ok(size == 0, "Expected 0, got %d\n", size);
11252 lstrcpyA(path, "kiwi");
11253 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11254 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11255 ok(!lstrcmpA(path, "kiwi"),
11256 "Expected path to be unchanged, got \"%s\"\n", path);
11257 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11261 lstrcpyA(path, "kiwi");
11262 r = MsiGetSourcePath(hpkg, "SubDir2", 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);
11268 r = MsiDoAction(hpkg, "CostInitialize");
11269 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11271 /* try TARGETDIR after CostInitialize */
11273 lstrcpyA(path, "kiwi");
11274 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11275 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11276 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11277 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11279 /* try SourceDir after CostInitialize */
11281 lstrcpyA(path, "kiwi");
11282 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11283 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11284 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11285 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11287 /* try SOURCEDIR after CostInitialize */
11289 lstrcpyA(path, "kiwi");
11290 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11293 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11294 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11295 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11298 /* source path does not exist, but the property exists */
11300 lstrcpyA(path, "kiwi");
11301 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11305 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11306 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11309 /* try SubDir after CostInitialize */
11311 lstrcpyA(path, "kiwi");
11312 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11313 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);
11317 /* try SubDir2 after CostInitialize */
11319 lstrcpyA(path, "kiwi");
11320 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11321 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11322 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11323 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11325 r = MsiDoAction(hpkg, "ResolveSource");
11326 ok(r == ERROR_SUCCESS, "file cost failed\n");
11328 /* try TARGETDIR after ResolveSource */
11330 lstrcpyA(path, "kiwi");
11331 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11332 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11333 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11334 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11336 /* try SourceDir after ResolveSource */
11338 lstrcpyA(path, "kiwi");
11339 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11340 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11341 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11342 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11344 /* try SOURCEDIR after ResolveSource */
11346 lstrcpyA(path, "kiwi");
11347 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11350 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11351 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11352 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11355 /* source path and the property exist */
11357 lstrcpyA(path, "kiwi");
11358 r = MsiGetProperty(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);
11363 /* try SubDir after ResolveSource */
11365 lstrcpyA(path, "kiwi");
11366 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11368 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11369 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11371 /* try SubDir2 after ResolveSource */
11373 lstrcpyA(path, "kiwi");
11374 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11376 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11377 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11379 r = MsiDoAction(hpkg, "FileCost");
11380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11382 /* try TARGETDIR after CostFinalize */
11384 lstrcpyA(path, "kiwi");
11385 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11387 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11388 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11390 /* try SourceDir after CostFinalize */
11392 lstrcpyA(path, "kiwi");
11393 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11394 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11395 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11396 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11398 /* try SOURCEDIR after CostFinalize */
11400 lstrcpyA(path, "kiwi");
11401 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11405 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11406 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11409 /* source path and the property exist */
11411 lstrcpyA(path, "kiwi");
11412 r = MsiGetProperty(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);
11417 /* try SubDir after CostFinalize */
11419 lstrcpyA(path, "kiwi");
11420 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11422 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11423 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11425 /* try SubDir2 after CostFinalize */
11427 lstrcpyA(path, "kiwi");
11428 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11430 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11431 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11433 r = MsiDoAction(hpkg, "CostFinalize");
11434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11436 /* try TARGETDIR after CostFinalize */
11438 lstrcpyA(path, "kiwi");
11439 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11441 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11442 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11444 /* try SourceDir after CostFinalize */
11446 lstrcpyA(path, "kiwi");
11447 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11449 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11450 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11452 /* try SOURCEDIR after CostFinalize */
11454 lstrcpyA(path, "kiwi");
11455 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11458 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11459 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11460 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11463 /* source path and the property exist */
11465 lstrcpyA(path, "kiwi");
11466 r = MsiGetProperty(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);
11471 /* try SubDir after CostFinalize */
11473 lstrcpyA(path, "kiwi");
11474 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11476 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11477 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11479 /* try SubDir2 after CostFinalize */
11481 lstrcpyA(path, "kiwi");
11482 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11484 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11485 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11487 MsiCloseHandle(hpkg);
11488 DeleteFile(msifile);
11491 static void test_shortlongsource(void)
11493 MSIHANDLE hdb, hpkg;
11494 CHAR path[MAX_PATH];
11495 CHAR cwd[MAX_PATH];
11496 CHAR subsrc[MAX_PATH];
11500 lstrcpyA(cwd, CURR_DIR);
11501 lstrcatA(cwd, "\\");
11503 lstrcpyA(subsrc, cwd);
11504 lstrcatA(subsrc, "long");
11505 lstrcatA(subsrc, "\\");
11507 /* long file names */
11509 hdb = create_package_db();
11510 ok( hdb, "failed to create database\n");
11512 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
11514 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11515 ok(r == S_OK, "failed\n");
11517 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
11518 ok(r == S_OK, "failed\n");
11520 /* CostInitialize:short */
11521 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
11522 ok(r == S_OK, "failed\n");
11524 /* CostInitialize:long */
11525 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
11526 ok(r == S_OK, "failed\n");
11528 /* FileCost:short */
11529 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
11530 ok(r == S_OK, "failed\n");
11532 /* FileCost:long */
11533 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
11534 ok(r == S_OK, "failed\n");
11536 /* CostFinalize:short */
11537 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
11538 ok(r == S_OK, "failed\n");
11540 /* CostFinalize:long */
11541 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
11542 ok(r == S_OK, "failed\n");
11544 MsiDatabaseCommit(hdb);
11546 r = package_from_db(hdb, &hpkg);
11547 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11549 skip("Not enough rights to perform tests\n");
11550 DeleteFile(msifile);
11553 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11555 MsiCloseHandle(hdb);
11557 CreateDirectoryA("one", NULL);
11558 CreateDirectoryA("four", NULL);
11560 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11562 r = MsiDoAction(hpkg, "CostInitialize");
11563 ok(r == ERROR_SUCCESS, "file cost failed\n");
11565 CreateDirectory("five", NULL);
11566 CreateDirectory("eight", NULL);
11568 r = MsiDoAction(hpkg, "FileCost");
11569 ok(r == ERROR_SUCCESS, "file cost failed\n");
11571 CreateDirectory("nine", NULL);
11572 CreateDirectory("twelve", NULL);
11574 r = MsiDoAction(hpkg, "CostFinalize");
11575 ok(r == ERROR_SUCCESS, "file cost failed\n");
11577 /* neither short nor long source directories exist */
11579 lstrcpyA(path, "kiwi");
11580 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11582 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11583 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11585 CreateDirectoryA("short", NULL);
11587 /* short source directory exists */
11589 lstrcpyA(path, "kiwi");
11590 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11592 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11593 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11595 CreateDirectoryA("long", NULL);
11597 /* both short and long source directories exist */
11599 lstrcpyA(path, "kiwi");
11600 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11601 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11602 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11603 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11605 lstrcpyA(subsrc, cwd);
11606 lstrcatA(subsrc, "two");
11607 lstrcatA(subsrc, "\\");
11609 /* short dir exists before CostInitialize */
11611 lstrcpyA(path, "kiwi");
11612 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11614 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11615 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11617 lstrcpyA(subsrc, cwd);
11618 lstrcatA(subsrc, "four");
11619 lstrcatA(subsrc, "\\");
11621 /* long dir exists before CostInitialize */
11623 lstrcpyA(path, "kiwi");
11624 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11625 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11626 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11627 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11629 lstrcpyA(subsrc, cwd);
11630 lstrcatA(subsrc, "six");
11631 lstrcatA(subsrc, "\\");
11633 /* short dir exists before FileCost */
11635 lstrcpyA(path, "kiwi");
11636 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11637 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11638 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11639 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11641 lstrcpyA(subsrc, cwd);
11642 lstrcatA(subsrc, "eight");
11643 lstrcatA(subsrc, "\\");
11645 /* long dir exists before FileCost */
11647 lstrcpyA(path, "kiwi");
11648 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11649 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11650 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11651 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11653 lstrcpyA(subsrc, cwd);
11654 lstrcatA(subsrc, "ten");
11655 lstrcatA(subsrc, "\\");
11657 /* short dir exists before CostFinalize */
11659 lstrcpyA(path, "kiwi");
11660 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11661 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11662 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11663 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11665 lstrcpyA(subsrc, cwd);
11666 lstrcatA(subsrc, "twelve");
11667 lstrcatA(subsrc, "\\");
11669 /* long dir exists before CostFinalize */
11671 lstrcpyA(path, "kiwi");
11672 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11674 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11675 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11677 MsiCloseHandle(hpkg);
11678 RemoveDirectoryA("short");
11679 RemoveDirectoryA("long");
11680 RemoveDirectoryA("one");
11681 RemoveDirectoryA("four");
11682 RemoveDirectoryA("five");
11683 RemoveDirectoryA("eight");
11684 RemoveDirectoryA("nine");
11685 RemoveDirectoryA("twelve");
11687 /* short file names */
11689 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11690 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11692 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
11694 r = package_from_db(hdb, &hpkg);
11695 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11697 MsiCloseHandle(hdb);
11699 CreateDirectoryA("one", NULL);
11700 CreateDirectoryA("four", NULL);
11702 r = MsiDoAction(hpkg, "CostInitialize");
11703 ok(r == ERROR_SUCCESS, "file cost failed\n");
11705 CreateDirectory("five", NULL);
11706 CreateDirectory("eight", NULL);
11708 r = MsiDoAction(hpkg, "FileCost");
11709 ok(r == ERROR_SUCCESS, "file cost failed\n");
11711 CreateDirectory("nine", NULL);
11712 CreateDirectory("twelve", NULL);
11714 r = MsiDoAction(hpkg, "CostFinalize");
11715 ok(r == ERROR_SUCCESS, "file cost failed\n");
11717 lstrcpyA(subsrc, cwd);
11718 lstrcatA(subsrc, "short");
11719 lstrcatA(subsrc, "\\");
11721 /* neither short nor long source directories exist */
11723 lstrcpyA(path, "kiwi");
11724 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11725 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11726 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11727 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11729 CreateDirectoryA("short", NULL);
11731 /* short source directory exists */
11733 lstrcpyA(path, "kiwi");
11734 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11735 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11736 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11737 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11739 CreateDirectoryA("long", NULL);
11741 /* both short and long source directories exist */
11743 lstrcpyA(path, "kiwi");
11744 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11745 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11746 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11747 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11749 lstrcpyA(subsrc, cwd);
11750 lstrcatA(subsrc, "one");
11751 lstrcatA(subsrc, "\\");
11753 /* short dir exists before CostInitialize */
11755 lstrcpyA(path, "kiwi");
11756 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11758 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11759 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11761 lstrcpyA(subsrc, cwd);
11762 lstrcatA(subsrc, "three");
11763 lstrcatA(subsrc, "\\");
11765 /* long dir exists before CostInitialize */
11767 lstrcpyA(path, "kiwi");
11768 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11769 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11770 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11771 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11773 lstrcpyA(subsrc, cwd);
11774 lstrcatA(subsrc, "five");
11775 lstrcatA(subsrc, "\\");
11777 /* short dir exists before FileCost */
11779 lstrcpyA(path, "kiwi");
11780 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11781 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11782 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11783 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11785 lstrcpyA(subsrc, cwd);
11786 lstrcatA(subsrc, "seven");
11787 lstrcatA(subsrc, "\\");
11789 /* long dir exists before FileCost */
11791 lstrcpyA(path, "kiwi");
11792 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11794 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11795 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11797 lstrcpyA(subsrc, cwd);
11798 lstrcatA(subsrc, "nine");
11799 lstrcatA(subsrc, "\\");
11801 /* short dir exists before CostFinalize */
11803 lstrcpyA(path, "kiwi");
11804 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11805 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11806 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11807 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11809 lstrcpyA(subsrc, cwd);
11810 lstrcatA(subsrc, "eleven");
11811 lstrcatA(subsrc, "\\");
11813 /* long dir exists before CostFinalize */
11815 lstrcpyA(path, "kiwi");
11816 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11817 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11818 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11819 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11821 MsiCloseHandle(hpkg);
11822 RemoveDirectoryA("short");
11823 RemoveDirectoryA("long");
11824 RemoveDirectoryA("one");
11825 RemoveDirectoryA("four");
11826 RemoveDirectoryA("five");
11827 RemoveDirectoryA("eight");
11828 RemoveDirectoryA("nine");
11829 RemoveDirectoryA("twelve");
11830 DeleteFileA(msifile);
11833 static void test_sourcedir(void)
11835 MSIHANDLE hdb, hpkg;
11837 CHAR path[MAX_PATH];
11838 CHAR cwd[MAX_PATH];
11839 CHAR subsrc[MAX_PATH];
11843 lstrcpyA(cwd, CURR_DIR);
11844 lstrcatA(cwd, "\\");
11846 lstrcpyA(subsrc, cwd);
11847 lstrcatA(subsrc, "long");
11848 lstrcatA(subsrc, "\\");
11850 hdb = create_package_db();
11851 ok( hdb, "failed to create database\n");
11853 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11854 ok(r == S_OK, "failed\n");
11856 sprintf(package, "#%u", hdb);
11857 r = MsiOpenPackage(package, &hpkg);
11858 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11860 skip("Not enough rights to perform tests\n");
11863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11865 /* properties only */
11867 /* SourceDir prop */
11869 lstrcpyA(path, "kiwi");
11870 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11871 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11872 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11873 ok(size == 0, "Expected 0, got %d\n", size);
11875 /* SOURCEDIR prop */
11877 lstrcpyA(path, "kiwi");
11878 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11879 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11880 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11881 ok(size == 0, "Expected 0, got %d\n", size);
11883 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11885 r = MsiDoAction(hpkg, "CostInitialize");
11886 ok(r == ERROR_SUCCESS, "file cost failed\n");
11888 /* SourceDir after CostInitialize */
11890 lstrcpyA(path, "kiwi");
11891 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11892 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11893 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11894 ok(size == 0, "Expected 0, got %d\n", size);
11896 /* SOURCEDIR after CostInitialize */
11898 lstrcpyA(path, "kiwi");
11899 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11900 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11901 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11902 ok(size == 0, "Expected 0, got %d\n", size);
11904 r = MsiDoAction(hpkg, "FileCost");
11905 ok(r == ERROR_SUCCESS, "file cost failed\n");
11907 /* SourceDir after FileCost */
11909 lstrcpyA(path, "kiwi");
11910 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11911 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11912 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11913 ok(size == 0, "Expected 0, got %d\n", size);
11915 /* SOURCEDIR after FileCost */
11917 lstrcpyA(path, "kiwi");
11918 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11919 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11920 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11921 ok(size == 0, "Expected 0, got %d\n", size);
11923 r = MsiDoAction(hpkg, "CostFinalize");
11924 ok(r == ERROR_SUCCESS, "file cost failed\n");
11926 /* SourceDir after CostFinalize */
11928 lstrcpyA(path, "kiwi");
11929 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11930 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11931 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11932 ok(size == 0, "Expected 0, got %d\n", size);
11934 /* SOURCEDIR after CostFinalize */
11936 lstrcpyA(path, "kiwi");
11937 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11939 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11940 ok(size == 0, "Expected 0, got %d\n", size);
11942 r = MsiDoAction(hpkg, "ResolveSource");
11943 ok(r == ERROR_SUCCESS, "file cost failed\n");
11945 /* SourceDir after ResolveSource */
11947 lstrcpyA(path, "kiwi");
11948 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11949 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11950 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11951 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11953 /* SOURCEDIR after ResolveSource */
11955 lstrcpyA(path, "kiwi");
11956 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11957 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11958 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11959 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11961 /* random casing */
11963 lstrcpyA(path, "kiwi");
11964 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
11965 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11966 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11967 ok(size == 0, "Expected 0, got %d\n", size);
11969 MsiCloseHandle(hpkg);
11971 /* reset the package state */
11972 sprintf(package, "#%i", hdb);
11973 r = MsiOpenPackage(package, &hpkg);
11974 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11976 /* test how MsiGetSourcePath affects the properties */
11978 /* SourceDir prop */
11980 lstrcpyA(path, "kiwi");
11981 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11982 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11985 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11986 ok(size == 0, "Expected 0, got %d\n", size);
11990 lstrcpyA(path, "kiwi");
11991 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11992 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11993 ok(!lstrcmpA(path, "kiwi"),
11994 "Expected path to be unchanged, got \"%s\"\n", path);
11995 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11997 /* SourceDir after MsiGetSourcePath */
11999 lstrcpyA(path, "kiwi");
12000 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12001 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12004 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12005 ok(size == 0, "Expected 0, got %d\n", size);
12008 /* SOURCEDIR prop */
12010 lstrcpyA(path, "kiwi");
12011 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12012 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12015 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12016 ok(size == 0, "Expected 0, got %d\n", size);
12020 lstrcpyA(path, "kiwi");
12021 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12022 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12023 ok(!lstrcmpA(path, "kiwi"),
12024 "Expected path to be unchanged, got \"%s\"\n", path);
12025 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12027 /* SOURCEDIR prop after MsiGetSourcePath */
12029 lstrcpyA(path, "kiwi");
12030 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12034 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12035 ok(size == 0, "Expected 0, got %d\n", size);
12038 r = MsiDoAction(hpkg, "CostInitialize");
12039 ok(r == ERROR_SUCCESS, "file cost failed\n");
12041 /* SourceDir after CostInitialize */
12043 lstrcpyA(path, "kiwi");
12044 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12045 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12048 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
12049 ok(size == 0, "Expected 0, got %d\n", size);
12053 lstrcpyA(path, "kiwi");
12054 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
12055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12056 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12057 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12059 /* SourceDir after MsiGetSourcePath */
12061 lstrcpyA(path, "kiwi");
12062 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12064 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12065 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
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);
12072 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12073 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12075 /* SOURCEDIR source path still does not exist */
12077 lstrcpyA(path, "kiwi");
12078 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12079 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12080 ok(!lstrcmpA(path, "kiwi"),
12081 "Expected path to be unchanged, got \"%s\"\n", path);
12082 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12084 r = MsiDoAction(hpkg, "FileCost");
12085 ok(r == ERROR_SUCCESS, "file cost failed\n");
12087 /* SourceDir after FileCost */
12089 lstrcpyA(path, "kiwi");
12090 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12091 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12092 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12093 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12095 /* SOURCEDIR after FileCost */
12097 lstrcpyA(path, "kiwi");
12098 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12099 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12100 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12101 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12103 /* SOURCEDIR source path still does not exist */
12105 lstrcpyA(path, "kiwi");
12106 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12107 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12108 ok(!lstrcmpA(path, "kiwi"),
12109 "Expected path to be unchanged, got \"%s\"\n", path);
12110 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12112 r = MsiDoAction(hpkg, "CostFinalize");
12113 ok(r == ERROR_SUCCESS, "file cost failed\n");
12115 /* SourceDir after CostFinalize */
12117 lstrcpyA(path, "kiwi");
12118 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12120 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12121 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12123 /* SOURCEDIR after CostFinalize */
12125 lstrcpyA(path, "kiwi");
12126 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12127 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12128 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12129 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12131 /* SOURCEDIR source path still does not exist */
12133 lstrcpyA(path, "kiwi");
12134 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12135 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12136 ok(!lstrcmpA(path, "kiwi"),
12137 "Expected path to be unchanged, got \"%s\"\n", path);
12138 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12140 r = MsiDoAction(hpkg, "ResolveSource");
12141 ok(r == ERROR_SUCCESS, "file cost failed\n");
12143 /* SourceDir after ResolveSource */
12145 lstrcpyA(path, "kiwi");
12146 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12148 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12149 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12151 /* SOURCEDIR after ResolveSource */
12153 lstrcpyA(path, "kiwi");
12154 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12155 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12156 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12157 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12159 /* SOURCEDIR source path still does not exist */
12161 lstrcpyA(path, "kiwi");
12162 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12163 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12164 ok(!lstrcmpA(path, "kiwi"),
12165 "Expected path to be unchanged, got \"%s\"\n", path);
12166 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12168 MsiCloseHandle(hpkg);
12171 MsiCloseHandle(hdb);
12172 DeleteFileA(msifile);
12182 static const struct access_res create[16] =
12184 { TRUE, ERROR_SUCCESS, TRUE },
12185 { TRUE, ERROR_SUCCESS, TRUE },
12186 { TRUE, ERROR_SUCCESS, FALSE },
12187 { TRUE, ERROR_SUCCESS, FALSE },
12188 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12189 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12190 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12191 { TRUE, ERROR_SUCCESS, FALSE },
12192 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12193 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12194 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12195 { TRUE, ERROR_SUCCESS, TRUE },
12196 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12197 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12198 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12199 { TRUE, ERROR_SUCCESS, TRUE }
12202 static const struct access_res create_commit[16] =
12204 { TRUE, ERROR_SUCCESS, TRUE },
12205 { TRUE, ERROR_SUCCESS, TRUE },
12206 { TRUE, ERROR_SUCCESS, FALSE },
12207 { TRUE, ERROR_SUCCESS, FALSE },
12208 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12209 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12210 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12211 { TRUE, ERROR_SUCCESS, FALSE },
12212 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12213 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12214 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12215 { TRUE, ERROR_SUCCESS, TRUE },
12216 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12217 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12218 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12219 { TRUE, ERROR_SUCCESS, TRUE }
12222 static const struct access_res create_close[16] =
12224 { TRUE, ERROR_SUCCESS, FALSE },
12225 { TRUE, ERROR_SUCCESS, FALSE },
12226 { TRUE, ERROR_SUCCESS, FALSE },
12227 { TRUE, ERROR_SUCCESS, FALSE },
12228 { TRUE, ERROR_SUCCESS, FALSE },
12229 { TRUE, ERROR_SUCCESS, FALSE },
12230 { TRUE, ERROR_SUCCESS, FALSE },
12231 { TRUE, ERROR_SUCCESS, FALSE },
12232 { TRUE, ERROR_SUCCESS, FALSE },
12233 { TRUE, ERROR_SUCCESS, FALSE },
12234 { TRUE, ERROR_SUCCESS, FALSE },
12235 { TRUE, ERROR_SUCCESS, FALSE },
12236 { TRUE, ERROR_SUCCESS, FALSE },
12237 { TRUE, ERROR_SUCCESS, FALSE },
12238 { TRUE, ERROR_SUCCESS, FALSE },
12239 { TRUE, ERROR_SUCCESS }
12242 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
12244 DWORD access = 0, share = 0;
12249 for (i = 0; i < 4; i++)
12251 if (i == 0) access = 0;
12252 if (i == 1) access = GENERIC_READ;
12253 if (i == 2) access = GENERIC_WRITE;
12254 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
12256 for (j = 0; j < 4; j++)
12258 if (ares[idx].ignore)
12261 if (j == 0) share = 0;
12262 if (j == 1) share = FILE_SHARE_READ;
12263 if (j == 2) share = FILE_SHARE_WRITE;
12264 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
12266 SetLastError(0xdeadbeef);
12267 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
12268 FILE_ATTRIBUTE_NORMAL, 0);
12269 lasterr = GetLastError();
12271 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
12272 "(%d, handle, %d): Expected %d, got %d\n",
12273 line, idx, ares[idx].gothandle,
12274 (hfile != INVALID_HANDLE_VALUE));
12276 ok(lasterr == ares[idx].lasterr ||
12277 lasterr == 0xdeadbeef, /* win9x */
12278 "(%d, lasterr, %d): Expected %d, got %d\n",
12279 line, idx, ares[idx].lasterr, lasterr);
12281 CloseHandle(hfile);
12287 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
12289 static void test_access(void)
12294 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
12295 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12297 test_file_access(msifile, create);
12299 r = MsiDatabaseCommit(hdb);
12300 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12302 test_file_access(msifile, create_commit);
12303 MsiCloseHandle(hdb);
12305 test_file_access(msifile, create_close);
12306 DeleteFileA(msifile);
12308 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
12309 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12311 test_file_access(msifile, create);
12313 r = MsiDatabaseCommit(hdb);
12314 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12316 test_file_access(msifile, create_commit);
12317 MsiCloseHandle(hdb);
12319 test_file_access(msifile, create_close);
12320 DeleteFileA(msifile);
12323 static void test_emptypackage(void)
12325 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
12326 MSIHANDLE hview = 0, hrec = 0;
12327 MSICONDITION condition;
12328 CHAR buffer[MAX_PATH];
12332 r = MsiOpenPackageA("", &hpkg);
12333 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12335 skip("Not enough rights to perform tests\n");
12340 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12343 hdb = MsiGetActiveDatabase(hpkg);
12346 ok(hdb != 0, "Expected a valid database handle\n");
12349 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
12352 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12354 r = MsiViewExecute(hview, 0);
12357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12360 r = MsiViewFetch(hview, &hrec);
12363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12368 r = MsiRecordGetString(hrec, 1, buffer, &size);
12371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12372 ok(!lstrcmpA(buffer, "_Property"),
12373 "Expected \"_Property\", got \"%s\"\n", buffer);
12376 MsiCloseHandle(hrec);
12378 r = MsiViewFetch(hview, &hrec);
12381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12385 r = MsiRecordGetString(hrec, 1, buffer, &size);
12388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12389 ok(!lstrcmpA(buffer, "#_FolderCache"),
12390 "Expected \"_Property\", got \"%s\"\n", buffer);
12393 MsiCloseHandle(hrec);
12394 MsiViewClose(hview);
12395 MsiCloseHandle(hview);
12397 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
12400 ok(condition == MSICONDITION_FALSE,
12401 "Expected MSICONDITION_FALSE, got %d\n", condition);
12404 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
12407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12409 r = MsiViewExecute(hview, 0);
12412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12415 /* _Property table is not empty */
12416 r = MsiViewFetch(hview, &hrec);
12419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12422 MsiCloseHandle(hrec);
12423 MsiViewClose(hview);
12424 MsiCloseHandle(hview);
12426 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
12429 ok(condition == MSICONDITION_FALSE,
12430 "Expected MSICONDITION_FALSE, got %d\n", condition);
12433 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
12436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12438 r = MsiViewExecute(hview, 0);
12441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12444 /* #_FolderCache is not empty */
12445 r = MsiViewFetch(hview, &hrec);
12448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12451 MsiCloseHandle(hrec);
12452 MsiViewClose(hview);
12453 MsiCloseHandle(hview);
12455 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
12458 ok(r == ERROR_BAD_QUERY_SYNTAX,
12459 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12462 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
12465 ok(r == ERROR_BAD_QUERY_SYNTAX,
12466 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12469 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
12472 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
12473 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
12476 MsiCloseHandle(hsuminfo);
12478 r = MsiDatabaseCommit(hdb);
12481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12484 MsiCloseHandle(hdb);
12485 MsiCloseHandle(hpkg);
12488 static void test_MsiGetProductProperty(void)
12490 MSIHANDLE hprod, hdb;
12491 CHAR val[MAX_PATH];
12492 CHAR path[MAX_PATH];
12493 CHAR query[MAX_PATH];
12494 CHAR keypath[MAX_PATH*2];
12495 CHAR prodcode[MAX_PATH];
12496 CHAR prod_squashed[MAX_PATH];
12497 HKEY prodkey, userkey, props;
12502 REGSAM access = KEY_ALL_ACCESS;
12504 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
12505 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
12507 win_skip("Different registry keys on Win9x and WinMe\n");
12510 CloseServiceHandle(scm);
12512 GetCurrentDirectoryA(MAX_PATH, path);
12513 lstrcatA(path, "\\");
12515 create_test_guid(prodcode, prod_squashed);
12518 access |= KEY_WOW64_64KEY;
12520 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
12521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12523 r = MsiDatabaseCommit(hdb);
12524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12526 r = set_summary_info(hdb);
12527 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12530 "CREATE TABLE `Directory` ( "
12531 "`Directory` CHAR(255) NOT NULL, "
12532 "`Directory_Parent` CHAR(255), "
12533 "`DefaultDir` CHAR(255) NOT NULL "
12534 "PRIMARY KEY `Directory`)");
12535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12538 "CREATE TABLE `Property` ( "
12539 "`Property` CHAR(72) NOT NULL, "
12540 "`Value` CHAR(255) "
12541 "PRIMARY KEY `Property`)");
12542 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12544 sprintf(query, "INSERT INTO `Property` "
12545 "(`Property`, `Value`) "
12546 "VALUES( 'ProductCode', '%s' )", prodcode);
12547 r = run_query(hdb, query);
12548 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12550 r = MsiDatabaseCommit(hdb);
12551 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12553 MsiCloseHandle(hdb);
12555 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
12556 lstrcatA(keypath, prod_squashed);
12558 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL);
12559 if (res == ERROR_ACCESS_DENIED)
12561 skip("Not enough rights to perform tests\n");
12562 DeleteFile(msifile);
12565 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12567 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
12568 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
12569 lstrcatA(keypath, prod_squashed);
12571 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL);
12572 if (res == ERROR_ACCESS_DENIED)
12574 skip("Not enough rights to perform tests\n");
12575 RegDeleteKeyA(prodkey, "");
12576 RegCloseKey(prodkey);
12579 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12581 res = RegCreateKeyExA(userkey, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
12582 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12584 lstrcpyA(val, path);
12585 lstrcatA(val, "\\");
12586 lstrcatA(val, msifile);
12587 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
12588 (const BYTE *)val, lstrlenA(val) + 1);
12589 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12591 hprod = 0xdeadbeef;
12592 r = MsiOpenProductA(prodcode, &hprod);
12593 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12594 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
12596 /* hProduct is invalid */
12598 lstrcpyA(val, "apple");
12599 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
12600 ok(r == ERROR_INVALID_HANDLE,
12601 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12602 ok(!lstrcmpA(val, "apple"),
12603 "Expected val to be unchanged, got \"%s\"\n", val);
12604 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12606 /* szProperty is NULL */
12608 lstrcpyA(val, "apple");
12609 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
12610 ok(r == ERROR_INVALID_PARAMETER,
12611 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12612 ok(!lstrcmpA(val, "apple"),
12613 "Expected val to be unchanged, got \"%s\"\n", val);
12614 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12616 /* szProperty is empty */
12618 lstrcpyA(val, "apple");
12619 r = MsiGetProductPropertyA(hprod, "", val, &size);
12620 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12621 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12622 ok(size == 0, "Expected 0, got %d\n", size);
12624 /* get the property */
12626 lstrcpyA(val, "apple");
12627 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12628 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12629 ok(!lstrcmpA(val, prodcode),
12630 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12631 ok(size == lstrlenA(prodcode),
12632 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12634 /* lpValueBuf is NULL */
12636 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
12637 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12638 ok(size == lstrlenA(prodcode),
12639 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12641 /* pcchValueBuf is NULL */
12642 lstrcpyA(val, "apple");
12643 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
12644 ok(r == ERROR_INVALID_PARAMETER,
12645 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12646 ok(!lstrcmpA(val, "apple"),
12647 "Expected val to be unchanged, got \"%s\"\n", val);
12648 ok(size == lstrlenA(prodcode),
12649 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12651 /* pcchValueBuf is too small */
12653 lstrcpyA(val, "apple");
12654 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12655 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12656 ok(!strncmp(val, prodcode, 3),
12657 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
12658 ok(size == lstrlenA(prodcode),
12659 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12661 /* pcchValueBuf does not leave room for NULL terminator */
12662 size = lstrlenA(prodcode);
12663 lstrcpyA(val, "apple");
12664 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12665 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12666 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
12667 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
12668 ok(size == lstrlenA(prodcode),
12669 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12671 /* pcchValueBuf has enough room for NULL terminator */
12672 size = lstrlenA(prodcode) + 1;
12673 lstrcpyA(val, "apple");
12674 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12676 ok(!lstrcmpA(val, prodcode),
12677 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12678 ok(size == lstrlenA(prodcode),
12679 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12681 /* nonexistent property */
12683 lstrcpyA(val, "apple");
12684 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
12685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12686 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12687 ok(size == 0, "Expected 0, got %d\n", size);
12689 r = MsiSetPropertyA(hprod, "NewProperty", "value");
12690 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12692 /* non-product property set */
12694 lstrcpyA(val, "apple");
12695 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
12696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12697 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12698 ok(size == 0, "Expected 0, got %d\n", size);
12700 r = MsiSetPropertyA(hprod, "ProductCode", "value");
12701 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12703 /* non-product property that is also a product property set */
12705 lstrcpyA(val, "apple");
12706 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12707 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12708 ok(!lstrcmpA(val, prodcode),
12709 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12710 ok(size == lstrlenA(prodcode),
12711 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12713 MsiCloseHandle(hprod);
12715 RegDeleteValueA(props, "LocalPackage");
12716 delete_key(props, "", access);
12717 RegCloseKey(props);
12718 delete_key(userkey, "", access);
12719 RegCloseKey(userkey);
12720 delete_key(prodkey, "", access);
12721 RegCloseKey(prodkey);
12722 DeleteFileA(msifile);
12725 static void test_MsiSetProperty(void)
12727 MSIHANDLE hpkg, hdb, hrec;
12728 CHAR buf[MAX_PATH];
12733 r = package_from_db(create_package_db(), &hpkg);
12734 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12736 skip("Not enough rights to perform tests\n");
12737 DeleteFile(msifile);
12740 ok(r == ERROR_SUCCESS, "Expected a valid package %u\n", r);
12742 /* invalid hInstall */
12743 r = MsiSetPropertyA(0, "Prop", "Val");
12744 ok(r == ERROR_INVALID_HANDLE,
12745 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12747 /* invalid hInstall */
12748 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12749 ok(r == ERROR_INVALID_HANDLE,
12750 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12752 /* szName is NULL */
12753 r = MsiSetPropertyA(hpkg, NULL, "Val");
12754 ok(r == ERROR_INVALID_PARAMETER,
12755 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12757 /* both szName and szValue are NULL */
12758 r = MsiSetPropertyA(hpkg, NULL, NULL);
12759 ok(r == ERROR_INVALID_PARAMETER,
12760 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12762 /* szName is empty */
12763 r = MsiSetPropertyA(hpkg, "", "Val");
12764 ok(r == ERROR_FUNCTION_FAILED,
12765 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
12767 /* szName is empty and szValue is NULL */
12768 r = MsiSetPropertyA(hpkg, "", NULL);
12769 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12771 /* set a property */
12772 r = MsiSetPropertyA(hpkg, "Prop", "Val");
12773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12775 /* get the property */
12777 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12779 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
12780 ok(size == 3, "Expected 3, got %d\n", size);
12782 /* update the property */
12783 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
12784 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12786 /* get the property */
12788 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12789 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12790 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
12791 ok(size == 4, "Expected 4, got %d\n", size);
12793 hdb = MsiGetActiveDatabase(hpkg);
12794 ok(hdb != 0, "Expected a valid database handle\n");
12796 /* set prop is not in the _Property table */
12797 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12798 r = do_query(hdb, query, &hrec);
12799 ok(r == ERROR_BAD_QUERY_SYNTAX,
12800 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12802 /* set prop is not in the Property table */
12803 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12804 r = do_query(hdb, query, &hrec);
12805 ok(r == ERROR_BAD_QUERY_SYNTAX,
12806 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12808 MsiCloseHandle(hdb);
12810 /* szValue is an empty string */
12811 r = MsiSetPropertyA(hpkg, "Prop", "");
12812 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12814 /* try to get the property */
12816 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12817 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12818 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12819 ok(size == 0, "Expected 0, got %d\n", size);
12821 /* reset the property */
12822 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
12823 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12825 /* delete the property */
12826 r = MsiSetPropertyA(hpkg, "Prop", NULL);
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 MsiCloseHandle(hpkg);
12837 DeleteFileA(msifile);
12840 static void test_MsiApplyMultiplePatches(void)
12842 UINT r, type = GetDriveType(NULL);
12844 if (!pMsiApplyMultiplePatchesA) {
12845 win_skip("MsiApplyMultiplePatchesA not found\n");
12849 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
12850 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12852 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
12853 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12855 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
12856 if (type == DRIVE_FIXED)
12857 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12859 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12861 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
12862 if (type == DRIVE_FIXED)
12863 todo_wine ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED, "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
12865 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12867 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
12868 if (type == DRIVE_FIXED)
12869 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12871 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12873 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
12874 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12876 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
12877 if (type == DRIVE_FIXED)
12878 todo_wine ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12880 ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r);
12882 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
12883 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12885 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
12886 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12889 static void test_MsiApplyPatch(void)
12893 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
12894 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12896 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
12897 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12900 START_TEST(package)
12902 STATEMGRSTATUS status;
12905 init_functionpointers();
12907 if (pIsWow64Process)
12908 pIsWow64Process(GetCurrentProcess(), &is_wow64);
12910 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
12912 /* Create a restore point ourselves so we circumvent the multitude of restore points
12913 * that would have been created by all the installation and removal tests.
12915 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
12916 * creation of restore points.
12918 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
12920 memset(&status, 0, sizeof(status));
12921 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
12924 test_createpackage();
12926 test_gettargetpath_bad();
12927 test_settargetpath();
12929 test_property_table();
12932 test_formatrecord2();
12934 test_getproperty();
12935 test_removefiles();
12937 test_appsearch_complocator();
12938 test_appsearch_reglocator();
12939 test_appsearch_inilocator();
12940 test_appsearch_drlocator();
12941 test_featureparents();
12942 test_installprops();
12943 test_launchconditions();
12945 test_complocator();
12946 test_MsiGetSourcePath();
12947 test_shortlongsource();
12950 test_emptypackage();
12951 test_MsiGetProductProperty();
12952 test_MsiSetProperty();
12953 test_MsiApplyMultiplePatches();
12954 test_MsiApplyPatch();
12956 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
12958 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
12960 remove_restore_point(status.llSequenceNumber);