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>
31 #include "wine/test.h"
33 static const char msifile[] = "winetest-package.msi";
34 char CURR_DIR[MAX_PATH];
36 static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
38 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
39 static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
40 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
41 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
42 static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
43 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
44 static void (WINAPI *pGetSystemInfo)(LPSYSTEM_INFO);
46 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
47 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
49 static void init_functionpointers(void)
51 HMODULE hmsi = GetModuleHandleA("msi.dll");
52 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
53 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
56 #define GET_PROC(mod, func) \
57 p ## func = (void*)GetProcAddress(mod, #func);
59 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
61 GET_PROC(hadvapi32, ConvertSidToStringSidA);
62 GET_PROC(hadvapi32, GetTokenInformation);
63 GET_PROC(hadvapi32, OpenProcessToken);
64 GET_PROC(hadvapi32, RegDeleteKeyExA)
65 GET_PROC(hadvapi32, RegDeleteKeyExW)
66 GET_PROC(hkernel32, IsWow64Process)
67 GET_PROC(hkernel32, GetSystemInfo)
69 hsrclient = LoadLibraryA("srclient.dll");
70 GET_PROC(hsrclient, SRRemoveRestorePoint);
71 GET_PROC(hsrclient, SRSetRestorePointA);
75 static BOOL is_process_limited(void)
79 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
81 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
84 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
87 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
89 return (ret && type == TokenElevationTypeLimited);
94 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
97 return pRegDeleteKeyExA( key, subkey, access, 0 );
98 return RegDeleteKeyA( key, subkey );
101 static LPSTR get_user_sid(LPSTR *usersid)
108 if (!pConvertSidToStringSidA)
110 win_skip("ConvertSidToStringSidA is not available\n");
115 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
117 GetTokenInformation(token, TokenUser, buf, size, &size);
118 user = (PTOKEN_USER)buf;
119 pConvertSidToStringSidA(user->User.Sid, usersid);
120 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
125 /* RegDeleteTreeW from dlls/advapi32/registry.c */
126 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM access)
129 DWORD dwMaxSubkeyLen, dwMaxValueLen;
130 DWORD dwMaxLen, dwSize;
131 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
136 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, access, &hSubKey);
140 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
141 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
142 if (ret) goto cleanup;
146 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
147 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
149 /* Name too big: alloc a buffer for it */
150 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
152 ret = ERROR_NOT_ENOUGH_MEMORY;
157 /* Recursively delete all the subkeys */
161 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
162 NULL, NULL, NULL)) break;
164 ret = package_RegDeleteTreeW(hSubKey, lpszName, access);
165 if (ret) goto cleanup;
170 if (pRegDeleteKeyExW)
171 ret = pRegDeleteKeyExW(hKey, lpszSubKey, access, 0);
173 ret = RegDeleteKeyW(hKey, lpszSubKey);
179 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
180 NULL, NULL, NULL, NULL)) break;
182 ret = RegDeleteValueW(hKey, lpszName);
183 if (ret) goto cleanup;
187 if (lpszName != szNameBuf)
188 HeapFree(GetProcessHeap(), 0, lpszName);
190 RegCloseKey(hSubKey);
194 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
199 if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid)))
213 out[17+i*2] = in[n++];
214 out[16+i*2] = in[n++];
219 out[17+i*2] = in[n++];
220 out[16+i*2] = in[n++];
226 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
228 WCHAR guidW[MAX_PATH];
229 WCHAR squashedW[MAX_PATH];
234 hr = CoCreateGuid(&guid);
235 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
237 size = StringFromGUID2(&guid, guidW, MAX_PATH);
238 ok(size == 39, "Expected 39, got %d\n", hr);
240 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
241 squash_guid(guidW, squashedW);
242 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
245 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
246 LPCSTR guid, LPSTR usersid, BOOL dir)
248 WCHAR guidW[MAX_PATH];
249 WCHAR squashedW[MAX_PATH];
250 CHAR squashed[MAX_PATH];
251 CHAR comppath[MAX_PATH];
252 CHAR prodpath[MAX_PATH];
256 REGSAM access = KEY_ALL_ACCESS;
259 if (pIsWow64Process && pIsWow64Process(GetCurrentProcess(), &wow64) && wow64)
260 access |= KEY_WOW64_64KEY;
262 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
263 squash_guid(guidW, squashedW);
264 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
266 if (context == MSIINSTALLCONTEXT_MACHINE)
268 prod = "3D0DAE300FACA1300AD792060BCDAA92";
270 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
271 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
273 "SOFTWARE\\Classes\\Installer\\"
274 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
276 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
278 prod = "7D2F387510109040002000060BECB6AB";
280 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
281 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
283 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
284 "Installer\\%s\\Installer\\Products\\"
285 "7D2F387510109040002000060BECB6AB", usersid);
287 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
289 prod = "7D2F387510109040002000060BECB6AB";
291 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
292 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
294 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
295 "Installer\\Managed\\%s\\Installer\\Products\\"
296 "7D2F387510109040002000060BECB6AB", usersid);
299 RegCreateKeyExA(HKEY_LOCAL_MACHINE, comppath, 0, NULL, 0, access, NULL, &hkey, NULL);
301 lstrcpyA(path, CURR_DIR);
302 lstrcatA(path, "\\");
303 if (!dir) lstrcatA(path, filename);
305 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
308 RegCreateKeyExA(HKEY_LOCAL_MACHINE, prodpath, 0, NULL, 0, access, NULL, &hkey, NULL);
312 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
314 WCHAR guidW[MAX_PATH];
315 WCHAR squashedW[MAX_PATH];
316 WCHAR substrW[MAX_PATH];
317 CHAR squashed[MAX_PATH];
318 CHAR comppath[MAX_PATH];
319 CHAR prodpath[MAX_PATH];
320 REGSAM access = KEY_ALL_ACCESS;
323 if (pIsWow64Process && pIsWow64Process(GetCurrentProcess(), &wow64) && wow64)
324 access |= KEY_WOW64_64KEY;
326 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
327 squash_guid(guidW, squashedW);
328 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
330 if (context == MSIINSTALLCONTEXT_MACHINE)
333 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
334 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
336 "SOFTWARE\\Classes\\Installer\\"
337 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
339 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
342 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
343 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
345 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
346 "Installer\\%s\\Installer\\Products\\"
347 "7D2F387510109040002000060BECB6AB", usersid);
349 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
352 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
353 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
355 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
356 "Installer\\Managed\\%s\\Installer\\Products\\"
357 "7D2F387510109040002000060BECB6AB", usersid);
360 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
361 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
363 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
364 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
367 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
372 /* open a select query */
373 r = MsiDatabaseOpenView(hdb, query, &hview);
374 if (r != ERROR_SUCCESS)
376 r = MsiViewExecute(hview, 0);
377 if (r != ERROR_SUCCESS)
379 ret = MsiViewFetch(hview, phrec);
380 r = MsiViewClose(hview);
381 if (r != ERROR_SUCCESS)
383 r = MsiCloseHandle(hview);
384 if (r != ERROR_SUCCESS)
389 static UINT run_query( MSIHANDLE hdb, const char *query )
394 r = MsiDatabaseOpenView(hdb, query, &hview);
395 if( r != ERROR_SUCCESS )
398 r = MsiViewExecute(hview, 0);
399 if( r == ERROR_SUCCESS )
400 r = MsiViewClose(hview);
401 MsiCloseHandle(hview);
405 static UINT create_component_table( MSIHANDLE hdb )
407 return run_query( hdb,
408 "CREATE TABLE `Component` ( "
409 "`Component` CHAR(72) NOT NULL, "
410 "`ComponentId` CHAR(38), "
411 "`Directory_` CHAR(72) NOT NULL, "
412 "`Attributes` SHORT NOT NULL, "
413 "`Condition` CHAR(255), "
414 "`KeyPath` CHAR(72) "
415 "PRIMARY KEY `Component`)" );
418 static UINT create_feature_table( MSIHANDLE hdb )
420 return run_query( hdb,
421 "CREATE TABLE `Feature` ( "
422 "`Feature` CHAR(38) NOT NULL, "
423 "`Feature_Parent` CHAR(38), "
425 "`Description` CHAR(255), "
426 "`Display` SHORT NOT NULL, "
427 "`Level` SHORT NOT NULL, "
428 "`Directory_` CHAR(72), "
429 "`Attributes` SHORT NOT NULL "
430 "PRIMARY KEY `Feature`)" );
433 static UINT create_feature_components_table( MSIHANDLE hdb )
435 return run_query( hdb,
436 "CREATE TABLE `FeatureComponents` ( "
437 "`Feature_` CHAR(38) NOT NULL, "
438 "`Component_` CHAR(72) NOT NULL "
439 "PRIMARY KEY `Feature_`, `Component_` )" );
442 static UINT create_file_table( MSIHANDLE hdb )
444 return run_query( hdb,
445 "CREATE TABLE `File` ("
446 "`File` CHAR(72) NOT NULL, "
447 "`Component_` CHAR(72) NOT NULL, "
448 "`FileName` CHAR(255) NOT NULL, "
449 "`FileSize` LONG NOT NULL, "
450 "`Version` CHAR(72), "
451 "`Language` CHAR(20), "
452 "`Attributes` SHORT, "
453 "`Sequence` SHORT NOT NULL "
454 "PRIMARY KEY `File`)" );
457 static UINT create_remove_file_table( MSIHANDLE hdb )
459 return run_query( hdb,
460 "CREATE TABLE `RemoveFile` ("
461 "`FileKey` CHAR(72) NOT NULL, "
462 "`Component_` CHAR(72) NOT NULL, "
463 "`FileName` CHAR(255) LOCALIZABLE, "
464 "`DirProperty` CHAR(72) NOT NULL, "
465 "`InstallMode` SHORT NOT NULL "
466 "PRIMARY KEY `FileKey`)" );
469 static UINT create_appsearch_table( MSIHANDLE hdb )
471 return run_query( hdb,
472 "CREATE TABLE `AppSearch` ("
473 "`Property` CHAR(72) NOT NULL, "
474 "`Signature_` CHAR(72) NOT NULL "
475 "PRIMARY KEY `Property`, `Signature_`)" );
478 static UINT create_reglocator_table( MSIHANDLE hdb )
480 return run_query( hdb,
481 "CREATE TABLE `RegLocator` ("
482 "`Signature_` CHAR(72) NOT NULL, "
483 "`Root` SHORT NOT NULL, "
484 "`Key` CHAR(255) NOT NULL, "
487 "PRIMARY KEY `Signature_`)" );
490 static UINT create_signature_table( MSIHANDLE hdb )
492 return run_query( hdb,
493 "CREATE TABLE `Signature` ("
494 "`Signature` CHAR(72) NOT NULL, "
495 "`FileName` CHAR(255) NOT NULL, "
496 "`MinVersion` CHAR(20), "
497 "`MaxVersion` CHAR(20), "
502 "`Languages` CHAR(255) "
503 "PRIMARY KEY `Signature`)" );
506 static UINT create_launchcondition_table( MSIHANDLE hdb )
508 return run_query( hdb,
509 "CREATE TABLE `LaunchCondition` ("
510 "`Condition` CHAR(255) NOT NULL, "
511 "`Description` CHAR(255) NOT NULL "
512 "PRIMARY KEY `Condition`)" );
515 static UINT create_property_table( MSIHANDLE hdb )
517 return run_query( hdb,
518 "CREATE TABLE `Property` ("
519 "`Property` CHAR(72) NOT NULL, "
521 "PRIMARY KEY `Property`)" );
524 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
526 return run_query( hdb,
527 "CREATE TABLE `InstallExecuteSequence` ("
528 "`Action` CHAR(72) NOT NULL, "
529 "`Condition` CHAR(255), "
531 "PRIMARY KEY `Action`)" );
534 static UINT create_media_table( MSIHANDLE hdb )
536 return run_query( hdb,
537 "CREATE TABLE `Media` ("
538 "`DiskId` SHORT NOT NULL, "
539 "`LastSequence` SHORT NOT NULL, "
540 "`DiskPrompt` CHAR(64), "
541 "`Cabinet` CHAR(255), "
542 "`VolumeLabel` CHAR(32), "
544 "PRIMARY KEY `DiskId`)" );
547 static UINT create_ccpsearch_table( MSIHANDLE hdb )
549 return run_query( hdb,
550 "CREATE TABLE `CCPSearch` ("
551 "`Signature_` CHAR(72) NOT NULL "
552 "PRIMARY KEY `Signature_`)" );
555 static UINT create_drlocator_table( MSIHANDLE hdb )
557 return run_query( hdb,
558 "CREATE TABLE `DrLocator` ("
559 "`Signature_` CHAR(72) NOT NULL, "
560 "`Parent` CHAR(72), "
563 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
566 static UINT create_complocator_table( MSIHANDLE hdb )
568 return run_query( hdb,
569 "CREATE TABLE `CompLocator` ("
570 "`Signature_` CHAR(72) NOT NULL, "
571 "`ComponentId` CHAR(38) NOT NULL, "
573 "PRIMARY KEY `Signature_`)" );
576 static UINT create_inilocator_table( MSIHANDLE hdb )
578 return run_query( hdb,
579 "CREATE TABLE `IniLocator` ("
580 "`Signature_` CHAR(72) NOT NULL, "
581 "`FileName` CHAR(255) NOT NULL, "
582 "`Section` CHAR(96)NOT NULL, "
583 "`Key` CHAR(128)NOT NULL, "
586 "PRIMARY KEY `Signature_`)" );
589 #define make_add_entry(type, qtext) \
590 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
592 char insert[] = qtext; \
595 sz = strlen(values) + sizeof insert; \
596 query = HeapAlloc(GetProcessHeap(),0,sz); \
597 sprintf(query,insert,values); \
598 r = run_query( hdb, query ); \
599 HeapFree(GetProcessHeap(), 0, query); \
603 make_add_entry(component,
604 "INSERT INTO `Component` "
605 "(`Component`, `ComponentId`, `Directory_`, "
606 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
608 make_add_entry(directory,
609 "INSERT INTO `Directory` "
610 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
612 make_add_entry(feature,
613 "INSERT INTO `Feature` "
614 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
615 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
617 make_add_entry(feature_components,
618 "INSERT INTO `FeatureComponents` "
619 "(`Feature_`, `Component_`) VALUES( %s )")
622 "INSERT INTO `File` "
623 "(`File`, `Component_`, `FileName`, `FileSize`, "
624 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
626 make_add_entry(appsearch,
627 "INSERT INTO `AppSearch` "
628 "(`Property`, `Signature_`) VALUES( %s )")
630 make_add_entry(signature,
631 "INSERT INTO `Signature` "
632 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
633 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
636 make_add_entry(launchcondition,
637 "INSERT INTO `LaunchCondition` "
638 "(`Condition`, `Description`) VALUES( %s )")
640 make_add_entry(property,
641 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
643 make_add_entry(install_execute_sequence,
644 "INSERT INTO `InstallExecuteSequence` "
645 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
647 make_add_entry(media,
648 "INSERT INTO `Media` "
649 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
650 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
652 make_add_entry(ccpsearch,
653 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
655 make_add_entry(drlocator,
656 "INSERT INTO `DrLocator` "
657 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
659 make_add_entry(complocator,
660 "INSERT INTO `CompLocator` "
661 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
663 make_add_entry(inilocator,
664 "INSERT INTO `IniLocator` "
665 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
668 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char *path,
669 const char *name, UINT type )
671 const char insert[] =
672 "INSERT INTO `RegLocator` (`Signature_`, `Root`, `Key`, `Name`, `Type`) "
673 "VALUES( '%s', %u, '%s', '%s', %u )";
677 sz = strlen( sig ) + 10 + strlen( path ) + strlen( name ) + 10 + sizeof( insert );
678 query = HeapAlloc( GetProcessHeap(), 0, sz );
679 sprintf( query, insert, sig, root, path, name, type );
680 r = run_query( hdb, query );
681 HeapFree( GetProcessHeap(), 0, query );
685 static UINT set_summary_info(MSIHANDLE hdb)
690 /* build summary info */
691 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
692 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
694 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
695 "Installation Database");
696 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
698 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
699 "Installation Database");
700 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
702 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
704 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
706 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
708 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
710 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
711 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
712 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
714 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
715 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
717 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
718 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
720 res = MsiSummaryInfoPersist(suminfo);
721 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
723 res = MsiCloseHandle( suminfo);
724 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
730 static MSIHANDLE create_package_db(void)
737 /* create an empty database */
738 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
739 ok( res == ERROR_SUCCESS , "Failed to create database %u\n", res );
740 if( res != ERROR_SUCCESS )
743 res = MsiDatabaseCommit( hdb );
744 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
746 res = set_summary_info(hdb);
748 res = run_query( hdb,
749 "CREATE TABLE `Directory` ( "
750 "`Directory` CHAR(255) NOT NULL, "
751 "`Directory_Parent` CHAR(255), "
752 "`DefaultDir` CHAR(255) NOT NULL "
753 "PRIMARY KEY `Directory`)" );
754 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
759 static UINT package_from_db(MSIHANDLE hdb, MSIHANDLE *handle)
765 sprintf(szPackage, "#%u", hdb);
766 res = MsiOpenPackage(szPackage, &hPackage);
767 if (res != ERROR_SUCCESS)
773 res = MsiCloseHandle(hdb);
774 if (res != ERROR_SUCCESS)
776 MsiCloseHandle(hPackage);
781 return ERROR_SUCCESS;
784 static void create_test_file(const CHAR *name)
789 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
790 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
791 WriteFile(file, name, strlen(name), &written, NULL);
792 WriteFile(file, "\n", strlen("\n"), &written, NULL);
796 typedef struct _tagVS_VERSIONINFO
803 VS_FIXEDFILEINFO Value;
808 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
809 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
811 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
813 VS_VERSIONINFO *pVerInfo;
814 VS_FIXEDFILEINFO *pFixedInfo;
821 GetSystemDirectory(path, MAX_PATH);
822 /* Some dlls can't be updated on Vista/W2K8 */
823 lstrcatA(path, "\\version.dll");
825 CopyFileA(path, name, FALSE);
827 size = GetFileVersionInfoSize(path, &handle);
828 buffer = HeapAlloc(GetProcessHeap(), 0, size);
830 GetFileVersionInfoA(path, 0, size, buffer);
832 pVerInfo = (VS_VERSIONINFO *)buffer;
833 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
834 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
836 pFixedInfo->dwFileVersionMS = ms;
837 pFixedInfo->dwFileVersionLS = ls;
838 pFixedInfo->dwProductVersionMS = ms;
839 pFixedInfo->dwProductVersionLS = ls;
841 resource = BeginUpdateResource(name, FALSE);
845 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
846 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
849 if (!EndUpdateResource(resource, FALSE))
855 HeapFree(GetProcessHeap(), 0, buffer);
859 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
861 RESTOREPOINTINFOA spec;
863 spec.dwEventType = event_type;
864 spec.dwRestorePtType = APPLICATION_INSTALL;
865 spec.llSequenceNumber = status->llSequenceNumber;
866 lstrcpyA(spec.szDescription, "msitest restore point");
868 return pSRSetRestorePointA(&spec, status);
871 static void remove_restore_point(DWORD seq_number)
875 res = pSRRemoveRestorePoint(seq_number);
876 if (res != ERROR_SUCCESS)
877 trace("Failed to remove the restore point : %08x\n", res);
880 static void test_createpackage(void)
882 MSIHANDLE hPackage = 0;
885 res = package_from_db(create_package_db(), &hPackage);
886 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
888 skip("Not enough rights to perform tests\n");
892 ok( res == ERROR_SUCCESS, " Failed to create package %u\n", res );
894 res = MsiCloseHandle( hPackage);
895 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
899 static void test_doaction( void )
904 r = MsiDoAction( -1, NULL );
905 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
907 r = package_from_db(create_package_db(), &hpkg);
908 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
910 skip("Not enough rights to perform tests\n");
914 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
916 r = MsiDoAction(hpkg, NULL);
917 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
919 r = MsiDoAction(0, "boo");
920 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
922 r = MsiDoAction(hpkg, "boo");
923 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
925 MsiCloseHandle( hpkg );
929 static void test_gettargetpath_bad(void)
931 static const WCHAR boo[] = {'b','o','o',0};
932 static const WCHAR empty[] = {0};
939 r = package_from_db(create_package_db(), &hpkg);
940 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
942 skip("Not enough rights to perform tests\n");
946 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
948 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
949 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
951 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
952 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
954 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
955 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
957 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
958 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
960 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
961 ok( r == ERROR_DIRECTORY, "wrong return val\n");
963 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
964 ok( r == ERROR_DIRECTORY, "wrong return val\n");
967 r = MsiGetTargetPath( hpkg, "", buffer, &sz );
968 ok( r == ERROR_DIRECTORY, "wrong return val\n");
970 r = MsiGetTargetPathW( 0, NULL, NULL, NULL );
971 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
973 r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
974 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
976 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
977 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
979 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
980 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
982 r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
983 ok( r == ERROR_DIRECTORY, "wrong return val\n");
985 r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
986 ok( r == ERROR_DIRECTORY, "wrong return val\n");
989 r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
990 ok( r == ERROR_DIRECTORY, "wrong return val\n");
992 MsiCloseHandle( hpkg );
996 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
1002 rec = MsiCreateRecord( 1 );
1003 ok(rec, "MsiCreate record failed\n");
1005 r = MsiRecordSetString( rec, 0, file );
1006 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1009 r = MsiFormatRecord( hpkg, rec, buff, &size );
1010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1012 MsiCloseHandle( rec );
1015 static void test_settargetpath(void)
1017 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
1023 hdb = create_package_db();
1024 ok ( hdb, "failed to create package database\n" );
1026 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
1027 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
1029 r = create_component_table( hdb );
1030 ok( r == S_OK, "cannot create Component table: %d\n", r );
1032 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1033 ok( r == S_OK, "cannot add dummy component: %d\n", r );
1035 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1036 ok( r == S_OK, "cannot add test component: %d\n", r );
1038 r = create_feature_table( hdb );
1039 ok( r == S_OK, "cannot create Feature table: %d\n", r );
1041 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
1042 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
1044 r = create_feature_components_table( hdb );
1045 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
1047 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
1048 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1050 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
1051 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1053 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
1054 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
1056 r = create_file_table( hdb );
1057 ok( r == S_OK, "cannot create File table: %d\n", r );
1059 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1060 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1062 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1063 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1065 r = package_from_db( hdb, &hpkg );
1066 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1068 skip("Not enough rights to perform tests\n");
1069 DeleteFile(msifile);
1072 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1074 r = MsiDoAction( hpkg, "CostInitialize");
1075 ok( r == ERROR_SUCCESS, "cost init failed\n");
1077 r = MsiDoAction( hpkg, "FileCost");
1078 ok( r == ERROR_SUCCESS, "file cost failed\n");
1080 r = MsiDoAction( hpkg, "CostFinalize");
1081 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
1083 r = MsiSetTargetPath( 0, NULL, NULL );
1084 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1086 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1087 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1089 r = MsiSetTargetPath( hpkg, "boo", NULL );
1090 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1092 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
1093 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1095 sz = sizeof tempdir - 1;
1096 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
1097 sprintf( file, "%srootfile.txt", tempdir );
1099 query_file_path( hpkg, "[#RootFile]", buffer );
1100 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1101 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
1103 GetTempFileName( tempdir, "_wt", 0, buffer );
1104 sprintf( tempdir, "%s\\subdir", buffer );
1106 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1107 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1108 "MsiSetTargetPath on file returned %d\n", r );
1110 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1111 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1112 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
1114 DeleteFile( buffer );
1116 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1117 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1119 r = GetFileAttributes( buffer );
1120 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
1122 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1123 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
1125 sz = sizeof buffer - 1;
1126 lstrcat( tempdir, "\\" );
1127 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
1128 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1129 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
1131 sprintf( file, "%srootfile.txt", tempdir );
1132 query_file_path( hpkg, "[#RootFile]", buffer );
1133 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
1135 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
1136 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1138 query_file_path( hpkg, "[#TestFile]", buffer );
1139 ok( !lstrcmpi(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
1140 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
1142 sz = sizeof buffer - 1;
1143 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1144 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1145 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
1147 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two\\three" );
1148 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1150 sz = sizeof buffer - 1;
1151 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1152 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1153 ok( !lstrcmpi(buffer, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer);
1155 MsiCloseHandle( hpkg );
1158 static void test_condition(void)
1163 r = package_from_db(create_package_db(), &hpkg);
1164 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1166 skip("Not enough rights to perform tests\n");
1167 DeleteFile(msifile);
1170 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1172 r = MsiEvaluateCondition(0, NULL);
1173 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1175 r = MsiEvaluateCondition(hpkg, NULL);
1176 ok( r == MSICONDITION_NONE, "wrong return val\n");
1178 r = MsiEvaluateCondition(hpkg, "");
1179 ok( r == MSICONDITION_NONE, "wrong return val\n");
1181 r = MsiEvaluateCondition(hpkg, "1");
1182 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1184 r = MsiEvaluateCondition(hpkg, "0");
1185 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1187 r = MsiEvaluateCondition(hpkg, "-1");
1188 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1190 r = MsiEvaluateCondition(hpkg, "0 = 0");
1191 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1193 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1194 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1196 r = MsiEvaluateCondition(hpkg, "0 = 1");
1197 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1199 r = MsiEvaluateCondition(hpkg, "0 > 1");
1200 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1202 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1203 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1205 r = MsiEvaluateCondition(hpkg, "1 > 1");
1206 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1208 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
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, "1 >= 1");
1218 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1220 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1221 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1223 r = MsiEvaluateCondition(hpkg, "0 < 1");
1224 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1226 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1227 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1229 r = MsiEvaluateCondition(hpkg, "1 < 1");
1230 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1232 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1233 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1235 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1236 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1238 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1239 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1241 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1242 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1244 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1245 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1247 r = MsiEvaluateCondition(hpkg, "0 >=");
1248 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1250 r = MsiEvaluateCondition(hpkg, " ");
1251 ok( r == MSICONDITION_NONE, "wrong return val\n");
1253 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1254 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1256 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1257 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1259 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1260 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1262 r = MsiEvaluateCondition(hpkg, "not 0");
1263 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1265 r = MsiEvaluateCondition(hpkg, "not LicView");
1266 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1268 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1269 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1271 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1272 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1274 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1275 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1277 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1278 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1280 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1281 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1283 r = MsiEvaluateCondition(hpkg, "\"0\"");
1284 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1286 r = MsiEvaluateCondition(hpkg, "1 and 2");
1287 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1289 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1290 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1292 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1293 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1295 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1296 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1298 r = MsiEvaluateCondition(hpkg, "(0)");
1299 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1301 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1302 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1304 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1305 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1307 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1308 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1310 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1311 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1313 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1314 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1316 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1317 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1319 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1320 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1322 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1323 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1325 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1326 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1328 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1329 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1331 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1332 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1334 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1335 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1337 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1338 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1340 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1341 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1343 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1344 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1346 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1347 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1349 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1350 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1352 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1353 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1355 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1356 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1358 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1359 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1361 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1362 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1364 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1365 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1367 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1368 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1370 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1371 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1373 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1374 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1376 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1377 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1379 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1380 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1382 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1383 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1385 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1386 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1388 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1389 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1391 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1392 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1394 MsiSetProperty(hpkg, "mm", "5" );
1396 r = MsiEvaluateCondition(hpkg, "mm = 5");
1397 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1399 r = MsiEvaluateCondition(hpkg, "mm < 6");
1400 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1402 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1403 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1405 r = MsiEvaluateCondition(hpkg, "mm > 4");
1406 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1408 r = MsiEvaluateCondition(hpkg, "mm < 12");
1409 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1411 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1412 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1414 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1415 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1417 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1418 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1420 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1421 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1423 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1424 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1426 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1427 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1429 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1430 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1432 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1433 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1435 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1436 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1438 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1439 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1441 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1442 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1444 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1445 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1447 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1448 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1450 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1451 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1453 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1454 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1456 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1457 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1459 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1460 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1462 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1463 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1465 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1466 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1468 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1469 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1471 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1472 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1474 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1475 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1477 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1478 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1480 r = MsiEvaluateCondition(hpkg, "bandalmael>=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 MsiSetProperty(hpkg, "bandalmael", "0" );
1490 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1491 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1493 MsiSetProperty(hpkg, "bandalmael", "" );
1494 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1495 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1497 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1498 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1499 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1501 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1502 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1503 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1505 MsiSetProperty(hpkg, "bandalmael", "0 " );
1506 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1507 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1509 MsiSetProperty(hpkg, "bandalmael", "-0" );
1510 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1511 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1513 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1514 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1515 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1517 MsiSetProperty(hpkg, "bandalmael", "--0" );
1518 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1519 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1521 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1522 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1523 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1525 MsiSetProperty(hpkg, "bandalmael", "-" );
1526 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1527 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1529 MsiSetProperty(hpkg, "bandalmael", "+0" );
1530 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1531 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1533 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1534 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1535 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1536 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1537 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1539 MsiSetProperty(hpkg, "one", "hi");
1540 MsiSetProperty(hpkg, "two", "hithere");
1541 r = MsiEvaluateCondition(hpkg, "one >< two");
1542 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1544 MsiSetProperty(hpkg, "one", "hithere");
1545 MsiSetProperty(hpkg, "two", "hi");
1546 r = MsiEvaluateCondition(hpkg, "one >< two");
1547 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1549 MsiSetProperty(hpkg, "one", "hello");
1550 MsiSetProperty(hpkg, "two", "hi");
1551 r = MsiEvaluateCondition(hpkg, "one >< two");
1552 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1554 MsiSetProperty(hpkg, "one", "hellohithere");
1555 MsiSetProperty(hpkg, "two", "hi");
1556 r = MsiEvaluateCondition(hpkg, "one >< two");
1557 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1559 MsiSetProperty(hpkg, "one", "");
1560 MsiSetProperty(hpkg, "two", "hi");
1561 r = MsiEvaluateCondition(hpkg, "one >< two");
1562 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1564 MsiSetProperty(hpkg, "one", "hi");
1565 MsiSetProperty(hpkg, "two", "");
1566 r = MsiEvaluateCondition(hpkg, "one >< two");
1567 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1569 MsiSetProperty(hpkg, "one", "");
1570 MsiSetProperty(hpkg, "two", "");
1571 r = MsiEvaluateCondition(hpkg, "one >< two");
1572 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1574 MsiSetProperty(hpkg, "one", "1234");
1575 MsiSetProperty(hpkg, "two", "1");
1576 r = MsiEvaluateCondition(hpkg, "one >< two");
1577 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1579 MsiSetProperty(hpkg, "one", "one 1234");
1580 MsiSetProperty(hpkg, "two", "1");
1581 r = MsiEvaluateCondition(hpkg, "one >< two");
1582 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1584 MsiSetProperty(hpkg, "one", "hithere");
1585 MsiSetProperty(hpkg, "two", "hi");
1586 r = MsiEvaluateCondition(hpkg, "one << two");
1587 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1589 MsiSetProperty(hpkg, "one", "hi");
1590 MsiSetProperty(hpkg, "two", "hithere");
1591 r = MsiEvaluateCondition(hpkg, "one << two");
1592 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1594 MsiSetProperty(hpkg, "one", "hi");
1595 MsiSetProperty(hpkg, "two", "hi");
1596 r = MsiEvaluateCondition(hpkg, "one << two");
1597 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1599 MsiSetProperty(hpkg, "one", "abcdhithere");
1600 MsiSetProperty(hpkg, "two", "hi");
1601 r = MsiEvaluateCondition(hpkg, "one << two");
1602 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1604 MsiSetProperty(hpkg, "one", "");
1605 MsiSetProperty(hpkg, "two", "hi");
1606 r = MsiEvaluateCondition(hpkg, "one << two");
1607 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1609 MsiSetProperty(hpkg, "one", "hithere");
1610 MsiSetProperty(hpkg, "two", "");
1611 r = MsiEvaluateCondition(hpkg, "one << two");
1612 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1614 MsiSetProperty(hpkg, "one", "");
1615 MsiSetProperty(hpkg, "two", "");
1616 r = MsiEvaluateCondition(hpkg, "one << two");
1617 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1619 MsiSetProperty(hpkg, "one", "1234");
1620 MsiSetProperty(hpkg, "two", "1");
1621 r = MsiEvaluateCondition(hpkg, "one << two");
1622 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1624 MsiSetProperty(hpkg, "one", "1234 one");
1625 MsiSetProperty(hpkg, "two", "1");
1626 r = MsiEvaluateCondition(hpkg, "one << two");
1627 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1629 MsiSetProperty(hpkg, "one", "hithere");
1630 MsiSetProperty(hpkg, "two", "there");
1631 r = MsiEvaluateCondition(hpkg, "one >> two");
1632 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1634 MsiSetProperty(hpkg, "one", "hithere");
1635 MsiSetProperty(hpkg, "two", "hi");
1636 r = MsiEvaluateCondition(hpkg, "one >> two");
1637 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1639 MsiSetProperty(hpkg, "one", "there");
1640 MsiSetProperty(hpkg, "two", "hithere");
1641 r = MsiEvaluateCondition(hpkg, "one >> two");
1642 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1644 MsiSetProperty(hpkg, "one", "there");
1645 MsiSetProperty(hpkg, "two", "there");
1646 r = MsiEvaluateCondition(hpkg, "one >> two");
1647 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1649 MsiSetProperty(hpkg, "one", "abcdhithere");
1650 MsiSetProperty(hpkg, "two", "hi");
1651 r = MsiEvaluateCondition(hpkg, "one >> two");
1652 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1654 MsiSetProperty(hpkg, "one", "");
1655 MsiSetProperty(hpkg, "two", "there");
1656 r = MsiEvaluateCondition(hpkg, "one >> two");
1657 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1659 MsiSetProperty(hpkg, "one", "there");
1660 MsiSetProperty(hpkg, "two", "");
1661 r = MsiEvaluateCondition(hpkg, "one >> two");
1662 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1664 MsiSetProperty(hpkg, "one", "");
1665 MsiSetProperty(hpkg, "two", "");
1666 r = MsiEvaluateCondition(hpkg, "one >> two");
1667 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1669 MsiSetProperty(hpkg, "one", "1234");
1670 MsiSetProperty(hpkg, "two", "4");
1671 r = MsiEvaluateCondition(hpkg, "one >> two");
1672 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1674 MsiSetProperty(hpkg, "one", "one 1234");
1675 MsiSetProperty(hpkg, "two", "4");
1676 r = MsiEvaluateCondition(hpkg, "one >> two");
1677 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1679 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1681 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1682 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1684 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1685 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1687 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1688 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1690 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1691 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1693 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1694 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1696 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1697 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1699 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1700 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1702 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1703 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1705 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1706 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1708 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1709 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1711 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1712 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1714 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1715 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1717 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1718 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1720 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1721 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1723 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1724 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1726 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1727 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1729 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1730 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1732 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1733 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1735 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1736 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1738 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1739 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1741 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1742 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1744 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1745 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1747 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1748 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1750 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1751 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1753 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1754 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1756 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1757 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1759 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1760 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1762 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1763 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1765 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1766 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1768 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1769 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1771 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1772 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1774 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1775 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1777 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1778 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1780 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[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]\"");
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 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1793 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1794 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1796 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1797 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1799 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1800 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1802 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1803 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1805 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1806 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1808 MsiSetProperty(hpkg, "one", "1");
1809 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1810 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1812 MsiSetProperty(hpkg, "X", "5.0");
1814 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1815 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1817 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1818 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1820 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1821 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1823 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1824 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1826 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1827 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1829 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1830 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1832 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1833 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1835 /* feature doesn't exist */
1836 r = MsiEvaluateCondition(hpkg, "&nofeature");
1837 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1839 MsiSetProperty(hpkg, "A", "2");
1840 MsiSetProperty(hpkg, "X", "50");
1842 r = MsiEvaluateCondition(hpkg, "2 <= X");
1843 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1845 r = MsiEvaluateCondition(hpkg, "A <= X");
1846 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1848 r = MsiEvaluateCondition(hpkg, "A <= 50");
1849 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1851 MsiSetProperty(hpkg, "X", "50val");
1853 r = MsiEvaluateCondition(hpkg, "2 <= X");
1854 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1856 r = MsiEvaluateCondition(hpkg, "A <= X");
1857 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1859 MsiSetProperty(hpkg, "A", "7");
1860 MsiSetProperty(hpkg, "X", "50");
1862 r = MsiEvaluateCondition(hpkg, "7 <= X");
1863 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1865 r = MsiEvaluateCondition(hpkg, "A <= X");
1866 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1868 r = MsiEvaluateCondition(hpkg, "A <= 50");
1869 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1871 MsiSetProperty(hpkg, "X", "50val");
1873 r = MsiEvaluateCondition(hpkg, "2 <= X");
1874 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1876 r = MsiEvaluateCondition(hpkg, "A <= X");
1877 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1879 MsiCloseHandle( hpkg );
1880 DeleteFile(msifile);
1883 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1891 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1892 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1895 static void test_props(void)
1897 MSIHANDLE hpkg, hdb;
1902 hdb = create_package_db();
1904 "CREATE TABLE `Property` ( "
1905 "`Property` CHAR(255) NOT NULL, "
1906 "`Value` CHAR(255) "
1907 "PRIMARY KEY `Property`)" );
1908 ok( r == ERROR_SUCCESS , "Failed\n" );
1911 "INSERT INTO `Property` "
1912 "(`Property`, `Value`) "
1913 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1914 ok( r == ERROR_SUCCESS , "Failed\n" );
1916 r = package_from_db( hdb, &hpkg );
1917 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1919 skip("Not enough rights to perform tests\n");
1920 DeleteFile(msifile);
1923 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1925 /* test invalid values */
1926 r = MsiGetProperty( 0, NULL, NULL, NULL );
1927 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1929 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1930 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1932 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1933 ok( r == ERROR_SUCCESS, "wrong return val\n");
1935 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1936 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1938 /* test retrieving an empty/nonexistent property */
1940 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1941 ok( r == ERROR_SUCCESS, "wrong return val\n");
1942 ok( sz == 0, "wrong size returned\n");
1944 check_prop_empty( hpkg, "boo");
1947 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1948 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1949 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1950 ok( sz == 0, "wrong size returned\n");
1954 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1955 ok( r == ERROR_SUCCESS, "wrong return val\n");
1956 ok( buffer[0] == 0, "buffer was not changed\n");
1957 ok( sz == 0, "wrong size returned\n");
1959 /* set the property to something */
1960 r = MsiSetProperty( 0, NULL, NULL );
1961 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1963 r = MsiSetProperty( hpkg, NULL, NULL );
1964 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1966 r = MsiSetProperty( hpkg, "", NULL );
1967 ok( r == ERROR_SUCCESS, "wrong return val\n");
1969 /* try set and get some illegal property identifiers */
1970 r = MsiSetProperty( hpkg, "", "asdf" );
1971 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1973 r = MsiSetProperty( hpkg, "=", "asdf" );
1974 ok( r == ERROR_SUCCESS, "wrong return val\n");
1976 r = MsiSetProperty( hpkg, " ", "asdf" );
1977 ok( r == ERROR_SUCCESS, "wrong return val\n");
1979 r = MsiSetProperty( hpkg, "'", "asdf" );
1980 ok( r == ERROR_SUCCESS, "wrong return val\n");
1984 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1985 ok( r == ERROR_SUCCESS, "wrong return val\n");
1986 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1988 /* set empty values */
1989 r = MsiSetProperty( hpkg, "boo", NULL );
1990 ok( r == ERROR_SUCCESS, "wrong return val\n");
1991 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1993 r = MsiSetProperty( hpkg, "boo", "" );
1994 ok( r == ERROR_SUCCESS, "wrong return val\n");
1995 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1997 /* set a non-empty value */
1998 r = MsiSetProperty( hpkg, "boo", "xyz" );
1999 ok( r == ERROR_SUCCESS, "wrong return val\n");
2003 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2004 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2005 ok( buffer[0] == 0, "buffer was not changed\n");
2006 ok( sz == 3, "wrong size returned\n");
2010 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2011 ok( r == ERROR_SUCCESS, "wrong return val\n");
2012 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
2013 ok( sz == 3, "wrong size returned\n");
2017 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2018 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2019 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
2020 ok( sz == 3, "wrong size returned\n");
2022 r = MsiSetProperty(hpkg, "SourceDir", "foo");
2023 ok( r == ERROR_SUCCESS, "wrong return val\n");
2026 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
2027 ok( r == ERROR_SUCCESS, "wrong return val\n");
2028 ok( !strcmp(buffer,""), "buffer wrong\n");
2029 ok( sz == 0, "wrong size returned\n");
2032 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
2033 ok( r == ERROR_SUCCESS, "wrong return val\n");
2034 ok( !strcmp(buffer,""), "buffer wrong\n");
2035 ok( sz == 0, "wrong size returned\n");
2038 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
2039 ok( r == ERROR_SUCCESS, "wrong return val\n");
2040 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
2041 ok( sz == 3, "wrong size returned\n");
2043 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
2044 ok( r == ERROR_SUCCESS, "wrong return val\n");
2047 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
2048 ok( r == ERROR_SUCCESS, "return wrong\n");
2049 ok( sz == 13, "size wrong (%d)\n", sz);
2052 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
2053 ok( r == ERROR_MORE_DATA, "return wrong\n");
2054 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
2056 r = MsiSetProperty(hpkg, "property", "value");
2057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2060 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2061 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2062 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
2064 r = MsiSetProperty(hpkg, "property", NULL);
2065 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2068 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2070 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
2072 MsiCloseHandle( hpkg );
2073 DeleteFile(msifile);
2076 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
2078 MSIHANDLE hview, hrec;
2080 CHAR buffer[MAX_PATH];
2084 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
2085 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
2086 r = MsiViewExecute(hview, 0);
2087 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
2090 while (r == ERROR_SUCCESS && !found)
2092 r = MsiViewFetch(hview, &hrec);
2093 if (r != ERROR_SUCCESS) break;
2096 r = MsiRecordGetString(hrec, 1, buffer, &sz);
2097 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
2100 r = MsiRecordGetString(hrec, 2, buffer, &sz);
2101 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
2105 MsiCloseHandle(hrec);
2108 MsiViewClose(hview);
2109 MsiCloseHandle(hview);
2114 static void test_property_table(void)
2118 MSIHANDLE hpkg, hdb, hrec;
2119 char buffer[MAX_PATH], package[10];
2123 hdb = create_package_db();
2124 ok( hdb, "failed to create package\n");
2126 r = package_from_db(hdb, &hpkg);
2127 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2129 skip("Not enough rights to perform tests\n");
2130 DeleteFile(msifile);
2133 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2135 MsiCloseHandle(hdb);
2137 hdb = MsiGetActiveDatabase(hpkg);
2139 query = "CREATE TABLE `_Property` ( "
2140 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2141 r = run_query(hdb, query);
2142 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2144 MsiCloseHandle(hdb);
2145 MsiCloseHandle(hpkg);
2146 DeleteFile(msifile);
2148 hdb = create_package_db();
2149 ok( hdb, "failed to create package\n");
2151 query = "CREATE TABLE `_Property` ( "
2152 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2153 r = run_query(hdb, query);
2154 ok(r == ERROR_SUCCESS, "failed to create table\n");
2156 query = "ALTER `_Property` ADD `foo` INTEGER";
2157 r = run_query(hdb, query);
2158 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2160 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2161 r = run_query(hdb, query);
2162 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2164 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2165 r = run_query(hdb, query);
2166 ok(r == ERROR_SUCCESS, "failed to add column\n");
2168 sprintf(package, "#%i", hdb);
2169 r = MsiOpenPackage(package, &hpkg);
2170 todo_wine ok(r != ERROR_SUCCESS, "MsiOpenPackage succeeded\n");
2171 if (r == ERROR_SUCCESS)
2172 MsiCloseHandle(hpkg);
2174 r = MsiCloseHandle(hdb);
2175 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
2177 hdb = create_package_db();
2178 ok (hdb, "failed to create package database\n");
2180 r = create_property_table(hdb);
2181 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2183 r = add_property_entry(hdb, "'prop', 'val'");
2184 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2186 r = package_from_db(hdb, &hpkg);
2187 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
2189 MsiCloseHandle(hdb);
2192 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2194 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2196 hdb = MsiGetActiveDatabase(hpkg);
2198 found = find_prop_in_property(hdb, "prop", "val");
2199 ok(found, "prop should be in the _Property table\n");
2201 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2202 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2204 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2205 r = do_query(hdb, query, &hrec);
2206 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2208 found = find_prop_in_property(hdb, "dantes", "mercedes");
2209 ok(found == FALSE, "dantes should not be in the _Property table\n");
2212 lstrcpy(buffer, "aaa");
2213 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2214 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2215 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2217 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2218 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2220 found = find_prop_in_property(hdb, "dantes", "mercedes");
2221 ok(found == TRUE, "dantes should be in the _Property table\n");
2223 MsiCloseHandle(hdb);
2224 MsiCloseHandle(hpkg);
2225 DeleteFile(msifile);
2228 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2233 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2234 if( res == ERROR_SUCCESS )
2238 r = MsiViewExecute( htab, hrec );
2239 if( r != ERROR_SUCCESS )
2242 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2245 r = MsiViewClose( htab );
2246 if( r != ERROR_SUCCESS )
2249 r = MsiCloseHandle( htab );
2250 if( r != ERROR_SUCCESS )
2256 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2258 return try_query_param( hdb, szQuery, 0 );
2261 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2266 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2267 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2269 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2270 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2272 r = MsiSummaryInfoPersist(summary);
2273 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2275 MsiCloseHandle(summary);
2278 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2283 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2284 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2286 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2287 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2289 r = MsiSummaryInfoPersist(summary);
2290 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2292 MsiCloseHandle(summary);
2295 static void test_msipackage(void)
2297 MSIHANDLE hdb = 0, hpack = 100;
2302 /* NULL szPackagePath */
2303 r = MsiOpenPackage(NULL, &hpack);
2304 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2306 /* empty szPackagePath */
2307 r = MsiOpenPackage("", &hpack);
2308 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2310 skip("Not enough rights to perform tests\n");
2315 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2318 if (r == ERROR_SUCCESS)
2319 MsiCloseHandle(hpack);
2321 /* nonexistent szPackagePath */
2322 r = MsiOpenPackage("nonexistent", &hpack);
2323 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2326 r = MsiOpenPackage(msifile, NULL);
2327 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2331 r = MsiOpenPackage(name, &hpack);
2332 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2334 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2337 /* database exists, but is emtpy */
2338 sprintf(name, "#%d", hdb);
2339 r = MsiOpenPackage(name, &hpack);
2340 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2341 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2343 query = "CREATE TABLE `Property` ( "
2344 "`Property` CHAR(72), `Value` CHAR(0) "
2345 "PRIMARY KEY `Property`)";
2346 r = try_query(hdb, query);
2347 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2349 query = "CREATE TABLE `InstallExecuteSequence` ("
2350 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2351 "PRIMARY KEY `Action`)";
2352 r = try_query(hdb, query);
2353 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2355 /* a few key tables exist */
2356 sprintf(name, "#%d", hdb);
2357 r = MsiOpenPackage(name, &hpack);
2358 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2359 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2361 MsiCloseHandle(hdb);
2362 DeleteFile(msifile);
2364 /* start with a clean database to show what constitutes a valid package */
2365 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2368 sprintf(name, "#%d", hdb);
2370 /* The following summary information props must exist:
2375 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2376 r = MsiOpenPackage(name, &hpack);
2377 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2378 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2380 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2381 r = MsiOpenPackage(name, &hpack);
2382 ok(r == ERROR_SUCCESS,
2383 "Expected ERROR_SUCCESS, got %d\n", r);
2385 MsiCloseHandle(hpack);
2386 MsiCloseHandle(hdb);
2387 DeleteFile(msifile);
2390 static void test_formatrecord2(void)
2392 MSIHANDLE hpkg, hrec ;
2397 r = package_from_db(create_package_db(), &hpkg);
2398 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2400 skip("Not enough rights to perform tests\n");
2401 DeleteFile(msifile);
2404 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2406 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2407 ok( r == ERROR_SUCCESS, "set property failed\n");
2409 hrec = MsiCreateRecord(2);
2410 ok(hrec, "create record failed\n");
2412 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2413 ok( r == ERROR_SUCCESS, "format record failed\n");
2417 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2419 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2420 r = MsiRecordSetString(hrec, 1, "hoo");
2422 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2423 ok( sz == 3, "size wrong\n");
2424 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2425 ok( r == ERROR_SUCCESS, "format failed\n");
2427 r = MsiRecordSetString(hrec, 0, "x[~]x");
2429 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2430 ok( sz == 3, "size wrong\n");
2431 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2432 ok( r == ERROR_SUCCESS, "format failed\n");
2434 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2435 r = MsiRecordSetString(hrec, 1, "hoo");
2437 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2438 ok( sz == 3, "size wrong\n");
2439 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2440 ok( r == ERROR_SUCCESS, "format failed\n");
2442 r = MsiRecordSetString(hrec, 0, "[\\[]");
2444 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2445 ok( sz == 1, "size wrong\n");
2446 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2447 ok( r == ERROR_SUCCESS, "format failed\n");
2449 SetEnvironmentVariable("FOO", "BAR");
2450 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2452 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2453 ok( sz == 3, "size wrong\n");
2454 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2455 ok( r == ERROR_SUCCESS, "format failed\n");
2457 r = MsiRecordSetString(hrec, 0, "[[1]]");
2458 r = MsiRecordSetString(hrec, 1, "%FOO");
2460 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2461 ok( sz == 3, "size wrong\n");
2462 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2463 ok( r == ERROR_SUCCESS, "format failed\n");
2465 MsiCloseHandle( hrec );
2466 MsiCloseHandle( hpkg );
2467 DeleteFile(msifile);
2470 static void test_states(void)
2475 INSTALLSTATE state, action;
2477 static const CHAR msifile2[] = "winetest2-package.msi";
2478 static const CHAR msifile3[] = "winetest3-package.msi";
2479 static const CHAR msifile4[] = "winetest4-package.msi";
2481 if (is_process_limited())
2483 skip("process is limited\n");
2487 hdb = create_package_db();
2488 ok ( hdb, "failed to create package database\n" );
2490 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2491 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2493 r = create_property_table( hdb );
2494 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2496 r = add_property_entry( hdb, "'ProductCode', '{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
2497 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2499 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2500 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2502 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2503 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2505 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2506 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2508 r = create_install_execute_sequence_table( hdb );
2509 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2511 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2512 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2514 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2515 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2517 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2518 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2520 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2521 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2523 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2524 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2526 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2527 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2529 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2530 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2532 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2533 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2535 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2536 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2538 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2539 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2541 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2542 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2544 r = create_media_table( hdb );
2545 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2547 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2548 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2550 r = create_feature_table( hdb );
2551 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2553 r = create_component_table( hdb );
2554 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2556 /* msidbFeatureAttributesFavorLocal */
2557 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2558 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2560 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2561 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2562 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2564 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2565 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2566 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2568 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2569 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2570 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2572 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2573 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2574 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2576 /* msidbFeatureAttributesFavorSource */
2577 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2578 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2580 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2581 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2582 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2584 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2585 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2586 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2588 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2589 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2590 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2592 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2593 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2594 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2596 /* msidbFeatureAttributesFavorSource */
2597 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2598 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2600 /* msidbFeatureAttributesFavorLocal */
2601 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2602 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2605 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2606 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2608 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2609 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2610 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2612 /* no feature parent:msidbComponentAttributesLocalOnly */
2613 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2614 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2616 /* msidbFeatureAttributesFavorLocal:removed */
2617 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2618 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2620 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2621 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2622 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2624 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2625 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2626 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2628 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2629 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2630 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2632 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2633 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2634 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2636 /* msidbFeatureAttributesFavorSource:removed */
2637 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2638 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2640 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2641 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2642 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2644 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2645 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2646 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2648 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2649 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2650 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2652 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2653 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2654 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2656 /* msidbFeatureAttributesFavorLocal */
2657 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2658 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2660 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2661 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2663 /* msidbFeatureAttributesFavorSource */
2664 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2665 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2667 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2668 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2670 /* msidbFeatureAttributesFavorAdvertise */
2671 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2672 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2674 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2675 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2677 r = create_feature_components_table( hdb );
2678 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2680 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2681 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2683 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2684 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2686 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2687 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2689 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2690 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2692 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2693 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2695 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2696 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2698 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2699 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2701 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2702 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2704 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2705 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2707 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2708 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2710 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2711 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2713 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2714 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2716 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2717 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2719 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2720 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2722 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2723 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2725 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2726 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2728 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2729 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2731 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2732 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2734 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2735 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2737 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2738 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2740 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2741 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2743 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2744 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2746 r = create_file_table( hdb );
2747 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2749 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2750 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2752 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2753 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2755 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2756 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2758 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2759 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2761 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2762 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2764 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2765 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2767 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2768 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2770 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2771 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2773 /* compressed file */
2774 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2775 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2777 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2778 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2780 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2781 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2783 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2784 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2786 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2787 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2789 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2790 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2792 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2793 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2795 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2796 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2798 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2799 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2801 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2802 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2804 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2805 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2807 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2808 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2810 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2811 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2813 MsiDatabaseCommit(hdb);
2815 /* these properties must not be in the saved msi file */
2816 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2817 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2819 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2820 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2822 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2823 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2825 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2826 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2828 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2829 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2831 r = package_from_db( hdb, &hpkg );
2832 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2834 skip("Not enough rights to perform tests\n");
2835 DeleteFile(msifile);
2838 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
2840 MsiCloseHandle(hdb);
2842 CopyFileA(msifile, msifile2, FALSE);
2843 CopyFileA(msifile, msifile3, FALSE);
2844 CopyFileA(msifile, msifile4, FALSE);
2848 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2849 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2850 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2851 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2855 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2856 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2857 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2858 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2862 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2863 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2864 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2865 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2869 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2870 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2871 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2872 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2876 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2877 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2878 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2879 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2883 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2884 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2885 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2886 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2890 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2891 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2892 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2893 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2897 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2898 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2899 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2900 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2904 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2905 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2906 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2907 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2911 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2912 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2913 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2914 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2918 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2919 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2920 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2921 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2925 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2926 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2927 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2928 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2932 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2933 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2934 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2935 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2939 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2940 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2941 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2942 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2946 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2947 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2948 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2949 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2953 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2954 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2955 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2956 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2960 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2961 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2962 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2963 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2967 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2968 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2969 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2970 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2974 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2975 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2976 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2977 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2981 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2982 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2983 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2984 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2988 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2989 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2990 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2991 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2995 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2996 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2997 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2998 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3002 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3003 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3004 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3005 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3009 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3010 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3011 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3012 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3016 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3017 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3018 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3019 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3023 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3024 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3025 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3026 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3030 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3031 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3032 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3033 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3037 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3038 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3039 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3040 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3044 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3045 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3046 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3047 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3051 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3052 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3053 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3054 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3058 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3059 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3060 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3061 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3063 r = MsiDoAction( hpkg, "CostInitialize");
3064 ok( r == ERROR_SUCCESS, "cost init failed\n");
3068 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3070 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3071 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3075 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3077 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3078 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3082 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3084 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3089 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3091 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3092 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3096 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3098 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3099 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3103 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3105 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3106 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3110 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3112 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3113 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3117 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3119 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3120 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3124 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3126 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3127 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3131 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3133 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3138 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3140 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3145 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3147 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3152 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3154 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3155 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3159 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3161 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3166 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3168 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3173 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3175 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3176 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3180 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3182 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3183 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3187 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3189 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3190 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3194 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3196 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3197 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3201 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3203 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3204 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3208 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3210 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3215 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3217 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3218 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3222 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3224 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3225 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3229 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3231 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3232 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3236 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3238 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3239 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3243 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3245 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3246 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3250 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3252 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3253 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3257 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3259 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3260 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3264 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3266 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3267 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3271 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3273 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3274 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3278 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3280 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3281 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3283 r = MsiDoAction( hpkg, "FileCost");
3284 ok( r == ERROR_SUCCESS, "file cost failed\n");
3288 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3290 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3291 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3295 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3297 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3298 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3302 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3304 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3305 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3309 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3310 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3311 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3312 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3316 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3318 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3319 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3323 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3325 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3326 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3330 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3332 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3333 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3337 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3339 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3340 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3344 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3346 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3347 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3351 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3353 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3354 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3358 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3360 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3361 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3365 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3367 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3368 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3372 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3374 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3375 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3379 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3381 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3382 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3386 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3388 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3389 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3393 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3394 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3395 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3396 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3400 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3401 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3402 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3403 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3407 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3408 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3409 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3410 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3414 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3415 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3416 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3417 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3421 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3422 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3423 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3424 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3428 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3429 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3430 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3431 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3435 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3436 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3437 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3438 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3442 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3444 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3445 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3449 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3451 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3452 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3456 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3458 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3459 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3463 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3464 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3465 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3466 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3470 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3472 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3473 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3477 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3478 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3479 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3480 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3484 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3485 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3486 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3487 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3491 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3493 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3494 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3498 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3500 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3501 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3503 r = MsiDoAction( hpkg, "CostFinalize");
3504 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3508 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3509 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3510 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3511 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3515 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3516 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3517 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3518 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3522 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3524 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3525 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3529 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3530 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3531 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3532 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3536 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3537 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3538 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3539 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3543 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3545 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3546 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3550 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3551 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3552 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3553 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3557 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3558 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3559 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3560 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3564 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3565 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3566 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3567 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3571 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3572 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3573 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3574 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3578 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3579 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3580 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3581 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3585 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3586 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3587 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3588 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3592 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3593 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3594 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3595 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3599 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3600 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3601 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3602 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3606 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3607 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3608 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3609 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3613 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3614 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3615 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3616 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3620 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3621 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3622 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3623 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3627 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3628 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3629 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3630 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3634 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3635 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3636 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3637 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3641 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3642 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3643 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3644 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3648 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3649 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3650 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3651 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3655 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3656 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3657 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3658 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3662 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3663 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3664 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3665 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3669 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3670 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3671 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3672 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3676 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3677 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3678 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3679 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3683 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3684 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3685 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3686 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3690 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3691 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3692 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3693 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3697 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3698 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3699 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3700 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3704 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3705 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3706 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3707 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3711 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3712 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3713 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3714 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3718 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3719 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3720 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3721 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3723 MsiCloseHandle( hpkg );
3725 /* publish the features and components */
3726 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3727 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3729 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3730 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3732 /* these properties must not be in the saved msi file */
3733 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3734 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3736 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3737 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3739 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3740 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3742 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3743 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3745 r = package_from_db( hdb, &hpkg );
3746 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
3748 MsiCloseHandle(hdb);
3752 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3753 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3754 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3755 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3759 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3760 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3761 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3762 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3766 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3767 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3768 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3769 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3773 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3774 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3775 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3776 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3780 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3781 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3782 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3783 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3787 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3788 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3789 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3790 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3794 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3795 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3796 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3797 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3801 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3802 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3803 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3804 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3808 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3809 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3810 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3811 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3815 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3816 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3817 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3818 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3822 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3823 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3824 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3825 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3829 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3830 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3831 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3832 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3836 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3837 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3838 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3839 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3843 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3844 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3845 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3846 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3850 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3851 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3852 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3853 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3857 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3858 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3859 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3860 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3864 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3865 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3866 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3867 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3871 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3872 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3873 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3874 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3878 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3879 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3880 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3881 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3885 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3886 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3887 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3888 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3892 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3893 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3894 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3895 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3899 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3900 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3901 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3902 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3906 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3907 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3913 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3914 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3920 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3921 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3922 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3923 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3927 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3928 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3929 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3930 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3934 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3935 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3936 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3937 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3941 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3942 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3943 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3944 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3948 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3949 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3950 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3951 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3955 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3956 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3957 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3958 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3962 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3963 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3964 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3965 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3967 r = MsiDoAction( hpkg, "CostInitialize");
3968 ok( r == ERROR_SUCCESS, "cost init failed\n");
3972 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3973 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3974 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3975 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3979 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3981 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3982 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3986 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3988 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3989 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3993 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3995 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3996 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4000 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4002 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4003 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4007 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4009 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4010 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4014 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4016 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4017 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4021 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4023 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4024 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4028 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4030 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4031 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4035 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4037 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4038 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4042 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4044 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4045 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4049 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4051 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4056 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4063 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4070 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4077 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4084 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4091 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4098 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4105 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4112 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4119 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4126 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4133 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4140 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4147 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4154 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4161 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4168 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4175 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4177 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4182 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4184 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4185 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4187 r = MsiDoAction( hpkg, "FileCost");
4188 ok( r == ERROR_SUCCESS, "file cost failed\n");
4192 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4199 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4206 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4213 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4220 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4227 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4234 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4241 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4248 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4250 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4251 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4255 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4262 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4269 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4276 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4283 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4290 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4297 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4304 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4311 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4318 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4325 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4332 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4339 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4346 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4353 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4360 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4362 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4363 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4367 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4369 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4370 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4374 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4376 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4377 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4381 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4383 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4384 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4388 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4389 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4390 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4391 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4395 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4396 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4397 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4398 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4400 r = MsiDoAction( hpkg, "CostFinalize");
4401 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4405 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4407 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4408 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4412 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4414 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4415 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4419 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4421 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4422 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4426 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4428 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4429 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4433 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4435 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4436 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4440 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4442 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4443 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4447 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4449 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4450 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4454 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4456 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4457 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4461 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4463 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4464 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4468 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4470 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4471 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4475 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4477 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4478 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4482 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4484 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4485 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4489 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4491 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4492 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4496 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4498 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4499 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4503 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4505 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4506 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4510 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4512 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4513 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4517 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4519 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4520 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4524 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4526 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4527 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4531 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4533 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4534 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4538 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4540 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4541 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4545 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4547 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4548 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4552 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4554 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4555 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4559 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4561 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4562 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4566 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4568 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4569 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4573 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4575 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4576 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4580 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4581 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4582 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4583 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4587 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4588 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4589 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4590 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4594 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4595 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4596 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4597 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4601 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4602 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4603 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4604 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4608 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4609 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4610 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4611 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4615 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4616 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4617 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4618 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4620 MsiCloseHandle(hpkg);
4622 /* uninstall the product */
4623 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4626 /* all features installed locally */
4627 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4628 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4630 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4631 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4633 /* these properties must not be in the saved msi file */
4634 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4635 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4637 r = package_from_db( hdb, &hpkg );
4638 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
4642 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4643 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4644 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4645 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4649 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4650 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4651 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4652 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4656 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4657 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4658 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4659 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4663 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4664 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4665 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4666 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4670 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4671 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4672 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4673 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4677 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4678 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4679 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4680 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4684 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4685 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4686 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4687 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4691 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4692 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4693 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4694 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4698 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4699 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4700 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4701 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4705 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4706 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4707 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4708 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4712 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4713 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4714 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4715 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4719 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4720 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4721 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4722 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4726 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4727 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4728 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4729 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4733 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4734 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4735 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4736 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4740 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4741 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4742 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4743 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4747 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4748 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4749 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4750 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4754 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4755 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4756 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4757 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4761 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4762 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4763 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4764 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4768 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4769 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4770 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4771 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4775 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4776 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4777 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4778 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4782 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4783 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4784 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4785 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4789 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4790 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4791 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4792 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4796 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4797 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4798 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4799 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4803 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4804 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4805 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4806 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4810 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4811 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4812 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4813 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4817 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4818 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4819 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4820 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4824 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4825 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4826 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4827 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4831 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4832 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4833 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4834 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4838 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4839 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4840 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4841 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4845 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4846 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4847 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4848 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4852 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4853 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4854 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4855 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4857 r = MsiDoAction( hpkg, "CostInitialize");
4858 ok( r == ERROR_SUCCESS, "cost init failed\n");
4862 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4863 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4864 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4865 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4869 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4870 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4871 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4872 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4876 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4877 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4878 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4879 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4883 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4884 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4885 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4886 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4890 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4891 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4892 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4893 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4897 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4898 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4899 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4900 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4904 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4905 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4906 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4907 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4911 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4912 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4913 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4914 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4918 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4920 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4921 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4925 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4927 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4928 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4932 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4934 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4935 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4939 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4941 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4942 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4946 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4947 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4948 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4949 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4953 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4955 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4956 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4960 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4961 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4962 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4963 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4967 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4968 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4969 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4970 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4974 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4976 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4977 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4981 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4983 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4984 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4988 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4989 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4990 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4991 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4995 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4996 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4997 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4998 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5002 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5003 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5004 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5005 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5009 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5011 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5012 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5016 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5018 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5019 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5023 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5025 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5030 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5032 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5037 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5039 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5040 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5044 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5046 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5047 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5051 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5052 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5053 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5054 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5058 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5059 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5060 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5061 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5065 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5067 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5068 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5072 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5073 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5074 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5075 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5077 r = MsiDoAction( hpkg, "FileCost");
5078 ok( r == ERROR_SUCCESS, "file cost failed\n");
5082 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5084 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5089 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5091 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5092 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5096 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5098 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5099 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5103 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5105 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5106 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5110 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5112 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5113 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5117 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5119 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5120 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5124 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5126 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5127 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5131 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5133 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5138 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5140 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5145 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5147 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5152 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5154 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5155 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5159 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5161 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5166 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5168 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5173 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5175 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5176 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5180 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5182 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5183 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5187 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5189 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5190 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5194 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5196 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5197 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5201 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5203 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5204 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5208 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5210 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5215 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5217 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5218 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5222 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5224 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5225 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5229 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5231 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5232 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5236 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5238 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5239 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5243 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5245 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5246 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5250 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5252 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5253 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5257 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5259 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5260 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5264 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5266 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5267 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5271 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5273 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5274 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5278 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5280 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5281 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5285 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5286 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5287 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5288 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5292 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5293 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5294 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5295 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5297 r = MsiDoAction( hpkg, "CostFinalize");
5298 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5302 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5304 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5305 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5309 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5310 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5311 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5312 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5316 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5318 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5319 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5323 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5325 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5326 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5330 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5332 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5333 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5337 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5339 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5340 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5344 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5346 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5347 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5351 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5353 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5354 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5358 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5360 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5361 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5365 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5367 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5368 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5372 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5374 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5375 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5379 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5381 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5382 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5386 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5388 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5389 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5393 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5394 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5395 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5396 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5400 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5401 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5402 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5403 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5407 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5408 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5409 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5410 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5414 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5415 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5416 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5417 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5421 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5422 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5423 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5424 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5428 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5429 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5430 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5431 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5435 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5436 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5437 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5438 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5442 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5444 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5445 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5449 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5451 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5452 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5456 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5458 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5459 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5463 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5464 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5465 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5466 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5470 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5472 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5473 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5477 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5478 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5479 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5480 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5484 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5485 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5486 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5487 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5491 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5493 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5494 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5498 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5500 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5501 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5505 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5507 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5508 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5512 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5513 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5514 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5515 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5517 MsiCloseHandle(hpkg);
5519 /* uninstall the product */
5520 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5523 /* all features installed from source */
5524 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5527 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5528 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5530 /* this property must not be in the saved msi file */
5531 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5532 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5534 r = package_from_db( hdb, &hpkg );
5535 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
5539 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5540 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5541 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5542 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5546 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5547 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5548 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5549 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5553 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5554 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5555 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5556 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5560 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5561 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5562 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5563 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5567 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5568 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5569 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5570 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5574 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5575 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5576 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5577 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5581 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5582 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5583 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5584 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5588 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5589 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5590 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5591 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5595 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5596 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5597 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5598 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5602 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5603 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5604 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5605 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5609 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5610 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5611 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5612 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5616 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5617 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5618 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5619 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5623 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5624 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5625 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5626 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5630 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5631 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5632 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5633 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5637 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5638 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5639 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5640 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5644 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5645 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5646 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5647 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5651 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5652 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5653 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5654 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5658 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5659 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5660 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5661 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5665 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5666 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5667 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5668 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5672 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5673 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5674 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5675 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5679 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5680 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5681 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5682 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5686 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5687 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5688 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5689 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5693 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5694 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5695 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5696 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5700 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5701 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5702 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5703 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5707 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5708 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5709 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5710 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5714 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5715 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5716 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5717 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5721 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5722 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5723 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5724 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5728 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5729 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5730 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5731 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5735 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5736 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5737 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5738 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5742 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5743 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5744 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5745 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5749 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5750 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5751 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5752 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5754 r = MsiDoAction( hpkg, "CostInitialize");
5755 ok( r == ERROR_SUCCESS, "cost init failed\n");
5759 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5760 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5761 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5762 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5766 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5767 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5768 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5769 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5773 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5774 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5775 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5776 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5780 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5781 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5782 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5783 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5787 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5788 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5789 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5790 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5794 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5795 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5796 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5797 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5801 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5802 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5803 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5804 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5808 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5809 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5810 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5811 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5815 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5816 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5817 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5818 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5822 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5823 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5824 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5825 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5829 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5830 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5831 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5832 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5836 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5837 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5838 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5839 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5843 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5844 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5845 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5846 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5850 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5851 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5852 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5853 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5857 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5858 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5859 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5860 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5864 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5865 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5866 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5867 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5871 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5872 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5873 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5874 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5878 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5879 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5880 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5881 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5885 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5886 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5887 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5888 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5892 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5893 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5894 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5895 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5899 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5900 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5901 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5902 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5906 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5907 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5908 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5909 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5913 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5914 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5915 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5916 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5920 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5921 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5922 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5923 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5927 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5928 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5929 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5930 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5934 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5935 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5936 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5937 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5941 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5942 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5943 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5944 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5948 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5949 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5950 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5951 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5955 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5956 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5957 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5958 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5962 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5963 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5964 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5965 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5969 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5970 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5971 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5972 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5974 r = MsiDoAction( hpkg, "FileCost");
5975 ok( r == ERROR_SUCCESS, "file cost failed\n");
5979 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5981 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5982 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5986 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5988 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5989 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5993 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5995 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5996 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6000 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6002 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6003 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6007 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6009 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6010 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6014 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6016 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6017 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6021 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6023 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6024 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6028 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6030 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6031 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6035 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6037 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6038 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6042 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6044 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6045 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6049 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6051 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6056 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6063 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6070 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6077 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6084 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6091 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6098 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6105 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6112 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6119 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6126 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6133 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6140 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6147 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6154 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6161 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6168 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6175 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6177 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6182 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6184 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6185 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6189 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6190 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6191 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6192 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6194 r = MsiDoAction( hpkg, "CostFinalize");
6195 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6199 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6201 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6202 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6206 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6208 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6209 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6213 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6215 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6216 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6220 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6222 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6223 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6227 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6229 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6234 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6236 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6237 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6241 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6243 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6244 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6248 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6250 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6251 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6255 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6257 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6258 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6262 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6264 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6265 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6269 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6271 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6272 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6276 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6278 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6283 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6285 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6290 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6292 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6293 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6297 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6299 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6300 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6304 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6306 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6311 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6313 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6318 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6320 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6321 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6325 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6327 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6328 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6332 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6334 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6339 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6341 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6342 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6346 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6348 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6353 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6355 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6360 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6362 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6363 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6367 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6369 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6370 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6374 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6376 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6377 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6381 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6383 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6384 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6388 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6389 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6390 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6391 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6395 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6396 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6397 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6398 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6402 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6403 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6404 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6405 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6409 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6410 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6411 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6412 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6414 MsiCloseHandle(hpkg);
6416 /* reinstall the product */
6417 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6420 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6421 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6423 /* this property must not be in the saved msi file */
6424 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6425 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6427 r = package_from_db( hdb, &hpkg );
6428 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
6432 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6433 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6434 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6435 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6439 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6440 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6441 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6442 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6446 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6447 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6448 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6449 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6453 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6454 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6455 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6456 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6460 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6461 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6462 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6463 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6467 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6468 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6469 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6470 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6474 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6475 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6476 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6477 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6481 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6482 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6483 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6484 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6488 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6489 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6490 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6491 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6495 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6496 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6497 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6498 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6502 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6503 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6504 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6505 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6509 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6510 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6511 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6512 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6516 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6517 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6518 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6519 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6523 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6524 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6525 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6526 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6530 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6531 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6532 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6533 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6537 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6538 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6539 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6540 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6544 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6545 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6546 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6547 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6551 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6552 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6553 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6554 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6558 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6559 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6560 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6561 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6565 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6566 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6567 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6568 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6572 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6573 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6574 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6575 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6579 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6580 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6581 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6582 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6586 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6587 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6588 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6589 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6593 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6594 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6595 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6596 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6600 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6601 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6602 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6603 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6607 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6608 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6609 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6610 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6614 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6615 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6616 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6617 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6621 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6622 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6623 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6624 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6628 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6629 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6630 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6631 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6635 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6636 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6637 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6638 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6642 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6643 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6644 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6645 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6647 r = MsiDoAction( hpkg, "CostInitialize");
6648 ok( r == ERROR_SUCCESS, "cost init failed\n");
6652 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6654 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6655 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6659 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6660 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6661 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6662 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6666 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6668 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6669 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6673 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6675 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6676 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6680 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6681 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6682 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6683 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6687 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6688 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6689 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6690 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6694 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6695 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6696 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6697 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6701 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6703 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6704 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6708 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6710 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6711 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6715 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6716 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6717 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6718 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6722 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6723 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6724 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6725 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6729 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6730 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6731 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6732 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6736 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6737 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6738 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6739 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6743 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6744 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6745 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6746 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6750 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6751 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6752 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6753 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6757 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6758 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6759 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6760 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6764 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6765 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6766 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6767 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6771 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6772 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6773 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6774 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6778 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6779 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6780 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6781 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6785 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6786 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6787 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6788 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6792 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6793 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6794 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6795 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6799 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6800 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6801 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6802 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6806 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6807 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6808 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6809 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6813 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6814 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6815 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6816 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6820 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6821 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6822 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6823 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6827 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6828 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6829 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6830 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6834 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6835 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6836 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6837 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6841 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6842 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6843 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6844 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6848 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6850 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6851 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6855 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6856 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6857 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6858 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6862 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6863 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6864 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6865 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6867 r = MsiDoAction( hpkg, "FileCost");
6868 ok( r == ERROR_SUCCESS, "file cost failed\n");
6872 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6873 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6874 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6875 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6879 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6880 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6881 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6882 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6886 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6887 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6888 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6889 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6893 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6894 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6895 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6896 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6900 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6901 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6902 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6903 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6907 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6908 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6909 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6910 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6914 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6915 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6916 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6917 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6921 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6922 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6923 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6924 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6928 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6929 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6930 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6931 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6935 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6936 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6937 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6938 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6942 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6943 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6944 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6945 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6949 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6950 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6951 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6952 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6956 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6957 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6958 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6959 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6963 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6964 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6965 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6966 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6970 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6971 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6972 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6973 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6977 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6978 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6979 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6980 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6984 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6985 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6986 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6987 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6991 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6992 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6993 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6994 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6998 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6999 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7000 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7001 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7005 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7006 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7007 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7008 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7012 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7013 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7014 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7015 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7019 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7020 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7021 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7022 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7026 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7027 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7028 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7029 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7033 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7034 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7035 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7036 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7040 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7041 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7042 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7043 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7047 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7048 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7049 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7050 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7054 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7056 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7057 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7061 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7063 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7064 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7068 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7070 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7071 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7075 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7077 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7078 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7082 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7084 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7087 r = MsiDoAction( hpkg, "CostFinalize");
7088 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
7092 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7094 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7095 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7099 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7101 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7102 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7106 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7108 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7109 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7113 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7115 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7116 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7120 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7122 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7127 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7129 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7130 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7134 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7136 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7137 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7141 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7143 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7144 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7148 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7150 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7151 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7155 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7157 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7158 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7162 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7164 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7165 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7169 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7171 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7172 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7176 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7178 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7183 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7185 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7186 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7190 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7192 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7193 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7197 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7199 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7200 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7204 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7206 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7207 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7211 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7212 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7213 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7214 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7218 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7219 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7220 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7221 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7225 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7226 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7227 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7228 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7232 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7234 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7235 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7239 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7241 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7242 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7246 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7248 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7249 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7253 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7255 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7256 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7260 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7262 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7263 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7267 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7269 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7270 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7274 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7275 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7276 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7277 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7281 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7283 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7284 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7288 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7290 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7291 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7295 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7297 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7298 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7302 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7304 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7305 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7307 MsiCloseHandle(hpkg);
7309 /* uninstall the product */
7310 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7313 DeleteFileA(msifile);
7314 DeleteFileA(msifile2);
7315 DeleteFileA(msifile3);
7316 DeleteFileA(msifile4);
7319 static void test_getproperty(void)
7321 MSIHANDLE hPackage = 0;
7323 static CHAR empty[] = "";
7327 r = package_from_db(create_package_db(), &hPackage);
7328 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7330 skip("Not enough rights to perform tests\n");
7331 DeleteFile(msifile);
7334 ok( r == ERROR_SUCCESS, "Failed to create package %u\n", r );
7336 /* set the property */
7337 r = MsiSetProperty(hPackage, "Name", "Value");
7338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7340 /* retrieve the size, NULL pointer */
7342 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7344 ok( size == 5, "Expected 5, got %d\n", size);
7346 /* retrieve the size, empty string */
7348 r = MsiGetProperty(hPackage, "Name", empty, &size);
7349 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7350 ok( size == 5, "Expected 5, got %d\n", size);
7352 /* don't change size */
7353 r = MsiGetProperty(hPackage, "Name", prop, &size);
7354 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7355 ok( size == 5, "Expected 5, got %d\n", size);
7356 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7358 /* increase the size by 1 */
7360 r = MsiGetProperty(hPackage, "Name", prop, &size);
7361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7362 ok( size == 5, "Expected 5, got %d\n", size);
7363 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7365 r = MsiCloseHandle( hPackage);
7366 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7367 DeleteFile(msifile);
7370 static void test_removefiles(void)
7376 hdb = create_package_db();
7377 ok ( hdb, "failed to create package database\n" );
7379 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7380 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7382 r = create_feature_table( hdb );
7383 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7385 r = create_component_table( hdb );
7386 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7388 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7389 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7391 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7392 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7394 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7395 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7397 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7398 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7400 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7401 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7403 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7404 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7406 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7407 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7409 r = create_feature_components_table( hdb );
7410 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7412 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7413 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7415 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7416 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7418 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7419 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7421 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7422 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7424 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7425 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7427 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7428 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7430 r = create_file_table( hdb );
7431 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7433 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7434 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7436 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7437 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7439 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7440 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7442 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7443 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7445 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7446 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7448 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7449 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7451 r = create_remove_file_table( hdb );
7452 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7454 r = package_from_db( hdb, &hpkg );
7455 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7457 skip("Not enough rights to perform tests\n");
7458 DeleteFile(msifile);
7461 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7463 MsiCloseHandle( hdb );
7465 create_test_file( "hydrogen.txt" );
7466 create_test_file( "helium.txt" );
7467 create_test_file( "lithium.txt" );
7468 create_test_file( "beryllium.txt" );
7469 create_test_file( "boron.txt" );
7470 create_test_file( "carbon.txt" );
7472 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7473 ok( r == ERROR_SUCCESS, "set property failed\n");
7475 r = MsiDoAction( hpkg, "CostInitialize");
7476 ok( r == ERROR_SUCCESS, "cost init failed\n");
7478 r = MsiDoAction( hpkg, "FileCost");
7479 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7481 r = MsiDoAction( hpkg, "CostFinalize");
7482 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7484 r = MsiDoAction( hpkg, "InstallValidate");
7485 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7487 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7488 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7490 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7491 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7493 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7494 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7496 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7497 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7499 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7500 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7502 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7503 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7505 r = MsiDoAction( hpkg, "RemoveFiles");
7506 ok( r == ERROR_SUCCESS, "remove files failed\n");
7508 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7509 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7510 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7511 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7512 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7513 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7515 MsiCloseHandle( hpkg );
7516 DeleteFileA(msifile);
7519 static void test_appsearch(void)
7524 CHAR prop[MAX_PATH];
7527 hdb = create_package_db();
7528 ok ( hdb, "failed to create package database\n" );
7530 r = create_appsearch_table( hdb );
7531 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7533 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7534 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7536 r = add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" );
7537 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7539 r = create_reglocator_table( hdb );
7540 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7542 r = add_reglocator_entry( hdb, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 );
7543 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7545 r = create_drlocator_table( hdb );
7546 ok( r == ERROR_SUCCESS, "cannot create DrLocator table: %d\n", r );
7548 r = add_drlocator_entry( hdb, "'NewSignature2', 0, 'c:\\windows\\system32', 0" );
7549 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7551 r = create_signature_table( hdb );
7552 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7554 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7555 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7557 r = add_signature_entry( hdb, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" );
7558 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7560 r = package_from_db( hdb, &hpkg );
7561 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7563 skip("Not enough rights to perform tests\n");
7564 DeleteFile(msifile);
7567 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7568 MsiCloseHandle( hdb );
7569 if (r != ERROR_SUCCESS)
7572 r = MsiDoAction( hpkg, "AppSearch" );
7573 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7575 size = sizeof(prop);
7576 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7577 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7580 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7583 size = sizeof(prop);
7584 r = MsiGetPropertyA( hpkg, "NOTEPAD", prop, &size );
7585 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7588 MsiCloseHandle( hpkg );
7589 DeleteFileA(msifile);
7592 static void test_appsearch_complocator(void)
7594 MSIHANDLE hpkg, hdb;
7595 CHAR path[MAX_PATH];
7596 CHAR prop[MAX_PATH];
7601 if (!get_user_sid(&usersid))
7604 if (is_process_limited())
7606 skip("process is limited\n");
7610 create_test_file("FileName1");
7611 create_test_file("FileName4");
7612 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7613 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7615 create_test_file("FileName2");
7616 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7617 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7619 create_test_file("FileName3");
7620 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7621 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7623 create_test_file("FileName5");
7624 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7625 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7627 create_test_file("FileName6");
7628 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7629 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7631 create_test_file("FileName7");
7632 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7633 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7635 /* dir is FALSE, but we're pretending it's a directory */
7636 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7637 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7639 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7640 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7641 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7643 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7644 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7645 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7647 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7648 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7649 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7651 hdb = create_package_db();
7652 ok(hdb, "Expected a valid database handle\n");
7654 r = create_appsearch_table(hdb);
7655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7657 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7660 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7661 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7663 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7664 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7666 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7667 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7669 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7672 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7675 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7676 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7678 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7681 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7684 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7687 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7688 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7690 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7691 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7693 r = create_complocator_table(hdb);
7694 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7696 /* published component, machine, file, signature, misdbLocatorTypeFile */
7697 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7698 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7700 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7701 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7702 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7704 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7705 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7708 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7709 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7710 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7712 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7713 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7716 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7717 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7720 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7721 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7722 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7724 /* unpublished component, no signature, misdbLocatorTypeDir */
7725 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7728 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7729 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7730 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7732 /* published component, signature w/ ver, misdbLocatorTypeFile */
7733 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7736 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7737 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7738 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7740 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7741 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7742 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7744 r = create_signature_table(hdb);
7745 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7747 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7748 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7750 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7751 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7753 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7756 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7759 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7762 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7765 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7766 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7768 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7769 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7771 r = package_from_db(hdb, &hpkg);
7772 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7774 skip("Not enough rights to perform tests\n");
7777 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
7779 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
7780 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7782 r = MsiDoAction(hpkg, "AppSearch");
7783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7786 sprintf(path, "%s\\FileName1", CURR_DIR);
7787 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7789 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7792 sprintf(path, "%s\\FileName2", CURR_DIR);
7793 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7795 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7798 sprintf(path, "%s\\FileName3", CURR_DIR);
7799 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7800 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7801 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7804 sprintf(path, "%s\\FileName4", CURR_DIR);
7805 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
7806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7807 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7810 sprintf(path, "%s\\FileName5", CURR_DIR);
7811 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7812 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7813 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7816 sprintf(path, "%s\\", CURR_DIR);
7817 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7819 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7822 sprintf(path, "%s\\", CURR_DIR);
7823 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7824 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7825 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7828 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7829 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7830 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
7833 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7834 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7835 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7838 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
7839 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7840 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7841 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7844 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
7845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7846 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7849 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
7850 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
7851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7852 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7854 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7855 MSIINSTALLCONTEXT_MACHINE, NULL);
7856 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7857 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
7858 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7859 MSIINSTALLCONTEXT_USERMANAGED, usersid);
7860 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7861 MSIINSTALLCONTEXT_MACHINE, NULL);
7862 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7863 MSIINSTALLCONTEXT_MACHINE, NULL);
7864 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7865 MSIINSTALLCONTEXT_MACHINE, NULL);
7866 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7867 MSIINSTALLCONTEXT_MACHINE, NULL);
7868 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7869 MSIINSTALLCONTEXT_MACHINE, NULL);
7870 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7871 MSIINSTALLCONTEXT_MACHINE, NULL);
7872 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7873 MSIINSTALLCONTEXT_MACHINE, NULL);
7875 MsiCloseHandle(hpkg);
7878 DeleteFileA("FileName1");
7879 DeleteFileA("FileName2");
7880 DeleteFileA("FileName3");
7881 DeleteFileA("FileName4");
7882 DeleteFileA("FileName5");
7883 DeleteFileA("FileName6");
7884 DeleteFileA("FileName7");
7885 DeleteFileA("FileName8.dll");
7886 DeleteFileA("FileName9.dll");
7887 DeleteFileA("FileName10.dll");
7888 DeleteFileA(msifile);
7892 static void test_appsearch_reglocator(void)
7894 MSIHANDLE hpkg, hdb;
7895 CHAR path[MAX_PATH], prop[MAX_PATH];
7896 DWORD binary[2], size, val;
7897 BOOL space, version, is_64bit = sizeof(void *) > sizeof(int);
7898 HKEY hklm, classes, hkcu, users;
7899 LPSTR pathdata, pathvar, ptr;
7905 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7908 DeleteFileA("test.dll");
7910 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
7911 if (res == ERROR_ACCESS_DENIED)
7913 skip("Not enough rights to perform tests\n");
7916 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7918 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
7919 (const BYTE *)"regszdata", 10);
7920 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7922 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
7923 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7925 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
7926 (const BYTE *)"regszdata", 10);
7927 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7930 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
7931 ok(res == ERROR_SUCCESS ||
7932 broken(res == ERROR_INVALID_PARAMETER),
7933 "Expected ERROR_SUCCESS, got %d\n", res);
7935 if (res == ERROR_SUCCESS)
7937 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
7938 (const BYTE *)"regszdata", 10);
7939 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7942 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
7943 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7945 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
7946 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7948 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
7949 (const BYTE *)"regszdata", 10);
7950 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7953 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
7954 (const BYTE *)&val, sizeof(DWORD));
7955 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7958 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
7959 (const BYTE *)&val, sizeof(DWORD));
7960 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7962 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
7963 (const BYTE *)"%PATH%", 7);
7964 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7966 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
7967 (const BYTE *)"my%NOVAR%", 10);
7968 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7970 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
7971 (const BYTE *)"one\0two\0", 9);
7972 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7974 binary[0] = 0x1234abcd;
7975 binary[1] = 0x567890ef;
7976 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
7977 (const BYTE *)binary, sizeof(binary));
7978 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7980 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
7981 (const BYTE *)"#regszdata", 11);
7982 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7984 create_test_file("FileName1");
7985 sprintf(path, "%s\\FileName1", CURR_DIR);
7986 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
7987 (const BYTE *)path, lstrlenA(path) + 1);
7988 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7990 sprintf(path, "%s\\FileName2", CURR_DIR);
7991 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
7992 (const BYTE *)path, lstrlenA(path) + 1);
7993 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7995 lstrcpyA(path, CURR_DIR);
7996 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
7997 (const BYTE *)path, lstrlenA(path) + 1);
7998 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8000 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
8001 (const BYTE *)"", 1);
8002 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8004 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8005 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8006 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
8007 (const BYTE *)path, lstrlenA(path) + 1);
8008 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8010 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8011 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8012 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
8013 (const BYTE *)path, lstrlenA(path) + 1);
8014 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8016 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8017 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8018 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
8019 (const BYTE *)path, lstrlenA(path) + 1);
8020 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8022 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
8023 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
8024 (const BYTE *)path, lstrlenA(path) + 1);
8026 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
8027 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
8028 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
8029 (const BYTE *)path, lstrlenA(path) + 1);
8031 hdb = create_package_db();
8032 ok(hdb, "Expected a valid database handle\n");
8034 r = create_appsearch_table(hdb);
8035 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8037 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8038 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8040 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8043 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8044 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8046 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8049 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8050 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8052 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8053 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8055 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8056 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8058 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8059 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8061 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8062 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8064 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8065 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8067 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8068 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8070 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8073 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
8074 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8076 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
8077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8079 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
8080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8082 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
8083 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8085 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
8086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8088 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
8089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8091 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
8092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8094 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
8095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8097 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
8098 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8100 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
8101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8103 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
8104 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8106 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
8107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8109 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
8110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8112 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
8113 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8115 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
8116 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8118 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
8119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8121 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
8122 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8124 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
8125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8127 r = create_reglocator_table(hdb);
8128 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8130 type = msidbLocatorTypeRawValue;
8132 type |= msidbLocatorType64bit;
8134 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
8135 r = add_reglocator_entry(hdb, "NewSignature1", 2, "Software\\Wine", "Value1", type);
8136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8138 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
8139 r = add_reglocator_entry(hdb, "NewSignature2", 2, "Software\\Wine", "Value2", type);
8140 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8142 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
8143 r = add_reglocator_entry(hdb, "NewSignature3", 2, "Software\\Wine", "Value3", type);
8144 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8146 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8147 r = add_reglocator_entry(hdb, "NewSignature4", 2, "Software\\Wine", "Value4", type);
8148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8150 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8151 r = add_reglocator_entry(hdb, "NewSignature5", 2, "Software\\Wine", "Value5", type);
8152 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8154 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
8155 r = add_reglocator_entry(hdb, "NewSignature6", 2, "Software\\Wine", "Value6", type);
8156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8158 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
8159 r = add_reglocator_entry(hdb, "NewSignature7", 2, "Software\\Wine", "Value7", type);
8160 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8162 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
8163 r = add_reglocator_entry(hdb, "NewSignature8", 2, "Software\\Wine", "Value8", type);
8164 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8166 type = msidbLocatorTypeFileName;
8168 type |= msidbLocatorType64bit;
8170 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
8171 r = add_reglocator_entry(hdb, "NewSignature9", 2, "Software\\Wine", "Value9", type);
8172 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8174 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
8175 r = add_reglocator_entry(hdb, "NewSignature10", 2, "Software\\Wine", "Value10", type);
8176 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8178 /* HKLM, msidbLocatorTypeFileName, no signature */
8179 r = add_reglocator_entry(hdb, "NewSignature11", 2, "Software\\Wine", "Value9", type);
8180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8182 type = msidbLocatorTypeDirectory;
8184 type |= msidbLocatorType64bit;
8186 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
8187 r = add_reglocator_entry(hdb, "NewSignature12", 2, "Software\\Wine", "Value9", type);
8188 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8190 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8191 r = add_reglocator_entry(hdb, "NewSignature13", 2, "Software\\Wine", "Value11", type);
8192 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8194 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8195 r = add_reglocator_entry(hdb, "NewSignature14", 2, "Software\\Wine", "Value9", type);
8196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8198 type = msidbLocatorTypeRawValue;
8200 type |= msidbLocatorType64bit;
8202 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8203 r = add_reglocator_entry(hdb, "NewSignature15", 0, "Software\\Wine", "Value1", type);
8204 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8206 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8207 r = add_reglocator_entry(hdb, "NewSignature16", 1, "Software\\Wine", "Value1", type);
8208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8210 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8211 r = add_reglocator_entry(hdb, "NewSignature17", 3, "S-1-5-18\\Software\\Wine", "Value1", type);
8212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8214 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8215 r = add_reglocator_entry(hdb, "NewSignature18", 2, "Software\\Wine", "", type);
8216 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8218 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8219 r = add_reglocator_entry(hdb, "NewSignature19", 2, "Software\\IDontExist", "", type);
8220 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8222 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8223 r = add_reglocator_entry(hdb, "NewSignature20", 2, "Software\\Wine", "Value12", type);
8224 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8226 type = msidbLocatorTypeFileName;
8228 type |= msidbLocatorType64bit;
8230 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8231 r = add_reglocator_entry(hdb, "NewSignature21", 2, "Software\\Wine", "Value13", type);
8232 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8234 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8235 r = add_reglocator_entry(hdb, "NewSignature22", 2, "Software\\Wine", "Value14", type);
8236 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8238 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8239 r = add_reglocator_entry(hdb, "NewSignature23", 2, "Software\\Wine", "Value15", type);
8240 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8242 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8243 r = add_reglocator_entry(hdb, "NewSignature24", 2, "Software\\Wine", "Value11", type);
8244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8246 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8247 r = add_reglocator_entry(hdb, "NewSignature25", 2, "Software\\Wine", "Value10", type);
8248 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8250 type = msidbLocatorTypeDirectory;
8252 type |= msidbLocatorType64bit;
8254 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8255 r = add_reglocator_entry(hdb, "NewSignature26", 2, "Software\\Wine", "Value11", type);
8256 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8258 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8259 r = add_reglocator_entry(hdb, "NewSignature27", 2, "Software\\Wine", "Value10", type);
8260 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8262 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8263 r = add_reglocator_entry(hdb, "NewSignature28", 2, "Software\\Wine", "Value10", type);
8264 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8266 type = msidbLocatorTypeFileName;
8268 type |= msidbLocatorType64bit;
8270 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8271 r = add_reglocator_entry(hdb, "NewSignature29", 2, "Software\\Wine", "Value16", type);
8272 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8274 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8275 r = add_reglocator_entry(hdb, "NewSignature30", 2, "Software\\Wine", "Value17", type);
8276 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8278 r = create_signature_table(hdb);
8279 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8281 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8282 r = add_signature_entry(hdb, str);
8283 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8285 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8286 r = add_signature_entry(hdb, str);
8287 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8289 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8290 r = add_signature_entry(hdb, str);
8291 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8293 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8294 r = add_signature_entry(hdb, str);
8295 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8297 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8298 r = add_signature_entry(hdb, str);
8299 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8301 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8302 r = add_signature_entry(hdb, str);
8303 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8305 ptr = strrchr(CURR_DIR, '\\') + 1;
8306 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8307 r = add_signature_entry(hdb, path);
8308 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8310 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8311 r = add_signature_entry(hdb, str);
8312 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8314 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8315 r = add_signature_entry(hdb, str);
8316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8318 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8319 r = add_signature_entry(hdb, str);
8320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8322 r = package_from_db(hdb, &hpkg);
8323 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8325 r = MsiDoAction(hpkg, "AppSearch");
8326 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8329 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8330 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8331 ok(!lstrcmpA(prop, "regszdata"),
8332 "Expected \"regszdata\", got \"%s\"\n", prop);
8335 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8337 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8340 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8341 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8342 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8344 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8345 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8347 /* Workaround for Win95 */
8349 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8351 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8352 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8355 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8358 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8359 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8360 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8361 ok(!lstrcmpA(pathdata, pathvar),
8362 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8364 HeapFree(GetProcessHeap(), 0, pathvar);
8365 HeapFree(GetProcessHeap(), 0, pathdata);
8368 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8371 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8374 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8378 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8379 "Expected \"\\0one\\0two\\0\\0\"\n");
8383 lstrcpyA(path, "#xCDAB3412EF907856");
8384 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8385 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8386 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8389 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8391 ok(!lstrcmpA(prop, "##regszdata"),
8392 "Expected \"##regszdata\", got \"%s\"\n", prop);
8395 sprintf(path, "%s\\FileName1", CURR_DIR);
8396 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8398 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8401 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8403 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8406 sprintf(path, "%s\\", CURR_DIR);
8407 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8409 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8412 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8414 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8417 sprintf(path, "%s\\", CURR_DIR);
8418 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8420 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8423 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8425 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8428 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8430 ok(!lstrcmpA(prop, "regszdata"),
8431 "Expected \"regszdata\", got \"%s\"\n", prop);
8434 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8436 ok(!lstrcmpA(prop, "regszdata"),
8437 "Expected \"regszdata\", got \"%s\"\n", prop);
8442 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8444 ok(!lstrcmpA(prop, "regszdata"),
8445 "Expected \"regszdata\", got \"%s\"\n", prop);
8449 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8451 ok(!lstrcmpA(prop, "defvalue"),
8452 "Expected \"defvalue\", got \"%s\"\n", prop);
8455 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8457 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8460 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8462 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8467 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8468 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8470 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8473 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8475 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8478 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8479 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8481 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8485 lstrcpyA(path, CURR_DIR);
8486 ptr = strrchr(path, '\\') + 1;
8488 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8490 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8493 sprintf(path, "%s\\", CURR_DIR);
8494 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8496 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8499 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8501 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8504 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8506 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8509 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8511 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8514 sprintf(path, "%s\\FileName1", CURR_DIR);
8515 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8517 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8520 sprintf(path, "%s\\FileName1", CURR_DIR);
8521 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8524 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8526 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8528 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8529 RegDeleteValueA(hklm, "Value1");
8530 RegDeleteValueA(hklm, "Value2");
8531 RegDeleteValueA(hklm, "Value3");
8532 RegDeleteValueA(hklm, "Value4");
8533 RegDeleteValueA(hklm, "Value5");
8534 RegDeleteValueA(hklm, "Value6");
8535 RegDeleteValueA(hklm, "Value7");
8536 RegDeleteValueA(hklm, "Value8");
8537 RegDeleteValueA(hklm, "Value9");
8538 RegDeleteValueA(hklm, "Value10");
8539 RegDeleteValueA(hklm, "Value11");
8540 RegDeleteValueA(hklm, "Value12");
8541 RegDeleteValueA(hklm, "Value13");
8542 RegDeleteValueA(hklm, "Value14");
8543 RegDeleteValueA(hklm, "Value15");
8544 RegDeleteValueA(hklm, "Value16");
8545 RegDeleteValueA(hklm, "Value17");
8546 RegDeleteKey(hklm, "");
8549 RegDeleteValueA(classes, "Value1");
8550 RegDeleteKeyA(classes, "");
8551 RegCloseKey(classes);
8553 RegDeleteValueA(hkcu, "Value1");
8554 RegDeleteKeyA(hkcu, "");
8557 RegDeleteValueA(users, "Value1");
8558 RegDeleteKeyA(users, "");
8561 DeleteFileA("FileName1");
8562 DeleteFileA("FileName3.dll");
8563 DeleteFileA("FileName4.dll");
8564 DeleteFileA("FileName5.dll");
8565 MsiCloseHandle(hpkg);
8566 DeleteFileA(msifile);
8569 static void delete_win_ini(LPCSTR file)
8571 CHAR path[MAX_PATH];
8573 GetWindowsDirectoryA(path, MAX_PATH);
8574 lstrcatA(path, "\\");
8575 lstrcatA(path, file);
8580 static void test_appsearch_inilocator(void)
8582 MSIHANDLE hpkg, hdb;
8583 CHAR path[MAX_PATH];
8584 CHAR prop[MAX_PATH];
8592 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8595 DeleteFileA("test.dll");
8597 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8599 create_test_file("FileName1");
8600 sprintf(path, "%s\\FileName1", CURR_DIR);
8601 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8603 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8605 sprintf(path, "%s\\IDontExist", CURR_DIR);
8606 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8608 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8609 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8610 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8612 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8613 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8614 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8616 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8617 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8618 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8620 hdb = create_package_db();
8621 ok(hdb, "Expected a valid database handle\n");
8623 r = create_appsearch_table(hdb);
8624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8626 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8629 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8632 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8635 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8638 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8641 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8644 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8647 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8650 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8653 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8656 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8659 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8662 r = create_inilocator_table(hdb);
8663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8665 /* msidbLocatorTypeRawValue, field 1 */
8666 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8667 r = add_inilocator_entry(hdb, str);
8668 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8670 /* msidbLocatorTypeRawValue, field 2 */
8671 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8672 r = add_inilocator_entry(hdb, str);
8673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8675 /* msidbLocatorTypeRawValue, entire field */
8676 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8677 r = add_inilocator_entry(hdb, str);
8678 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8680 /* msidbLocatorTypeFile */
8681 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8682 r = add_inilocator_entry(hdb, str);
8683 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8685 /* msidbLocatorTypeDirectory, file */
8686 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8687 r = add_inilocator_entry(hdb, str);
8688 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8690 /* msidbLocatorTypeDirectory, directory */
8691 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8692 r = add_inilocator_entry(hdb, str);
8693 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8695 /* msidbLocatorTypeFile, file, no signature */
8696 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8697 r = add_inilocator_entry(hdb, str);
8698 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8700 /* msidbLocatorTypeFile, dir, no signature */
8701 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8702 r = add_inilocator_entry(hdb, str);
8703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8705 /* msidbLocatorTypeFile, file does not exist */
8706 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8707 r = add_inilocator_entry(hdb, str);
8708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8710 /* msidbLocatorTypeFile, signature with version */
8711 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8712 r = add_inilocator_entry(hdb, str);
8713 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8715 /* msidbLocatorTypeFile, signature with version, ver > max */
8716 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8717 r = add_inilocator_entry(hdb, str);
8718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8720 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8721 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8722 r = add_inilocator_entry(hdb, str);
8723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8725 r = create_signature_table(hdb);
8726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8728 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8731 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8734 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8735 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8737 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8738 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8740 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8741 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8743 r = package_from_db(hdb, &hpkg);
8744 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8746 skip("Not enough rights to perform tests\n");
8749 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8751 r = MsiDoAction(hpkg, "AppSearch");
8752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8755 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8756 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8757 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
8760 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8762 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
8765 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8766 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8767 ok(!lstrcmpA(prop, "keydata,field2"),
8768 "Expected \"keydata,field2\", got \"%s\"\n", prop);
8771 sprintf(path, "%s\\FileName1", CURR_DIR);
8772 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8774 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8777 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8779 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8782 sprintf(path, "%s\\", CURR_DIR);
8783 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8784 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8785 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8788 sprintf(path, "%s\\", CURR_DIR);
8789 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8790 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8791 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8794 lstrcpyA(path, CURR_DIR);
8795 ptr = strrchr(path, '\\');
8797 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8799 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8802 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8804 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8809 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8810 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8811 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8812 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8815 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8816 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8817 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8820 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8821 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8823 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8826 MsiCloseHandle(hpkg);
8829 delete_win_ini("IniFile.ini");
8830 DeleteFileA("FileName1");
8831 DeleteFileA("FileName2.dll");
8832 DeleteFileA("FileName3.dll");
8833 DeleteFileA("FileName4.dll");
8834 DeleteFileA(msifile);
8838 * MSI AppSearch action on DrLocator table always returns absolute paths.
8839 * If a relative path was set, it returns the first absolute path that
8840 * matches or an empty string if it didn't find anything.
8841 * This helper function replicates this behaviour.
8843 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
8848 size = lstrlenA(relative);
8849 drives = GetLogicalDrives();
8850 lstrcpyA(absolute, "A:\\");
8851 for (i = 0; i < 26; absolute[0] = '\0', i++)
8853 if (!(drives & (1 << i)))
8856 absolute[0] = 'A' + i;
8857 if (GetDriveType(absolute) != DRIVE_FIXED)
8860 lstrcpynA(absolute + 3, relative, size + 1);
8861 attr = GetFileAttributesA(absolute);
8862 if (attr != INVALID_FILE_ATTRIBUTES &&
8863 (attr & FILE_ATTRIBUTE_DIRECTORY))
8865 if (absolute[3 + size - 1] != '\\')
8866 lstrcatA(absolute, "\\");
8873 static void test_appsearch_drlocator(void)
8875 MSIHANDLE hpkg, hdb;
8876 CHAR path[MAX_PATH];
8877 CHAR prop[MAX_PATH];
8884 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8887 DeleteFileA("test.dll");
8889 create_test_file("FileName1");
8890 CreateDirectoryA("one", NULL);
8891 CreateDirectoryA("one\\two", NULL);
8892 CreateDirectoryA("one\\two\\three", NULL);
8893 create_test_file("one\\two\\three\\FileName2");
8894 CreateDirectoryA("another", NULL);
8895 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8896 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8897 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8899 hdb = create_package_db();
8900 ok(hdb, "Expected a valid database handle\n");
8902 r = create_appsearch_table(hdb);
8903 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8905 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8906 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8908 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8909 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8911 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8914 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8915 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8917 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8918 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8920 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8921 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8923 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8924 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8926 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8927 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8929 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8930 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8932 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8933 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8935 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8936 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8938 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
8939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8941 r = create_drlocator_table(hdb);
8942 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8944 /* no parent, full path, depth 0, signature */
8945 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
8946 r = add_drlocator_entry(hdb, path);
8947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8949 /* no parent, full path, depth 0, no signature */
8950 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
8951 r = add_drlocator_entry(hdb, path);
8952 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8954 /* no parent, relative path, depth 0, no signature */
8955 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
8956 r = add_drlocator_entry(hdb, path);
8957 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8959 /* no parent, full path, depth 2, signature */
8960 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
8961 r = add_drlocator_entry(hdb, path);
8962 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8964 /* no parent, full path, depth 3, signature */
8965 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
8966 r = add_drlocator_entry(hdb, path);
8967 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8969 /* no parent, full path, depth 1, signature is dir */
8970 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
8971 r = add_drlocator_entry(hdb, path);
8972 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8974 /* parent is in DrLocator, relative path, depth 0, signature */
8975 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8976 r = add_drlocator_entry(hdb, path);
8977 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8979 /* no parent, full path, depth 0, signature w/ version */
8980 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
8981 r = add_drlocator_entry(hdb, path);
8982 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8984 /* no parent, full path, depth 0, signature w/ version, ver > max */
8985 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
8986 r = add_drlocator_entry(hdb, path);
8987 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8989 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8990 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
8991 r = add_drlocator_entry(hdb, path);
8992 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8994 /* no parent, relative empty path, depth 0, no signature */
8995 sprintf(path, "'NewSignature11', '', '', 0");
8996 r = add_drlocator_entry(hdb, path);
8997 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8999 r = create_reglocator_table(hdb);
9000 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9003 r = add_reglocator_entry(hdb, "NewSignature12", 2, "htmlfile\\shell\\open\\nonexistent", "", 1);
9004 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9006 /* parent is in RegLocator, no path, depth 0, no signature */
9007 sprintf(path, "'NewSignature13', 'NewSignature12', '', 0");
9008 r = add_drlocator_entry(hdb, path);
9009 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9011 r = create_signature_table(hdb);
9012 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9014 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9015 r = add_signature_entry(hdb, str);
9016 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9018 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9019 r = add_signature_entry(hdb, str);
9020 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9022 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9023 r = add_signature_entry(hdb, str);
9024 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9026 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9027 r = add_signature_entry(hdb, str);
9028 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9030 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9031 r = add_signature_entry(hdb, str);
9032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9034 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9035 r = add_signature_entry(hdb, str);
9036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9038 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9039 r = add_signature_entry(hdb, str);
9040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9042 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9043 r = add_signature_entry(hdb, str);
9044 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9046 r = package_from_db(hdb, &hpkg);
9047 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9049 skip("Not enough rights to perform tests\n");
9052 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9054 r = MsiDoAction(hpkg, "AppSearch");
9055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9058 sprintf(path, "%s\\FileName1", CURR_DIR);
9059 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9061 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9064 sprintf(path, "%s\\", CURR_DIR);
9065 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9067 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9070 search_absolute_directory(path, CURR_DIR + 3);
9071 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9073 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9076 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9078 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9081 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9082 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9083 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9084 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9087 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9088 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9089 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9092 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9093 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9094 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9095 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9100 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9101 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9103 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9106 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9108 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9111 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9112 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9113 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9117 search_absolute_directory(path, "");
9118 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9120 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9123 strcpy(path, "c:\\");
9124 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
9125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9126 ok(!prop[0], "Expected \"\", got \"%s\"\n", prop);
9128 MsiCloseHandle(hpkg);
9131 DeleteFileA("FileName1");
9132 DeleteFileA("FileName3.dll");
9133 DeleteFileA("FileName4.dll");
9134 DeleteFileA("FileName5.dll");
9135 DeleteFileA("one\\two\\three\\FileName2");
9136 RemoveDirectoryA("one\\two\\three");
9137 RemoveDirectoryA("one\\two");
9138 RemoveDirectoryA("one");
9139 RemoveDirectoryA("another");
9140 DeleteFileA(msifile);
9143 static void test_featureparents(void)
9148 INSTALLSTATE state, action;
9150 hdb = create_package_db();
9151 ok ( hdb, "failed to create package database\n" );
9153 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
9154 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
9156 r = create_feature_table( hdb );
9157 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
9159 r = create_component_table( hdb );
9160 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
9162 r = create_feature_components_table( hdb );
9163 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
9165 r = create_file_table( hdb );
9166 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
9168 /* msidbFeatureAttributesFavorLocal */
9169 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
9170 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9172 /* msidbFeatureAttributesFavorSource */
9173 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
9174 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9176 /* msidbFeatureAttributesFavorLocal */
9177 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
9178 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9180 /* disabled because of install level */
9181 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
9182 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9184 /* child feature of disabled feature */
9185 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9186 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9188 /* component of disabled feature (install level) */
9189 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9190 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9192 /* component of disabled child feature (install level) */
9193 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9194 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9196 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9197 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9198 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9200 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9201 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9202 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9204 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9205 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9206 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9208 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9209 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9210 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9212 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9213 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9214 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9216 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9217 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9218 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9220 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9221 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9222 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9224 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9225 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9226 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9228 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9229 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9231 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9232 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9234 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9235 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9237 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9238 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9240 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9241 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9243 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9244 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9246 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9247 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9249 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9250 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9252 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9253 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9255 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9256 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9258 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9259 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9261 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9262 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9264 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9265 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9267 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9268 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9270 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9271 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9273 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9274 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9276 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9277 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9279 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9280 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9282 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9283 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9285 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9286 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9288 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9289 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9291 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9292 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9294 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9295 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9297 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9298 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9300 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9301 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9303 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9304 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9306 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9307 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9309 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9310 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9312 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9313 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9315 r = package_from_db( hdb, &hpkg );
9316 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9318 skip("Not enough rights to perform tests\n");
9319 DeleteFile(msifile);
9322 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9324 MsiCloseHandle( hdb );
9326 r = MsiDoAction( hpkg, "CostInitialize");
9327 ok( r == ERROR_SUCCESS, "cost init failed\n");
9329 r = MsiDoAction( hpkg, "FileCost");
9330 ok( r == ERROR_SUCCESS, "file cost failed\n");
9332 r = MsiDoAction( hpkg, "CostFinalize");
9333 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9337 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9339 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9340 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9344 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9346 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9347 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9351 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9353 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9354 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9358 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9360 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9361 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9365 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9367 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9368 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9372 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9374 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9375 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9379 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9381 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9382 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9386 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9388 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9389 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9393 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9394 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9395 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9396 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9400 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9401 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9402 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9403 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9407 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9408 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9409 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9410 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9414 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9415 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9416 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9417 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9421 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9422 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9423 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9424 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9428 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9429 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9430 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9431 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9435 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9436 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9437 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9438 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9442 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9444 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9445 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9447 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9448 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9450 r = MsiSetFeatureState(hpkg, "nosuchfeature", INSTALLSTATE_ABSENT);
9451 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r);
9455 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9456 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9457 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9458 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9462 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9464 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9465 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9469 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9470 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9471 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9472 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9476 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9478 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9479 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9483 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9484 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9485 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9486 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9490 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9491 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9492 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9493 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9497 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9499 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9500 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9504 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9505 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9506 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9507 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9511 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9513 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9514 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9518 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9520 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9521 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9525 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9526 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9527 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9528 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9532 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9534 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9535 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9539 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9541 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9542 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9546 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9548 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9549 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9551 MsiCloseHandle(hpkg);
9552 DeleteFileA(msifile);
9555 static void test_installprops(void)
9557 MSIHANDLE hpkg, hdb;
9558 CHAR path[MAX_PATH], buf[MAX_PATH];
9564 REGSAM access = KEY_ALL_ACCESS;
9568 if (pIsWow64Process && pIsWow64Process(GetCurrentProcess(), &wow64) && wow64)
9569 access |= KEY_WOW64_64KEY;
9571 GetCurrentDirectory(MAX_PATH, path);
9572 lstrcat(path, "\\");
9573 lstrcat(path, msifile);
9575 hdb = create_package_db();
9576 ok( hdb, "failed to create database\n");
9578 r = package_from_db(hdb, &hpkg);
9579 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9581 skip("Not enough rights to perform tests\n");
9582 DeleteFile(msifile);
9585 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9587 MsiCloseHandle(hdb);
9590 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
9591 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9592 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9594 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
9595 RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
9600 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9604 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
9607 /* win9x doesn't set this */
9611 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
9612 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9613 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9619 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9623 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
9629 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
9630 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9631 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9635 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
9636 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9637 trace("VersionDatabase = %s\n", buf);
9640 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
9641 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9642 trace("VersionMsi = %s\n", buf);
9645 r = MsiGetProperty(hpkg, "Date", buf, &size);
9646 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9647 trace("Date = %s\n", buf);
9650 r = MsiGetProperty(hpkg, "Time", buf, &size);
9651 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9652 trace("Time = %s\n", buf);
9655 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
9656 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9657 trace("PackageCode = %s\n", buf);
9659 langid = GetUserDefaultLangID();
9660 sprintf(path, "%d", langid);
9663 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
9664 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9665 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
9667 res = GetSystemMetrics(SM_CXSCREEN);
9669 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
9670 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9672 res = GetSystemMetrics(SM_CYSCREEN);
9674 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
9675 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9679 pGetSystemInfo(&si);
9680 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
9684 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
9685 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9686 ok(buf[0], "property not set\n");
9690 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
9691 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9692 ok(buf[0], "property not set\n");
9696 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
9697 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9698 ok(buf[0], "property not set\n");
9704 MsiCloseHandle(hpkg);
9705 DeleteFile(msifile);
9708 static void test_launchconditions(void)
9714 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9716 hdb = create_package_db();
9717 ok( hdb, "failed to create package database\n" );
9719 r = create_launchcondition_table( hdb );
9720 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
9722 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
9723 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9725 /* invalid condition */
9726 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
9727 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9729 r = package_from_db( hdb, &hpkg );
9730 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9732 skip("Not enough rights to perform tests\n");
9733 DeleteFile(msifile);
9736 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9738 MsiCloseHandle( hdb );
9740 r = MsiSetProperty( hpkg, "X", "1" );
9741 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9743 /* invalid conditions are ignored */
9744 r = MsiDoAction( hpkg, "LaunchConditions" );
9745 ok( r == ERROR_SUCCESS, "cost init failed\n" );
9747 /* verify LaunchConditions still does some verification */
9748 r = MsiSetProperty( hpkg, "X", "2" );
9749 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9751 r = MsiDoAction( hpkg, "LaunchConditions" );
9752 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
9754 MsiCloseHandle( hpkg );
9755 DeleteFile( msifile );
9758 static void test_ccpsearch(void)
9760 MSIHANDLE hdb, hpkg;
9761 CHAR prop[MAX_PATH];
9762 DWORD size = MAX_PATH;
9765 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9767 hdb = create_package_db();
9768 ok(hdb, "failed to create package database\n");
9770 r = create_ccpsearch_table(hdb);
9771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9773 r = add_ccpsearch_entry(hdb, "'CCP_random'");
9774 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9776 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
9777 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9779 r = create_reglocator_table(hdb);
9780 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9782 r = add_reglocator_entry(hdb, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
9783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9785 r = create_drlocator_table(hdb);
9786 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9788 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
9789 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9791 r = create_signature_table(hdb);
9792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9794 r = package_from_db(hdb, &hpkg);
9795 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9797 skip("Not enough rights to perform tests\n");
9798 DeleteFile(msifile);
9801 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
9803 MsiCloseHandle(hdb);
9805 r = MsiDoAction(hpkg, "CCPSearch");
9806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9808 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
9809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9810 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
9812 MsiCloseHandle(hpkg);
9813 DeleteFileA(msifile);
9816 static void test_complocator(void)
9818 MSIHANDLE hdb, hpkg;
9820 CHAR prop[MAX_PATH];
9821 CHAR expected[MAX_PATH];
9822 DWORD size = MAX_PATH;
9824 hdb = create_package_db();
9825 ok(hdb, "failed to create package database\n");
9827 r = create_appsearch_table(hdb);
9828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9830 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
9831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9833 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
9834 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9836 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
9837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9839 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
9840 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9842 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
9843 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9845 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
9846 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9848 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
9849 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9851 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
9852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9854 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
9855 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9857 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
9858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9860 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
9861 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9863 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
9864 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9866 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
9867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9869 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
9870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9872 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
9873 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9875 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
9876 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9878 r = create_complocator_table(hdb);
9879 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9881 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9882 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9884 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9885 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9887 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9888 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9890 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9893 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9896 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9897 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9899 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9900 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9902 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9903 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9905 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9906 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9908 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9909 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9911 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9914 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9915 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9917 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9918 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9920 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9921 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9923 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9924 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9926 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9927 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9929 r = create_signature_table(hdb);
9930 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9932 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9933 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9935 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9936 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9938 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9941 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9942 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9944 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9945 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9947 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9948 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9950 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9951 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9953 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9954 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9956 r = package_from_db(hdb, &hpkg);
9957 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9959 skip("Not enough rights to perform tests\n");
9960 DeleteFile(msifile);
9963 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
9965 MsiCloseHandle(hdb);
9967 create_test_file("abelisaurus");
9968 create_test_file("bactrosaurus");
9969 create_test_file("camelotia");
9970 create_test_file("diclonius");
9971 create_test_file("echinodon");
9972 create_test_file("falcarius");
9973 create_test_file("gallimimus");
9974 create_test_file("hagryphus");
9975 CreateDirectoryA("iguanodon", NULL);
9976 CreateDirectoryA("jobaria", NULL);
9977 CreateDirectoryA("kakuru", NULL);
9978 CreateDirectoryA("labocania", NULL);
9979 CreateDirectoryA("megaraptor", NULL);
9980 CreateDirectoryA("neosodon", NULL);
9981 CreateDirectoryA("olorotitan", NULL);
9982 CreateDirectoryA("pantydraco", NULL);
9984 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
9985 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
9986 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
9987 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
9988 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
9989 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
9990 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
9991 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
9992 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
9993 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
9994 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
9995 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
9996 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
9997 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
9998 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
9999 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
10001 r = MsiDoAction(hpkg, "AppSearch");
10002 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10005 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
10006 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10008 lstrcpyA(expected, CURR_DIR);
10009 lstrcatA(expected, "\\abelisaurus");
10010 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10011 "Expected %s or empty string, got %s\n", expected, prop);
10014 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
10015 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10016 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10019 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
10020 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10021 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10024 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
10025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10026 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10029 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
10030 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10032 lstrcpyA(expected, CURR_DIR);
10033 lstrcatA(expected, "\\");
10034 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10035 "Expected %s or empty string, got %s\n", expected, prop);
10038 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
10039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10040 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10043 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
10044 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10045 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10048 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
10049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10050 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10053 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
10054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10055 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10058 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
10059 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10060 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10063 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
10064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10065 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10068 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
10069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10070 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10073 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
10074 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10076 lstrcpyA(expected, CURR_DIR);
10077 lstrcatA(expected, "\\");
10078 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10079 "Expected %s or empty string, got %s\n", expected, prop);
10082 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
10083 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10085 lstrcpyA(expected, CURR_DIR);
10086 lstrcatA(expected, "\\neosodon\\");
10087 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10088 "Expected %s or empty string, got %s\n", expected, prop);
10091 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
10092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10093 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10096 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
10097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10098 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10100 MsiCloseHandle(hpkg);
10101 DeleteFileA("abelisaurus");
10102 DeleteFileA("bactrosaurus");
10103 DeleteFileA("camelotia");
10104 DeleteFileA("diclonius");
10105 DeleteFileA("echinodon");
10106 DeleteFileA("falcarius");
10107 DeleteFileA("gallimimus");
10108 DeleteFileA("hagryphus");
10109 RemoveDirectoryA("iguanodon");
10110 RemoveDirectoryA("jobaria");
10111 RemoveDirectoryA("kakuru");
10112 RemoveDirectoryA("labocania");
10113 RemoveDirectoryA("megaraptor");
10114 RemoveDirectoryA("neosodon");
10115 RemoveDirectoryA("olorotitan");
10116 RemoveDirectoryA("pantydraco");
10117 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10118 MSIINSTALLCONTEXT_MACHINE, NULL);
10119 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10120 MSIINSTALLCONTEXT_MACHINE, NULL);
10121 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10122 MSIINSTALLCONTEXT_MACHINE, NULL);
10123 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10124 MSIINSTALLCONTEXT_MACHINE, NULL);
10125 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10126 MSIINSTALLCONTEXT_MACHINE, NULL);
10127 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10128 MSIINSTALLCONTEXT_MACHINE, NULL);
10129 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10130 MSIINSTALLCONTEXT_MACHINE, NULL);
10131 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10132 MSIINSTALLCONTEXT_MACHINE, NULL);
10133 DeleteFileA(msifile);
10136 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
10141 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
10142 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10144 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
10145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10147 r = MsiSummaryInfoPersist(summary);
10148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10150 MsiCloseHandle(summary);
10153 static void test_MsiGetSourcePath(void)
10155 MSIHANDLE hdb, hpkg;
10156 CHAR path[MAX_PATH];
10157 CHAR cwd[MAX_PATH];
10158 CHAR subsrc[MAX_PATH];
10159 CHAR sub2[MAX_PATH];
10163 lstrcpyA(cwd, CURR_DIR);
10164 lstrcatA(cwd, "\\");
10166 lstrcpyA(subsrc, cwd);
10167 lstrcatA(subsrc, "subsource");
10168 lstrcatA(subsrc, "\\");
10170 lstrcpyA(sub2, subsrc);
10171 lstrcatA(sub2, "sub2");
10172 lstrcatA(sub2, "\\");
10174 /* uncompressed source */
10176 hdb = create_package_db();
10177 ok( hdb, "failed to create database\n");
10179 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10181 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10182 ok(r == S_OK, "failed\n");
10184 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10185 ok(r == S_OK, "failed\n");
10187 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
10188 ok(r == S_OK, "failed\n");
10190 r = MsiDatabaseCommit(hdb);
10191 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
10193 r = package_from_db(hdb, &hpkg);
10194 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10196 skip("Not enough rights to perform tests\n");
10197 DeleteFile(msifile);
10200 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10202 MsiCloseHandle(hdb);
10204 /* invalid database handle */
10206 lstrcpyA(path, "kiwi");
10207 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
10208 ok(r == ERROR_INVALID_HANDLE,
10209 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
10210 ok(!lstrcmpA(path, "kiwi"),
10211 "Expected path to be unchanged, got \"%s\"\n", path);
10212 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10214 /* NULL szFolder */
10216 lstrcpyA(path, "kiwi");
10217 r = MsiGetSourcePath(hpkg, NULL, path, &size);
10218 ok(r == ERROR_INVALID_PARAMETER,
10219 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10220 ok(!lstrcmpA(path, "kiwi"),
10221 "Expected path to be unchanged, got \"%s\"\n", path);
10222 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10224 /* empty szFolder */
10226 lstrcpyA(path, "kiwi");
10227 r = MsiGetSourcePath(hpkg, "", path, &size);
10228 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10229 ok(!lstrcmpA(path, "kiwi"),
10230 "Expected path to be unchanged, got \"%s\"\n", path);
10231 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10233 /* try TARGETDIR */
10235 lstrcpyA(path, "kiwi");
10236 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10237 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10238 ok(!lstrcmpA(path, "kiwi"),
10239 "Expected path to be unchanged, got \"%s\"\n", path);
10240 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10243 lstrcpyA(path, "kiwi");
10244 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10245 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10246 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10247 ok(size == 0, "Expected 0, got %d\n", size);
10250 lstrcpyA(path, "kiwi");
10251 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10252 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10253 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10254 ok(size == 0, "Expected 0, got %d\n", size);
10256 /* try SourceDir */
10258 lstrcpyA(path, "kiwi");
10259 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10260 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10261 ok(!lstrcmpA(path, "kiwi"),
10262 "Expected path to be unchanged, got \"%s\"\n", path);
10263 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10265 /* try SOURCEDIR */
10267 lstrcpyA(path, "kiwi");
10268 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10269 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10270 ok(!lstrcmpA(path, "kiwi"),
10271 "Expected path to be unchanged, got \"%s\"\n", path);
10272 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10274 /* source path does not exist, but the property exists */
10276 lstrcpyA(path, "kiwi");
10277 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10278 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10279 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10280 ok(size == 0, "Expected 0, got %d\n", size);
10283 lstrcpyA(path, "kiwi");
10284 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10285 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10286 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10287 ok(size == 0, "Expected 0, got %d\n", size);
10291 lstrcpyA(path, "kiwi");
10292 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10293 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10294 ok(!lstrcmpA(path, "kiwi"),
10295 "Expected path to be unchanged, got \"%s\"\n", path);
10296 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10300 lstrcpyA(path, "kiwi");
10301 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10302 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10303 ok(!lstrcmpA(path, "kiwi"),
10304 "Expected path to be unchanged, got \"%s\"\n", path);
10305 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10307 r = MsiDoAction(hpkg, "CostInitialize");
10308 ok(r == ERROR_SUCCESS, "cost init failed\n");
10310 /* try TARGETDIR after CostInitialize */
10312 lstrcpyA(path, "kiwi");
10313 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10314 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10315 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10316 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10318 /* try SourceDir after CostInitialize */
10320 lstrcpyA(path, "kiwi");
10321 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10323 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10324 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10326 /* try SOURCEDIR after CostInitialize */
10328 lstrcpyA(path, "kiwi");
10329 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10330 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10331 ok(!lstrcmpA(path, "kiwi"),
10332 "Expected path to be unchanged, got \"%s\"\n", path);
10333 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10335 /* source path does not exist, but the property exists */
10337 lstrcpyA(path, "kiwi");
10338 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10342 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10343 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10346 /* try SubDir after CostInitialize */
10348 lstrcpyA(path, "kiwi");
10349 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10350 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10351 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10352 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10354 /* try SubDir2 after CostInitialize */
10356 lstrcpyA(path, "kiwi");
10357 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10358 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10359 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10360 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10362 r = MsiDoAction(hpkg, "ResolveSource");
10363 ok(r == ERROR_SUCCESS, "file cost failed\n");
10365 /* try TARGETDIR after ResolveSource */
10367 lstrcpyA(path, "kiwi");
10368 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10370 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10371 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10373 /* try SourceDir after ResolveSource */
10375 lstrcpyA(path, "kiwi");
10376 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10378 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10379 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10381 /* try SOURCEDIR after ResolveSource */
10383 lstrcpyA(path, "kiwi");
10384 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10385 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10386 ok(!lstrcmpA(path, "kiwi"),
10387 "Expected path to be unchanged, got \"%s\"\n", path);
10388 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10390 /* source path does not exist, but the property exists */
10392 lstrcpyA(path, "kiwi");
10393 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10394 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10395 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10396 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10398 /* try SubDir after ResolveSource */
10400 lstrcpyA(path, "kiwi");
10401 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10403 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10404 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10406 /* try SubDir2 after ResolveSource */
10408 lstrcpyA(path, "kiwi");
10409 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10410 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10411 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10412 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10414 r = MsiDoAction(hpkg, "FileCost");
10415 ok(r == ERROR_SUCCESS, "file cost failed\n");
10417 /* try TARGETDIR after FileCost */
10419 lstrcpyA(path, "kiwi");
10420 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10422 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10423 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10425 /* try SourceDir after FileCost */
10427 lstrcpyA(path, "kiwi");
10428 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10430 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10431 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10433 /* try SOURCEDIR after FileCost */
10435 lstrcpyA(path, "kiwi");
10436 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10437 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10438 ok(!lstrcmpA(path, "kiwi"),
10439 "Expected path to be unchanged, got \"%s\"\n", path);
10440 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10442 /* source path does not exist, but the property exists */
10444 lstrcpyA(path, "kiwi");
10445 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10447 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10448 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10450 /* try SubDir after FileCost */
10452 lstrcpyA(path, "kiwi");
10453 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10455 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10456 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10458 /* try SubDir2 after FileCost */
10460 lstrcpyA(path, "kiwi");
10461 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10463 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10464 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10466 r = MsiDoAction(hpkg, "CostFinalize");
10467 ok(r == ERROR_SUCCESS, "file cost failed\n");
10469 /* try TARGETDIR after CostFinalize */
10471 lstrcpyA(path, "kiwi");
10472 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10474 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10475 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10477 /* try SourceDir after CostFinalize */
10479 lstrcpyA(path, "kiwi");
10480 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10482 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10483 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10485 /* try SOURCEDIR after CostFinalize */
10487 lstrcpyA(path, "kiwi");
10488 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10489 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10490 ok(!lstrcmpA(path, "kiwi"),
10491 "Expected path to be unchanged, got \"%s\"\n", path);
10492 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10494 /* source path does not exist, but the property exists */
10496 lstrcpyA(path, "kiwi");
10497 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10499 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10500 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10502 /* try SubDir after CostFinalize */
10504 lstrcpyA(path, "kiwi");
10505 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10507 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10508 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10510 /* try SubDir2 after CostFinalize */
10512 lstrcpyA(path, "kiwi");
10513 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10515 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10516 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10518 /* nonexistent directory */
10520 lstrcpyA(path, "kiwi");
10521 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
10522 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10523 ok(!lstrcmpA(path, "kiwi"),
10524 "Expected path to be unchanged, got \"%s\"\n", path);
10525 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10527 /* NULL szPathBuf */
10529 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
10530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10531 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10533 /* NULL pcchPathBuf */
10534 lstrcpyA(path, "kiwi");
10535 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
10536 ok(r == ERROR_INVALID_PARAMETER,
10537 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10538 ok(!lstrcmpA(path, "kiwi"),
10539 "Expected path to be unchanged, got \"%s\"\n", path);
10541 /* pcchPathBuf is 0 */
10543 lstrcpyA(path, "kiwi");
10544 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10545 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10546 ok(!lstrcmpA(path, "kiwi"),
10547 "Expected path to be unchanged, got \"%s\"\n", path);
10548 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10550 /* pcchPathBuf does not have room for NULL terminator */
10551 size = lstrlenA(cwd);
10552 lstrcpyA(path, "kiwi");
10553 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10554 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10555 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
10556 "Expected path with no backslash, got \"%s\"\n", path);
10557 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10559 /* pcchPathBuf has room for NULL terminator */
10560 size = lstrlenA(cwd) + 1;
10561 lstrcpyA(path, "kiwi");
10562 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10563 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10564 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10565 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10567 /* remove property */
10568 r = MsiSetProperty(hpkg, "SourceDir", NULL);
10569 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10571 /* try SourceDir again */
10573 lstrcpyA(path, "kiwi");
10574 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10576 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10577 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10579 /* set property to a valid directory */
10580 r = MsiSetProperty(hpkg, "SOURCEDIR", cwd);
10581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10583 /* try SOURCEDIR again */
10585 lstrcpyA(path, "kiwi");
10586 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10587 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10588 ok(!lstrcmpA(path, "kiwi"),
10589 "Expected path to be unchanged, got \"%s\"\n", path);
10590 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10592 MsiCloseHandle(hpkg);
10594 /* compressed source */
10596 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10599 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
10601 r = package_from_db(hdb, &hpkg);
10602 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10604 /* try TARGETDIR */
10606 lstrcpyA(path, "kiwi");
10607 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10608 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10609 ok(!lstrcmpA(path, "kiwi"),
10610 "Expected path to be unchanged, got \"%s\"\n", path);
10611 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10613 /* try SourceDir */
10615 lstrcpyA(path, "kiwi");
10616 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10617 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10618 ok(!lstrcmpA(path, "kiwi"),
10619 "Expected path to be unchanged, got \"%s\"\n", path);
10620 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10622 /* try SOURCEDIR */
10624 lstrcpyA(path, "kiwi");
10625 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10626 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10627 ok(!lstrcmpA(path, "kiwi"),
10628 "Expected path to be unchanged, got \"%s\"\n", path);
10629 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10631 /* source path nor the property exist */
10633 lstrcpyA(path, "kiwi");
10634 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10635 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10636 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10637 ok(size == 0, "Expected 0, got %d\n", size);
10641 lstrcpyA(path, "kiwi");
10642 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10643 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10644 ok(!lstrcmpA(path, "kiwi"),
10645 "Expected path to be unchanged, got \"%s\"\n", path);
10646 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10650 lstrcpyA(path, "kiwi");
10651 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10652 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10653 ok(!lstrcmpA(path, "kiwi"),
10654 "Expected path to be unchanged, got \"%s\"\n", path);
10655 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10657 r = MsiDoAction(hpkg, "CostInitialize");
10658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10660 /* try TARGETDIR after CostInitialize */
10662 lstrcpyA(path, "kiwi");
10663 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10664 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10665 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10666 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10668 /* try SourceDir after CostInitialize */
10670 lstrcpyA(path, "kiwi");
10671 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10672 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10673 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10674 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10676 /* try SOURCEDIR after CostInitialize */
10678 lstrcpyA(path, "kiwi");
10679 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10683 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10684 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10687 /* source path does not exist, but the property exists */
10689 lstrcpyA(path, "kiwi");
10690 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10691 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10694 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10695 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10698 /* try SubDir after CostInitialize */
10700 lstrcpyA(path, "kiwi");
10701 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10702 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10703 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10704 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10706 /* try SubDir2 after CostInitialize */
10708 lstrcpyA(path, "kiwi");
10709 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10710 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10711 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10712 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10714 r = MsiDoAction(hpkg, "ResolveSource");
10715 ok(r == ERROR_SUCCESS, "file cost failed\n");
10717 /* try TARGETDIR after ResolveSource */
10719 lstrcpyA(path, "kiwi");
10720 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10721 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10722 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10723 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10725 /* try SourceDir after ResolveSource */
10727 lstrcpyA(path, "kiwi");
10728 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10730 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10731 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10733 /* try SOURCEDIR after ResolveSource */
10735 lstrcpyA(path, "kiwi");
10736 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10739 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10740 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10741 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10744 /* source path and the property exist */
10746 lstrcpyA(path, "kiwi");
10747 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10748 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10749 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10750 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10752 /* try SubDir after ResolveSource */
10754 lstrcpyA(path, "kiwi");
10755 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10756 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10757 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10758 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10760 /* try SubDir2 after ResolveSource */
10762 lstrcpyA(path, "kiwi");
10763 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10764 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10765 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10766 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10768 r = MsiDoAction(hpkg, "FileCost");
10769 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10771 /* try TARGETDIR after CostFinalize */
10773 lstrcpyA(path, "kiwi");
10774 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10775 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10776 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10777 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10779 /* try SourceDir after CostFinalize */
10781 lstrcpyA(path, "kiwi");
10782 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10784 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10785 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10787 /* try SOURCEDIR after CostFinalize */
10789 lstrcpyA(path, "kiwi");
10790 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10794 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10795 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10798 /* source path and the property exist */
10800 lstrcpyA(path, "kiwi");
10801 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10803 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10804 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10806 /* try SubDir after CostFinalize */
10808 lstrcpyA(path, "kiwi");
10809 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10811 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10812 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10814 /* try SubDir2 after CostFinalize */
10816 lstrcpyA(path, "kiwi");
10817 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10819 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10820 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10822 r = MsiDoAction(hpkg, "CostFinalize");
10823 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10825 /* try TARGETDIR after CostFinalize */
10827 lstrcpyA(path, "kiwi");
10828 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10829 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10830 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10831 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10833 /* try SourceDir after CostFinalize */
10835 lstrcpyA(path, "kiwi");
10836 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10838 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10839 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10841 /* try SOURCEDIR after CostFinalize */
10843 lstrcpyA(path, "kiwi");
10844 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10847 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10848 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10849 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10852 /* source path and the property exist */
10854 lstrcpyA(path, "kiwi");
10855 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10856 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10857 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10858 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10860 /* try SubDir after CostFinalize */
10862 lstrcpyA(path, "kiwi");
10863 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10864 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10865 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10866 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10868 /* try SubDir2 after CostFinalize */
10870 lstrcpyA(path, "kiwi");
10871 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10872 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10873 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10874 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10876 MsiCloseHandle(hpkg);
10877 DeleteFile(msifile);
10880 static void test_shortlongsource(void)
10882 MSIHANDLE hdb, hpkg;
10883 CHAR path[MAX_PATH];
10884 CHAR cwd[MAX_PATH];
10885 CHAR subsrc[MAX_PATH];
10889 lstrcpyA(cwd, CURR_DIR);
10890 lstrcatA(cwd, "\\");
10892 lstrcpyA(subsrc, cwd);
10893 lstrcatA(subsrc, "long");
10894 lstrcatA(subsrc, "\\");
10896 /* long file names */
10898 hdb = create_package_db();
10899 ok( hdb, "failed to create database\n");
10901 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10903 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10904 ok(r == S_OK, "failed\n");
10906 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
10907 ok(r == S_OK, "failed\n");
10909 /* CostInitialize:short */
10910 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
10911 ok(r == S_OK, "failed\n");
10913 /* CostInitialize:long */
10914 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
10915 ok(r == S_OK, "failed\n");
10917 /* FileCost:short */
10918 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
10919 ok(r == S_OK, "failed\n");
10921 /* FileCost:long */
10922 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
10923 ok(r == S_OK, "failed\n");
10925 /* CostFinalize:short */
10926 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
10927 ok(r == S_OK, "failed\n");
10929 /* CostFinalize:long */
10930 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
10931 ok(r == S_OK, "failed\n");
10933 MsiDatabaseCommit(hdb);
10935 r = package_from_db(hdb, &hpkg);
10936 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10938 skip("Not enough rights to perform tests\n");
10939 DeleteFile(msifile);
10942 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10944 MsiCloseHandle(hdb);
10946 CreateDirectoryA("one", NULL);
10947 CreateDirectoryA("four", NULL);
10949 r = MsiDoAction(hpkg, "CostInitialize");
10950 ok(r == ERROR_SUCCESS, "file cost failed\n");
10952 CreateDirectory("five", NULL);
10953 CreateDirectory("eight", NULL);
10955 r = MsiDoAction(hpkg, "FileCost");
10956 ok(r == ERROR_SUCCESS, "file cost failed\n");
10958 CreateDirectory("nine", NULL);
10959 CreateDirectory("twelve", NULL);
10961 r = MsiDoAction(hpkg, "CostFinalize");
10962 ok(r == ERROR_SUCCESS, "file cost failed\n");
10964 /* neither short nor long source directories exist */
10966 lstrcpyA(path, "kiwi");
10967 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10968 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10969 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10970 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10972 CreateDirectoryA("short", NULL);
10974 /* short source directory exists */
10976 lstrcpyA(path, "kiwi");
10977 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10978 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10979 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10980 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10982 CreateDirectoryA("long", NULL);
10984 /* both short and long source directories exist */
10986 lstrcpyA(path, "kiwi");
10987 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10988 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10989 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10990 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10992 lstrcpyA(subsrc, cwd);
10993 lstrcatA(subsrc, "two");
10994 lstrcatA(subsrc, "\\");
10996 /* short dir exists before CostInitialize */
10998 lstrcpyA(path, "kiwi");
10999 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11000 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11001 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11002 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11004 lstrcpyA(subsrc, cwd);
11005 lstrcatA(subsrc, "four");
11006 lstrcatA(subsrc, "\\");
11008 /* long dir exists before CostInitialize */
11010 lstrcpyA(path, "kiwi");
11011 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11012 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11013 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11014 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11016 lstrcpyA(subsrc, cwd);
11017 lstrcatA(subsrc, "six");
11018 lstrcatA(subsrc, "\\");
11020 /* short dir exists before FileCost */
11022 lstrcpyA(path, "kiwi");
11023 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11024 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11025 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11026 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11028 lstrcpyA(subsrc, cwd);
11029 lstrcatA(subsrc, "eight");
11030 lstrcatA(subsrc, "\\");
11032 /* long dir exists before FileCost */
11034 lstrcpyA(path, "kiwi");
11035 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11037 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11038 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11040 lstrcpyA(subsrc, cwd);
11041 lstrcatA(subsrc, "ten");
11042 lstrcatA(subsrc, "\\");
11044 /* short dir exists before CostFinalize */
11046 lstrcpyA(path, "kiwi");
11047 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11048 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11049 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11050 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11052 lstrcpyA(subsrc, cwd);
11053 lstrcatA(subsrc, "twelve");
11054 lstrcatA(subsrc, "\\");
11056 /* long dir exists before CostFinalize */
11058 lstrcpyA(path, "kiwi");
11059 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11061 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11062 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11064 MsiCloseHandle(hpkg);
11065 RemoveDirectoryA("short");
11066 RemoveDirectoryA("long");
11067 RemoveDirectoryA("one");
11068 RemoveDirectoryA("four");
11069 RemoveDirectoryA("five");
11070 RemoveDirectoryA("eight");
11071 RemoveDirectoryA("nine");
11072 RemoveDirectoryA("twelve");
11074 /* short file names */
11076 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11079 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
11081 r = package_from_db(hdb, &hpkg);
11082 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11084 MsiCloseHandle(hdb);
11086 CreateDirectoryA("one", NULL);
11087 CreateDirectoryA("four", NULL);
11089 r = MsiDoAction(hpkg, "CostInitialize");
11090 ok(r == ERROR_SUCCESS, "file cost failed\n");
11092 CreateDirectory("five", NULL);
11093 CreateDirectory("eight", NULL);
11095 r = MsiDoAction(hpkg, "FileCost");
11096 ok(r == ERROR_SUCCESS, "file cost failed\n");
11098 CreateDirectory("nine", NULL);
11099 CreateDirectory("twelve", NULL);
11101 r = MsiDoAction(hpkg, "CostFinalize");
11102 ok(r == ERROR_SUCCESS, "file cost failed\n");
11104 lstrcpyA(subsrc, cwd);
11105 lstrcatA(subsrc, "short");
11106 lstrcatA(subsrc, "\\");
11108 /* neither short nor long source directories exist */
11110 lstrcpyA(path, "kiwi");
11111 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11112 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11113 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11114 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11116 CreateDirectoryA("short", NULL);
11118 /* short source directory exists */
11120 lstrcpyA(path, "kiwi");
11121 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11122 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11123 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11124 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11126 CreateDirectoryA("long", NULL);
11128 /* both short and long source directories exist */
11130 lstrcpyA(path, "kiwi");
11131 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11132 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11133 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11134 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11136 lstrcpyA(subsrc, cwd);
11137 lstrcatA(subsrc, "one");
11138 lstrcatA(subsrc, "\\");
11140 /* short dir exists before CostInitialize */
11142 lstrcpyA(path, "kiwi");
11143 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11144 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11145 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11146 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11148 lstrcpyA(subsrc, cwd);
11149 lstrcatA(subsrc, "three");
11150 lstrcatA(subsrc, "\\");
11152 /* long dir exists before CostInitialize */
11154 lstrcpyA(path, "kiwi");
11155 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11157 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11158 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11160 lstrcpyA(subsrc, cwd);
11161 lstrcatA(subsrc, "five");
11162 lstrcatA(subsrc, "\\");
11164 /* short dir exists before FileCost */
11166 lstrcpyA(path, "kiwi");
11167 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11169 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11170 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11172 lstrcpyA(subsrc, cwd);
11173 lstrcatA(subsrc, "seven");
11174 lstrcatA(subsrc, "\\");
11176 /* long dir exists before FileCost */
11178 lstrcpyA(path, "kiwi");
11179 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11181 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11182 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11184 lstrcpyA(subsrc, cwd);
11185 lstrcatA(subsrc, "nine");
11186 lstrcatA(subsrc, "\\");
11188 /* short dir exists before CostFinalize */
11190 lstrcpyA(path, "kiwi");
11191 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11192 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11193 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11194 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11196 lstrcpyA(subsrc, cwd);
11197 lstrcatA(subsrc, "eleven");
11198 lstrcatA(subsrc, "\\");
11200 /* long dir exists before CostFinalize */
11202 lstrcpyA(path, "kiwi");
11203 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11204 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11205 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11206 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11208 MsiCloseHandle(hpkg);
11209 RemoveDirectoryA("short");
11210 RemoveDirectoryA("long");
11211 RemoveDirectoryA("one");
11212 RemoveDirectoryA("four");
11213 RemoveDirectoryA("five");
11214 RemoveDirectoryA("eight");
11215 RemoveDirectoryA("nine");
11216 RemoveDirectoryA("twelve");
11217 DeleteFileA(msifile);
11220 static void test_sourcedir(void)
11222 MSIHANDLE hdb, hpkg;
11224 CHAR path[MAX_PATH];
11225 CHAR cwd[MAX_PATH];
11226 CHAR subsrc[MAX_PATH];
11230 lstrcpyA(cwd, CURR_DIR);
11231 lstrcatA(cwd, "\\");
11233 lstrcpyA(subsrc, cwd);
11234 lstrcatA(subsrc, "long");
11235 lstrcatA(subsrc, "\\");
11237 hdb = create_package_db();
11238 ok( hdb, "failed to create database\n");
11240 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11241 ok(r == S_OK, "failed\n");
11243 sprintf(package, "#%u", hdb);
11244 r = MsiOpenPackage(package, &hpkg);
11245 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11247 skip("Not enough rights to perform tests\n");
11250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11252 /* properties only */
11254 /* SourceDir prop */
11256 lstrcpyA(path, "kiwi");
11257 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11258 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11259 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11260 ok(size == 0, "Expected 0, got %d\n", size);
11262 /* SOURCEDIR prop */
11264 lstrcpyA(path, "kiwi");
11265 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11266 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11267 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11268 ok(size == 0, "Expected 0, got %d\n", size);
11270 r = MsiDoAction(hpkg, "CostInitialize");
11271 ok(r == ERROR_SUCCESS, "file cost failed\n");
11273 /* SourceDir after CostInitialize */
11275 lstrcpyA(path, "kiwi");
11276 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11277 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11278 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11279 ok(size == 0, "Expected 0, got %d\n", size);
11281 /* SOURCEDIR after CostInitialize */
11283 lstrcpyA(path, "kiwi");
11284 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11285 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11286 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11287 ok(size == 0, "Expected 0, got %d\n", size);
11289 r = MsiDoAction(hpkg, "FileCost");
11290 ok(r == ERROR_SUCCESS, "file cost failed\n");
11292 /* SourceDir after FileCost */
11294 lstrcpyA(path, "kiwi");
11295 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11296 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11297 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11298 ok(size == 0, "Expected 0, got %d\n", size);
11300 /* SOURCEDIR after FileCost */
11302 lstrcpyA(path, "kiwi");
11303 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11304 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11305 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11306 ok(size == 0, "Expected 0, got %d\n", size);
11308 r = MsiDoAction(hpkg, "CostFinalize");
11309 ok(r == ERROR_SUCCESS, "file cost failed\n");
11311 /* SourceDir after CostFinalize */
11313 lstrcpyA(path, "kiwi");
11314 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11315 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11316 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11317 ok(size == 0, "Expected 0, got %d\n", size);
11319 /* SOURCEDIR after CostFinalize */
11321 lstrcpyA(path, "kiwi");
11322 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11323 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11324 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11325 ok(size == 0, "Expected 0, got %d\n", size);
11327 r = MsiDoAction(hpkg, "ResolveSource");
11328 ok(r == ERROR_SUCCESS, "file cost failed\n");
11330 /* SourceDir after ResolveSource */
11332 lstrcpyA(path, "kiwi");
11333 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11334 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11335 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11336 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11338 /* SOURCEDIR after ResolveSource */
11340 lstrcpyA(path, "kiwi");
11341 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11342 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11343 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11344 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11346 /* random casing */
11348 lstrcpyA(path, "kiwi");
11349 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
11350 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11351 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11352 ok(size == 0, "Expected 0, got %d\n", size);
11354 MsiCloseHandle(hpkg);
11356 /* reset the package state */
11357 sprintf(package, "#%i", hdb);
11358 r = MsiOpenPackage(package, &hpkg);
11359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11361 /* test how MsiGetSourcePath affects the properties */
11363 /* SourceDir prop */
11365 lstrcpyA(path, "kiwi");
11366 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11370 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11371 ok(size == 0, "Expected 0, got %d\n", size);
11375 lstrcpyA(path, "kiwi");
11376 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11377 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11378 ok(!lstrcmpA(path, "kiwi"),
11379 "Expected path to be unchanged, got \"%s\"\n", path);
11380 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11382 /* SourceDir after MsiGetSourcePath */
11384 lstrcpyA(path, "kiwi");
11385 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11389 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11390 ok(size == 0, "Expected 0, got %d\n", size);
11393 /* SOURCEDIR prop */
11395 lstrcpyA(path, "kiwi");
11396 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11400 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11401 ok(size == 0, "Expected 0, got %d\n", size);
11405 lstrcpyA(path, "kiwi");
11406 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11407 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11408 ok(!lstrcmpA(path, "kiwi"),
11409 "Expected path to be unchanged, got \"%s\"\n", path);
11410 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11412 /* SOURCEDIR prop after MsiGetSourcePath */
11414 lstrcpyA(path, "kiwi");
11415 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11419 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11420 ok(size == 0, "Expected 0, got %d\n", size);
11423 r = MsiDoAction(hpkg, "CostInitialize");
11424 ok(r == ERROR_SUCCESS, "file cost failed\n");
11426 /* SourceDir after CostInitialize */
11428 lstrcpyA(path, "kiwi");
11429 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11433 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11434 ok(size == 0, "Expected 0, got %d\n", size);
11438 lstrcpyA(path, "kiwi");
11439 r = MsiGetSourcePath(hpkg, "SourceDir", 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 /* SourceDir after MsiGetSourcePath */
11446 lstrcpyA(path, "kiwi");
11447 r = MsiGetProperty(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 /* SOURCEDIR after CostInitialize */
11454 lstrcpyA(path, "kiwi");
11455 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11457 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11458 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11460 /* SOURCEDIR source path still does not exist */
11462 lstrcpyA(path, "kiwi");
11463 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11464 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11465 ok(!lstrcmpA(path, "kiwi"),
11466 "Expected path to be unchanged, got \"%s\"\n", path);
11467 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11469 r = MsiDoAction(hpkg, "FileCost");
11470 ok(r == ERROR_SUCCESS, "file cost failed\n");
11472 /* SourceDir after FileCost */
11474 lstrcpyA(path, "kiwi");
11475 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11476 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11477 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11478 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11480 /* SOURCEDIR after FileCost */
11482 lstrcpyA(path, "kiwi");
11483 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11485 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11486 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11488 /* SOURCEDIR source path still does not exist */
11490 lstrcpyA(path, "kiwi");
11491 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11492 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11493 ok(!lstrcmpA(path, "kiwi"),
11494 "Expected path to be unchanged, got \"%s\"\n", path);
11495 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11497 r = MsiDoAction(hpkg, "CostFinalize");
11498 ok(r == ERROR_SUCCESS, "file cost failed\n");
11500 /* SourceDir after CostFinalize */
11502 lstrcpyA(path, "kiwi");
11503 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11505 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11506 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11508 /* SOURCEDIR after CostFinalize */
11510 lstrcpyA(path, "kiwi");
11511 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11512 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11513 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11514 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11516 /* SOURCEDIR source path still does not exist */
11518 lstrcpyA(path, "kiwi");
11519 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11520 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11521 ok(!lstrcmpA(path, "kiwi"),
11522 "Expected path to be unchanged, got \"%s\"\n", path);
11523 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11525 r = MsiDoAction(hpkg, "ResolveSource");
11526 ok(r == ERROR_SUCCESS, "file cost failed\n");
11528 /* SourceDir after ResolveSource */
11530 lstrcpyA(path, "kiwi");
11531 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11533 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11534 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11536 /* SOURCEDIR after ResolveSource */
11538 lstrcpyA(path, "kiwi");
11539 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11540 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11541 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11542 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11544 /* SOURCEDIR source path still does not exist */
11546 lstrcpyA(path, "kiwi");
11547 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11548 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11549 ok(!lstrcmpA(path, "kiwi"),
11550 "Expected path to be unchanged, got \"%s\"\n", path);
11551 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11553 MsiCloseHandle(hpkg);
11556 MsiCloseHandle(hdb);
11557 DeleteFileA(msifile);
11567 static const struct access_res create[16] =
11569 { TRUE, ERROR_SUCCESS, TRUE },
11570 { TRUE, ERROR_SUCCESS, TRUE },
11571 { TRUE, ERROR_SUCCESS, FALSE },
11572 { TRUE, ERROR_SUCCESS, FALSE },
11573 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11574 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11575 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11576 { TRUE, ERROR_SUCCESS, FALSE },
11577 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11578 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11579 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11580 { TRUE, ERROR_SUCCESS, TRUE },
11581 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11582 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11583 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11584 { TRUE, ERROR_SUCCESS, TRUE }
11587 static const struct access_res create_commit[16] =
11589 { TRUE, ERROR_SUCCESS, TRUE },
11590 { TRUE, ERROR_SUCCESS, TRUE },
11591 { TRUE, ERROR_SUCCESS, FALSE },
11592 { TRUE, ERROR_SUCCESS, FALSE },
11593 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11594 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11595 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11596 { TRUE, ERROR_SUCCESS, FALSE },
11597 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11598 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11599 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11600 { TRUE, ERROR_SUCCESS, TRUE },
11601 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11602 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11603 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11604 { TRUE, ERROR_SUCCESS, TRUE }
11607 static const struct access_res create_close[16] =
11609 { TRUE, ERROR_SUCCESS, FALSE },
11610 { TRUE, ERROR_SUCCESS, FALSE },
11611 { TRUE, ERROR_SUCCESS, FALSE },
11612 { TRUE, ERROR_SUCCESS, FALSE },
11613 { TRUE, ERROR_SUCCESS, FALSE },
11614 { TRUE, ERROR_SUCCESS, FALSE },
11615 { TRUE, ERROR_SUCCESS, FALSE },
11616 { TRUE, ERROR_SUCCESS, FALSE },
11617 { TRUE, ERROR_SUCCESS, FALSE },
11618 { TRUE, ERROR_SUCCESS, FALSE },
11619 { TRUE, ERROR_SUCCESS, FALSE },
11620 { TRUE, ERROR_SUCCESS, FALSE },
11621 { TRUE, ERROR_SUCCESS, FALSE },
11622 { TRUE, ERROR_SUCCESS, FALSE },
11623 { TRUE, ERROR_SUCCESS, FALSE },
11624 { TRUE, ERROR_SUCCESS }
11627 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
11629 DWORD access = 0, share = 0;
11634 for (i = 0; i < 4; i++)
11636 if (i == 0) access = 0;
11637 if (i == 1) access = GENERIC_READ;
11638 if (i == 2) access = GENERIC_WRITE;
11639 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
11641 for (j = 0; j < 4; j++)
11643 if (ares[idx].ignore)
11646 if (j == 0) share = 0;
11647 if (j == 1) share = FILE_SHARE_READ;
11648 if (j == 2) share = FILE_SHARE_WRITE;
11649 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
11651 SetLastError(0xdeadbeef);
11652 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
11653 FILE_ATTRIBUTE_NORMAL, 0);
11654 lasterr = GetLastError();
11656 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
11657 "(%d, handle, %d): Expected %d, got %d\n",
11658 line, idx, ares[idx].gothandle,
11659 (hfile != INVALID_HANDLE_VALUE));
11661 ok(lasterr == ares[idx].lasterr ||
11662 lasterr == 0xdeadbeef, /* win9x */
11663 "(%d, lasterr, %d): Expected %d, got %d\n",
11664 line, idx, ares[idx].lasterr, lasterr);
11666 CloseHandle(hfile);
11672 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
11674 static void test_access(void)
11679 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
11680 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11682 test_file_access(msifile, create);
11684 r = MsiDatabaseCommit(hdb);
11685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11687 test_file_access(msifile, create_commit);
11689 MsiCloseHandle(hdb);
11691 test_file_access(msifile, create_close);
11693 DeleteFileA(msifile);
11695 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
11696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11698 test_file_access(msifile, create);
11700 r = MsiDatabaseCommit(hdb);
11701 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11703 test_file_access(msifile, create_commit);
11705 MsiCloseHandle(hdb);
11707 test_file_access(msifile, create_close);
11709 DeleteFileA(msifile);
11712 static void test_emptypackage(void)
11714 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
11715 MSIHANDLE hview = 0, hrec = 0;
11716 MSICONDITION condition;
11717 CHAR buffer[MAX_PATH];
11721 r = MsiOpenPackageA("", &hpkg);
11722 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11724 skip("Not enough rights to perform tests\n");
11729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11732 hdb = MsiGetActiveDatabase(hpkg);
11735 ok(hdb != 0, "Expected a valid database handle\n");
11738 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
11741 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11743 r = MsiViewExecute(hview, 0);
11746 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11749 r = MsiViewFetch(hview, &hrec);
11752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11757 r = MsiRecordGetString(hrec, 1, buffer, &size);
11760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11761 ok(!lstrcmpA(buffer, "_Property"),
11762 "Expected \"_Property\", got \"%s\"\n", buffer);
11765 MsiCloseHandle(hrec);
11767 r = MsiViewFetch(hview, &hrec);
11770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11774 r = MsiRecordGetString(hrec, 1, buffer, &size);
11777 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11778 ok(!lstrcmpA(buffer, "#_FolderCache"),
11779 "Expected \"_Property\", got \"%s\"\n", buffer);
11782 MsiCloseHandle(hrec);
11783 MsiViewClose(hview);
11784 MsiCloseHandle(hview);
11786 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
11789 ok(condition == MSICONDITION_FALSE,
11790 "Expected MSICONDITION_FALSE, got %d\n", condition);
11793 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
11796 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11798 r = MsiViewExecute(hview, 0);
11801 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11804 /* _Property table is not empty */
11805 r = MsiViewFetch(hview, &hrec);
11808 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11811 MsiCloseHandle(hrec);
11812 MsiViewClose(hview);
11813 MsiCloseHandle(hview);
11815 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
11818 ok(condition == MSICONDITION_FALSE,
11819 "Expected MSICONDITION_FALSE, got %d\n", condition);
11822 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
11825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11827 r = MsiViewExecute(hview, 0);
11830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11833 /* #_FolderCache is not empty */
11834 r = MsiViewFetch(hview, &hrec);
11837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11840 MsiCloseHandle(hrec);
11841 MsiViewClose(hview);
11842 MsiCloseHandle(hview);
11844 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
11847 ok(r == ERROR_BAD_QUERY_SYNTAX,
11848 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11851 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
11854 ok(r == ERROR_BAD_QUERY_SYNTAX,
11855 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11858 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
11861 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
11862 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
11865 MsiCloseHandle(hsuminfo);
11867 r = MsiDatabaseCommit(hdb);
11870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11873 MsiCloseHandle(hdb);
11874 MsiCloseHandle(hpkg);
11877 static void test_MsiGetProductProperty(void)
11879 MSIHANDLE hprod, hdb;
11880 CHAR val[MAX_PATH];
11881 CHAR path[MAX_PATH];
11882 CHAR query[MAX_PATH];
11883 CHAR keypath[MAX_PATH*2];
11884 CHAR prodcode[MAX_PATH];
11885 CHAR prod_squashed[MAX_PATH];
11886 HKEY prodkey, userkey, props;
11891 REGSAM access = KEY_ALL_ACCESS;
11894 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
11895 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
11897 win_skip("Different registry keys on Win9x and WinMe\n");
11900 CloseServiceHandle(scm);
11902 GetCurrentDirectoryA(MAX_PATH, path);
11903 lstrcatA(path, "\\");
11905 create_test_guid(prodcode, prod_squashed);
11907 if (pIsWow64Process && pIsWow64Process(GetCurrentProcess(), &wow64) && wow64)
11908 access |= KEY_WOW64_64KEY;
11910 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
11911 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11913 r = MsiDatabaseCommit(hdb);
11914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11916 r = set_summary_info(hdb);
11917 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11920 "CREATE TABLE `Directory` ( "
11921 "`Directory` CHAR(255) NOT NULL, "
11922 "`Directory_Parent` CHAR(255), "
11923 "`DefaultDir` CHAR(255) NOT NULL "
11924 "PRIMARY KEY `Directory`)");
11925 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11928 "CREATE TABLE `Property` ( "
11929 "`Property` CHAR(72) NOT NULL, "
11930 "`Value` CHAR(255) "
11931 "PRIMARY KEY `Property`)");
11932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11934 sprintf(query, "INSERT INTO `Property` "
11935 "(`Property`, `Value`) "
11936 "VALUES( 'ProductCode', '%s' )", prodcode);
11937 r = run_query(hdb, query);
11938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11940 r = MsiDatabaseCommit(hdb);
11941 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11943 MsiCloseHandle(hdb);
11945 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
11946 lstrcatA(keypath, prod_squashed);
11948 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL);
11949 if (res == ERROR_ACCESS_DENIED)
11951 skip("Not enough rights to perform tests\n");
11952 DeleteFile(msifile);
11955 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11957 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
11958 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
11959 lstrcatA(keypath, prod_squashed);
11961 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL);
11962 if (res == ERROR_ACCESS_DENIED)
11964 skip("Not enough rights to perform tests\n");
11965 RegDeleteKeyA(prodkey, "");
11966 RegCloseKey(prodkey);
11969 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11971 res = RegCreateKeyExA(userkey, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
11972 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11974 lstrcpyA(val, path);
11975 lstrcatA(val, "\\");
11976 lstrcatA(val, msifile);
11977 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
11978 (const BYTE *)val, lstrlenA(val) + 1);
11979 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11981 hprod = 0xdeadbeef;
11982 r = MsiOpenProductA(prodcode, &hprod);
11983 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11984 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
11986 /* hProduct is invalid */
11988 lstrcpyA(val, "apple");
11989 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
11990 ok(r == ERROR_INVALID_HANDLE,
11991 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11992 ok(!lstrcmpA(val, "apple"),
11993 "Expected val to be unchanged, got \"%s\"\n", val);
11994 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11996 /* szProperty is NULL */
11998 lstrcpyA(val, "apple");
11999 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
12000 ok(r == ERROR_INVALID_PARAMETER,
12001 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12002 ok(!lstrcmpA(val, "apple"),
12003 "Expected val to be unchanged, got \"%s\"\n", val);
12004 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12006 /* szProperty is empty */
12008 lstrcpyA(val, "apple");
12009 r = MsiGetProductPropertyA(hprod, "", val, &size);
12010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12011 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12012 ok(size == 0, "Expected 0, got %d\n", size);
12014 /* get the property */
12016 lstrcpyA(val, "apple");
12017 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12018 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12019 ok(!lstrcmpA(val, prodcode),
12020 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12021 ok(size == lstrlenA(prodcode),
12022 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12024 /* lpValueBuf is NULL */
12026 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
12027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12028 ok(size == lstrlenA(prodcode),
12029 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12031 /* pcchValueBuf is NULL */
12032 lstrcpyA(val, "apple");
12033 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
12034 ok(r == ERROR_INVALID_PARAMETER,
12035 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12036 ok(!lstrcmpA(val, "apple"),
12037 "Expected val to be unchanged, got \"%s\"\n", val);
12038 ok(size == lstrlenA(prodcode),
12039 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12041 /* pcchValueBuf is too small */
12043 lstrcpyA(val, "apple");
12044 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12045 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12046 ok(!strncmp(val, prodcode, 3),
12047 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
12048 ok(size == lstrlenA(prodcode),
12049 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12051 /* pcchValueBuf does not leave room for NULL terminator */
12052 size = lstrlenA(prodcode);
12053 lstrcpyA(val, "apple");
12054 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12055 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12056 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
12057 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
12058 ok(size == lstrlenA(prodcode),
12059 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12061 /* pcchValueBuf has enough room for NULL terminator */
12062 size = lstrlenA(prodcode) + 1;
12063 lstrcpyA(val, "apple");
12064 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12065 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12066 ok(!lstrcmpA(val, prodcode),
12067 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12068 ok(size == lstrlenA(prodcode),
12069 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12071 /* nonexistent property */
12073 lstrcpyA(val, "apple");
12074 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
12075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12076 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12077 ok(size == 0, "Expected 0, got %d\n", size);
12079 r = MsiSetPropertyA(hprod, "NewProperty", "value");
12080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12082 /* non-product property set */
12084 lstrcpyA(val, "apple");
12085 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
12086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12087 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12088 ok(size == 0, "Expected 0, got %d\n", size);
12090 r = MsiSetPropertyA(hprod, "ProductCode", "value");
12091 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12093 /* non-product property that is also a product property set */
12095 lstrcpyA(val, "apple");
12096 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12098 ok(!lstrcmpA(val, prodcode),
12099 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12100 ok(size == lstrlenA(prodcode),
12101 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12103 MsiCloseHandle(hprod);
12105 RegDeleteValueA(props, "LocalPackage");
12106 delete_key(props, "", access);
12107 RegCloseKey(props);
12108 delete_key(userkey, "", access);
12109 RegCloseKey(userkey);
12110 delete_key(prodkey, "", access);
12111 RegCloseKey(prodkey);
12112 DeleteFileA(msifile);
12115 static void test_MsiSetProperty(void)
12117 MSIHANDLE hpkg, hdb, hrec;
12118 CHAR buf[MAX_PATH];
12123 r = package_from_db(create_package_db(), &hpkg);
12124 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12126 skip("Not enough rights to perform tests\n");
12127 DeleteFile(msifile);
12130 ok(r == ERROR_SUCCESS, "Expected a valid package %u\n", r);
12132 /* invalid hInstall */
12133 r = MsiSetPropertyA(0, "Prop", "Val");
12134 ok(r == ERROR_INVALID_HANDLE,
12135 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12137 /* invalid hInstall */
12138 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12139 ok(r == ERROR_INVALID_HANDLE,
12140 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12142 /* szName is NULL */
12143 r = MsiSetPropertyA(hpkg, NULL, "Val");
12144 ok(r == ERROR_INVALID_PARAMETER,
12145 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12147 /* both szName and szValue are NULL */
12148 r = MsiSetPropertyA(hpkg, NULL, NULL);
12149 ok(r == ERROR_INVALID_PARAMETER,
12150 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12152 /* szName is empty */
12153 r = MsiSetPropertyA(hpkg, "", "Val");
12154 ok(r == ERROR_FUNCTION_FAILED,
12155 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
12157 /* szName is empty and szValue is NULL */
12158 r = MsiSetPropertyA(hpkg, "", NULL);
12159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12161 /* set a property */
12162 r = MsiSetPropertyA(hpkg, "Prop", "Val");
12163 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12165 /* get the property */
12167 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12169 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
12170 ok(size == 3, "Expected 3, got %d\n", size);
12172 /* update the property */
12173 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
12174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12176 /* get the property */
12178 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12179 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12180 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
12181 ok(size == 4, "Expected 4, got %d\n", size);
12183 hdb = MsiGetActiveDatabase(hpkg);
12184 ok(hdb != 0, "Expected a valid database handle\n");
12186 /* set prop is not in the _Property table */
12187 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12188 r = do_query(hdb, query, &hrec);
12189 ok(r == ERROR_BAD_QUERY_SYNTAX,
12190 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12192 /* set prop is not in the Property table */
12193 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12194 r = do_query(hdb, query, &hrec);
12195 ok(r == ERROR_BAD_QUERY_SYNTAX,
12196 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12198 MsiCloseHandle(hdb);
12200 /* szValue is an empty string */
12201 r = MsiSetPropertyA(hpkg, "Prop", "");
12202 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12204 /* try to get the property */
12206 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12208 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12209 ok(size == 0, "Expected 0, got %d\n", size);
12211 /* reset the property */
12212 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
12213 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12215 /* delete the property */
12216 r = MsiSetPropertyA(hpkg, "Prop", NULL);
12217 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12219 /* try to get the property */
12221 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12222 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12223 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12224 ok(size == 0, "Expected 0, got %d\n", size);
12226 MsiCloseHandle(hpkg);
12227 DeleteFileA(msifile);
12230 static void test_MsiApplyMultiplePatches(void)
12232 UINT r, type = GetDriveType(NULL);
12234 if (!pMsiApplyMultiplePatchesA) {
12235 win_skip("MsiApplyMultiplePatchesA not found\n");
12239 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
12240 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12242 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
12243 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12245 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
12248 if (type == DRIVE_FIXED)
12249 ok(r == ERROR_PATH_NOT_FOUND,
12250 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12252 ok(r == ERROR_INVALID_NAME,
12253 "Expected ERROR_INVALID_NAME, got %u\n", r);
12256 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
12259 if (type == DRIVE_FIXED)
12260 ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED,
12261 "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
12263 ok(r == ERROR_INVALID_NAME,
12264 "Expected ERROR_INVALID_NAME, got %u\n", r);
12267 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
12270 if (type == DRIVE_FIXED)
12271 ok(r == ERROR_PATH_NOT_FOUND,
12272 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12274 ok(r == ERROR_INVALID_NAME,
12275 "Expected ERROR_INVALID_NAME, got %u\n", r);
12278 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
12279 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12281 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
12284 if (type == DRIVE_FIXED)
12285 ok(r == ERROR_PATH_NOT_FOUND,
12286 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12288 ok(r == ERROR_INVALID_NAME,
12289 "Expected ERROR_INVALID_NAME, got %u\n", r);
12292 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
12293 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12295 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
12296 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12299 static void test_MsiApplyPatch(void)
12303 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
12304 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12306 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
12307 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12310 START_TEST(package)
12312 STATEMGRSTATUS status;
12315 init_functionpointers();
12317 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
12319 /* Create a restore point ourselves so we circumvent the multitude of restore points
12320 * that would have been created by all the installation and removal tests.
12322 if (pSRSetRestorePointA)
12324 memset(&status, 0, sizeof(status));
12325 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
12328 test_createpackage();
12330 test_gettargetpath_bad();
12331 test_settargetpath();
12333 test_property_table();
12336 test_formatrecord2();
12338 test_getproperty();
12339 test_removefiles();
12341 test_appsearch_complocator();
12342 test_appsearch_reglocator();
12343 test_appsearch_inilocator();
12344 test_appsearch_drlocator();
12345 test_featureparents();
12346 test_installprops();
12347 test_launchconditions();
12349 test_complocator();
12350 test_MsiGetSourcePath();
12351 test_shortlongsource();
12354 test_emptypackage();
12355 test_MsiGetProductProperty();
12356 test_MsiSetProperty();
12357 test_MsiApplyMultiplePatches();
12358 test_MsiApplyPatch();
12360 if (pSRSetRestorePointA && ret)
12362 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
12364 remove_restore_point(status.llSequenceNumber);