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.msi";
34 char CURR_DIR[MAX_PATH];
36 static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
38 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
40 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
41 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
43 static void init_functionpointers(void)
45 HMODULE hmsi = GetModuleHandleA("msi.dll");
46 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
49 #define GET_PROC(mod, func) \
50 p ## func = (void*)GetProcAddress(mod, #func);
52 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
54 GET_PROC(hadvapi32, ConvertSidToStringSidA);
56 hsrclient = LoadLibraryA("srclient.dll");
57 GET_PROC(hsrclient, SRRemoveRestorePoint);
58 GET_PROC(hsrclient, SRSetRestorePointA);
63 static LPSTR get_user_sid(LPSTR *usersid)
70 if (!pConvertSidToStringSidA)
72 win_skip("ConvertSidToStringSidA is not available\n");
77 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
79 GetTokenInformation(token, TokenUser, buf, size, &size);
80 user = (PTOKEN_USER)buf;
81 pConvertSidToStringSidA(user->User.Sid, usersid);
82 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
87 /* RegDeleteTreeW from dlls/advapi32/registry.c */
88 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
91 DWORD dwMaxSubkeyLen, dwMaxValueLen;
92 DWORD dwMaxLen, dwSize;
93 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
98 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
102 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
103 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
104 if (ret) goto cleanup;
108 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
109 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
111 /* Name too big: alloc a buffer for it */
112 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
114 ret = ERROR_NOT_ENOUGH_MEMORY;
119 /* Recursively delete all the subkeys */
123 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
124 NULL, NULL, NULL)) break;
126 ret = package_RegDeleteTreeW(hSubKey, lpszName);
127 if (ret) goto cleanup;
131 ret = RegDeleteKeyW(hKey, lpszSubKey);
136 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
137 NULL, NULL, NULL, NULL)) break;
139 ret = RegDeleteValueW(hKey, lpszName);
140 if (ret) goto cleanup;
144 if (lpszName != szNameBuf)
145 HeapFree(GetProcessHeap(), 0, lpszName);
147 RegCloseKey(hSubKey);
151 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
156 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
170 out[17+i*2] = in[n++];
171 out[16+i*2] = in[n++];
176 out[17+i*2] = in[n++];
177 out[16+i*2] = in[n++];
183 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
185 WCHAR guidW[MAX_PATH];
186 WCHAR squashedW[MAX_PATH];
191 hr = CoCreateGuid(&guid);
192 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
194 size = StringFromGUID2(&guid, guidW, MAX_PATH);
195 ok(size == 39, "Expected 39, got %d\n", hr);
197 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
198 squash_guid(guidW, squashedW);
199 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
202 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
203 LPCSTR guid, LPSTR usersid, BOOL dir)
205 WCHAR guidW[MAX_PATH];
206 WCHAR squashedW[MAX_PATH];
207 CHAR squashed[MAX_PATH];
208 CHAR comppath[MAX_PATH];
209 CHAR prodpath[MAX_PATH];
214 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
215 squash_guid(guidW, squashedW);
216 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
218 if (context == MSIINSTALLCONTEXT_MACHINE)
220 prod = "3D0DAE300FACA1300AD792060BCDAA92";
222 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
223 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
225 "SOFTWARE\\Classes\\Installer\\"
226 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
228 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
230 prod = "7D2F387510109040002000060BECB6AB";
232 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
233 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
235 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
236 "Installer\\%s\\Installer\\Products\\"
237 "7D2F387510109040002000060BECB6AB", usersid);
239 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
241 prod = "7D2F387510109040002000060BECB6AB";
243 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
244 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
246 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
247 "Installer\\Managed\\%s\\Installer\\Products\\"
248 "7D2F387510109040002000060BECB6AB", usersid);
251 RegCreateKeyA(HKEY_LOCAL_MACHINE, comppath, &hkey);
253 lstrcpyA(path, CURR_DIR);
254 lstrcatA(path, "\\");
255 if (!dir) lstrcatA(path, filename);
257 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
260 RegCreateKeyA(HKEY_LOCAL_MACHINE, prodpath, &hkey);
264 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
266 WCHAR guidW[MAX_PATH];
267 WCHAR squashedW[MAX_PATH];
268 WCHAR substrW[MAX_PATH];
269 CHAR squashed[MAX_PATH];
270 CHAR comppath[MAX_PATH];
271 CHAR prodpath[MAX_PATH];
273 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
274 squash_guid(guidW, squashedW);
275 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
277 if (context == MSIINSTALLCONTEXT_MACHINE)
280 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
281 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
283 "SOFTWARE\\Classes\\Installer\\"
284 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
286 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
289 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
290 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
292 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
293 "Installer\\%s\\Installer\\Products\\"
294 "7D2F387510109040002000060BECB6AB", usersid);
296 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
299 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
300 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
302 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
303 "Installer\\Managed\\%s\\Installer\\Products\\"
304 "7D2F387510109040002000060BECB6AB", usersid);
307 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
308 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
310 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
311 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
314 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
319 /* open a select query */
320 r = MsiDatabaseOpenView(hdb, query, &hview);
321 if (r != ERROR_SUCCESS)
323 r = MsiViewExecute(hview, 0);
324 if (r != ERROR_SUCCESS)
326 ret = MsiViewFetch(hview, phrec);
327 r = MsiViewClose(hview);
328 if (r != ERROR_SUCCESS)
330 r = MsiCloseHandle(hview);
331 if (r != ERROR_SUCCESS)
336 static UINT run_query( MSIHANDLE hdb, const char *query )
341 r = MsiDatabaseOpenView(hdb, query, &hview);
342 if( r != ERROR_SUCCESS )
345 r = MsiViewExecute(hview, 0);
346 if( r == ERROR_SUCCESS )
347 r = MsiViewClose(hview);
348 MsiCloseHandle(hview);
352 static UINT create_component_table( MSIHANDLE hdb )
354 return run_query( hdb,
355 "CREATE TABLE `Component` ( "
356 "`Component` CHAR(72) NOT NULL, "
357 "`ComponentId` CHAR(38), "
358 "`Directory_` CHAR(72) NOT NULL, "
359 "`Attributes` SHORT NOT NULL, "
360 "`Condition` CHAR(255), "
361 "`KeyPath` CHAR(72) "
362 "PRIMARY KEY `Component`)" );
365 static UINT create_feature_table( MSIHANDLE hdb )
367 return run_query( hdb,
368 "CREATE TABLE `Feature` ( "
369 "`Feature` CHAR(38) NOT NULL, "
370 "`Feature_Parent` CHAR(38), "
372 "`Description` CHAR(255), "
373 "`Display` SHORT NOT NULL, "
374 "`Level` SHORT NOT NULL, "
375 "`Directory_` CHAR(72), "
376 "`Attributes` SHORT NOT NULL "
377 "PRIMARY KEY `Feature`)" );
380 static UINT create_feature_components_table( MSIHANDLE hdb )
382 return run_query( hdb,
383 "CREATE TABLE `FeatureComponents` ( "
384 "`Feature_` CHAR(38) NOT NULL, "
385 "`Component_` CHAR(72) NOT NULL "
386 "PRIMARY KEY `Feature_`, `Component_` )" );
389 static UINT create_file_table( MSIHANDLE hdb )
391 return run_query( hdb,
392 "CREATE TABLE `File` ("
393 "`File` CHAR(72) NOT NULL, "
394 "`Component_` CHAR(72) NOT NULL, "
395 "`FileName` CHAR(255) NOT NULL, "
396 "`FileSize` LONG NOT NULL, "
397 "`Version` CHAR(72), "
398 "`Language` CHAR(20), "
399 "`Attributes` SHORT, "
400 "`Sequence` SHORT NOT NULL "
401 "PRIMARY KEY `File`)" );
404 static UINT create_remove_file_table( MSIHANDLE hdb )
406 return run_query( hdb,
407 "CREATE TABLE `RemoveFile` ("
408 "`FileKey` CHAR(72) NOT NULL, "
409 "`Component_` CHAR(72) NOT NULL, "
410 "`FileName` CHAR(255) LOCALIZABLE, "
411 "`DirProperty` CHAR(72) NOT NULL, "
412 "`InstallMode` SHORT NOT NULL "
413 "PRIMARY KEY `FileKey`)" );
416 static UINT create_appsearch_table( MSIHANDLE hdb )
418 return run_query( hdb,
419 "CREATE TABLE `AppSearch` ("
420 "`Property` CHAR(72) NOT NULL, "
421 "`Signature_` CHAR(72) NOT NULL "
422 "PRIMARY KEY `Property`, `Signature_`)" );
425 static UINT create_reglocator_table( MSIHANDLE hdb )
427 return run_query( hdb,
428 "CREATE TABLE `RegLocator` ("
429 "`Signature_` CHAR(72) NOT NULL, "
430 "`Root` SHORT NOT NULL, "
431 "`Key` CHAR(255) NOT NULL, "
434 "PRIMARY KEY `Signature_`)" );
437 static UINT create_signature_table( MSIHANDLE hdb )
439 return run_query( hdb,
440 "CREATE TABLE `Signature` ("
441 "`Signature` CHAR(72) NOT NULL, "
442 "`FileName` CHAR(255) NOT NULL, "
443 "`MinVersion` CHAR(20), "
444 "`MaxVersion` CHAR(20), "
449 "`Languages` CHAR(255) "
450 "PRIMARY KEY `Signature`)" );
453 static UINT create_launchcondition_table( MSIHANDLE hdb )
455 return run_query( hdb,
456 "CREATE TABLE `LaunchCondition` ("
457 "`Condition` CHAR(255) NOT NULL, "
458 "`Description` CHAR(255) NOT NULL "
459 "PRIMARY KEY `Condition`)" );
462 static UINT create_property_table( MSIHANDLE hdb )
464 return run_query( hdb,
465 "CREATE TABLE `Property` ("
466 "`Property` CHAR(72) NOT NULL, "
468 "PRIMARY KEY `Property`)" );
471 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
473 return run_query( hdb,
474 "CREATE TABLE `InstallExecuteSequence` ("
475 "`Action` CHAR(72) NOT NULL, "
476 "`Condition` CHAR(255), "
478 "PRIMARY KEY `Action`)" );
481 static UINT create_media_table( MSIHANDLE hdb )
483 return run_query( hdb,
484 "CREATE TABLE `Media` ("
485 "`DiskId` SHORT NOT NULL, "
486 "`LastSequence` SHORT NOT NULL, "
487 "`DiskPrompt` CHAR(64), "
488 "`Cabinet` CHAR(255), "
489 "`VolumeLabel` CHAR(32), "
491 "PRIMARY KEY `DiskId`)" );
494 static UINT create_ccpsearch_table( MSIHANDLE hdb )
496 return run_query( hdb,
497 "CREATE TABLE `CCPSearch` ("
498 "`Signature_` CHAR(72) NOT NULL "
499 "PRIMARY KEY `Signature_`)" );
502 static UINT create_drlocator_table( MSIHANDLE hdb )
504 return run_query( hdb,
505 "CREATE TABLE `DrLocator` ("
506 "`Signature_` CHAR(72) NOT NULL, "
507 "`Parent` CHAR(72), "
510 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
513 static UINT create_complocator_table( MSIHANDLE hdb )
515 return run_query( hdb,
516 "CREATE TABLE `CompLocator` ("
517 "`Signature_` CHAR(72) NOT NULL, "
518 "`ComponentId` CHAR(38) NOT NULL, "
520 "PRIMARY KEY `Signature_`)" );
523 static UINT create_inilocator_table( MSIHANDLE hdb )
525 return run_query( hdb,
526 "CREATE TABLE `IniLocator` ("
527 "`Signature_` CHAR(72) NOT NULL, "
528 "`FileName` CHAR(255) NOT NULL, "
529 "`Section` CHAR(96)NOT NULL, "
530 "`Key` CHAR(128)NOT NULL, "
533 "PRIMARY KEY `Signature_`)" );
536 #define make_add_entry(type, qtext) \
537 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
539 char insert[] = qtext; \
542 sz = strlen(values) + sizeof insert; \
543 query = HeapAlloc(GetProcessHeap(),0,sz); \
544 sprintf(query,insert,values); \
545 r = run_query( hdb, query ); \
546 HeapFree(GetProcessHeap(), 0, query); \
550 make_add_entry(component,
551 "INSERT INTO `Component` "
552 "(`Component`, `ComponentId`, `Directory_`, "
553 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
555 make_add_entry(directory,
556 "INSERT INTO `Directory` "
557 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
559 make_add_entry(feature,
560 "INSERT INTO `Feature` "
561 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
562 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
564 make_add_entry(feature_components,
565 "INSERT INTO `FeatureComponents` "
566 "(`Feature_`, `Component_`) VALUES( %s )")
569 "INSERT INTO `File` "
570 "(`File`, `Component_`, `FileName`, `FileSize`, "
571 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
573 make_add_entry(appsearch,
574 "INSERT INTO `AppSearch` "
575 "(`Property`, `Signature_`) VALUES( %s )")
577 make_add_entry(reglocator,
578 "INSERT INTO `RegLocator` "
579 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES( %s )")
581 make_add_entry(signature,
582 "INSERT INTO `Signature` "
583 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
584 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
587 make_add_entry(launchcondition,
588 "INSERT INTO `LaunchCondition` "
589 "(`Condition`, `Description`) VALUES( %s )")
591 make_add_entry(property,
592 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
594 make_add_entry(install_execute_sequence,
595 "INSERT INTO `InstallExecuteSequence` "
596 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
598 make_add_entry(media,
599 "INSERT INTO `Media` "
600 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
601 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
603 make_add_entry(ccpsearch,
604 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
606 make_add_entry(drlocator,
607 "INSERT INTO `DrLocator` "
608 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
610 make_add_entry(complocator,
611 "INSERT INTO `CompLocator` "
612 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
614 make_add_entry(inilocator,
615 "INSERT INTO `IniLocator` "
616 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
619 static UINT set_summary_info(MSIHANDLE hdb)
624 /* build summary info */
625 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
626 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
628 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
629 "Installation Database");
630 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
632 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
633 "Installation Database");
634 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
636 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
638 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
640 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
642 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
644 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
645 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
646 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
648 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
649 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
651 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
652 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
654 res = MsiSummaryInfoPersist(suminfo);
655 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
657 res = MsiCloseHandle( suminfo);
658 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
664 static MSIHANDLE create_package_db(void)
671 /* create an empty database */
672 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
673 ok( res == ERROR_SUCCESS , "Failed to create database\n" );
674 if( res != ERROR_SUCCESS )
677 res = MsiDatabaseCommit( hdb );
678 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
680 res = set_summary_info(hdb);
682 res = run_query( hdb,
683 "CREATE TABLE `Directory` ( "
684 "`Directory` CHAR(255) NOT NULL, "
685 "`Directory_Parent` CHAR(255), "
686 "`DefaultDir` CHAR(255) NOT NULL "
687 "PRIMARY KEY `Directory`)" );
688 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
693 static MSIHANDLE package_from_db(MSIHANDLE hdb)
699 sprintf(szPackage,"#%i",hdb);
700 res = MsiOpenPackage(szPackage,&hPackage);
701 if (res != ERROR_SUCCESS)
704 res = MsiCloseHandle(hdb);
705 if (res != ERROR_SUCCESS)
711 static void create_test_file(const CHAR *name)
716 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
717 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
718 WriteFile(file, name, strlen(name), &written, NULL);
719 WriteFile(file, "\n", strlen("\n"), &written, NULL);
723 typedef struct _tagVS_VERSIONINFO
730 VS_FIXEDFILEINFO Value;
735 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
736 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
738 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
740 VS_VERSIONINFO *pVerInfo;
741 VS_FIXEDFILEINFO *pFixedInfo;
748 GetSystemDirectory(path, MAX_PATH);
749 /* Some dlls can't be updated on Vista/W2K8 */
750 lstrcatA(path, "\\version.dll");
752 CopyFileA(path, name, FALSE);
754 size = GetFileVersionInfoSize(path, &handle);
755 buffer = HeapAlloc(GetProcessHeap(), 0, size);
757 GetFileVersionInfoA(path, 0, size, buffer);
759 pVerInfo = (VS_VERSIONINFO *)buffer;
760 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
761 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
763 pFixedInfo->dwFileVersionMS = ms;
764 pFixedInfo->dwFileVersionLS = ls;
765 pFixedInfo->dwProductVersionMS = ms;
766 pFixedInfo->dwProductVersionLS = ls;
768 resource = BeginUpdateResource(name, FALSE);
772 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
773 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
776 if (!EndUpdateResource(resource, FALSE))
782 HeapFree(GetProcessHeap(), 0, buffer);
786 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
788 RESTOREPOINTINFOA spec;
790 spec.dwEventType = event_type;
791 spec.dwRestorePtType = APPLICATION_INSTALL;
792 spec.llSequenceNumber = status->llSequenceNumber;
793 lstrcpyA(spec.szDescription, "msitest restore point");
795 return pSRSetRestorePointA(&spec, status);
798 static void remove_restore_point(DWORD seq_number)
802 res = pSRRemoveRestorePoint(seq_number);
803 if (res != ERROR_SUCCESS)
804 trace("Failed to remove the restore point : %08x\n", res);
807 static void test_createpackage(void)
809 MSIHANDLE hPackage = 0;
812 hPackage = package_from_db(create_package_db());
813 ok( hPackage != 0, " Failed to create package\n");
815 res = MsiCloseHandle( hPackage);
816 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
820 static void test_doaction( void )
825 r = MsiDoAction( -1, NULL );
826 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
828 hpkg = package_from_db(create_package_db());
829 ok( hpkg, "failed to create package\n");
831 r = MsiDoAction(hpkg, NULL);
832 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
834 r = MsiDoAction(0, "boo");
835 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
837 r = MsiDoAction(hpkg, "boo");
838 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
840 MsiCloseHandle( hpkg );
844 static void test_gettargetpath_bad(void)
851 hpkg = package_from_db(create_package_db());
852 ok( hpkg, "failed to create package\n");
854 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
855 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
857 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
858 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
860 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
861 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
863 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
864 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
866 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
867 ok( r == ERROR_DIRECTORY, "wrong return val\n");
869 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
870 ok( r == ERROR_DIRECTORY, "wrong return val\n");
872 MsiCloseHandle( hpkg );
876 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
882 rec = MsiCreateRecord( 1 );
883 ok(rec, "MsiCreate record failed\n");
885 r = MsiRecordSetString( rec, 0, file );
886 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
889 r = MsiFormatRecord( hpkg, rec, buff, &size );
890 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
892 MsiCloseHandle( rec );
895 static void test_settargetpath(void)
897 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
903 hdb = create_package_db();
904 ok ( hdb, "failed to create package database\n" );
906 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
907 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
909 r = create_component_table( hdb );
910 ok( r == S_OK, "cannot create Component table: %d\n", r );
912 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
913 ok( r == S_OK, "cannot add dummy component: %d\n", r );
915 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
916 ok( r == S_OK, "cannot add test component: %d\n", r );
918 r = create_feature_table( hdb );
919 ok( r == S_OK, "cannot create Feature table: %d\n", r );
921 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
922 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
924 r = create_feature_components_table( hdb );
925 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
927 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
928 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
930 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
931 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
933 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
934 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
936 r = create_file_table( hdb );
937 ok( r == S_OK, "cannot create File table: %d\n", r );
939 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
940 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
942 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
943 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
945 hpkg = package_from_db( hdb );
946 ok( hpkg, "failed to create package\n");
948 r = MsiDoAction( hpkg, "CostInitialize");
949 ok( r == ERROR_SUCCESS, "cost init failed\n");
951 r = MsiDoAction( hpkg, "FileCost");
952 ok( r == ERROR_SUCCESS, "file cost failed\n");
954 r = MsiDoAction( hpkg, "CostFinalize");
955 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
957 r = MsiSetTargetPath( 0, NULL, NULL );
958 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
960 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
961 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
963 r = MsiSetTargetPath( hpkg, "boo", NULL );
964 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
966 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
967 ok( r == ERROR_DIRECTORY, "wrong return val\n");
969 sz = sizeof tempdir - 1;
970 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
971 sprintf( file, "%srootfile.txt", tempdir );
973 query_file_path( hpkg, "[#RootFile]", buffer );
974 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
975 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
977 GetTempFileName( tempdir, "_wt", 0, buffer );
978 sprintf( tempdir, "%s\\subdir", buffer );
980 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
981 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
982 "MsiSetTargetPath on file returned %d\n", r );
984 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
985 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
986 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
988 DeleteFile( buffer );
990 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
991 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
993 r = GetFileAttributes( buffer );
994 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
996 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
997 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
999 sz = sizeof buffer - 1;
1000 lstrcat( tempdir, "\\" );
1001 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
1002 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1003 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
1005 sprintf( file, "%srootfile.txt", tempdir );
1006 query_file_path( hpkg, "[#RootFile]", buffer );
1007 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
1009 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
1010 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1012 query_file_path( hpkg, "[#TestFile]", buffer );
1013 ok( !lstrcmpi(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
1014 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
1016 sz = sizeof buffer - 1;
1017 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1018 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1019 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
1021 MsiCloseHandle( hpkg );
1024 static void test_condition(void)
1029 hpkg = package_from_db(create_package_db());
1030 ok( hpkg, "failed to create package\n");
1032 r = MsiEvaluateCondition(0, NULL);
1033 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1035 r = MsiEvaluateCondition(hpkg, NULL);
1036 ok( r == MSICONDITION_NONE, "wrong return val\n");
1038 r = MsiEvaluateCondition(hpkg, "");
1039 ok( r == MSICONDITION_NONE, "wrong return val\n");
1041 r = MsiEvaluateCondition(hpkg, "1");
1042 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1044 r = MsiEvaluateCondition(hpkg, "0");
1045 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1047 r = MsiEvaluateCondition(hpkg, "-1");
1048 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1050 r = MsiEvaluateCondition(hpkg, "0 = 0");
1051 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1053 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1054 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1056 r = MsiEvaluateCondition(hpkg, "0 = 1");
1057 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1059 r = MsiEvaluateCondition(hpkg, "0 > 1");
1060 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1062 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1063 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1065 r = MsiEvaluateCondition(hpkg, "1 > 1");
1066 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1068 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1069 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1071 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1072 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1074 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1075 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1077 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1078 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1080 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1081 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1083 r = MsiEvaluateCondition(hpkg, "0 < 1");
1084 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1086 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1087 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1089 r = MsiEvaluateCondition(hpkg, "1 < 1");
1090 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1092 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1093 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1095 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1096 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1098 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1099 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1101 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1102 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1104 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1105 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1107 r = MsiEvaluateCondition(hpkg, "0 >=");
1108 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1110 r = MsiEvaluateCondition(hpkg, " ");
1111 ok( r == MSICONDITION_NONE, "wrong return val\n");
1113 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1114 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1116 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1117 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1119 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1120 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1122 r = MsiEvaluateCondition(hpkg, "not 0");
1123 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1125 r = MsiEvaluateCondition(hpkg, "not LicView");
1126 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1128 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1129 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1131 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1132 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1134 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1135 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1137 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1138 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1140 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1141 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1143 r = MsiEvaluateCondition(hpkg, "\"0\"");
1144 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1146 r = MsiEvaluateCondition(hpkg, "1 and 2");
1147 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1149 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1150 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1152 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1153 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1155 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1156 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1158 r = MsiEvaluateCondition(hpkg, "(0)");
1159 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1161 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1162 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1164 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1165 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1167 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1168 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1170 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1171 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1173 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1174 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1176 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1177 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1179 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1180 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1182 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1183 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1185 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1186 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1188 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1189 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1191 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1192 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1194 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1195 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1197 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1198 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1200 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1201 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1203 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1204 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1206 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1207 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1209 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1210 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1212 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1213 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1215 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1216 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1218 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1219 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1221 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1222 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1224 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1225 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1227 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1228 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1230 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1231 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1233 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1234 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1236 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1237 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1239 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1240 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1242 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1243 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1245 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1246 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1248 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1249 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1251 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1252 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1254 MsiSetProperty(hpkg, "mm", "5" );
1256 r = MsiEvaluateCondition(hpkg, "mm = 5");
1257 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1259 r = MsiEvaluateCondition(hpkg, "mm < 6");
1260 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1262 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1263 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1265 r = MsiEvaluateCondition(hpkg, "mm > 4");
1266 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1268 r = MsiEvaluateCondition(hpkg, "mm < 12");
1269 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1271 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1272 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1274 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1275 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1277 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1278 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1280 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1281 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1283 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1284 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1286 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1287 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1289 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1290 ok( r == MSICONDITION_FALSE, "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 AND 1");
1296 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1298 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1299 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1301 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1302 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1304 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1305 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1307 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1308 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1310 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1311 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1313 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1314 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1316 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1317 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1319 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1320 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1322 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1323 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1325 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1326 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1328 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1329 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1331 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1332 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1334 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1335 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1337 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1338 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1340 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1341 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1343 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1344 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1346 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1347 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1349 MsiSetProperty(hpkg, "bandalmael", "0" );
1350 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1351 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1353 MsiSetProperty(hpkg, "bandalmael", "" );
1354 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1355 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1357 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1358 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1359 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1361 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1362 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1363 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1365 MsiSetProperty(hpkg, "bandalmael", "0 " );
1366 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1367 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1369 MsiSetProperty(hpkg, "bandalmael", "-0" );
1370 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1371 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1373 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1374 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1375 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1377 MsiSetProperty(hpkg, "bandalmael", "--0" );
1378 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1379 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1381 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1382 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1383 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1385 MsiSetProperty(hpkg, "bandalmael", "-" );
1386 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1387 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1389 MsiSetProperty(hpkg, "bandalmael", "+0" );
1390 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1391 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1393 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1394 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1395 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1396 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1397 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1399 MsiSetProperty(hpkg, "one", "hi");
1400 MsiSetProperty(hpkg, "two", "hithere");
1401 r = MsiEvaluateCondition(hpkg, "one >< two");
1402 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1404 MsiSetProperty(hpkg, "one", "hithere");
1405 MsiSetProperty(hpkg, "two", "hi");
1406 r = MsiEvaluateCondition(hpkg, "one >< two");
1407 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1409 MsiSetProperty(hpkg, "one", "hello");
1410 MsiSetProperty(hpkg, "two", "hi");
1411 r = MsiEvaluateCondition(hpkg, "one >< two");
1412 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1414 MsiSetProperty(hpkg, "one", "hellohithere");
1415 MsiSetProperty(hpkg, "two", "hi");
1416 r = MsiEvaluateCondition(hpkg, "one >< two");
1417 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1419 MsiSetProperty(hpkg, "one", "");
1420 MsiSetProperty(hpkg, "two", "hi");
1421 r = MsiEvaluateCondition(hpkg, "one >< two");
1422 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1424 MsiSetProperty(hpkg, "one", "hi");
1425 MsiSetProperty(hpkg, "two", "");
1426 r = MsiEvaluateCondition(hpkg, "one >< two");
1427 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1429 MsiSetProperty(hpkg, "one", "");
1430 MsiSetProperty(hpkg, "two", "");
1431 r = MsiEvaluateCondition(hpkg, "one >< two");
1432 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1434 MsiSetProperty(hpkg, "one", "1234");
1435 MsiSetProperty(hpkg, "two", "1");
1436 r = MsiEvaluateCondition(hpkg, "one >< two");
1437 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1439 MsiSetProperty(hpkg, "one", "one 1234");
1440 MsiSetProperty(hpkg, "two", "1");
1441 r = MsiEvaluateCondition(hpkg, "one >< two");
1442 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1444 MsiSetProperty(hpkg, "one", "hithere");
1445 MsiSetProperty(hpkg, "two", "hi");
1446 r = MsiEvaluateCondition(hpkg, "one << two");
1447 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1449 MsiSetProperty(hpkg, "one", "hi");
1450 MsiSetProperty(hpkg, "two", "hithere");
1451 r = MsiEvaluateCondition(hpkg, "one << two");
1452 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1454 MsiSetProperty(hpkg, "one", "hi");
1455 MsiSetProperty(hpkg, "two", "hi");
1456 r = MsiEvaluateCondition(hpkg, "one << two");
1457 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1459 MsiSetProperty(hpkg, "one", "abcdhithere");
1460 MsiSetProperty(hpkg, "two", "hi");
1461 r = MsiEvaluateCondition(hpkg, "one << two");
1462 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1464 MsiSetProperty(hpkg, "one", "");
1465 MsiSetProperty(hpkg, "two", "hi");
1466 r = MsiEvaluateCondition(hpkg, "one << two");
1467 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1469 MsiSetProperty(hpkg, "one", "hithere");
1470 MsiSetProperty(hpkg, "two", "");
1471 r = MsiEvaluateCondition(hpkg, "one << two");
1472 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1474 MsiSetProperty(hpkg, "one", "");
1475 MsiSetProperty(hpkg, "two", "");
1476 r = MsiEvaluateCondition(hpkg, "one << two");
1477 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1479 MsiSetProperty(hpkg, "one", "1234");
1480 MsiSetProperty(hpkg, "two", "1");
1481 r = MsiEvaluateCondition(hpkg, "one << two");
1482 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1484 MsiSetProperty(hpkg, "one", "1234 one");
1485 MsiSetProperty(hpkg, "two", "1");
1486 r = MsiEvaluateCondition(hpkg, "one << two");
1487 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1489 MsiSetProperty(hpkg, "one", "hithere");
1490 MsiSetProperty(hpkg, "two", "there");
1491 r = MsiEvaluateCondition(hpkg, "one >> two");
1492 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1494 MsiSetProperty(hpkg, "one", "hithere");
1495 MsiSetProperty(hpkg, "two", "hi");
1496 r = MsiEvaluateCondition(hpkg, "one >> two");
1497 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1499 MsiSetProperty(hpkg, "one", "there");
1500 MsiSetProperty(hpkg, "two", "hithere");
1501 r = MsiEvaluateCondition(hpkg, "one >> two");
1502 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1504 MsiSetProperty(hpkg, "one", "there");
1505 MsiSetProperty(hpkg, "two", "there");
1506 r = MsiEvaluateCondition(hpkg, "one >> two");
1507 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1509 MsiSetProperty(hpkg, "one", "abcdhithere");
1510 MsiSetProperty(hpkg, "two", "hi");
1511 r = MsiEvaluateCondition(hpkg, "one >> two");
1512 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1514 MsiSetProperty(hpkg, "one", "");
1515 MsiSetProperty(hpkg, "two", "there");
1516 r = MsiEvaluateCondition(hpkg, "one >> two");
1517 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1519 MsiSetProperty(hpkg, "one", "there");
1520 MsiSetProperty(hpkg, "two", "");
1521 r = MsiEvaluateCondition(hpkg, "one >> two");
1522 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1524 MsiSetProperty(hpkg, "one", "");
1525 MsiSetProperty(hpkg, "two", "");
1526 r = MsiEvaluateCondition(hpkg, "one >> two");
1527 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1529 MsiSetProperty(hpkg, "one", "1234");
1530 MsiSetProperty(hpkg, "two", "4");
1531 r = MsiEvaluateCondition(hpkg, "one >> two");
1532 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1534 MsiSetProperty(hpkg, "one", "one 1234");
1535 MsiSetProperty(hpkg, "two", "4");
1536 r = MsiEvaluateCondition(hpkg, "one >> two");
1537 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1539 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1541 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1542 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1544 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1545 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1547 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1548 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1550 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1551 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1553 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1554 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1556 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1557 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1559 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1560 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1562 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1563 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1565 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1566 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1568 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1569 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1571 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1572 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1574 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1575 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1577 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1578 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1580 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1581 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1583 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1584 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1586 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1587 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1589 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1590 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1592 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1593 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1595 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1596 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1598 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1599 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1601 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1602 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1604 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1605 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1607 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1608 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1610 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1611 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1613 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1614 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1616 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1617 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1619 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1620 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1622 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1623 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1625 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1626 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1628 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1629 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1631 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1632 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1634 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1635 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1637 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1638 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1640 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1641 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1643 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1644 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1646 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1647 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1649 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1650 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1652 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1653 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1654 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1656 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1657 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1659 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1660 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1662 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1663 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1665 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1666 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1668 MsiSetProperty(hpkg, "one", "1");
1669 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1670 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1672 MsiSetProperty(hpkg, "X", "5.0");
1674 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1675 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1677 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1678 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1680 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1681 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1683 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1684 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1686 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1687 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1689 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1690 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1692 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1693 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1695 /* feature doesn't exist */
1696 r = MsiEvaluateCondition(hpkg, "&nofeature");
1697 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1699 MsiSetProperty(hpkg, "A", "2");
1700 MsiSetProperty(hpkg, "X", "50");
1702 r = MsiEvaluateCondition(hpkg, "2 <= X");
1703 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1705 r = MsiEvaluateCondition(hpkg, "A <= X");
1706 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1708 r = MsiEvaluateCondition(hpkg, "A <= 50");
1709 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1711 MsiSetProperty(hpkg, "X", "50val");
1713 r = MsiEvaluateCondition(hpkg, "2 <= X");
1714 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1716 r = MsiEvaluateCondition(hpkg, "A <= X");
1717 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1719 MsiSetProperty(hpkg, "A", "7");
1720 MsiSetProperty(hpkg, "X", "50");
1722 r = MsiEvaluateCondition(hpkg, "7 <= X");
1723 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1725 r = MsiEvaluateCondition(hpkg, "A <= X");
1726 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1728 r = MsiEvaluateCondition(hpkg, "A <= 50");
1729 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1731 MsiSetProperty(hpkg, "X", "50val");
1733 r = MsiEvaluateCondition(hpkg, "2 <= X");
1734 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1736 r = MsiEvaluateCondition(hpkg, "A <= X");
1737 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1739 MsiCloseHandle( hpkg );
1740 DeleteFile(msifile);
1743 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1751 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1752 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1755 static void test_props(void)
1757 MSIHANDLE hpkg, hdb;
1762 hdb = create_package_db();
1764 "CREATE TABLE `Property` ( "
1765 "`Property` CHAR(255) NOT NULL, "
1766 "`Value` CHAR(255) "
1767 "PRIMARY KEY `Property`)" );
1768 ok( r == ERROR_SUCCESS , "Failed\n" );
1771 "INSERT INTO `Property` "
1772 "(`Property`, `Value`) "
1773 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1774 ok( r == ERROR_SUCCESS , "Failed\n" );
1776 hpkg = package_from_db( hdb );
1777 ok( hpkg, "failed to create package\n");
1779 /* test invalid values */
1780 r = MsiGetProperty( 0, NULL, NULL, NULL );
1781 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1783 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1784 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1786 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1787 ok( r == ERROR_SUCCESS, "wrong return val\n");
1789 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1790 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1792 /* test retrieving an empty/nonexistent property */
1794 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1795 ok( r == ERROR_SUCCESS, "wrong return val\n");
1796 ok( sz == 0, "wrong size returned\n");
1798 check_prop_empty( hpkg, "boo");
1801 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1802 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1803 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1804 ok( sz == 0, "wrong size returned\n");
1808 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1809 ok( r == ERROR_SUCCESS, "wrong return val\n");
1810 ok( buffer[0] == 0, "buffer was not changed\n");
1811 ok( sz == 0, "wrong size returned\n");
1813 /* set the property to something */
1814 r = MsiSetProperty( 0, NULL, NULL );
1815 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1817 r = MsiSetProperty( hpkg, NULL, NULL );
1818 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1820 r = MsiSetProperty( hpkg, "", NULL );
1821 ok( r == ERROR_SUCCESS, "wrong return val\n");
1823 /* try set and get some illegal property identifiers */
1824 r = MsiSetProperty( hpkg, "", "asdf" );
1825 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1827 r = MsiSetProperty( hpkg, "=", "asdf" );
1828 ok( r == ERROR_SUCCESS, "wrong return val\n");
1830 r = MsiSetProperty( hpkg, " ", "asdf" );
1831 ok( r == ERROR_SUCCESS, "wrong return val\n");
1833 r = MsiSetProperty( hpkg, "'", "asdf" );
1834 ok( r == ERROR_SUCCESS, "wrong return val\n");
1838 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1839 ok( r == ERROR_SUCCESS, "wrong return val\n");
1840 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1842 /* set empty values */
1843 r = MsiSetProperty( hpkg, "boo", NULL );
1844 ok( r == ERROR_SUCCESS, "wrong return val\n");
1845 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1847 r = MsiSetProperty( hpkg, "boo", "" );
1848 ok( r == ERROR_SUCCESS, "wrong return val\n");
1849 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1851 /* set a non-empty value */
1852 r = MsiSetProperty( hpkg, "boo", "xyz" );
1853 ok( r == ERROR_SUCCESS, "wrong return val\n");
1857 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1858 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1859 ok( buffer[0] == 0, "buffer was not changed\n");
1860 ok( sz == 3, "wrong size returned\n");
1864 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1865 ok( r == ERROR_SUCCESS, "wrong return val\n");
1866 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1867 ok( sz == 3, "wrong size returned\n");
1871 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1872 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1873 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1874 ok( sz == 3, "wrong size returned\n");
1876 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1877 ok( r == ERROR_SUCCESS, "wrong return val\n");
1880 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1881 ok( r == ERROR_SUCCESS, "wrong return val\n");
1882 ok( !strcmp(buffer,""), "buffer wrong\n");
1883 ok( sz == 0, "wrong size returned\n");
1886 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1887 ok( r == ERROR_SUCCESS, "wrong return val\n");
1888 ok( !strcmp(buffer,""), "buffer wrong\n");
1889 ok( sz == 0, "wrong size returned\n");
1892 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1893 ok( r == ERROR_SUCCESS, "wrong return val\n");
1894 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1895 ok( sz == 3, "wrong size returned\n");
1897 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1898 ok( r == ERROR_SUCCESS, "wrong return val\n");
1901 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1902 ok( r == ERROR_SUCCESS, "return wrong\n");
1903 ok( sz == 13, "size wrong (%d)\n", sz);
1906 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1907 ok( r == ERROR_MORE_DATA, "return wrong\n");
1908 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1910 r = MsiSetProperty(hpkg, "property", "value");
1911 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1914 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1915 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1916 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1918 r = MsiSetProperty(hpkg, "property", NULL);
1919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1922 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1923 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1924 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1926 MsiCloseHandle( hpkg );
1927 DeleteFile(msifile);
1930 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1932 MSIHANDLE hview, hrec;
1934 CHAR buffer[MAX_PATH];
1938 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1939 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1940 r = MsiViewExecute(hview, 0);
1941 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1944 while (r == ERROR_SUCCESS && !found)
1946 r = MsiViewFetch(hview, &hrec);
1947 if (r != ERROR_SUCCESS) break;
1950 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1951 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1954 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1955 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1959 MsiCloseHandle(hrec);
1962 MsiViewClose(hview);
1963 MsiCloseHandle(hview);
1968 static void test_property_table(void)
1972 MSIHANDLE hpkg, hdb, hrec;
1973 char buffer[MAX_PATH];
1977 hdb = create_package_db();
1978 ok( hdb, "failed to create package\n");
1980 hpkg = package_from_db(hdb);
1981 ok( hpkg, "failed to create package\n");
1983 MsiCloseHandle(hdb);
1985 hdb = MsiGetActiveDatabase(hpkg);
1987 query = "CREATE TABLE `_Property` ( "
1988 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1989 r = run_query(hdb, query);
1990 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1992 MsiCloseHandle(hdb);
1993 MsiCloseHandle(hpkg);
1994 DeleteFile(msifile);
1996 hdb = create_package_db();
1997 ok( hdb, "failed to create package\n");
1999 query = "CREATE TABLE `_Property` ( "
2000 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2001 r = run_query(hdb, query);
2002 ok(r == ERROR_SUCCESS, "failed to create table\n");
2004 query = "ALTER `_Property` ADD `foo` INTEGER";
2005 r = run_query(hdb, query);
2006 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2008 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2009 r = run_query(hdb, query);
2010 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2012 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2013 r = run_query(hdb, query);
2014 ok(r == ERROR_SUCCESS, "failed to add column\n");
2016 hpkg = package_from_db(hdb);
2019 ok(!hpkg, "package should not be created\n");
2022 MsiCloseHandle(hdb);
2023 MsiCloseHandle(hpkg);
2024 DeleteFile(msifile);
2026 hdb = create_package_db();
2027 ok (hdb, "failed to create package database\n");
2029 r = create_property_table(hdb);
2030 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2032 r = add_property_entry(hdb, "'prop', 'val'");
2033 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2035 hpkg = package_from_db(hdb);
2036 ok(hpkg, "failed to create package\n");
2038 MsiCloseHandle(hdb);
2041 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2043 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2045 hdb = MsiGetActiveDatabase(hpkg);
2047 found = find_prop_in_property(hdb, "prop", "val");
2048 ok(found, "prop should be in the _Property table\n");
2050 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2051 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2053 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2054 r = do_query(hdb, query, &hrec);
2055 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2057 found = find_prop_in_property(hdb, "dantes", "mercedes");
2058 ok(found == FALSE, "dantes should not be in the _Property table\n");
2061 lstrcpy(buffer, "aaa");
2062 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2064 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2066 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2069 found = find_prop_in_property(hdb, "dantes", "mercedes");
2070 ok(found == TRUE, "dantes should be in the _Property table\n");
2072 MsiCloseHandle(hdb);
2073 MsiCloseHandle(hpkg);
2074 DeleteFile(msifile);
2077 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2082 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2083 if( res == ERROR_SUCCESS )
2087 r = MsiViewExecute( htab, hrec );
2088 if( r != ERROR_SUCCESS )
2091 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2094 r = MsiViewClose( htab );
2095 if( r != ERROR_SUCCESS )
2098 r = MsiCloseHandle( htab );
2099 if( r != ERROR_SUCCESS )
2105 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2107 return try_query_param( hdb, szQuery, 0 );
2110 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2115 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2116 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2118 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2121 r = MsiSummaryInfoPersist(summary);
2122 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2124 MsiCloseHandle(summary);
2127 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2132 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2133 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2135 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2138 r = MsiSummaryInfoPersist(summary);
2139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2141 MsiCloseHandle(summary);
2144 static void test_msipackage(void)
2146 MSIHANDLE hdb = 0, hpack = 100;
2151 /* NULL szPackagePath */
2152 r = MsiOpenPackage(NULL, &hpack);
2153 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2155 /* empty szPackagePath */
2156 r = MsiOpenPackage("", &hpack);
2159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2162 if (r == ERROR_SUCCESS)
2163 MsiCloseHandle(hpack);
2165 /* nonexistent szPackagePath */
2166 r = MsiOpenPackage("nonexistent", &hpack);
2167 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2170 r = MsiOpenPackage(msifile, NULL);
2171 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2175 r = MsiOpenPackage(name, &hpack);
2176 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2178 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2179 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2181 /* database exists, but is emtpy */
2182 sprintf(name, "#%d", hdb);
2183 r = MsiOpenPackage(name, &hpack);
2184 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2185 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2187 query = "CREATE TABLE `Property` ( "
2188 "`Property` CHAR(72), `Value` CHAR(0) "
2189 "PRIMARY KEY `Property`)";
2190 r = try_query(hdb, query);
2191 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2193 query = "CREATE TABLE `InstallExecuteSequence` ("
2194 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2195 "PRIMARY KEY `Action`)";
2196 r = try_query(hdb, query);
2197 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2199 /* a few key tables exist */
2200 sprintf(name, "#%d", hdb);
2201 r = MsiOpenPackage(name, &hpack);
2202 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2203 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2205 MsiCloseHandle(hdb);
2206 DeleteFile(msifile);
2208 /* start with a clean database to show what constitutes a valid package */
2209 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2210 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2212 sprintf(name, "#%d", hdb);
2214 /* The following summary information props must exist:
2219 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2220 r = MsiOpenPackage(name, &hpack);
2221 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2222 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2224 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2225 r = MsiOpenPackage(name, &hpack);
2226 ok(r == ERROR_SUCCESS,
2227 "Expected ERROR_SUCCESS, got %d\n", r);
2229 MsiCloseHandle(hpack);
2230 MsiCloseHandle(hdb);
2231 DeleteFile(msifile);
2234 static void test_formatrecord2(void)
2236 MSIHANDLE hpkg, hrec ;
2241 hpkg = package_from_db(create_package_db());
2242 ok( hpkg, "failed to create package\n");
2244 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2245 ok( r == ERROR_SUCCESS, "set property failed\n");
2247 hrec = MsiCreateRecord(2);
2248 ok(hrec, "create record failed\n");
2250 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2251 ok( r == ERROR_SUCCESS, "format record failed\n");
2255 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2257 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2258 r = MsiRecordSetString(hrec, 1, "hoo");
2260 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2261 ok( sz == 3, "size wrong\n");
2262 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2263 ok( r == ERROR_SUCCESS, "format failed\n");
2265 r = MsiRecordSetString(hrec, 0, "x[~]x");
2267 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2268 ok( sz == 3, "size wrong\n");
2269 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2270 ok( r == ERROR_SUCCESS, "format failed\n");
2272 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2273 r = MsiRecordSetString(hrec, 1, "hoo");
2275 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2276 ok( sz == 3, "size wrong\n");
2277 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2278 ok( r == ERROR_SUCCESS, "format failed\n");
2280 r = MsiRecordSetString(hrec, 0, "[\\[]");
2282 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2283 ok( sz == 1, "size wrong\n");
2284 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2285 ok( r == ERROR_SUCCESS, "format failed\n");
2287 SetEnvironmentVariable("FOO", "BAR");
2288 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2290 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2291 ok( sz == 3, "size wrong\n");
2292 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2293 ok( r == ERROR_SUCCESS, "format failed\n");
2295 r = MsiRecordSetString(hrec, 0, "[[1]]");
2296 r = MsiRecordSetString(hrec, 1, "%FOO");
2298 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2299 ok( sz == 3, "size wrong\n");
2300 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2301 ok( r == ERROR_SUCCESS, "format failed\n");
2303 MsiCloseHandle( hrec );
2304 MsiCloseHandle( hpkg );
2305 DeleteFile(msifile);
2308 static void test_states(void)
2313 INSTALLSTATE state, action;
2315 static const CHAR msifile2[] = "winetest2.msi";
2316 static const CHAR msifile3[] = "winetest3.msi";
2317 static const CHAR msifile4[] = "winetest4.msi";
2319 hdb = create_package_db();
2320 ok ( hdb, "failed to create package database\n" );
2322 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2323 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2325 r = create_property_table( hdb );
2326 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2328 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2329 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2331 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2332 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2334 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2335 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2337 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2338 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2340 r = create_install_execute_sequence_table( hdb );
2341 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2343 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2344 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2346 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2347 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2349 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2350 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2352 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2353 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2355 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2356 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2358 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2359 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2361 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2362 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2364 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2365 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2367 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2368 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2370 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2371 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2373 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2374 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2376 r = create_media_table( hdb );
2377 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2379 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2380 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2382 r = create_feature_table( hdb );
2383 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2385 r = create_component_table( hdb );
2386 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2388 /* msidbFeatureAttributesFavorLocal */
2389 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2390 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2392 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2393 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2394 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2396 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2397 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2398 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2400 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2401 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2402 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2404 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2405 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2406 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2408 /* msidbFeatureAttributesFavorSource */
2409 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2410 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2412 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2413 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2414 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2416 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2417 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2418 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2420 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2421 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2422 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2424 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2425 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2426 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2428 /* msidbFeatureAttributesFavorSource */
2429 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2430 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2432 /* msidbFeatureAttributesFavorLocal */
2433 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2434 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2437 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2438 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2440 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2441 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2442 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2444 /* no feature parent:msidbComponentAttributesLocalOnly */
2445 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2446 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2448 /* msidbFeatureAttributesFavorLocal:removed */
2449 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2450 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2452 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2453 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2454 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2456 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2457 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2458 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2460 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2461 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2462 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2464 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2465 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2466 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2468 /* msidbFeatureAttributesFavorSource:removed */
2469 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2470 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2472 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2473 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2474 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2476 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2477 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2478 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2480 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2481 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2482 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2484 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2485 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2486 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2488 /* msidbFeatureAttributesFavorLocal */
2489 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2490 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2492 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2493 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2495 /* msidbFeatureAttributesFavorSource */
2496 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2497 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2499 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2500 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2502 /* msidbFeatureAttributesFavorAdvertise */
2503 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2504 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2506 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2507 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2509 r = create_feature_components_table( hdb );
2510 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2512 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2513 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2515 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2516 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2518 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2519 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2521 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2522 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2524 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2525 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2527 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2528 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2530 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2531 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2533 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2534 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2536 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2537 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2539 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2540 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2542 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2543 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2545 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2546 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2548 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2549 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2551 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2552 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2554 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2555 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2557 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2558 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2560 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2561 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2563 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2564 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2566 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2567 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2569 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2570 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2572 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2573 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2575 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2576 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2578 r = create_file_table( hdb );
2579 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2581 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2582 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2584 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2585 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2587 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2588 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2590 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2591 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2593 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2594 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2596 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2597 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2599 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2600 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2602 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2603 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2605 /* compressed file */
2606 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2607 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2609 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2610 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2612 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2613 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2615 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2616 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2618 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2619 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2621 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2622 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2624 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2625 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2627 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2628 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2630 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2631 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2633 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2634 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2636 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2637 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2639 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2640 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2642 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2643 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2645 MsiDatabaseCommit(hdb);
2647 /* these properties must not be in the saved msi file */
2648 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2649 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2651 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2652 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2654 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2655 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2657 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2658 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2660 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2661 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2663 hpkg = package_from_db( hdb );
2664 ok( hpkg, "failed to create package\n");
2666 MsiCloseHandle(hdb);
2668 CopyFileA(msifile, msifile2, FALSE);
2669 CopyFileA(msifile, msifile3, FALSE);
2670 CopyFileA(msifile, msifile4, FALSE);
2674 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2675 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2676 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2677 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2681 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2682 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2683 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2684 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2688 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2689 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2690 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2691 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2695 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2696 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2697 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2698 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2702 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2703 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2704 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2705 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2709 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2710 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2711 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2712 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2716 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2717 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2718 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2719 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2723 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2724 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2725 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2726 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2730 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2731 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2732 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2733 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2737 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2738 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2739 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2740 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2744 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2745 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2746 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2747 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2751 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2752 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2753 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2754 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2758 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2759 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2760 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2761 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2765 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2766 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2767 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2768 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2772 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2773 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2774 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2775 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2779 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2780 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2781 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2782 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2786 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2787 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2788 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2789 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2793 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2794 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2795 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2796 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2800 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2801 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2802 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2803 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2807 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2808 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2809 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2810 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2814 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2815 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2816 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2817 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2821 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2822 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2823 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2824 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2828 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2829 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2830 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2831 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2835 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2836 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2837 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2838 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2842 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2843 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2844 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2845 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2849 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2850 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2851 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2852 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2856 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2857 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2858 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2859 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2863 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2864 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2865 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2866 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2870 r = MsiGetComponentState(hpkg, "tau", &state, &action);
2871 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2872 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2873 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2877 r = MsiGetComponentState(hpkg, "phi", &state, &action);
2878 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2879 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2880 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2884 r = MsiGetComponentState(hpkg, "chi", &state, &action);
2885 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2886 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2887 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2889 r = MsiDoAction( hpkg, "CostInitialize");
2890 ok( r == ERROR_SUCCESS, "cost init failed\n");
2894 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2895 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2896 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2897 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2901 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2902 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2903 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2904 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2908 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2909 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2910 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2911 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2915 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2916 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2917 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2918 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2922 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2923 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2924 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2925 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2929 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2930 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2931 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2932 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2936 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2937 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2938 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2939 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2943 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2944 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2945 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2946 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2950 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2951 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2952 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2953 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2957 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2958 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2959 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2960 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2964 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2965 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2966 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2967 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2971 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2972 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2973 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2974 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2978 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2979 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2980 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2981 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2985 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2986 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2987 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2988 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2992 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2993 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2994 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2995 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2999 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3000 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3001 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3002 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3006 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3007 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3008 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3009 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3013 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3014 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3015 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3016 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3020 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3021 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3022 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3023 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3027 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3029 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3030 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3034 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3035 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3036 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3037 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3041 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3042 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3043 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3044 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3048 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3049 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3050 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3051 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3055 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3056 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3057 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3058 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3062 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3063 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3064 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3065 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3069 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3071 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3072 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3076 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3077 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3078 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3079 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3083 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3084 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3085 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3086 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3090 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3092 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3093 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3097 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3099 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3100 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3104 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3106 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3107 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3109 r = MsiDoAction( hpkg, "FileCost");
3110 ok( r == ERROR_SUCCESS, "file cost failed\n");
3114 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3116 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3117 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3121 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3123 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3124 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3128 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3130 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3131 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3135 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3137 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3138 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3142 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3144 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3145 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3149 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3151 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3152 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3156 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3158 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3159 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3163 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3165 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3166 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3170 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3172 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3173 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3177 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3179 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3180 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3184 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3186 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3187 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3191 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3193 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3194 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3198 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3200 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3201 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3205 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3207 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3208 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3212 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3214 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3215 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3219 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3220 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3221 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3222 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3226 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3227 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3228 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3229 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3233 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3234 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3235 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3236 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3240 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3241 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3242 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3243 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3247 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3248 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3249 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3250 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3254 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3255 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3256 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3257 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3261 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3262 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3263 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3264 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3268 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3269 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3270 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3271 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3275 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3276 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3277 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3278 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3282 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3283 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3284 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3285 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3289 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3290 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3291 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3292 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3296 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3297 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3298 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3299 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3303 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3304 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3305 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3306 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3310 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3311 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3312 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3313 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3317 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3318 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3319 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3320 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3324 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3325 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3326 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3327 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3329 r = MsiDoAction( hpkg, "CostFinalize");
3330 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3334 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3335 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3336 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3337 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3341 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3342 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3343 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3344 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3348 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3349 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3350 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3351 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3355 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3356 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3357 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3358 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3362 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3363 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3364 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3365 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3369 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3370 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3371 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3372 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3376 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3377 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3378 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3379 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3383 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3384 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3385 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3386 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3390 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3391 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3392 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3393 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3397 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3398 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3399 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3400 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3404 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3405 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3406 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3407 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3411 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3412 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3413 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3414 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3418 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3419 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3420 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3421 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3425 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3426 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3427 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3428 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3432 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3433 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3434 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3435 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3439 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3440 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3441 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3442 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3446 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3447 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3448 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3449 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3453 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3454 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3455 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3456 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3460 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3461 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3462 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3463 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3467 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3468 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3469 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3470 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3474 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3475 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3476 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3477 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3481 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3482 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3483 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3484 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3488 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3489 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3490 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3491 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3495 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3496 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3497 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3498 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3502 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3503 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3504 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3505 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3509 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3510 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3511 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3512 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3516 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3517 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3518 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3519 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3523 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3524 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3525 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3526 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3530 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3531 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3532 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3533 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3537 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3538 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3539 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3540 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3544 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3545 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3546 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3547 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3549 MsiCloseHandle( hpkg );
3551 /* publish the features and components */
3552 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3555 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3556 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3558 /* these properties must not be in the saved msi file */
3559 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3560 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3562 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3563 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3565 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3566 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3568 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3569 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3571 hpkg = package_from_db( hdb );
3572 ok( hpkg, "failed to create package\n");
3574 MsiCloseHandle(hdb);
3578 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3579 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3580 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3581 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3585 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3586 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3587 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3588 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3592 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3593 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3594 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3595 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3599 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3600 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3601 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3602 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3606 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3607 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3608 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3609 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3613 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3614 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3615 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3616 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3620 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3621 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3622 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3623 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3627 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3628 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3629 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3630 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3634 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3635 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3636 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3637 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3641 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3642 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3643 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3644 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3648 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3649 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3650 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3651 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3655 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3656 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3657 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3658 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3662 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3663 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3664 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3665 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3669 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3670 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3671 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3672 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3676 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3677 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3678 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3679 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3683 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3684 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3685 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3686 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3690 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3691 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3692 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3693 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3697 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3698 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3699 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3700 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3704 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3705 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3706 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3707 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3711 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3712 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3713 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3714 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3718 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3719 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3720 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3721 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3725 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3726 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3727 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3728 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3732 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3733 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3734 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3735 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3739 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3740 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3741 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3742 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3746 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3747 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3748 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3749 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3753 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3754 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3755 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3756 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3760 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3761 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3762 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3763 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3767 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3768 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3769 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3770 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3774 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3775 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3776 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3777 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3781 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3782 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3783 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3784 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3788 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3789 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3790 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3791 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3793 r = MsiDoAction( hpkg, "CostInitialize");
3794 ok( r == ERROR_SUCCESS, "cost init failed\n");
3798 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3799 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3800 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3801 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3805 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3806 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3807 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3808 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3812 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3814 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3815 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3819 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3820 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3821 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3822 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3826 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3828 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3829 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3833 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3835 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3836 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3840 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3842 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3843 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3847 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3849 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3850 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3854 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3855 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3856 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3857 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3861 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3863 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3864 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3868 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3869 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3870 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3871 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3875 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3876 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3877 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3878 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3882 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3883 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3884 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3885 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3889 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3890 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3891 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3892 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3896 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3897 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3898 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3899 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3903 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3904 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3905 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3906 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3910 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3911 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3912 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3913 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3917 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3918 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3919 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3920 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3924 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3925 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3926 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3927 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3931 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3932 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3933 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3934 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3938 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3939 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3940 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3941 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3945 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3947 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3948 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3952 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3953 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3954 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3955 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3959 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3961 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3962 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3966 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3968 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3969 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3973 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3975 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3976 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3980 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3982 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3983 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3987 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3989 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3990 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3994 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3996 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3997 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4001 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4002 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4003 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4004 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4008 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4009 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4010 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4011 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4013 r = MsiDoAction( hpkg, "FileCost");
4014 ok( r == ERROR_SUCCESS, "file cost failed\n");
4018 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4019 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4020 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4021 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4025 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4026 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4027 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4028 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4032 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4033 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4034 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4035 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4039 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4040 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4041 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4042 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4046 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4047 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4048 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4049 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4053 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4054 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4055 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4056 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4060 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4061 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4062 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4063 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4067 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4068 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4069 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4070 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4074 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4075 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4076 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4077 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4081 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4082 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4083 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4084 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4088 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4089 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4090 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4091 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4095 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4096 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4097 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4098 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4102 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4103 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4104 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4105 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4109 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4110 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4111 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4112 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4116 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4117 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4118 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4119 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4123 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4124 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4125 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4126 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4130 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4131 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4132 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4133 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4137 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4138 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4139 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4140 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4144 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4145 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4146 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4147 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4151 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4152 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4153 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4154 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4158 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4159 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4160 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4161 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4165 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4166 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4167 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4168 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4172 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4173 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4174 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4175 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4179 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4180 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4181 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4182 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4186 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4187 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4188 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4189 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4193 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4194 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4195 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4196 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4200 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4202 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4203 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4207 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4209 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4210 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4214 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4215 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4216 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4217 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4221 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4222 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4223 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4224 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4226 r = MsiDoAction( hpkg, "CostFinalize");
4227 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4231 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4233 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4234 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4238 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4240 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4241 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4245 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4247 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4248 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4252 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4253 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4254 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4255 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4259 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4260 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4261 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4262 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4266 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4268 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4269 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4273 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4274 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4275 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4276 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4280 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4281 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4282 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4283 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4287 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4288 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4289 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4290 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4294 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4295 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4296 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4297 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4301 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4302 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4303 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4304 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4308 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4309 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4310 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4311 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4315 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4316 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4317 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4318 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4322 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4323 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4324 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4325 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4329 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4330 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4331 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4332 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4336 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4337 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4338 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4339 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4343 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4344 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4345 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4346 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4350 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4351 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4352 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4353 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4357 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4358 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4359 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4360 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4364 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4365 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4366 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4367 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4371 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4372 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4373 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4374 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4378 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4379 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4380 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4381 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4385 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4386 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4387 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4388 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4392 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4393 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4394 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4395 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4399 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4400 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4401 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4402 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4406 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4407 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4408 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4409 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4413 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4414 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4415 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4416 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4420 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4421 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4422 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4423 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4427 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4428 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4429 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4430 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4434 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4435 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4436 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4437 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4441 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4442 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4443 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4444 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4446 MsiCloseHandle(hpkg);
4448 /* uninstall the product */
4449 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4452 /* all features installed locally */
4453 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4456 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4457 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4459 /* these properties must not be in the saved msi file */
4460 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4461 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4463 hpkg = package_from_db( hdb );
4464 ok( hpkg, "failed to create package\n");
4468 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4469 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4470 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4471 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4475 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4476 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4477 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4478 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4482 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4483 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4484 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4485 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4489 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4490 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4491 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4492 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4496 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4497 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4498 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4499 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4503 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4504 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4505 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4506 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4510 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4511 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4512 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4513 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4517 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4518 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4519 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4520 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4524 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4525 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4526 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4527 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4531 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4532 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4533 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4534 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4538 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4539 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4540 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4541 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4545 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4546 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4547 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4548 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4552 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4553 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4554 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4555 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4559 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4560 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4561 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4562 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4566 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4567 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4568 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4569 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4573 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4574 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4575 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4576 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4580 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4581 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4582 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4583 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4587 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4588 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4589 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4590 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4594 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4595 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4596 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4597 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4601 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4602 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4603 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4604 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4608 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4609 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4610 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4611 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4615 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4616 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4617 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4618 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4622 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4623 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4624 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4625 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4629 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4630 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4631 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4632 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4636 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4637 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4638 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4639 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4643 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4644 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4645 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4646 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4650 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4651 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4652 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4653 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4657 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4658 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4659 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4660 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4664 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4665 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4666 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4667 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4671 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4672 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4673 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4674 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4678 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4679 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4680 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4681 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4683 r = MsiDoAction( hpkg, "CostInitialize");
4684 ok( r == ERROR_SUCCESS, "cost init failed\n");
4688 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4690 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4691 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4695 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4696 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4697 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4698 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4702 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4703 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4704 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4705 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4709 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4710 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4711 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4712 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4716 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4717 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4718 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4719 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4723 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4724 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4725 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4726 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4730 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4731 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4732 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4733 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4737 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4738 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4739 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4740 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4744 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4745 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4746 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4747 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4751 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4752 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4753 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4754 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4758 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4759 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4760 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4761 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4765 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4766 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4767 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4768 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4772 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4773 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4774 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4775 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4779 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4780 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4781 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4782 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4786 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4787 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4788 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4789 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4793 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4794 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4795 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4796 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4800 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4801 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4802 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4803 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4807 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4808 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4809 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4810 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4814 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4815 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4816 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4817 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4821 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4822 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4823 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4824 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4828 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4829 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4830 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4831 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4835 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4836 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4837 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4838 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4842 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4843 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4844 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4845 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4849 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4850 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4851 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4852 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4856 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4858 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4859 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4863 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4864 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4865 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4866 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4870 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4871 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4872 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4873 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4877 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4879 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4880 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4884 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4886 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4887 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4891 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4893 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4894 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4898 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4900 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4901 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4903 r = MsiDoAction( hpkg, "FileCost");
4904 ok( r == ERROR_SUCCESS, "file cost failed\n");
4908 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4909 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4910 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4911 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4915 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4916 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4917 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4918 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4922 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4923 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4924 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4925 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4929 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4930 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4931 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4932 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4936 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4937 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4938 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4939 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4943 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4944 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4945 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4946 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4950 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4951 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4952 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4953 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4957 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4958 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4959 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4960 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4964 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4965 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4966 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4967 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4971 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4972 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4973 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4974 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4978 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4979 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4980 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4981 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4985 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4986 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4987 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4988 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4992 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4993 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4994 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4995 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4999 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5000 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5001 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5002 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5006 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5007 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5008 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5009 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5013 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5014 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5015 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5016 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5020 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5021 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5022 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5023 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5027 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5029 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5030 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5034 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5035 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5036 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5037 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5041 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5042 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5043 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5044 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5048 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5049 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5050 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5051 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5055 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5056 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5057 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5058 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5062 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5063 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5064 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5065 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5069 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5071 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5072 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5076 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5077 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5078 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5079 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5083 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5084 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5085 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5086 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5090 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5092 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5093 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5097 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5099 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5100 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5104 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5106 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5107 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5111 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5112 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5113 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5114 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5118 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5120 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5121 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5123 r = MsiDoAction( hpkg, "CostFinalize");
5124 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5128 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5130 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5131 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5135 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5137 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5138 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5142 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5144 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5145 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5149 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5151 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5152 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5156 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5158 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5159 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5163 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5165 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5166 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5170 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5172 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5173 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5177 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5179 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5180 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5184 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5186 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5187 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5191 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5193 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5194 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5198 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5200 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5201 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5205 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5207 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5208 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5212 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5214 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5215 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5219 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5220 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5221 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5222 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5226 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5227 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5228 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5229 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5233 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5234 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5235 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5236 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5240 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5241 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5242 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5243 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5247 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5248 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5249 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5250 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5254 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5255 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5256 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5257 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5261 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5262 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5263 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5264 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5268 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5269 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5270 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5271 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5275 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5276 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5277 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5278 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5282 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5283 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5284 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5285 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5289 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5290 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5291 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5292 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5296 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5297 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5298 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5299 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5303 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5304 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5305 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5306 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5310 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5311 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5312 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5313 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5317 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5318 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5319 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5320 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5324 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5325 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5326 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5327 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5331 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5332 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5333 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5334 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5338 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5339 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5340 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5341 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5343 MsiCloseHandle(hpkg);
5345 /* uninstall the product */
5346 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5347 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5349 /* all features installed from source */
5350 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5353 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5354 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5356 /* this property must not be in the saved msi file */
5357 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5358 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5360 hpkg = package_from_db( hdb );
5361 ok( hpkg, "failed to create package\n");
5365 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5366 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5367 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5368 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5372 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5373 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5374 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5375 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5379 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5380 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5381 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5382 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5386 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5387 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5388 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5389 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5393 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5394 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5395 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5396 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5400 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5401 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5402 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5403 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5407 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5408 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5409 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5410 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5414 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5415 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5416 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5417 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5421 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5422 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5423 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5424 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5428 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5429 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5430 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5431 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5435 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5436 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5437 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5438 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5442 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5443 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5444 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5445 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5449 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5450 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5451 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5452 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5456 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5457 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5458 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5459 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5463 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5464 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5465 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5466 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5470 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5471 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5472 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5473 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5477 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5478 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5479 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5480 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5484 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5485 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5486 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5487 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5491 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5492 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5493 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5494 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5498 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5499 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5500 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5501 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5505 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5506 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5507 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5508 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5512 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5513 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5514 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5515 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5519 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5520 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5521 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5522 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5526 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5527 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5528 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5529 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5533 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5534 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5535 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5536 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5540 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5541 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5542 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5543 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5547 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5548 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5549 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5550 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5554 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5555 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5556 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5557 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5561 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5562 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5563 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5564 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5568 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5569 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5570 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5571 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5575 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5576 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5577 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5578 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5580 r = MsiDoAction( hpkg, "CostInitialize");
5581 ok( r == ERROR_SUCCESS, "cost init failed\n");
5585 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5586 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5587 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5588 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5592 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5593 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5594 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5595 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5599 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5600 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5601 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5602 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5606 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5607 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5608 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5609 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5613 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5614 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5615 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5616 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5620 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5621 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5622 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5623 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5627 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5628 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5629 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5630 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5634 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5635 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5636 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5637 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5641 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5642 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5643 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5644 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5648 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5649 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5650 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5651 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5655 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5656 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5657 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5658 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5662 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5663 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5664 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5665 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5669 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5670 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5671 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5672 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5676 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5677 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5678 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5679 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5683 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5684 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5685 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5686 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5690 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5691 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5692 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5693 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5697 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5698 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5699 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5700 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5704 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5705 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5706 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5707 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5711 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5712 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5713 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5714 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5718 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5719 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5720 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5721 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5725 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5726 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5727 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5728 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5732 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5733 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5734 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5735 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5739 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5740 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5741 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5742 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5746 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5747 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5748 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5749 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5753 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5754 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5755 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5756 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5760 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5761 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5762 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5763 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5767 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5768 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5769 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5770 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5774 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5775 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5776 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5777 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5781 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5783 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5784 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5788 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5790 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5791 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5795 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5797 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5798 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5800 r = MsiDoAction( hpkg, "FileCost");
5801 ok( r == ERROR_SUCCESS, "file cost failed\n");
5805 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5806 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5807 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5808 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5812 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5814 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5815 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5819 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5820 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5821 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5822 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5826 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5828 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5829 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5833 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5835 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5836 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5840 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5842 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5843 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5847 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5849 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5850 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5854 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5855 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5856 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5857 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5861 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5863 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5864 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5868 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5869 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5870 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5871 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5875 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5876 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5877 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5878 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5882 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5883 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5884 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5885 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5889 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5890 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5891 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5892 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5896 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5897 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5898 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5899 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5903 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5904 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5905 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5906 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5910 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5911 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5912 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5913 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5917 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5918 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5919 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5920 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5924 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5925 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5926 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5927 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5931 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5932 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5933 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5934 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5938 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5939 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5940 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5941 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5945 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5947 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5948 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5952 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5953 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5954 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5955 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5959 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5961 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5962 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5966 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5968 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5969 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5973 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5975 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5976 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5980 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5982 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5983 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5987 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5989 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5990 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5994 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5996 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5997 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6001 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6002 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6003 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6004 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6008 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6009 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6010 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6011 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6015 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6016 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6017 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6018 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6020 r = MsiDoAction( hpkg, "CostFinalize");
6021 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6025 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6026 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6027 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6028 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6032 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6033 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6034 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6035 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6039 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6040 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6041 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6042 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6046 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6047 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6048 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6049 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6053 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6054 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6055 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6056 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6060 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6061 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6062 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6063 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6067 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6068 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6069 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6070 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6074 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6075 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6076 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6077 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6081 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6082 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6083 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6084 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6088 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6089 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6090 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6091 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6095 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6096 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6097 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6098 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6102 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6103 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6104 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6105 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6109 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6110 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6111 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6112 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6116 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6117 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6118 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6119 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6123 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6124 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6125 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6126 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6130 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6131 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6132 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6133 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6137 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6138 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6139 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6140 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6144 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6145 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6146 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6147 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6151 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6152 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6153 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6154 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6158 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6159 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6160 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6161 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6165 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6166 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6167 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6168 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6172 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6173 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6174 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6175 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6179 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6180 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6181 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6182 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6186 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6187 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6188 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6189 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6193 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6194 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6195 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6196 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6200 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6202 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6203 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6207 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6209 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6210 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6214 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6215 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6216 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6217 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6221 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6222 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6223 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6224 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6228 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6229 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6230 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6231 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6235 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6236 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6237 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6238 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6240 MsiCloseHandle(hpkg);
6242 /* reinstall the product */
6243 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6246 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6247 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6249 /* this property must not be in the saved msi file */
6250 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6251 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6253 hpkg = package_from_db( hdb );
6254 ok( hpkg, "failed to create package\n");
6258 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6259 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6260 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6261 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6265 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6266 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6267 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6268 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6272 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6273 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6274 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6275 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6279 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6280 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6281 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6282 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6286 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6287 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6288 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6289 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6293 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6294 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6295 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6296 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6300 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6301 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6302 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6303 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6307 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6308 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6309 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6310 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6314 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6315 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6316 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6317 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6321 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6322 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6323 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6324 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6328 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6329 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6330 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6331 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6335 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6336 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6337 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6338 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6342 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6343 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6344 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6345 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6349 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6350 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6351 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6352 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6356 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6357 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6358 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6359 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6363 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6364 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6365 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6366 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6370 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6371 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6372 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6373 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6377 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6378 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6379 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6380 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6384 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6385 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6386 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6387 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6391 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6392 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6393 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6394 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6398 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6399 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6400 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6401 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6405 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6406 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6407 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6408 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6412 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6413 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6414 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6415 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6419 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6420 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6421 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6422 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6426 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6427 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6428 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6429 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6433 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6434 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6435 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6436 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6440 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6441 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6442 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6443 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6447 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6448 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6449 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6450 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6454 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6455 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6456 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6457 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6461 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6462 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6463 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6464 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6468 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6469 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6470 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6471 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6473 r = MsiDoAction( hpkg, "CostInitialize");
6474 ok( r == ERROR_SUCCESS, "cost init failed\n");
6478 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6479 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6480 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6481 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6485 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6486 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6487 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6488 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6492 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6493 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6494 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6495 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6499 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6500 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6501 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6502 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6506 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6507 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6508 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6509 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6513 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6514 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6515 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6516 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6520 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6521 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6522 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6523 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6527 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6528 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6529 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6530 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6534 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6535 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6536 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6537 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6541 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6542 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6543 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6544 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6548 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6549 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6550 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6551 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6555 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6556 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6557 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6558 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6562 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6563 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6564 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6565 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6569 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6570 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6571 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6572 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6576 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6577 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6578 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6579 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6583 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6584 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6585 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6586 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6590 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6591 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6592 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6593 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6597 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6598 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6599 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6600 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6604 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6605 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6606 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6607 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6611 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6612 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6613 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6614 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6618 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6619 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6620 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6621 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6625 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6626 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6627 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6628 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6632 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6633 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6634 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6635 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6639 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6640 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6641 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6642 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6646 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6647 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6648 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6649 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6653 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6654 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6655 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6656 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6660 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6661 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6662 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6663 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6667 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6668 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6669 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6670 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6674 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6676 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6677 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6681 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6683 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6684 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6688 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6690 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6691 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6693 r = MsiDoAction( hpkg, "FileCost");
6694 ok( r == ERROR_SUCCESS, "file cost failed\n");
6698 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6699 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6700 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6701 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6705 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6706 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6707 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6708 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6712 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6713 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6714 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6715 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6719 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6720 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6721 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6722 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6726 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6727 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6728 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6729 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6733 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6734 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6735 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6736 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6740 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6741 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6742 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6743 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6747 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6748 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6749 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6750 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6754 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6755 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6756 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6757 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6761 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6762 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6763 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6764 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6768 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6769 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6770 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6771 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6775 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6776 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6777 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6778 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6782 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6784 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6785 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6789 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6790 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6791 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6792 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6796 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6797 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6798 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6799 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6803 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6804 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6805 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6806 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6810 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6811 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6812 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6813 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6817 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6818 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6819 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6820 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6824 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6825 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6826 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6827 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6831 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6832 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6833 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6834 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6838 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6839 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6840 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6841 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6845 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6846 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6847 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6848 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6852 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6853 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6854 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6855 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6859 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6860 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6861 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6862 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6866 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6867 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6868 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6869 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6873 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6874 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6875 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6876 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6880 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6881 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6882 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6883 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6887 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6888 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6889 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6890 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6894 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6895 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6896 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6897 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6901 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6902 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6903 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6904 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6908 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6909 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6910 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6911 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6913 r = MsiDoAction( hpkg, "CostFinalize");
6914 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6918 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6920 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6921 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6925 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6927 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6928 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6932 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6934 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6935 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6939 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6941 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6942 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6946 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6947 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6948 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6949 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6953 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6955 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6956 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6960 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6961 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6962 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6963 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6967 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6968 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6969 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6970 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6974 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6976 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6977 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6981 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6983 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6984 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6988 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6989 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6990 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6991 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6995 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6996 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6997 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6998 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7002 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7003 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7004 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7005 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7009 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7011 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7012 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7016 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7018 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7019 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7023 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7025 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7030 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7032 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7037 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7039 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7040 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7044 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7046 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7047 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7051 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7052 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7053 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7054 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7058 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7059 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7060 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7061 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7065 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7067 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7068 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7072 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7073 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7074 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7075 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7079 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7080 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7081 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7082 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7086 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7087 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7088 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7089 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7093 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7095 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7096 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7100 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7102 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7103 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7107 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7108 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7109 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7110 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7114 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7116 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7117 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7121 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7123 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7124 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7128 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7130 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7131 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7133 MsiCloseHandle(hpkg);
7135 /* uninstall the product */
7136 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7137 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7139 DeleteFileA(msifile);
7140 DeleteFileA(msifile2);
7141 DeleteFileA(msifile3);
7142 DeleteFileA(msifile4);
7145 static void test_getproperty(void)
7147 MSIHANDLE hPackage = 0;
7149 static CHAR empty[] = "";
7153 hPackage = package_from_db(create_package_db());
7154 ok( hPackage != 0, " Failed to create package\n");
7156 /* set the property */
7157 r = MsiSetProperty(hPackage, "Name", "Value");
7158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7160 /* retrieve the size, NULL pointer */
7162 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7164 ok( size == 5, "Expected 5, got %d\n", size);
7166 /* retrieve the size, empty string */
7168 r = MsiGetProperty(hPackage, "Name", empty, &size);
7169 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7170 ok( size == 5, "Expected 5, got %d\n", size);
7172 /* don't change size */
7173 r = MsiGetProperty(hPackage, "Name", prop, &size);
7174 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7175 ok( size == 5, "Expected 5, got %d\n", size);
7176 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7178 /* increase the size by 1 */
7180 r = MsiGetProperty(hPackage, "Name", prop, &size);
7181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7182 ok( size == 5, "Expected 5, got %d\n", size);
7183 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7185 r = MsiCloseHandle( hPackage);
7186 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7187 DeleteFile(msifile);
7190 static void test_removefiles(void)
7196 hdb = create_package_db();
7197 ok ( hdb, "failed to create package database\n" );
7199 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7200 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7202 r = create_feature_table( hdb );
7203 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7205 r = create_component_table( hdb );
7206 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7208 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7209 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7211 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7212 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7214 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7215 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7217 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7218 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7220 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7221 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7223 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7224 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7226 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7227 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7229 r = create_feature_components_table( hdb );
7230 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7232 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7233 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7235 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7236 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7238 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7239 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7241 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7242 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7244 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7245 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7247 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7248 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7250 r = create_file_table( hdb );
7251 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7253 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7254 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7256 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7257 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7259 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7260 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7262 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7263 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7265 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7266 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7268 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7269 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7271 r = create_remove_file_table( hdb );
7272 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7274 hpkg = package_from_db( hdb );
7275 ok( hpkg, "failed to create package\n");
7277 MsiCloseHandle( hdb );
7279 create_test_file( "hydrogen.txt" );
7280 create_test_file( "helium.txt" );
7281 create_test_file( "lithium.txt" );
7282 create_test_file( "beryllium.txt" );
7283 create_test_file( "boron.txt" );
7284 create_test_file( "carbon.txt" );
7286 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7287 ok( r == ERROR_SUCCESS, "set property failed\n");
7289 r = MsiDoAction( hpkg, "CostInitialize");
7290 ok( r == ERROR_SUCCESS, "cost init failed\n");
7292 r = MsiDoAction( hpkg, "FileCost");
7293 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7295 r = MsiDoAction( hpkg, "CostFinalize");
7296 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7298 r = MsiDoAction( hpkg, "InstallValidate");
7299 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7301 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7302 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7304 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7305 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7307 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7308 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7310 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7311 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7313 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7314 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7316 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7317 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7319 r = MsiDoAction( hpkg, "RemoveFiles");
7320 ok( r == ERROR_SUCCESS, "remove files failed\n");
7322 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7323 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7324 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7325 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7326 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7327 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7329 MsiCloseHandle( hpkg );
7330 DeleteFileA(msifile);
7333 static void test_appsearch(void)
7338 CHAR prop[MAX_PATH];
7339 DWORD size = MAX_PATH;
7341 hdb = create_package_db();
7342 ok ( hdb, "failed to create package database\n" );
7344 r = create_appsearch_table( hdb );
7345 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7347 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7348 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7350 r = create_reglocator_table( hdb );
7351 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7353 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7354 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7356 r = create_signature_table( hdb );
7357 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7359 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7360 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7362 hpkg = package_from_db( hdb );
7363 ok( hpkg, "failed to create package\n");
7365 MsiCloseHandle( hdb );
7367 r = MsiDoAction( hpkg, "AppSearch" );
7368 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7370 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7371 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7374 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7377 MsiCloseHandle( hpkg );
7378 DeleteFileA(msifile);
7381 static void test_appsearch_complocator(void)
7383 MSIHANDLE hpkg, hdb;
7384 CHAR path[MAX_PATH];
7385 CHAR prop[MAX_PATH];
7390 if (!get_user_sid(&usersid))
7393 create_test_file("FileName1");
7394 create_test_file("FileName4");
7395 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7396 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7398 create_test_file("FileName2");
7399 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7400 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7402 create_test_file("FileName3");
7403 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7404 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7406 create_test_file("FileName5");
7407 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7408 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7410 create_test_file("FileName6");
7411 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7412 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7414 create_test_file("FileName7");
7415 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7416 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7418 /* dir is FALSE, but we're pretending it's a directory */
7419 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7420 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7422 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7423 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7424 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7426 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7427 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7428 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7430 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7431 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7432 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7434 hdb = create_package_db();
7435 ok(hdb, "Expected a valid database handle\n");
7437 r = create_appsearch_table(hdb);
7438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7440 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7443 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7446 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7449 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7452 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7455 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7458 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7461 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7464 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7467 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7470 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7473 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7476 r = create_complocator_table(hdb);
7477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7479 /* published component, machine, file, signature, misdbLocatorTypeFile */
7480 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7483 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7484 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7487 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7488 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7491 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7492 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7495 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7496 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7499 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7500 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7503 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7504 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7507 /* unpublished component, no signature, misdbLocatorTypeDir */
7508 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7511 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7512 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7515 /* published component, signature w/ ver, misdbLocatorTypeFile */
7516 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7519 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7520 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7523 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7524 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7527 r = create_signature_table(hdb);
7528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7530 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7533 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7536 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7539 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7540 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7542 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7545 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7548 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7551 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7554 hpkg = package_from_db(hdb);
7555 ok(hpkg, "Expected a valid package handle\n");
7557 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
7558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7560 r = MsiDoAction(hpkg, "AppSearch");
7561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7564 sprintf(path, "%s\\FileName1", CURR_DIR);
7565 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7566 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7567 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7570 sprintf(path, "%s\\FileName2", CURR_DIR);
7571 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7572 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7573 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7576 sprintf(path, "%s\\FileName3", CURR_DIR);
7577 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7578 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7579 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7582 sprintf(path, "%s\\FileName4", CURR_DIR);
7583 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
7584 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7585 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7588 sprintf(path, "%s\\FileName5", CURR_DIR);
7589 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7591 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7594 sprintf(path, "%s\\", CURR_DIR);
7595 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7596 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7597 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7600 sprintf(path, "%s\\", CURR_DIR);
7601 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7602 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7603 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7606 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7608 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
7611 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7612 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7613 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7616 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
7617 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7618 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7619 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7622 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
7623 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7624 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7627 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
7628 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
7629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7630 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7632 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7633 MSIINSTALLCONTEXT_MACHINE, NULL);
7634 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7635 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
7636 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7637 MSIINSTALLCONTEXT_USERMANAGED, usersid);
7638 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7639 MSIINSTALLCONTEXT_MACHINE, NULL);
7640 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7641 MSIINSTALLCONTEXT_MACHINE, NULL);
7642 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7643 MSIINSTALLCONTEXT_MACHINE, NULL);
7644 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7645 MSIINSTALLCONTEXT_MACHINE, NULL);
7646 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7647 MSIINSTALLCONTEXT_MACHINE, NULL);
7648 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7649 MSIINSTALLCONTEXT_MACHINE, NULL);
7650 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7651 MSIINSTALLCONTEXT_MACHINE, NULL);
7653 DeleteFileA("FileName1");
7654 DeleteFileA("FileName2");
7655 DeleteFileA("FileName3");
7656 DeleteFileA("FileName4");
7657 DeleteFileA("FileName5");
7658 DeleteFileA("FileName6");
7659 DeleteFileA("FileName7");
7660 DeleteFileA("FileName8.dll");
7661 DeleteFileA("FileName9.dll");
7662 DeleteFileA("FileName10.dll");
7663 MsiCloseHandle(hpkg);
7664 DeleteFileA(msifile);
7667 static void test_appsearch_reglocator(void)
7669 MSIHANDLE hpkg, hdb;
7670 CHAR path[MAX_PATH];
7671 CHAR prop[MAX_PATH];
7674 BOOL space, version;
7685 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7688 DeleteFileA("test.dll");
7690 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
7691 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7693 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
7694 (const BYTE *)"regszdata", 10);
7695 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7697 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
7698 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7700 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
7701 (const BYTE *)"regszdata", 10);
7702 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7705 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
7706 ok(res == ERROR_SUCCESS ||
7707 broken(res == ERROR_INVALID_PARAMETER),
7708 "Expected ERROR_SUCCESS, got %d\n", res);
7710 if (res == ERROR_SUCCESS)
7712 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
7713 (const BYTE *)"regszdata", 10);
7714 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7717 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
7718 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7720 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
7721 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7723 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
7724 (const BYTE *)"regszdata", 10);
7725 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7728 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
7729 (const BYTE *)&val, sizeof(DWORD));
7730 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7733 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
7734 (const BYTE *)&val, sizeof(DWORD));
7735 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7737 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
7738 (const BYTE *)"%PATH%", 7);
7739 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7741 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
7742 (const BYTE *)"my%NOVAR%", 10);
7743 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7745 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
7746 (const BYTE *)"one\0two\0", 9);
7747 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7749 binary[0] = 0x1234abcd;
7750 binary[1] = 0x567890ef;
7751 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
7752 (const BYTE *)binary, sizeof(binary));
7753 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7755 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
7756 (const BYTE *)"#regszdata", 11);
7757 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7759 create_test_file("FileName1");
7760 sprintf(path, "%s\\FileName1", CURR_DIR);
7761 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
7762 (const BYTE *)path, lstrlenA(path) + 1);
7763 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7765 sprintf(path, "%s\\FileName2", CURR_DIR);
7766 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
7767 (const BYTE *)path, lstrlenA(path) + 1);
7768 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7770 lstrcpyA(path, CURR_DIR);
7771 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
7772 (const BYTE *)path, lstrlenA(path) + 1);
7773 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7775 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
7776 (const BYTE *)"", 1);
7777 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7779 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7780 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
7781 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
7782 (const BYTE *)path, lstrlenA(path) + 1);
7783 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7785 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7786 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
7787 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
7788 (const BYTE *)path, lstrlenA(path) + 1);
7789 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7791 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7792 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
7793 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
7794 (const BYTE *)path, lstrlenA(path) + 1);
7795 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7797 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
7798 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
7799 (const BYTE *)path, lstrlenA(path) + 1);
7801 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
7802 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
7803 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
7804 (const BYTE *)path, lstrlenA(path) + 1);
7806 hdb = create_package_db();
7807 ok(hdb, "Expected a valid database handle\n");
7809 r = create_appsearch_table(hdb);
7810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7812 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7813 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7815 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7816 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7818 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7819 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7821 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7824 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7827 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7830 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7833 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7834 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7836 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7839 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7840 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7842 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7843 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7845 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7846 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7848 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
7849 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7851 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
7852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7854 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
7855 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7857 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
7858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7860 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
7861 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7863 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
7864 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7866 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
7867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7869 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
7870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7872 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
7873 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7875 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
7876 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7878 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
7879 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7881 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
7882 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7884 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
7885 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7887 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
7888 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7890 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
7891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7893 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
7894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7896 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
7897 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7899 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
7900 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7902 r = create_reglocator_table(hdb);
7903 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7905 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
7906 str = "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
7907 r = add_reglocator_entry(hdb, str);
7908 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7910 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
7911 str = "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
7912 r = add_reglocator_entry(hdb, str);
7913 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7915 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
7916 str = "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
7917 r = add_reglocator_entry(hdb, str);
7918 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7920 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7921 str = "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
7922 r = add_reglocator_entry(hdb, str);
7923 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7925 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7926 str = "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
7927 r = add_reglocator_entry(hdb, str);
7928 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7930 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
7931 str = "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
7932 r = add_reglocator_entry(hdb, str);
7933 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7935 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
7936 str = "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
7937 r = add_reglocator_entry(hdb, str);
7938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7940 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
7941 str = "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
7942 r = add_reglocator_entry(hdb, str);
7943 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7945 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
7946 str = "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
7947 r = add_reglocator_entry(hdb, str);
7948 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7950 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
7951 str = "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
7952 r = add_reglocator_entry(hdb, str);
7953 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7955 /* HKLM, msidbLocatorTypeFileName, no signature */
7956 str = "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
7957 r = add_reglocator_entry(hdb, str);
7958 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7960 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
7961 str = "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
7962 r = add_reglocator_entry(hdb, str);
7963 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7965 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
7966 str = "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
7967 r = add_reglocator_entry(hdb, str);
7968 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7970 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
7971 str = "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
7972 r = add_reglocator_entry(hdb, str);
7973 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7975 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
7976 str = "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
7977 r = add_reglocator_entry(hdb, str);
7978 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7980 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
7981 str = "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
7982 r = add_reglocator_entry(hdb, str);
7983 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7985 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
7986 str = "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
7987 r = add_reglocator_entry(hdb, str);
7988 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7990 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
7991 str = "'NewSignature18', 2, 'Software\\Wine', '', 2";
7992 r = add_reglocator_entry(hdb, str);
7993 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7995 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
7996 str = "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
7997 r = add_reglocator_entry(hdb, str);
7998 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8000 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8001 str = "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
8002 r = add_reglocator_entry(hdb, str);
8003 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8005 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8006 str = "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
8007 r = add_reglocator_entry(hdb, str);
8008 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8010 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8011 str = "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
8012 r = add_reglocator_entry(hdb, str);
8013 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8015 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8016 str = "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
8017 r = add_reglocator_entry(hdb, str);
8018 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8020 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8021 str = "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
8022 r = add_reglocator_entry(hdb, str);
8023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8025 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8026 str = "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
8027 r = add_reglocator_entry(hdb, str);
8028 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8030 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8031 str = "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
8032 r = add_reglocator_entry(hdb, str);
8033 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8035 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8036 str = "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
8037 r = add_reglocator_entry(hdb, str);
8038 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8040 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8041 str = "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
8042 r = add_reglocator_entry(hdb, str);
8043 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8045 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8046 str = "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
8047 r = add_reglocator_entry(hdb, str);
8048 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8050 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8051 str = "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
8052 r = add_reglocator_entry(hdb, str);
8053 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8055 r = create_signature_table(hdb);
8056 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8058 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8059 r = add_signature_entry(hdb, str);
8060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8062 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8063 r = add_signature_entry(hdb, str);
8064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8066 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8067 r = add_signature_entry(hdb, str);
8068 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8070 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8071 r = add_signature_entry(hdb, str);
8072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8074 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8075 r = add_signature_entry(hdb, str);
8076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8078 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8079 r = add_signature_entry(hdb, str);
8080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8082 ptr = strrchr(CURR_DIR, '\\') + 1;
8083 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8084 r = add_signature_entry(hdb, path);
8085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8087 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8088 r = add_signature_entry(hdb, str);
8089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8091 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8092 r = add_signature_entry(hdb, str);
8093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8095 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8096 r = add_signature_entry(hdb, str);
8097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8099 hpkg = package_from_db(hdb);
8100 ok(hpkg, "Expected a valid package handle\n");
8102 r = MsiDoAction(hpkg, "AppSearch");
8103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8106 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8108 ok(!lstrcmpA(prop, "regszdata"),
8109 "Expected \"regszdata\", got \"%s\"\n", prop);
8112 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8113 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8114 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8117 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8119 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8121 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8122 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8124 /* Workaround for Win95 */
8126 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8128 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8129 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8132 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8133 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8135 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8136 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8137 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8138 ok(!lstrcmpA(pathdata, pathvar),
8139 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8141 HeapFree(GetProcessHeap(), 0, pathvar);
8142 HeapFree(GetProcessHeap(), 0, pathdata);
8145 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8146 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8148 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8151 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8152 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8155 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8156 "Expected \"\\0one\\0two\\0\\0\"\n");
8160 lstrcpyA(path, "#xCDAB3412EF907856");
8161 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8162 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8163 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8166 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8167 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8168 ok(!lstrcmpA(prop, "##regszdata"),
8169 "Expected \"##regszdata\", got \"%s\"\n", prop);
8172 sprintf(path, "%s\\FileName1", CURR_DIR);
8173 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8175 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8178 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8179 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8180 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8183 sprintf(path, "%s\\", CURR_DIR);
8184 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8185 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8186 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8189 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8191 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8194 sprintf(path, "%s\\", CURR_DIR);
8195 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8197 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8200 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8201 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8202 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8205 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8206 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8207 ok(!lstrcmpA(prop, "regszdata"),
8208 "Expected \"regszdata\", got \"%s\"\n", prop);
8211 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8213 ok(!lstrcmpA(prop, "regszdata"),
8214 "Expected \"regszdata\", got \"%s\"\n", prop);
8219 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8220 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8221 ok(!lstrcmpA(prop, "regszdata"),
8222 "Expected \"regszdata\", got \"%s\"\n", prop);
8226 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8227 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8228 ok(!lstrcmpA(prop, "defvalue"),
8229 "Expected \"defvalue\", got \"%s\"\n", prop);
8232 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8233 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8234 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8237 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8238 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8239 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8244 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8245 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8247 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8250 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8251 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8252 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8255 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8256 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8257 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8258 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8262 lstrcpyA(path, CURR_DIR);
8263 ptr = strrchr(path, '\\') + 1;
8265 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8266 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8267 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8270 sprintf(path, "%s\\", CURR_DIR);
8271 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8272 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8273 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8276 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8277 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8278 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8281 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8282 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8283 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8286 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8287 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8288 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8291 sprintf(path, "%s\\FileName1", CURR_DIR);
8292 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8293 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8294 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8297 sprintf(path, "%s\\FileName1", CURR_DIR);
8298 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8299 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8301 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8303 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8305 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8306 RegDeleteValueA(hklm, "Value1");
8307 RegDeleteValueA(hklm, "Value2");
8308 RegDeleteValueA(hklm, "Value3");
8309 RegDeleteValueA(hklm, "Value4");
8310 RegDeleteValueA(hklm, "Value5");
8311 RegDeleteValueA(hklm, "Value6");
8312 RegDeleteValueA(hklm, "Value7");
8313 RegDeleteValueA(hklm, "Value8");
8314 RegDeleteValueA(hklm, "Value9");
8315 RegDeleteValueA(hklm, "Value10");
8316 RegDeleteValueA(hklm, "Value11");
8317 RegDeleteValueA(hklm, "Value12");
8318 RegDeleteValueA(hklm, "Value13");
8319 RegDeleteValueA(hklm, "Value14");
8320 RegDeleteValueA(hklm, "Value15");
8321 RegDeleteValueA(hklm, "Value16");
8322 RegDeleteValueA(hklm, "Value17");
8323 RegDeleteKeyA(hklm, "");
8326 RegDeleteValueA(classes, "Value1");
8327 RegDeleteKeyA(classes, "");
8328 RegCloseKey(classes);
8330 RegDeleteValueA(hkcu, "Value1");
8331 RegDeleteKeyA(hkcu, "");
8334 RegDeleteValueA(users, "Value1");
8335 RegDeleteKeyA(users, "");
8338 DeleteFileA("FileName1");
8339 DeleteFileA("FileName3.dll");
8340 DeleteFileA("FileName4.dll");
8341 DeleteFileA("FileName5.dll");
8342 MsiCloseHandle(hpkg);
8343 DeleteFileA(msifile);
8346 static void delete_win_ini(LPCSTR file)
8348 CHAR path[MAX_PATH];
8350 GetWindowsDirectoryA(path, MAX_PATH);
8351 lstrcatA(path, "\\");
8352 lstrcatA(path, file);
8357 static void test_appsearch_inilocator(void)
8359 MSIHANDLE hpkg, hdb;
8360 CHAR path[MAX_PATH];
8361 CHAR prop[MAX_PATH];
8369 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8372 DeleteFileA("test.dll");
8374 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8376 create_test_file("FileName1");
8377 sprintf(path, "%s\\FileName1", CURR_DIR);
8378 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8380 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8382 sprintf(path, "%s\\IDontExist", CURR_DIR);
8383 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8385 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8386 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8387 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8389 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8390 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8391 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8393 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8394 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8395 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8397 hdb = create_package_db();
8398 ok(hdb, "Expected a valid database handle\n");
8400 r = create_appsearch_table(hdb);
8401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8403 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8406 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8409 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8410 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8412 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8415 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8418 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8421 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8424 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8427 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8428 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8430 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8433 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8436 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8437 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8439 r = create_inilocator_table(hdb);
8440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8442 /* msidbLocatorTypeRawValue, field 1 */
8443 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8444 r = add_inilocator_entry(hdb, str);
8445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8447 /* msidbLocatorTypeRawValue, field 2 */
8448 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8449 r = add_inilocator_entry(hdb, str);
8450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8452 /* msidbLocatorTypeRawValue, entire field */
8453 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8454 r = add_inilocator_entry(hdb, str);
8455 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8457 /* msidbLocatorTypeFile */
8458 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8459 r = add_inilocator_entry(hdb, str);
8460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8462 /* msidbLocatorTypeDirectory, file */
8463 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8464 r = add_inilocator_entry(hdb, str);
8465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8467 /* msidbLocatorTypeDirectory, directory */
8468 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8469 r = add_inilocator_entry(hdb, str);
8470 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8472 /* msidbLocatorTypeFile, file, no signature */
8473 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8474 r = add_inilocator_entry(hdb, str);
8475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8477 /* msidbLocatorTypeFile, dir, no signature */
8478 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8479 r = add_inilocator_entry(hdb, str);
8480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8482 /* msidbLocatorTypeFile, file does not exist */
8483 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8484 r = add_inilocator_entry(hdb, str);
8485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8487 /* msidbLocatorTypeFile, signature with version */
8488 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8489 r = add_inilocator_entry(hdb, str);
8490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8492 /* msidbLocatorTypeFile, signature with version, ver > max */
8493 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8494 r = add_inilocator_entry(hdb, str);
8495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8497 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8498 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8499 r = add_inilocator_entry(hdb, str);
8500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8502 r = create_signature_table(hdb);
8503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8505 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8508 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8511 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8512 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8514 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8517 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8520 hpkg = package_from_db(hdb);
8521 ok(hpkg, "Expected a valid package handle\n");
8523 r = MsiDoAction(hpkg, "AppSearch");
8524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8527 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8529 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
8532 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8533 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8534 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
8537 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8539 ok(!lstrcmpA(prop, "keydata,field2"),
8540 "Expected \"keydata,field2\", got \"%s\"\n", prop);
8543 sprintf(path, "%s\\FileName1", CURR_DIR);
8544 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8546 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8549 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8551 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8554 sprintf(path, "%s\\", CURR_DIR);
8555 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8556 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8557 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8560 sprintf(path, "%s\\", CURR_DIR);
8561 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8562 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8563 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8566 lstrcpyA(path, CURR_DIR);
8567 ptr = strrchr(path, '\\');
8569 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8570 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8571 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8574 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8576 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8581 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8582 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8583 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8584 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8587 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8589 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8592 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8593 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8595 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8598 delete_win_ini("IniFile.ini");
8599 DeleteFileA("FileName1");
8600 DeleteFileA("FileName2.dll");
8601 DeleteFileA("FileName3.dll");
8602 DeleteFileA("FileName4.dll");
8603 MsiCloseHandle(hpkg);
8604 DeleteFileA(msifile);
8608 * MSI AppSearch action on DrLocator table always returns absolute paths.
8609 * If a relative path was set, it returns the first absolute path that
8610 * matches or an empty string if it didn't find anything.
8611 * This helper function replicates this behaviour.
8613 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
8618 size = lstrlenA(relative);
8619 drives = GetLogicalDrives();
8620 lstrcpyA(absolute, "A:\\");
8621 for (i = 0; i < 26; absolute[0] = '\0', i++)
8623 if (!(drives & (1 << i)))
8626 absolute[0] = 'A' + i;
8627 if (GetDriveType(absolute) != DRIVE_FIXED)
8630 lstrcpynA(absolute + 3, relative, size + 1);
8631 attr = GetFileAttributesA(absolute);
8632 if (attr != INVALID_FILE_ATTRIBUTES &&
8633 (attr & FILE_ATTRIBUTE_DIRECTORY))
8635 if (absolute[3 + size - 1] != '\\')
8636 lstrcatA(absolute, "\\");
8643 static void test_appsearch_drlocator(void)
8645 MSIHANDLE hpkg, hdb;
8646 CHAR path[MAX_PATH];
8647 CHAR prop[MAX_PATH];
8654 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8657 DeleteFileA("test.dll");
8659 create_test_file("FileName1");
8660 CreateDirectoryA("one", NULL);
8661 CreateDirectoryA("one\\two", NULL);
8662 CreateDirectoryA("one\\two\\three", NULL);
8663 create_test_file("one\\two\\three\\FileName2");
8664 CreateDirectoryA("another", NULL);
8665 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8666 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8667 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8669 hdb = create_package_db();
8670 ok(hdb, "Expected a valid database handle\n");
8672 r = create_appsearch_table(hdb);
8673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8675 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8676 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8678 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8681 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8684 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8687 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8688 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8690 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8691 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8693 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8694 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8696 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8697 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8699 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8700 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8702 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8705 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8708 r = create_drlocator_table(hdb);
8709 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8711 /* no parent, full path, depth 0, signature */
8712 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
8713 r = add_drlocator_entry(hdb, path);
8714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8716 /* no parent, full path, depth 0, no signature */
8717 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
8718 r = add_drlocator_entry(hdb, path);
8719 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8721 /* no parent, relative path, depth 0, no signature */
8722 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
8723 r = add_drlocator_entry(hdb, path);
8724 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8726 /* no parent, full path, depth 2, signature */
8727 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
8728 r = add_drlocator_entry(hdb, path);
8729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8731 /* no parent, full path, depth 3, signature */
8732 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
8733 r = add_drlocator_entry(hdb, path);
8734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8736 /* no parent, full path, depth 1, signature is dir */
8737 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
8738 r = add_drlocator_entry(hdb, path);
8739 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8741 /* parent is in DrLocator, relative path, depth 0, signature */
8742 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8743 r = add_drlocator_entry(hdb, path);
8744 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8746 /* no parent, full path, depth 0, signature w/ version */
8747 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
8748 r = add_drlocator_entry(hdb, path);
8749 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8751 /* no parent, full path, depth 0, signature w/ version, ver > max */
8752 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
8753 r = add_drlocator_entry(hdb, path);
8754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8756 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8757 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
8758 r = add_drlocator_entry(hdb, path);
8759 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8761 /* no parent, relative empty path, depth 0, no signature */
8762 sprintf(path, "'NewSignature11', '', '', 0");
8763 r = add_drlocator_entry(hdb, path);
8764 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8766 r = create_signature_table(hdb);
8767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8769 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
8770 r = add_signature_entry(hdb, str);
8771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8773 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
8774 r = add_signature_entry(hdb, str);
8775 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8777 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
8778 r = add_signature_entry(hdb, str);
8779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8781 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
8782 r = add_signature_entry(hdb, str);
8783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8785 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
8786 r = add_signature_entry(hdb, str);
8787 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8789 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8790 r = add_signature_entry(hdb, str);
8791 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8793 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8794 r = add_signature_entry(hdb, str);
8795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8797 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8798 r = add_signature_entry(hdb, str);
8799 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8801 hpkg = package_from_db(hdb);
8802 ok(hpkg, "Expected a valid package handle\n");
8804 r = MsiDoAction(hpkg, "AppSearch");
8805 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8808 sprintf(path, "%s\\FileName1", CURR_DIR);
8809 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8811 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8814 sprintf(path, "%s\\", CURR_DIR);
8815 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8816 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8817 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8820 search_absolute_directory(path, CURR_DIR + 3);
8821 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8823 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8826 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8828 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8831 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8832 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8834 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8837 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8838 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8839 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8842 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8843 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8844 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8845 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8850 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8851 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8853 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8856 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8857 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8858 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8861 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8862 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8863 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8867 search_absolute_directory(path, "");
8868 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8869 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8870 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8872 DeleteFileA("FileName1");
8873 DeleteFileA("FileName3.dll");
8874 DeleteFileA("FileName4.dll");
8875 DeleteFileA("FileName5.dll");
8876 DeleteFileA("one\\two\\three\\FileName2");
8877 RemoveDirectoryA("one\\two\\three");
8878 RemoveDirectoryA("one\\two");
8879 RemoveDirectoryA("one");
8880 RemoveDirectoryA("another");
8881 MsiCloseHandle(hpkg);
8882 DeleteFileA(msifile);
8885 static void test_featureparents(void)
8890 INSTALLSTATE state, action;
8892 hdb = create_package_db();
8893 ok ( hdb, "failed to create package database\n" );
8895 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
8896 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
8898 r = create_feature_table( hdb );
8899 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
8901 r = create_component_table( hdb );
8902 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
8904 r = create_feature_components_table( hdb );
8905 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
8907 r = create_file_table( hdb );
8908 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
8910 /* msidbFeatureAttributesFavorLocal */
8911 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
8912 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8914 /* msidbFeatureAttributesFavorSource */
8915 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
8916 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8918 /* msidbFeatureAttributesFavorLocal */
8919 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
8920 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8922 /* disabled because of install level */
8923 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
8924 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8926 /* child feature of disabled feature */
8927 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
8928 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8930 /* component of disabled feature (install level) */
8931 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
8932 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8934 /* component of disabled child feature (install level) */
8935 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
8936 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8938 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8939 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
8940 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8942 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8943 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
8944 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8946 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8947 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
8948 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8950 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
8951 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
8952 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8954 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
8955 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
8956 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8958 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
8959 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
8960 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8962 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8963 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
8964 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8966 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8967 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
8968 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8970 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8971 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
8973 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
8974 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8976 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
8977 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8979 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
8980 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8982 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
8983 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8985 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
8986 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8988 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
8989 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8991 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
8992 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8994 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
8995 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8997 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
8998 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9000 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9001 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9003 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9004 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9006 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9007 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9009 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9010 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9012 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9013 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9015 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9016 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9018 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9019 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9021 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9022 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9024 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9025 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9027 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9028 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9030 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9031 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9033 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9034 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9036 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9037 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9039 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9040 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9042 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9043 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9045 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9046 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9048 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9049 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9051 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9052 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9054 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9055 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9057 hpkg = package_from_db( hdb );
9058 ok( hpkg, "failed to create package\n");
9060 MsiCloseHandle( hdb );
9062 r = MsiDoAction( hpkg, "CostInitialize");
9063 ok( r == ERROR_SUCCESS, "cost init failed\n");
9065 r = MsiDoAction( hpkg, "FileCost");
9066 ok( r == ERROR_SUCCESS, "file cost failed\n");
9068 r = MsiDoAction( hpkg, "CostFinalize");
9069 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9073 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9075 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9076 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9080 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9082 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9083 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9087 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9089 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9090 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9094 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9096 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9097 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9101 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9103 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9104 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9108 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9110 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9111 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9115 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9117 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9118 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9122 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9124 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9125 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9129 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9131 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9132 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9136 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9138 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9139 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9143 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9145 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9146 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9150 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9152 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9153 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9157 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9159 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9160 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9164 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9166 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9167 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9171 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9173 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9174 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9178 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9180 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9181 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9183 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9184 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9188 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9190 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9191 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9195 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9197 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9198 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9202 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9204 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9205 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9209 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9211 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9212 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9216 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9218 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9219 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9223 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9224 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9225 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9226 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9230 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9232 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9233 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9237 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9238 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9239 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9240 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9244 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9245 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9246 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9247 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9251 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9253 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9254 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9258 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9260 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9261 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9265 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9266 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9267 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9268 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9272 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9274 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9275 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9279 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9281 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9282 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9284 MsiCloseHandle(hpkg);
9285 DeleteFileA(msifile);
9288 static void test_installprops(void)
9290 MSIHANDLE hpkg, hdb;
9291 CHAR path[MAX_PATH];
9299 GetCurrentDirectory(MAX_PATH, path);
9300 lstrcat(path, "\\");
9301 lstrcat(path, msifile);
9303 hdb = create_package_db();
9304 ok( hdb, "failed to create database\n");
9306 hpkg = package_from_db(hdb);
9307 ok( hpkg, "failed to create package\n");
9309 MsiCloseHandle(hdb);
9312 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
9313 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9314 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9316 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
9318 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
9323 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9327 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
9330 /* win9x doesn't set this */
9334 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
9335 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9336 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9342 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9346 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
9352 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
9353 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9354 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9358 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
9359 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9360 trace("VersionDatabase = %s\n", buf);
9363 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
9364 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9365 trace("VersionMsi = %s\n", buf);
9368 r = MsiGetProperty(hpkg, "Date", buf, &size);
9369 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9370 trace("Date = %s\n", buf);
9373 r = MsiGetProperty(hpkg, "Time", buf, &size);
9374 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9375 trace("Time = %s\n", buf);
9378 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
9379 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9380 trace("PackageCode = %s\n", buf);
9382 langid = GetUserDefaultLangID();
9383 sprintf(path, "%d", langid);
9386 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
9387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9388 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
9390 res = GetSystemMetrics(SM_CXSCREEN);
9392 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
9393 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9395 res = GetSystemMetrics(SM_CYSCREEN);
9397 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
9398 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9402 MsiCloseHandle(hpkg);
9403 DeleteFile(msifile);
9406 static void test_launchconditions(void)
9412 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9414 hdb = create_package_db();
9415 ok( hdb, "failed to create package database\n" );
9417 r = create_launchcondition_table( hdb );
9418 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
9420 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
9421 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9423 /* invalid condition */
9424 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
9425 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9427 hpkg = package_from_db( hdb );
9428 ok( hpkg, "failed to create package\n");
9430 MsiCloseHandle( hdb );
9432 r = MsiSetProperty( hpkg, "X", "1" );
9433 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9435 /* invalid conditions are ignored */
9436 r = MsiDoAction( hpkg, "LaunchConditions" );
9437 ok( r == ERROR_SUCCESS, "cost init failed\n" );
9439 /* verify LaunchConditions still does some verification */
9440 r = MsiSetProperty( hpkg, "X", "2" );
9441 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9443 r = MsiDoAction( hpkg, "LaunchConditions" );
9444 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
9446 MsiCloseHandle( hpkg );
9447 DeleteFile( msifile );
9450 static void test_ccpsearch(void)
9452 MSIHANDLE hdb, hpkg;
9453 CHAR prop[MAX_PATH];
9454 DWORD size = MAX_PATH;
9457 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9459 hdb = create_package_db();
9460 ok(hdb, "failed to create package database\n");
9462 r = create_ccpsearch_table(hdb);
9463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9465 r = add_ccpsearch_entry(hdb, "'CCP_random'");
9466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9468 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
9469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9471 r = create_reglocator_table(hdb);
9472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9474 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9477 r = create_drlocator_table(hdb);
9478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9480 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
9481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9483 r = create_signature_table(hdb);
9484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9486 hpkg = package_from_db(hdb);
9487 ok(hpkg, "failed to create package\n");
9489 MsiCloseHandle(hdb);
9491 r = MsiDoAction(hpkg, "CCPSearch");
9492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9494 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
9495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9496 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
9498 MsiCloseHandle(hpkg);
9499 DeleteFileA(msifile);
9502 static void test_complocator(void)
9504 MSIHANDLE hdb, hpkg;
9506 CHAR prop[MAX_PATH];
9507 CHAR expected[MAX_PATH];
9508 DWORD size = MAX_PATH;
9510 hdb = create_package_db();
9511 ok(hdb, "failed to create package database\n");
9513 r = create_appsearch_table(hdb);
9514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9516 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
9517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9519 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
9520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9522 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
9523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9525 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
9526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9528 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
9529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9531 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
9532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9534 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
9535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9537 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
9538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9540 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
9541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9543 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
9544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9546 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
9547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9549 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
9550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9552 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
9553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9555 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
9556 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9558 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
9559 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9561 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
9562 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9564 r = create_complocator_table(hdb);
9565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9567 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9568 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9570 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9573 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9576 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9577 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9579 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9580 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9582 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9583 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9585 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9586 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9588 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9589 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9591 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9592 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9594 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9595 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9597 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9600 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9601 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9603 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9604 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9606 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9609 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9610 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9612 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9615 r = create_signature_table(hdb);
9616 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9618 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9619 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9621 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9622 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9624 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9625 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9627 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9628 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9630 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9633 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9634 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9636 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9637 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9639 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9640 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9642 hpkg = package_from_db(hdb);
9643 ok(hpkg, "failed to create package\n");
9645 MsiCloseHandle(hdb);
9647 create_test_file("abelisaurus");
9648 create_test_file("bactrosaurus");
9649 create_test_file("camelotia");
9650 create_test_file("diclonius");
9651 create_test_file("echinodon");
9652 create_test_file("falcarius");
9653 create_test_file("gallimimus");
9654 create_test_file("hagryphus");
9655 CreateDirectoryA("iguanodon", NULL);
9656 CreateDirectoryA("jobaria", NULL);
9657 CreateDirectoryA("kakuru", NULL);
9658 CreateDirectoryA("labocania", NULL);
9659 CreateDirectoryA("megaraptor", NULL);
9660 CreateDirectoryA("neosodon", NULL);
9661 CreateDirectoryA("olorotitan", NULL);
9662 CreateDirectoryA("pantydraco", NULL);
9664 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
9665 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
9666 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
9667 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
9668 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
9669 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
9670 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
9671 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
9672 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
9673 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
9674 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
9675 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
9676 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
9677 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
9678 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
9679 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
9681 r = MsiDoAction(hpkg, "AppSearch");
9682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9685 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
9686 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9688 lstrcpyA(expected, CURR_DIR);
9689 lstrcatA(expected, "\\abelisaurus");
9690 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9691 "Expected %s or empty string, got %s\n", expected, prop);
9694 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
9695 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9696 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9699 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
9700 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9701 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9704 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
9705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9706 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9709 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
9710 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9712 lstrcpyA(expected, CURR_DIR);
9713 lstrcatA(expected, "\\");
9714 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9715 "Expected %s or empty string, got %s\n", expected, prop);
9718 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
9719 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9720 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9723 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
9724 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9725 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9728 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
9729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9730 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9733 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
9734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9735 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9738 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
9739 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9740 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9743 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
9744 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9745 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9748 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
9749 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9750 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9753 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
9754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9756 lstrcpyA(expected, CURR_DIR);
9757 lstrcatA(expected, "\\");
9758 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9759 "Expected %s or empty string, got %s\n", expected, prop);
9762 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
9763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9765 lstrcpyA(expected, CURR_DIR);
9766 lstrcatA(expected, "\\neosodon\\");
9767 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9768 "Expected %s or empty string, got %s\n", expected, prop);
9771 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
9772 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9773 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9776 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
9777 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9778 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9780 MsiCloseHandle(hpkg);
9781 DeleteFileA("abelisaurus");
9782 DeleteFileA("bactrosaurus");
9783 DeleteFileA("camelotia");
9784 DeleteFileA("diclonius");
9785 DeleteFileA("echinodon");
9786 DeleteFileA("falcarius");
9787 DeleteFileA("gallimimus");
9788 DeleteFileA("hagryphus");
9789 RemoveDirectoryA("iguanodon");
9790 RemoveDirectoryA("jobaria");
9791 RemoveDirectoryA("kakuru");
9792 RemoveDirectoryA("labocania");
9793 RemoveDirectoryA("megaraptor");
9794 RemoveDirectoryA("neosodon");
9795 RemoveDirectoryA("olorotitan");
9796 RemoveDirectoryA("pantydraco");
9797 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
9798 MSIINSTALLCONTEXT_MACHINE, NULL);
9799 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
9800 MSIINSTALLCONTEXT_MACHINE, NULL);
9801 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
9802 MSIINSTALLCONTEXT_MACHINE, NULL);
9803 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
9804 MSIINSTALLCONTEXT_MACHINE, NULL);
9805 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
9806 MSIINSTALLCONTEXT_MACHINE, NULL);
9807 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
9808 MSIINSTALLCONTEXT_MACHINE, NULL);
9809 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
9810 MSIINSTALLCONTEXT_MACHINE, NULL);
9811 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
9812 MSIINSTALLCONTEXT_MACHINE, NULL);
9813 DeleteFileA(msifile);
9816 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
9821 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
9822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9824 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
9825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9827 r = MsiSummaryInfoPersist(summary);
9828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9830 MsiCloseHandle(summary);
9833 static void test_MsiGetSourcePath(void)
9835 MSIHANDLE hdb, hpkg;
9836 CHAR path[MAX_PATH];
9838 CHAR subsrc[MAX_PATH];
9839 CHAR sub2[MAX_PATH];
9843 lstrcpyA(cwd, CURR_DIR);
9844 lstrcatA(cwd, "\\");
9846 lstrcpyA(subsrc, cwd);
9847 lstrcatA(subsrc, "subsource");
9848 lstrcatA(subsrc, "\\");
9850 lstrcpyA(sub2, subsrc);
9851 lstrcatA(sub2, "sub2");
9852 lstrcatA(sub2, "\\");
9854 /* uncompressed source */
9856 hdb = create_package_db();
9857 ok( hdb, "failed to create database\n");
9859 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
9861 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
9862 ok(r == S_OK, "failed\n");
9864 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
9865 ok(r == S_OK, "failed\n");
9867 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
9868 ok(r == S_OK, "failed\n");
9870 r = MsiDatabaseCommit(hdb);
9871 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
9873 hpkg = package_from_db(hdb);
9874 ok(hpkg, "failed to create package\n");
9876 MsiCloseHandle(hdb);
9878 /* invalid database handle */
9880 lstrcpyA(path, "kiwi");
9881 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
9882 ok(r == ERROR_INVALID_HANDLE,
9883 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
9884 ok(!lstrcmpA(path, "kiwi"),
9885 "Expected path to be unchanged, got \"%s\"\n", path);
9886 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9890 lstrcpyA(path, "kiwi");
9891 r = MsiGetSourcePath(hpkg, NULL, path, &size);
9892 ok(r == ERROR_INVALID_PARAMETER,
9893 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
9894 ok(!lstrcmpA(path, "kiwi"),
9895 "Expected path to be unchanged, got \"%s\"\n", path);
9896 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9898 /* empty szFolder */
9900 lstrcpyA(path, "kiwi");
9901 r = MsiGetSourcePath(hpkg, "", path, &size);
9902 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9903 ok(!lstrcmpA(path, "kiwi"),
9904 "Expected path to be unchanged, got \"%s\"\n", path);
9905 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9909 lstrcpyA(path, "kiwi");
9910 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9911 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9912 ok(!lstrcmpA(path, "kiwi"),
9913 "Expected path to be unchanged, got \"%s\"\n", path);
9914 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9918 lstrcpyA(path, "kiwi");
9919 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9920 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9921 ok(!lstrcmpA(path, "kiwi"),
9922 "Expected path to be unchanged, got \"%s\"\n", path);
9923 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9927 lstrcpyA(path, "kiwi");
9928 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9929 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9930 ok(!lstrcmpA(path, "kiwi"),
9931 "Expected path to be unchanged, got \"%s\"\n", path);
9932 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9934 /* source path does not exist, but the property exists */
9936 lstrcpyA(path, "kiwi");
9937 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9939 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9940 ok(size == 0, "Expected 0, got %d\n", size);
9944 lstrcpyA(path, "kiwi");
9945 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9946 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9947 ok(!lstrcmpA(path, "kiwi"),
9948 "Expected path to be unchanged, got \"%s\"\n", path);
9949 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9953 lstrcpyA(path, "kiwi");
9954 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9955 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9956 ok(!lstrcmpA(path, "kiwi"),
9957 "Expected path to be unchanged, got \"%s\"\n", path);
9958 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9960 r = MsiDoAction(hpkg, "CostInitialize");
9961 ok(r == ERROR_SUCCESS, "cost init failed\n");
9963 /* try TARGETDIR after CostInitialize */
9965 lstrcpyA(path, "kiwi");
9966 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9967 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9968 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9969 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9971 /* try SourceDir after CostInitialize */
9973 lstrcpyA(path, "kiwi");
9974 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9975 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9976 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9977 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9979 /* try SOURCEDIR after CostInitialize */
9981 lstrcpyA(path, "kiwi");
9982 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9983 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9984 ok(!lstrcmpA(path, "kiwi"),
9985 "Expected path to be unchanged, got \"%s\"\n", path);
9986 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9988 /* source path does not exist, but the property exists */
9990 lstrcpyA(path, "kiwi");
9991 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9992 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9995 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9996 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9999 /* try SubDir after CostInitialize */
10001 lstrcpyA(path, "kiwi");
10002 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10003 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10004 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10005 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10007 /* try SubDir2 after CostInitialize */
10009 lstrcpyA(path, "kiwi");
10010 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10011 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10012 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10013 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10015 r = MsiDoAction(hpkg, "ResolveSource");
10016 ok(r == ERROR_SUCCESS, "file cost failed\n");
10018 /* try TARGETDIR after ResolveSource */
10020 lstrcpyA(path, "kiwi");
10021 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10023 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10024 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10026 /* try SourceDir after ResolveSource */
10028 lstrcpyA(path, "kiwi");
10029 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10030 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10031 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10032 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10034 /* try SOURCEDIR after ResolveSource */
10036 lstrcpyA(path, "kiwi");
10037 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10038 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10039 ok(!lstrcmpA(path, "kiwi"),
10040 "Expected path to be unchanged, got \"%s\"\n", path);
10041 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10043 /* source path does not exist, but the property exists */
10045 lstrcpyA(path, "kiwi");
10046 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10048 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10049 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10051 /* try SubDir after ResolveSource */
10053 lstrcpyA(path, "kiwi");
10054 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10056 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10057 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10059 /* try SubDir2 after ResolveSource */
10061 lstrcpyA(path, "kiwi");
10062 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10064 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10065 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10067 r = MsiDoAction(hpkg, "FileCost");
10068 ok(r == ERROR_SUCCESS, "file cost failed\n");
10070 /* try TARGETDIR after FileCost */
10072 lstrcpyA(path, "kiwi");
10073 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10074 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10075 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10076 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10078 /* try SourceDir after FileCost */
10080 lstrcpyA(path, "kiwi");
10081 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10083 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10084 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10086 /* try SOURCEDIR after FileCost */
10088 lstrcpyA(path, "kiwi");
10089 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10090 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10091 ok(!lstrcmpA(path, "kiwi"),
10092 "Expected path to be unchanged, got \"%s\"\n", path);
10093 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10095 /* source path does not exist, but the property exists */
10097 lstrcpyA(path, "kiwi");
10098 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10099 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10100 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10101 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10103 /* try SubDir after FileCost */
10105 lstrcpyA(path, "kiwi");
10106 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10108 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10109 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10111 /* try SubDir2 after FileCost */
10113 lstrcpyA(path, "kiwi");
10114 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10116 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10117 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10119 r = MsiDoAction(hpkg, "CostFinalize");
10120 ok(r == ERROR_SUCCESS, "file cost failed\n");
10122 /* try TARGETDIR after CostFinalize */
10124 lstrcpyA(path, "kiwi");
10125 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10127 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10128 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10130 /* try SourceDir after CostFinalize */
10132 lstrcpyA(path, "kiwi");
10133 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10134 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10135 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10136 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10138 /* try SOURCEDIR after CostFinalize */
10140 lstrcpyA(path, "kiwi");
10141 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10142 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10143 ok(!lstrcmpA(path, "kiwi"),
10144 "Expected path to be unchanged, got \"%s\"\n", path);
10145 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10147 /* source path does not exist, but the property exists */
10149 lstrcpyA(path, "kiwi");
10150 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10151 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10152 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10153 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10155 /* try SubDir after CostFinalize */
10157 lstrcpyA(path, "kiwi");
10158 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10160 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10161 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10163 /* try SubDir2 after CostFinalize */
10165 lstrcpyA(path, "kiwi");
10166 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10167 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10168 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10169 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10171 /* nonexistent directory */
10173 lstrcpyA(path, "kiwi");
10174 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
10175 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10176 ok(!lstrcmpA(path, "kiwi"),
10177 "Expected path to be unchanged, got \"%s\"\n", path);
10178 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10180 /* NULL szPathBuf */
10182 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
10183 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10184 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10186 /* NULL pcchPathBuf */
10187 lstrcpyA(path, "kiwi");
10188 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
10189 ok(r == ERROR_INVALID_PARAMETER,
10190 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10191 ok(!lstrcmpA(path, "kiwi"),
10192 "Expected path to be unchanged, got \"%s\"\n", path);
10194 /* pcchPathBuf is 0 */
10196 lstrcpyA(path, "kiwi");
10197 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10198 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10199 ok(!lstrcmpA(path, "kiwi"),
10200 "Expected path to be unchanged, got \"%s\"\n", path);
10201 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10203 /* pcchPathBuf does not have room for NULL terminator */
10204 size = lstrlenA(cwd);
10205 lstrcpyA(path, "kiwi");
10206 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10207 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10208 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
10209 "Expected path with no backslash, got \"%s\"\n", path);
10210 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10212 /* pcchPathBuf has room for NULL terminator */
10213 size = lstrlenA(cwd) + 1;
10214 lstrcpyA(path, "kiwi");
10215 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10216 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10217 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10218 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10220 MsiCloseHandle(hpkg);
10222 /* compressed source */
10224 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10225 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10227 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
10229 hpkg = package_from_db(hdb);
10230 ok(hpkg, "failed to create package\n");
10232 /* try TARGETDIR */
10234 lstrcpyA(path, "kiwi");
10235 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10236 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10237 ok(!lstrcmpA(path, "kiwi"),
10238 "Expected path to be unchanged, got \"%s\"\n", path);
10239 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10241 /* try SourceDir */
10243 lstrcpyA(path, "kiwi");
10244 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10245 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10246 ok(!lstrcmpA(path, "kiwi"),
10247 "Expected path to be unchanged, got \"%s\"\n", path);
10248 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10250 /* try SOURCEDIR */
10252 lstrcpyA(path, "kiwi");
10253 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10254 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10255 ok(!lstrcmpA(path, "kiwi"),
10256 "Expected path to be unchanged, got \"%s\"\n", path);
10257 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10259 /* source path nor the property exist */
10261 lstrcpyA(path, "kiwi");
10262 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10263 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10264 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10265 ok(size == 0, "Expected 0, got %d\n", size);
10269 lstrcpyA(path, "kiwi");
10270 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10271 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10272 ok(!lstrcmpA(path, "kiwi"),
10273 "Expected path to be unchanged, got \"%s\"\n", path);
10274 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10278 lstrcpyA(path, "kiwi");
10279 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10280 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10281 ok(!lstrcmpA(path, "kiwi"),
10282 "Expected path to be unchanged, got \"%s\"\n", path);
10283 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10285 r = MsiDoAction(hpkg, "CostInitialize");
10286 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10288 /* try TARGETDIR after CostInitialize */
10290 lstrcpyA(path, "kiwi");
10291 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10293 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10294 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10296 /* try SourceDir after CostInitialize */
10298 lstrcpyA(path, "kiwi");
10299 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10300 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10301 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10302 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10304 /* try SOURCEDIR after CostInitialize */
10306 lstrcpyA(path, "kiwi");
10307 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10310 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10311 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10312 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10315 /* source path does not exist, but the property exists */
10317 lstrcpyA(path, "kiwi");
10318 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10322 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10323 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10326 /* try SubDir after CostInitialize */
10328 lstrcpyA(path, "kiwi");
10329 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10330 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10331 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10332 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10334 /* try SubDir2 after CostInitialize */
10336 lstrcpyA(path, "kiwi");
10337 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10338 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10339 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10340 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10342 r = MsiDoAction(hpkg, "ResolveSource");
10343 ok(r == ERROR_SUCCESS, "file cost failed\n");
10345 /* try TARGETDIR after ResolveSource */
10347 lstrcpyA(path, "kiwi");
10348 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10349 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10350 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10351 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10353 /* try SourceDir after ResolveSource */
10355 lstrcpyA(path, "kiwi");
10356 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10358 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10359 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10361 /* try SOURCEDIR after ResolveSource */
10363 lstrcpyA(path, "kiwi");
10364 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10368 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10369 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10372 /* source path and the property exist */
10374 lstrcpyA(path, "kiwi");
10375 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10377 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10378 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10380 /* try SubDir after ResolveSource */
10382 lstrcpyA(path, "kiwi");
10383 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10384 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10385 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10386 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10388 /* try SubDir2 after ResolveSource */
10390 lstrcpyA(path, "kiwi");
10391 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10393 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10394 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10396 r = MsiDoAction(hpkg, "FileCost");
10397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10399 /* try TARGETDIR after CostFinalize */
10401 lstrcpyA(path, "kiwi");
10402 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10403 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10404 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10405 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10407 /* try SourceDir after CostFinalize */
10409 lstrcpyA(path, "kiwi");
10410 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10411 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10412 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10413 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10415 /* try SOURCEDIR after CostFinalize */
10417 lstrcpyA(path, "kiwi");
10418 r = MsiGetSourcePath(hpkg, "SOURCEDIR", 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);
10426 /* source path and the property exist */
10428 lstrcpyA(path, "kiwi");
10429 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10431 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10432 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10434 /* try SubDir after CostFinalize */
10436 lstrcpyA(path, "kiwi");
10437 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10439 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10440 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10442 /* try SubDir2 after CostFinalize */
10444 lstrcpyA(path, "kiwi");
10445 r = MsiGetSourcePath(hpkg, "SubDir2", 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 r = MsiDoAction(hpkg, "CostFinalize");
10451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10453 /* try TARGETDIR after CostFinalize */
10455 lstrcpyA(path, "kiwi");
10456 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10458 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10459 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10461 /* try SourceDir after CostFinalize */
10463 lstrcpyA(path, "kiwi");
10464 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10466 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10467 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10469 /* try SOURCEDIR after CostFinalize */
10471 lstrcpyA(path, "kiwi");
10472 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10476 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10477 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10480 /* source path and the property exist */
10482 lstrcpyA(path, "kiwi");
10483 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10485 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10486 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10488 /* try SubDir after CostFinalize */
10490 lstrcpyA(path, "kiwi");
10491 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10493 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10494 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10496 /* try SubDir2 after CostFinalize */
10498 lstrcpyA(path, "kiwi");
10499 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10501 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10502 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10504 MsiCloseHandle(hpkg);
10505 DeleteFile(msifile);
10508 static void test_shortlongsource(void)
10510 MSIHANDLE hdb, hpkg;
10511 CHAR path[MAX_PATH];
10512 CHAR cwd[MAX_PATH];
10513 CHAR subsrc[MAX_PATH];
10517 lstrcpyA(cwd, CURR_DIR);
10518 lstrcatA(cwd, "\\");
10520 lstrcpyA(subsrc, cwd);
10521 lstrcatA(subsrc, "long");
10522 lstrcatA(subsrc, "\\");
10524 /* long file names */
10526 hdb = create_package_db();
10527 ok( hdb, "failed to create database\n");
10529 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10531 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10532 ok(r == S_OK, "failed\n");
10534 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
10535 ok(r == S_OK, "failed\n");
10537 /* CostInitialize:short */
10538 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
10539 ok(r == S_OK, "failed\n");
10541 /* CostInitialize:long */
10542 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
10543 ok(r == S_OK, "failed\n");
10545 /* FileCost:short */
10546 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
10547 ok(r == S_OK, "failed\n");
10549 /* FileCost:long */
10550 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
10551 ok(r == S_OK, "failed\n");
10553 /* CostFinalize:short */
10554 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
10555 ok(r == S_OK, "failed\n");
10557 /* CostFinalize:long */
10558 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
10559 ok(r == S_OK, "failed\n");
10561 MsiDatabaseCommit(hdb);
10563 hpkg = package_from_db(hdb);
10564 ok(hpkg, "failed to create package\n");
10566 MsiCloseHandle(hdb);
10568 CreateDirectoryA("one", NULL);
10569 CreateDirectoryA("four", NULL);
10571 r = MsiDoAction(hpkg, "CostInitialize");
10572 ok(r == ERROR_SUCCESS, "file cost failed\n");
10574 CreateDirectory("five", NULL);
10575 CreateDirectory("eight", NULL);
10577 r = MsiDoAction(hpkg, "FileCost");
10578 ok(r == ERROR_SUCCESS, "file cost failed\n");
10580 CreateDirectory("nine", NULL);
10581 CreateDirectory("twelve", NULL);
10583 r = MsiDoAction(hpkg, "CostFinalize");
10584 ok(r == ERROR_SUCCESS, "file cost failed\n");
10586 /* neither short nor long source directories exist */
10588 lstrcpyA(path, "kiwi");
10589 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10591 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10592 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10594 CreateDirectoryA("short", NULL);
10596 /* short source directory exists */
10598 lstrcpyA(path, "kiwi");
10599 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10600 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10601 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10602 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10604 CreateDirectoryA("long", NULL);
10606 /* both short and long source directories exist */
10608 lstrcpyA(path, "kiwi");
10609 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10610 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10611 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10612 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10614 lstrcpyA(subsrc, cwd);
10615 lstrcatA(subsrc, "two");
10616 lstrcatA(subsrc, "\\");
10618 /* short dir exists before CostInitialize */
10620 lstrcpyA(path, "kiwi");
10621 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10622 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10623 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10624 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10626 lstrcpyA(subsrc, cwd);
10627 lstrcatA(subsrc, "four");
10628 lstrcatA(subsrc, "\\");
10630 /* long dir exists before CostInitialize */
10632 lstrcpyA(path, "kiwi");
10633 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10634 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10635 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10636 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10638 lstrcpyA(subsrc, cwd);
10639 lstrcatA(subsrc, "six");
10640 lstrcatA(subsrc, "\\");
10642 /* short dir exists before FileCost */
10644 lstrcpyA(path, "kiwi");
10645 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10647 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10648 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10650 lstrcpyA(subsrc, cwd);
10651 lstrcatA(subsrc, "eight");
10652 lstrcatA(subsrc, "\\");
10654 /* long dir exists before FileCost */
10656 lstrcpyA(path, "kiwi");
10657 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10659 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10660 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10662 lstrcpyA(subsrc, cwd);
10663 lstrcatA(subsrc, "ten");
10664 lstrcatA(subsrc, "\\");
10666 /* short dir exists before CostFinalize */
10668 lstrcpyA(path, "kiwi");
10669 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10671 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10672 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10674 lstrcpyA(subsrc, cwd);
10675 lstrcatA(subsrc, "twelve");
10676 lstrcatA(subsrc, "\\");
10678 /* long dir exists before CostFinalize */
10680 lstrcpyA(path, "kiwi");
10681 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10683 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10684 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10686 MsiCloseHandle(hpkg);
10687 RemoveDirectoryA("short");
10688 RemoveDirectoryA("long");
10689 RemoveDirectoryA("one");
10690 RemoveDirectoryA("four");
10691 RemoveDirectoryA("five");
10692 RemoveDirectoryA("eight");
10693 RemoveDirectoryA("nine");
10694 RemoveDirectoryA("twelve");
10696 /* short file names */
10698 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10701 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
10703 hpkg = package_from_db(hdb);
10704 ok(hpkg, "failed to create package\n");
10706 MsiCloseHandle(hdb);
10708 CreateDirectoryA("one", NULL);
10709 CreateDirectoryA("four", NULL);
10711 r = MsiDoAction(hpkg, "CostInitialize");
10712 ok(r == ERROR_SUCCESS, "file cost failed\n");
10714 CreateDirectory("five", NULL);
10715 CreateDirectory("eight", NULL);
10717 r = MsiDoAction(hpkg, "FileCost");
10718 ok(r == ERROR_SUCCESS, "file cost failed\n");
10720 CreateDirectory("nine", NULL);
10721 CreateDirectory("twelve", NULL);
10723 r = MsiDoAction(hpkg, "CostFinalize");
10724 ok(r == ERROR_SUCCESS, "file cost failed\n");
10726 lstrcpyA(subsrc, cwd);
10727 lstrcatA(subsrc, "short");
10728 lstrcatA(subsrc, "\\");
10730 /* neither short nor long source directories exist */
10732 lstrcpyA(path, "kiwi");
10733 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10735 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10736 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10738 CreateDirectoryA("short", NULL);
10740 /* short source directory exists */
10742 lstrcpyA(path, "kiwi");
10743 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10744 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10745 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10746 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10748 CreateDirectoryA("long", NULL);
10750 /* both short and long source directories exist */
10752 lstrcpyA(path, "kiwi");
10753 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10755 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10756 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10758 lstrcpyA(subsrc, cwd);
10759 lstrcatA(subsrc, "one");
10760 lstrcatA(subsrc, "\\");
10762 /* short dir exists before CostInitialize */
10764 lstrcpyA(path, "kiwi");
10765 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10766 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10767 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10768 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10770 lstrcpyA(subsrc, cwd);
10771 lstrcatA(subsrc, "three");
10772 lstrcatA(subsrc, "\\");
10774 /* long dir exists before CostInitialize */
10776 lstrcpyA(path, "kiwi");
10777 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10779 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10780 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10782 lstrcpyA(subsrc, cwd);
10783 lstrcatA(subsrc, "five");
10784 lstrcatA(subsrc, "\\");
10786 /* short dir exists before FileCost */
10788 lstrcpyA(path, "kiwi");
10789 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10790 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10791 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10792 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10794 lstrcpyA(subsrc, cwd);
10795 lstrcatA(subsrc, "seven");
10796 lstrcatA(subsrc, "\\");
10798 /* long dir exists before FileCost */
10800 lstrcpyA(path, "kiwi");
10801 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10803 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10804 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10806 lstrcpyA(subsrc, cwd);
10807 lstrcatA(subsrc, "nine");
10808 lstrcatA(subsrc, "\\");
10810 /* short dir exists before CostFinalize */
10812 lstrcpyA(path, "kiwi");
10813 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10815 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10816 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10818 lstrcpyA(subsrc, cwd);
10819 lstrcatA(subsrc, "eleven");
10820 lstrcatA(subsrc, "\\");
10822 /* long dir exists before CostFinalize */
10824 lstrcpyA(path, "kiwi");
10825 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10826 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10827 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10828 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10830 MsiCloseHandle(hpkg);
10831 RemoveDirectoryA("short");
10832 RemoveDirectoryA("long");
10833 RemoveDirectoryA("one");
10834 RemoveDirectoryA("four");
10835 RemoveDirectoryA("five");
10836 RemoveDirectoryA("eight");
10837 RemoveDirectoryA("nine");
10838 RemoveDirectoryA("twelve");
10839 DeleteFileA(msifile);
10842 static void test_sourcedir(void)
10844 MSIHANDLE hdb, hpkg;
10846 CHAR path[MAX_PATH];
10847 CHAR cwd[MAX_PATH];
10848 CHAR subsrc[MAX_PATH];
10852 lstrcpyA(cwd, CURR_DIR);
10853 lstrcatA(cwd, "\\");
10855 lstrcpyA(subsrc, cwd);
10856 lstrcatA(subsrc, "long");
10857 lstrcatA(subsrc, "\\");
10859 hdb = create_package_db();
10860 ok( hdb, "failed to create database\n");
10862 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10863 ok(r == S_OK, "failed\n");
10865 sprintf(package, "#%i", hdb);
10866 r = MsiOpenPackage(package, &hpkg);
10867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10869 /* properties only */
10871 /* SourceDir prop */
10873 lstrcpyA(path, "kiwi");
10874 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10875 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10876 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10877 ok(size == 0, "Expected 0, got %d\n", size);
10879 /* SOURCEDIR prop */
10881 lstrcpyA(path, "kiwi");
10882 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10883 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10884 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10885 ok(size == 0, "Expected 0, got %d\n", size);
10887 r = MsiDoAction(hpkg, "CostInitialize");
10888 ok(r == ERROR_SUCCESS, "file cost failed\n");
10890 /* SourceDir after CostInitialize */
10892 lstrcpyA(path, "kiwi");
10893 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10895 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10896 ok(size == 0, "Expected 0, got %d\n", size);
10898 /* SOURCEDIR after CostInitialize */
10900 lstrcpyA(path, "kiwi");
10901 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10903 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10904 ok(size == 0, "Expected 0, got %d\n", size);
10906 r = MsiDoAction(hpkg, "FileCost");
10907 ok(r == ERROR_SUCCESS, "file cost failed\n");
10909 /* SourceDir after FileCost */
10911 lstrcpyA(path, "kiwi");
10912 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10913 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10914 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10915 ok(size == 0, "Expected 0, got %d\n", size);
10917 /* SOURCEDIR after FileCost */
10919 lstrcpyA(path, "kiwi");
10920 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10921 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10922 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10923 ok(size == 0, "Expected 0, got %d\n", size);
10925 r = MsiDoAction(hpkg, "CostFinalize");
10926 ok(r == ERROR_SUCCESS, "file cost failed\n");
10928 /* SourceDir after CostFinalize */
10930 lstrcpyA(path, "kiwi");
10931 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10933 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10934 ok(size == 0, "Expected 0, got %d\n", size);
10936 /* SOURCEDIR after CostFinalize */
10938 lstrcpyA(path, "kiwi");
10939 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10940 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10941 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10942 ok(size == 0, "Expected 0, got %d\n", size);
10944 r = MsiDoAction(hpkg, "ResolveSource");
10945 ok(r == ERROR_SUCCESS, "file cost failed\n");
10947 /* SourceDir after ResolveSource */
10949 lstrcpyA(path, "kiwi");
10950 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10951 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10952 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10953 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10955 /* SOURCEDIR after ResolveSource */
10957 lstrcpyA(path, "kiwi");
10958 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10959 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10960 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10961 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10963 /* random casing */
10965 lstrcpyA(path, "kiwi");
10966 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
10967 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10968 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10969 ok(size == 0, "Expected 0, got %d\n", size);
10971 MsiCloseHandle(hpkg);
10973 /* reset the package state */
10974 sprintf(package, "#%i", hdb);
10975 r = MsiOpenPackage(package, &hpkg);
10976 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10978 /* test how MsiGetSourcePath affects the properties */
10980 /* SourceDir prop */
10982 lstrcpyA(path, "kiwi");
10983 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10984 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10987 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10988 ok(size == 0, "Expected 0, got %d\n", size);
10992 lstrcpyA(path, "kiwi");
10993 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10994 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10995 ok(!lstrcmpA(path, "kiwi"),
10996 "Expected path to be unchanged, got \"%s\"\n", path);
10997 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10999 /* SourceDir after MsiGetSourcePath */
11001 lstrcpyA(path, "kiwi");
11002 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11003 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11006 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11007 ok(size == 0, "Expected 0, got %d\n", size);
11010 /* SOURCEDIR prop */
11012 lstrcpyA(path, "kiwi");
11013 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11017 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11018 ok(size == 0, "Expected 0, got %d\n", size);
11022 lstrcpyA(path, "kiwi");
11023 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11024 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11025 ok(!lstrcmpA(path, "kiwi"),
11026 "Expected path to be unchanged, got \"%s\"\n", path);
11027 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11029 /* SOURCEDIR prop after MsiGetSourcePath */
11031 lstrcpyA(path, "kiwi");
11032 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11033 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11036 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11037 ok(size == 0, "Expected 0, got %d\n", size);
11040 r = MsiDoAction(hpkg, "CostInitialize");
11041 ok(r == ERROR_SUCCESS, "file cost failed\n");
11043 /* SourceDir after CostInitialize */
11045 lstrcpyA(path, "kiwi");
11046 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11050 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11051 ok(size == 0, "Expected 0, got %d\n", size);
11055 lstrcpyA(path, "kiwi");
11056 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11058 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11059 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11061 /* SourceDir after MsiGetSourcePath */
11063 lstrcpyA(path, "kiwi");
11064 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11065 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11066 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11067 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11069 /* SOURCEDIR after CostInitialize */
11071 lstrcpyA(path, "kiwi");
11072 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11074 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11075 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11077 /* SOURCEDIR source path still does not exist */
11079 lstrcpyA(path, "kiwi");
11080 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11081 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11082 ok(!lstrcmpA(path, "kiwi"),
11083 "Expected path to be unchanged, got \"%s\"\n", path);
11084 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11086 r = MsiDoAction(hpkg, "FileCost");
11087 ok(r == ERROR_SUCCESS, "file cost failed\n");
11089 /* SourceDir after FileCost */
11091 lstrcpyA(path, "kiwi");
11092 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11094 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11095 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11097 /* SOURCEDIR after FileCost */
11099 lstrcpyA(path, "kiwi");
11100 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11102 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11103 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11105 /* SOURCEDIR source path still does not exist */
11107 lstrcpyA(path, "kiwi");
11108 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11109 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11110 ok(!lstrcmpA(path, "kiwi"),
11111 "Expected path to be unchanged, got \"%s\"\n", path);
11112 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11114 r = MsiDoAction(hpkg, "CostFinalize");
11115 ok(r == ERROR_SUCCESS, "file cost failed\n");
11117 /* SourceDir after CostFinalize */
11119 lstrcpyA(path, "kiwi");
11120 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11122 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11123 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11125 /* SOURCEDIR after CostFinalize */
11127 lstrcpyA(path, "kiwi");
11128 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11129 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11130 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11131 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11133 /* SOURCEDIR source path still does not exist */
11135 lstrcpyA(path, "kiwi");
11136 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11137 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11138 ok(!lstrcmpA(path, "kiwi"),
11139 "Expected path to be unchanged, got \"%s\"\n", path);
11140 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11142 r = MsiDoAction(hpkg, "ResolveSource");
11143 ok(r == ERROR_SUCCESS, "file cost failed\n");
11145 /* SourceDir after ResolveSource */
11147 lstrcpyA(path, "kiwi");
11148 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11149 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11150 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11151 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11153 /* SOURCEDIR after ResolveSource */
11155 lstrcpyA(path, "kiwi");
11156 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11157 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11158 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11159 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11161 /* SOURCEDIR source path still does not exist */
11163 lstrcpyA(path, "kiwi");
11164 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11165 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11166 ok(!lstrcmpA(path, "kiwi"),
11167 "Expected path to be unchanged, got \"%s\"\n", path);
11168 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11170 MsiCloseHandle(hdb);
11171 MsiCloseHandle(hpkg);
11172 DeleteFileA(msifile);
11182 static const struct access_res create[16] =
11184 { TRUE, ERROR_SUCCESS, TRUE },
11185 { TRUE, ERROR_SUCCESS, TRUE },
11186 { TRUE, ERROR_SUCCESS, FALSE },
11187 { TRUE, ERROR_SUCCESS, FALSE },
11188 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11189 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11190 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11191 { TRUE, ERROR_SUCCESS, FALSE },
11192 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11193 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11194 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11195 { TRUE, ERROR_SUCCESS, TRUE },
11196 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11197 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11198 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11199 { TRUE, ERROR_SUCCESS, TRUE }
11202 static const struct access_res create_commit[16] =
11204 { TRUE, ERROR_SUCCESS, TRUE },
11205 { TRUE, ERROR_SUCCESS, TRUE },
11206 { TRUE, ERROR_SUCCESS, FALSE },
11207 { TRUE, ERROR_SUCCESS, FALSE },
11208 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11209 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11210 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11211 { TRUE, ERROR_SUCCESS, FALSE },
11212 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11213 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11214 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11215 { TRUE, ERROR_SUCCESS, TRUE },
11216 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11217 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11218 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11219 { TRUE, ERROR_SUCCESS, TRUE }
11222 static const struct access_res create_close[16] =
11224 { TRUE, ERROR_SUCCESS, FALSE },
11225 { TRUE, ERROR_SUCCESS, FALSE },
11226 { TRUE, ERROR_SUCCESS, FALSE },
11227 { TRUE, ERROR_SUCCESS, FALSE },
11228 { TRUE, ERROR_SUCCESS, FALSE },
11229 { TRUE, ERROR_SUCCESS, FALSE },
11230 { TRUE, ERROR_SUCCESS, FALSE },
11231 { TRUE, ERROR_SUCCESS, FALSE },
11232 { TRUE, ERROR_SUCCESS, FALSE },
11233 { TRUE, ERROR_SUCCESS, FALSE },
11234 { TRUE, ERROR_SUCCESS, FALSE },
11235 { TRUE, ERROR_SUCCESS, FALSE },
11236 { TRUE, ERROR_SUCCESS, FALSE },
11237 { TRUE, ERROR_SUCCESS, FALSE },
11238 { TRUE, ERROR_SUCCESS, FALSE },
11239 { TRUE, ERROR_SUCCESS }
11242 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
11244 DWORD access = 0, share = 0;
11249 for (i = 0; i < 4; i++)
11251 if (i == 0) access = 0;
11252 if (i == 1) access = GENERIC_READ;
11253 if (i == 2) access = GENERIC_WRITE;
11254 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
11256 for (j = 0; j < 4; j++)
11258 if (ares[idx].ignore)
11261 if (j == 0) share = 0;
11262 if (j == 1) share = FILE_SHARE_READ;
11263 if (j == 2) share = FILE_SHARE_WRITE;
11264 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
11266 SetLastError(0xdeadbeef);
11267 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
11268 FILE_ATTRIBUTE_NORMAL, 0);
11269 lasterr = GetLastError();
11271 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
11272 "(%d, handle, %d): Expected %d, got %d\n",
11273 line, idx, ares[idx].gothandle,
11274 (hfile != INVALID_HANDLE_VALUE));
11276 ok(lasterr == ares[idx].lasterr ||
11277 lasterr == 0xdeadbeef, /* win9x */
11278 "(%d, lasterr, %d): Expected %d, got %d\n",
11279 line, idx, ares[idx].lasterr, lasterr);
11281 CloseHandle(hfile);
11287 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
11289 static void test_access(void)
11294 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
11295 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11297 test_file_access(msifile, create);
11299 r = MsiDatabaseCommit(hdb);
11300 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11302 test_file_access(msifile, create_commit);
11304 MsiCloseHandle(hdb);
11306 test_file_access(msifile, create_close);
11308 DeleteFileA(msifile);
11310 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
11311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11313 test_file_access(msifile, create);
11315 r = MsiDatabaseCommit(hdb);
11316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11318 test_file_access(msifile, create_commit);
11320 MsiCloseHandle(hdb);
11322 test_file_access(msifile, create_close);
11324 DeleteFileA(msifile);
11327 static void test_emptypackage(void)
11329 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
11330 MSIHANDLE hview = 0, hrec = 0;
11331 MSICONDITION condition;
11332 CHAR buffer[MAX_PATH];
11336 r = MsiOpenPackageA("", &hpkg);
11339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11342 hdb = MsiGetActiveDatabase(hpkg);
11345 ok(hdb != 0, "Expected a valid database handle\n");
11348 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
11351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11353 r = MsiViewExecute(hview, 0);
11356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11359 r = MsiViewFetch(hview, &hrec);
11362 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11366 r = MsiRecordGetString(hrec, 1, buffer, &size);
11369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11370 ok(!lstrcmpA(buffer, "_Property"),
11371 "Expected \"_Property\", got \"%s\"\n", buffer);
11374 MsiCloseHandle(hrec);
11376 r = MsiViewFetch(hview, &hrec);
11379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11383 r = MsiRecordGetString(hrec, 1, buffer, &size);
11386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11387 ok(!lstrcmpA(buffer, "#_FolderCache"),
11388 "Expected \"_Property\", got \"%s\"\n", buffer);
11391 MsiCloseHandle(hrec);
11392 MsiViewClose(hview);
11393 MsiCloseHandle(hview);
11395 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
11398 ok(condition == MSICONDITION_FALSE,
11399 "Expected MSICONDITION_FALSE, got %d\n", condition);
11402 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
11405 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11407 r = MsiViewExecute(hview, 0);
11410 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11413 /* _Property table is not empty */
11414 r = MsiViewFetch(hview, &hrec);
11417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11420 MsiCloseHandle(hrec);
11421 MsiViewClose(hview);
11422 MsiCloseHandle(hview);
11424 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
11427 ok(condition == MSICONDITION_FALSE,
11428 "Expected MSICONDITION_FALSE, got %d\n", condition);
11431 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
11434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11436 r = MsiViewExecute(hview, 0);
11439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11442 /* #_FolderCache is not empty */
11443 r = MsiViewFetch(hview, &hrec);
11446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11449 MsiCloseHandle(hrec);
11450 MsiViewClose(hview);
11451 MsiCloseHandle(hview);
11453 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
11456 ok(r == ERROR_BAD_QUERY_SYNTAX,
11457 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11460 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
11463 ok(r == ERROR_BAD_QUERY_SYNTAX,
11464 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11467 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
11470 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
11471 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
11474 MsiCloseHandle(hsuminfo);
11476 r = MsiDatabaseCommit(hdb);
11479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11482 MsiCloseHandle(hdb);
11483 MsiCloseHandle(hpkg);
11486 static void test_MsiGetProductProperty(void)
11488 MSIHANDLE hprod, hdb;
11489 CHAR val[MAX_PATH];
11490 CHAR path[MAX_PATH];
11491 CHAR query[MAX_PATH];
11492 CHAR keypath[MAX_PATH*2];
11493 CHAR prodcode[MAX_PATH];
11494 CHAR prod_squashed[MAX_PATH];
11495 HKEY prodkey, userkey, props;
11501 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
11502 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
11504 win_skip("Different registry keys on Win9x and WinMe\n");
11507 CloseServiceHandle(scm);
11509 GetCurrentDirectoryA(MAX_PATH, path);
11510 lstrcatA(path, "\\");
11512 create_test_guid(prodcode, prod_squashed);
11514 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
11515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11517 r = MsiDatabaseCommit(hdb);
11518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11520 r = set_summary_info(hdb);
11521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11524 "CREATE TABLE `Directory` ( "
11525 "`Directory` CHAR(255) NOT NULL, "
11526 "`Directory_Parent` CHAR(255), "
11527 "`DefaultDir` CHAR(255) NOT NULL "
11528 "PRIMARY KEY `Directory`)");
11529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11532 "CREATE TABLE `Property` ( "
11533 "`Property` CHAR(72) NOT NULL, "
11534 "`Value` CHAR(255) "
11535 "PRIMARY KEY `Property`)");
11536 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11538 sprintf(query, "INSERT INTO `Property` "
11539 "(`Property`, `Value`) "
11540 "VALUES( 'ProductCode', '%s' )", prodcode);
11541 r = run_query(hdb, query);
11542 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11544 r = MsiDatabaseCommit(hdb);
11545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11547 MsiCloseHandle(hdb);
11549 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
11550 lstrcatA(keypath, prod_squashed);
11552 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &prodkey);
11553 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11555 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
11556 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
11557 lstrcatA(keypath, prod_squashed);
11559 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &userkey);
11560 if (res == ERROR_ACCESS_DENIED)
11562 skip("Not enough rights to perform tests\n");
11563 RegDeleteKeyA(prodkey, "");
11564 RegCloseKey(prodkey);
11567 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11569 res = RegCreateKeyA(userkey, "InstallProperties", &props);
11570 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11572 lstrcpyA(val, path);
11573 lstrcatA(val, "\\winetest.msi");
11574 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
11575 (const BYTE *)val, lstrlenA(val) + 1);
11576 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11578 hprod = 0xdeadbeef;
11579 r = MsiOpenProductA(prodcode, &hprod);
11580 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11581 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
11583 /* hProduct is invalid */
11585 lstrcpyA(val, "apple");
11586 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
11587 ok(r == ERROR_INVALID_HANDLE,
11588 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11589 ok(!lstrcmpA(val, "apple"),
11590 "Expected val to be unchanged, got \"%s\"\n", val);
11591 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11593 /* szProperty is NULL */
11595 lstrcpyA(val, "apple");
11596 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
11597 ok(r == ERROR_INVALID_PARAMETER,
11598 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11599 ok(!lstrcmpA(val, "apple"),
11600 "Expected val to be unchanged, got \"%s\"\n", val);
11601 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11603 /* szProperty is empty */
11605 lstrcpyA(val, "apple");
11606 r = MsiGetProductPropertyA(hprod, "", val, &size);
11607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11608 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11609 ok(size == 0, "Expected 0, got %d\n", size);
11611 /* get the property */
11613 lstrcpyA(val, "apple");
11614 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11616 ok(!lstrcmpA(val, prodcode),
11617 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11618 ok(size == lstrlenA(prodcode),
11619 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11621 /* lpValueBuf is NULL */
11623 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
11624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11625 ok(size == lstrlenA(prodcode),
11626 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11628 /* pcchValueBuf is NULL */
11629 lstrcpyA(val, "apple");
11630 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
11631 ok(r == ERROR_INVALID_PARAMETER,
11632 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11633 ok(!lstrcmpA(val, "apple"),
11634 "Expected val to be unchanged, got \"%s\"\n", val);
11635 ok(size == lstrlenA(prodcode),
11636 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11638 /* pcchValueBuf is too small */
11640 lstrcpyA(val, "apple");
11641 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11642 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11643 ok(!strncmp(val, prodcode, 3),
11644 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
11645 ok(size == lstrlenA(prodcode),
11646 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11648 /* pcchValueBuf does not leave room for NULL terminator */
11649 size = lstrlenA(prodcode);
11650 lstrcpyA(val, "apple");
11651 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11652 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11653 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
11654 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
11655 ok(size == lstrlenA(prodcode),
11656 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11658 /* pcchValueBuf has enough room for NULL terminator */
11659 size = lstrlenA(prodcode) + 1;
11660 lstrcpyA(val, "apple");
11661 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11662 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11663 ok(!lstrcmpA(val, prodcode),
11664 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11665 ok(size == lstrlenA(prodcode),
11666 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11668 /* nonexistent property */
11670 lstrcpyA(val, "apple");
11671 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
11672 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11673 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11674 ok(size == 0, "Expected 0, got %d\n", size);
11676 r = MsiSetPropertyA(hprod, "NewProperty", "value");
11677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11679 /* non-product property set */
11681 lstrcpyA(val, "apple");
11682 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
11683 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11684 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11685 ok(size == 0, "Expected 0, got %d\n", size);
11687 r = MsiSetPropertyA(hprod, "ProductCode", "value");
11688 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11690 /* non-product property that is also a product property set */
11692 lstrcpyA(val, "apple");
11693 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11694 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11695 ok(!lstrcmpA(val, prodcode),
11696 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11697 ok(size == lstrlenA(prodcode),
11698 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11700 MsiCloseHandle(hprod);
11702 RegDeleteValueA(props, "LocalPackage");
11703 RegDeleteKeyA(props, "");
11704 RegCloseKey(props);
11705 RegDeleteKeyA(userkey, "");
11706 RegCloseKey(userkey);
11707 RegDeleteKeyA(prodkey, "");
11708 RegCloseKey(prodkey);
11709 DeleteFileA(msifile);
11712 static void test_MsiSetProperty(void)
11714 MSIHANDLE hpkg, hdb, hrec;
11715 CHAR buf[MAX_PATH];
11720 hpkg = package_from_db(create_package_db());
11721 ok(hpkg != 0, "Expected a valid package\n");
11723 /* invalid hInstall */
11724 r = MsiSetPropertyA(0, "Prop", "Val");
11725 ok(r == ERROR_INVALID_HANDLE,
11726 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11728 /* invalid hInstall */
11729 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
11730 ok(r == ERROR_INVALID_HANDLE,
11731 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11733 /* szName is NULL */
11734 r = MsiSetPropertyA(hpkg, NULL, "Val");
11735 ok(r == ERROR_INVALID_PARAMETER,
11736 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11738 /* both szName and szValue are NULL */
11739 r = MsiSetPropertyA(hpkg, NULL, NULL);
11740 ok(r == ERROR_INVALID_PARAMETER,
11741 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11743 /* szName is empty */
11744 r = MsiSetPropertyA(hpkg, "", "Val");
11745 ok(r == ERROR_FUNCTION_FAILED,
11746 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
11748 /* szName is empty and szValue is NULL */
11749 r = MsiSetPropertyA(hpkg, "", NULL);
11750 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11752 /* set a property */
11753 r = MsiSetPropertyA(hpkg, "Prop", "Val");
11754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11756 /* get the property */
11758 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11759 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11760 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
11761 ok(size == 3, "Expected 3, got %d\n", size);
11763 /* update the property */
11764 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
11765 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11767 /* get the property */
11769 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11771 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
11772 ok(size == 4, "Expected 4, got %d\n", size);
11774 hdb = MsiGetActiveDatabase(hpkg);
11775 ok(hdb != 0, "Expected a valid database handle\n");
11777 /* set prop is not in the _Property table */
11778 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
11779 r = do_query(hdb, query, &hrec);
11780 ok(r == ERROR_BAD_QUERY_SYNTAX,
11781 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11783 /* set prop is not in the Property table */
11784 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
11785 r = do_query(hdb, query, &hrec);
11786 ok(r == ERROR_BAD_QUERY_SYNTAX,
11787 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11789 MsiCloseHandle(hdb);
11791 /* szValue is an empty string */
11792 r = MsiSetPropertyA(hpkg, "Prop", "");
11793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11795 /* try to get the property */
11797 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11799 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11800 ok(size == 0, "Expected 0, got %d\n", size);
11802 /* reset the property */
11803 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
11804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11806 /* delete the property */
11807 r = MsiSetPropertyA(hpkg, "Prop", NULL);
11808 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11810 /* try to get the property */
11812 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11813 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11814 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11815 ok(size == 0, "Expected 0, got %d\n", size);
11817 MsiCloseHandle(hpkg);
11818 DeleteFileA(msifile);
11821 static void test_MsiApplyMultiplePatches(void)
11823 UINT r, type = GetDriveType(NULL);
11825 if (!pMsiApplyMultiplePatchesA) {
11826 win_skip("MsiApplyMultiplePatchesA not found\n");
11830 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
11831 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11833 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
11834 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11836 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
11839 if (type == DRIVE_FIXED)
11840 ok(r == ERROR_PATH_NOT_FOUND,
11841 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11843 ok(r == ERROR_INVALID_NAME,
11844 "Expected ERROR_INVALID_NAME, got %u\n", r);
11847 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
11850 if (type == DRIVE_FIXED)
11851 ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED,
11852 "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
11854 ok(r == ERROR_INVALID_NAME,
11855 "Expected ERROR_INVALID_NAME, got %u\n", r);
11858 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
11861 if (type == DRIVE_FIXED)
11862 ok(r == ERROR_PATH_NOT_FOUND,
11863 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11865 ok(r == ERROR_INVALID_NAME,
11866 "Expected ERROR_INVALID_NAME, got %u\n", r);
11869 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
11870 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11872 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
11875 if (type == DRIVE_FIXED)
11876 ok(r == ERROR_PATH_NOT_FOUND,
11877 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11879 ok(r == ERROR_INVALID_NAME,
11880 "Expected ERROR_INVALID_NAME, got %u\n", r);
11883 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
11884 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11886 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
11887 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11890 static void test_MsiApplyPatch(void)
11894 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
11895 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11897 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
11898 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11901 START_TEST(package)
11903 STATEMGRSTATUS status;
11906 init_functionpointers();
11908 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
11910 /* Create a restore point ourselves so we circumvent the multitude of restore points
11911 * that would have been created by all the installation and removal tests.
11913 if (pSRSetRestorePointA)
11915 memset(&status, 0, sizeof(status));
11916 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
11919 test_createpackage();
11921 test_gettargetpath_bad();
11922 test_settargetpath();
11924 test_property_table();
11927 test_formatrecord2();
11929 test_getproperty();
11930 test_removefiles();
11932 test_appsearch_complocator();
11933 test_appsearch_reglocator();
11934 test_appsearch_inilocator();
11935 test_appsearch_drlocator();
11936 test_featureparents();
11937 test_installprops();
11938 test_launchconditions();
11940 test_complocator();
11941 test_MsiGetSourcePath();
11942 test_shortlongsource();
11945 test_emptypackage();
11946 test_MsiGetProductProperty();
11947 test_MsiSetProperty();
11948 test_MsiApplyMultiplePatches();
11949 test_MsiApplyPatch();
11951 if (pSRSetRestorePointA && ret)
11953 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
11955 remove_restore_point(status.llSequenceNumber);