2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include <srrestoreptapi.h>
31 #include "wine/test.h"
33 static const char msifile[] = "winetest-package.msi";
34 char CURR_DIR[MAX_PATH];
36 static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
38 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
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)
846 static const WCHAR boo[] = {'b','o','o',0};
847 static const WCHAR empty[] = {0};
854 hpkg = package_from_db(create_package_db());
855 ok( hpkg, "failed to create package\n");
857 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
858 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
860 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
861 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
863 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
864 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
866 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
867 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
869 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
870 ok( r == ERROR_DIRECTORY, "wrong return val\n");
872 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
873 ok( r == ERROR_DIRECTORY, "wrong return val\n");
876 r = MsiGetTargetPath( hpkg, "", buffer, &sz );
877 ok( r == ERROR_DIRECTORY, "wrong return val\n");
879 r = MsiGetTargetPathW( 0, NULL, NULL, NULL );
880 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
882 r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
883 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
885 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
886 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
888 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
889 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
891 r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
892 ok( r == ERROR_DIRECTORY, "wrong return val\n");
894 r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
895 ok( r == ERROR_DIRECTORY, "wrong return val\n");
898 r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
899 ok( r == ERROR_DIRECTORY, "wrong return val\n");
901 MsiCloseHandle( hpkg );
905 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
911 rec = MsiCreateRecord( 1 );
912 ok(rec, "MsiCreate record failed\n");
914 r = MsiRecordSetString( rec, 0, file );
915 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
918 r = MsiFormatRecord( hpkg, rec, buff, &size );
919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
921 MsiCloseHandle( rec );
924 static void test_settargetpath(void)
926 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
932 hdb = create_package_db();
933 ok ( hdb, "failed to create package database\n" );
935 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
936 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
938 r = create_component_table( hdb );
939 ok( r == S_OK, "cannot create Component table: %d\n", r );
941 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
942 ok( r == S_OK, "cannot add dummy component: %d\n", r );
944 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
945 ok( r == S_OK, "cannot add test component: %d\n", r );
947 r = create_feature_table( hdb );
948 ok( r == S_OK, "cannot create Feature table: %d\n", r );
950 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
951 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
953 r = create_feature_components_table( hdb );
954 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
956 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
957 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
959 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
960 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
962 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
963 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
965 r = create_file_table( hdb );
966 ok( r == S_OK, "cannot create File table: %d\n", r );
968 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
969 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
971 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
972 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
974 hpkg = package_from_db( hdb );
975 ok( hpkg, "failed to create package\n");
977 r = MsiDoAction( hpkg, "CostInitialize");
978 ok( r == ERROR_SUCCESS, "cost init failed\n");
980 r = MsiDoAction( hpkg, "FileCost");
981 ok( r == ERROR_SUCCESS, "file cost failed\n");
983 r = MsiDoAction( hpkg, "CostFinalize");
984 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
986 r = MsiSetTargetPath( 0, NULL, NULL );
987 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
989 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
990 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
992 r = MsiSetTargetPath( hpkg, "boo", NULL );
993 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
995 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
996 ok( r == ERROR_DIRECTORY, "wrong return val\n");
998 sz = sizeof tempdir - 1;
999 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
1000 sprintf( file, "%srootfile.txt", tempdir );
1002 query_file_path( hpkg, "[#RootFile]", buffer );
1003 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1004 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
1006 GetTempFileName( tempdir, "_wt", 0, buffer );
1007 sprintf( tempdir, "%s\\subdir", buffer );
1009 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1010 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1011 "MsiSetTargetPath on file returned %d\n", r );
1013 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1014 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1015 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
1017 DeleteFile( buffer );
1019 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1020 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1022 r = GetFileAttributes( buffer );
1023 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
1025 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1026 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
1028 sz = sizeof buffer - 1;
1029 lstrcat( tempdir, "\\" );
1030 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
1031 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1032 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
1034 sprintf( file, "%srootfile.txt", tempdir );
1035 query_file_path( hpkg, "[#RootFile]", buffer );
1036 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
1038 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
1039 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1041 query_file_path( hpkg, "[#TestFile]", buffer );
1042 ok( !lstrcmpi(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
1043 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
1045 sz = sizeof buffer - 1;
1046 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1047 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1048 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
1050 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two\\three" );
1051 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1053 sz = sizeof buffer - 1;
1054 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1055 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1056 ok( !lstrcmpi(buffer, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer);
1058 MsiCloseHandle( hpkg );
1061 static void test_condition(void)
1066 hpkg = package_from_db(create_package_db());
1067 ok( hpkg, "failed to create package\n");
1069 r = MsiEvaluateCondition(0, NULL);
1070 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1072 r = MsiEvaluateCondition(hpkg, NULL);
1073 ok( r == MSICONDITION_NONE, "wrong return val\n");
1075 r = MsiEvaluateCondition(hpkg, "");
1076 ok( r == MSICONDITION_NONE, "wrong return val\n");
1078 r = MsiEvaluateCondition(hpkg, "1");
1079 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1081 r = MsiEvaluateCondition(hpkg, "0");
1082 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1084 r = MsiEvaluateCondition(hpkg, "-1");
1085 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1087 r = MsiEvaluateCondition(hpkg, "0 = 0");
1088 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1090 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1091 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1093 r = MsiEvaluateCondition(hpkg, "0 = 1");
1094 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1096 r = MsiEvaluateCondition(hpkg, "0 > 1");
1097 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1099 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1100 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1102 r = MsiEvaluateCondition(hpkg, "1 > 1");
1103 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1105 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1106 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1108 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1109 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1111 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1112 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1114 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1115 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1117 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1118 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1120 r = MsiEvaluateCondition(hpkg, "0 < 1");
1121 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1123 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1124 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1126 r = MsiEvaluateCondition(hpkg, "1 < 1");
1127 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1129 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1130 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1132 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1133 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1135 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1136 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1138 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1139 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1141 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1142 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1144 r = MsiEvaluateCondition(hpkg, "0 >=");
1145 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1147 r = MsiEvaluateCondition(hpkg, " ");
1148 ok( r == MSICONDITION_NONE, "wrong return val\n");
1150 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1151 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1153 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1154 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1156 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1157 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1159 r = MsiEvaluateCondition(hpkg, "not 0");
1160 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1162 r = MsiEvaluateCondition(hpkg, "not LicView");
1163 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1165 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1166 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1168 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1169 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1171 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1172 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1174 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1175 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1177 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1178 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1180 r = MsiEvaluateCondition(hpkg, "\"0\"");
1181 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1183 r = MsiEvaluateCondition(hpkg, "1 and 2");
1184 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1186 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1187 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1189 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1190 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1192 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1193 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1195 r = MsiEvaluateCondition(hpkg, "(0)");
1196 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1198 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1199 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1201 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1202 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1204 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1205 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1207 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1208 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1210 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1211 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1213 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1214 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1216 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1217 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1219 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1220 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1222 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1223 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1225 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1226 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1228 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1229 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1231 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1232 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1234 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1235 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1237 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1238 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1240 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1241 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1243 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1244 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1246 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1247 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1249 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1250 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1252 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1253 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1255 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1256 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1258 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1259 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1261 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1262 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1264 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1265 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1267 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1268 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1270 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1271 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1273 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1274 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1276 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1277 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1279 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1280 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1282 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1283 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1285 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1286 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1288 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1289 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1291 MsiSetProperty(hpkg, "mm", "5" );
1293 r = MsiEvaluateCondition(hpkg, "mm = 5");
1294 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1296 r = MsiEvaluateCondition(hpkg, "mm < 6");
1297 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1299 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1300 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1302 r = MsiEvaluateCondition(hpkg, "mm > 4");
1303 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1305 r = MsiEvaluateCondition(hpkg, "mm < 12");
1306 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1308 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1309 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1311 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1312 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1314 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1315 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1317 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1318 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1320 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1321 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1323 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1324 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1326 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1327 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1329 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1330 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1332 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1333 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1335 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1336 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1338 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1339 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1341 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1342 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1344 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1345 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1347 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1348 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1350 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1351 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1353 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1354 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1356 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1357 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1359 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1360 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1362 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1363 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1365 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1366 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1368 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1369 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1371 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1372 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1374 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1375 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1377 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1378 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1380 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1381 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1383 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1384 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1386 MsiSetProperty(hpkg, "bandalmael", "0" );
1387 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1388 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1390 MsiSetProperty(hpkg, "bandalmael", "" );
1391 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1392 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1394 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1395 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1396 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1398 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1399 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1400 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1402 MsiSetProperty(hpkg, "bandalmael", "0 " );
1403 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1404 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1406 MsiSetProperty(hpkg, "bandalmael", "-0" );
1407 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1408 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1410 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1411 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1412 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1414 MsiSetProperty(hpkg, "bandalmael", "--0" );
1415 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1416 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1418 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1419 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1420 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1422 MsiSetProperty(hpkg, "bandalmael", "-" );
1423 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1424 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1426 MsiSetProperty(hpkg, "bandalmael", "+0" );
1427 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1428 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1430 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1431 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1432 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1433 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1434 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1436 MsiSetProperty(hpkg, "one", "hi");
1437 MsiSetProperty(hpkg, "two", "hithere");
1438 r = MsiEvaluateCondition(hpkg, "one >< two");
1439 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1441 MsiSetProperty(hpkg, "one", "hithere");
1442 MsiSetProperty(hpkg, "two", "hi");
1443 r = MsiEvaluateCondition(hpkg, "one >< two");
1444 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1446 MsiSetProperty(hpkg, "one", "hello");
1447 MsiSetProperty(hpkg, "two", "hi");
1448 r = MsiEvaluateCondition(hpkg, "one >< two");
1449 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1451 MsiSetProperty(hpkg, "one", "hellohithere");
1452 MsiSetProperty(hpkg, "two", "hi");
1453 r = MsiEvaluateCondition(hpkg, "one >< two");
1454 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1456 MsiSetProperty(hpkg, "one", "");
1457 MsiSetProperty(hpkg, "two", "hi");
1458 r = MsiEvaluateCondition(hpkg, "one >< two");
1459 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1461 MsiSetProperty(hpkg, "one", "hi");
1462 MsiSetProperty(hpkg, "two", "");
1463 r = MsiEvaluateCondition(hpkg, "one >< two");
1464 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1466 MsiSetProperty(hpkg, "one", "");
1467 MsiSetProperty(hpkg, "two", "");
1468 r = MsiEvaluateCondition(hpkg, "one >< two");
1469 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1471 MsiSetProperty(hpkg, "one", "1234");
1472 MsiSetProperty(hpkg, "two", "1");
1473 r = MsiEvaluateCondition(hpkg, "one >< two");
1474 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1476 MsiSetProperty(hpkg, "one", "one 1234");
1477 MsiSetProperty(hpkg, "two", "1");
1478 r = MsiEvaluateCondition(hpkg, "one >< two");
1479 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1481 MsiSetProperty(hpkg, "one", "hithere");
1482 MsiSetProperty(hpkg, "two", "hi");
1483 r = MsiEvaluateCondition(hpkg, "one << two");
1484 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1486 MsiSetProperty(hpkg, "one", "hi");
1487 MsiSetProperty(hpkg, "two", "hithere");
1488 r = MsiEvaluateCondition(hpkg, "one << two");
1489 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1491 MsiSetProperty(hpkg, "one", "hi");
1492 MsiSetProperty(hpkg, "two", "hi");
1493 r = MsiEvaluateCondition(hpkg, "one << two");
1494 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1496 MsiSetProperty(hpkg, "one", "abcdhithere");
1497 MsiSetProperty(hpkg, "two", "hi");
1498 r = MsiEvaluateCondition(hpkg, "one << two");
1499 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1501 MsiSetProperty(hpkg, "one", "");
1502 MsiSetProperty(hpkg, "two", "hi");
1503 r = MsiEvaluateCondition(hpkg, "one << two");
1504 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1506 MsiSetProperty(hpkg, "one", "hithere");
1507 MsiSetProperty(hpkg, "two", "");
1508 r = MsiEvaluateCondition(hpkg, "one << two");
1509 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1511 MsiSetProperty(hpkg, "one", "");
1512 MsiSetProperty(hpkg, "two", "");
1513 r = MsiEvaluateCondition(hpkg, "one << two");
1514 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1516 MsiSetProperty(hpkg, "one", "1234");
1517 MsiSetProperty(hpkg, "two", "1");
1518 r = MsiEvaluateCondition(hpkg, "one << two");
1519 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1521 MsiSetProperty(hpkg, "one", "1234 one");
1522 MsiSetProperty(hpkg, "two", "1");
1523 r = MsiEvaluateCondition(hpkg, "one << two");
1524 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1526 MsiSetProperty(hpkg, "one", "hithere");
1527 MsiSetProperty(hpkg, "two", "there");
1528 r = MsiEvaluateCondition(hpkg, "one >> two");
1529 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1531 MsiSetProperty(hpkg, "one", "hithere");
1532 MsiSetProperty(hpkg, "two", "hi");
1533 r = MsiEvaluateCondition(hpkg, "one >> two");
1534 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1536 MsiSetProperty(hpkg, "one", "there");
1537 MsiSetProperty(hpkg, "two", "hithere");
1538 r = MsiEvaluateCondition(hpkg, "one >> two");
1539 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1541 MsiSetProperty(hpkg, "one", "there");
1542 MsiSetProperty(hpkg, "two", "there");
1543 r = MsiEvaluateCondition(hpkg, "one >> two");
1544 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1546 MsiSetProperty(hpkg, "one", "abcdhithere");
1547 MsiSetProperty(hpkg, "two", "hi");
1548 r = MsiEvaluateCondition(hpkg, "one >> two");
1549 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1551 MsiSetProperty(hpkg, "one", "");
1552 MsiSetProperty(hpkg, "two", "there");
1553 r = MsiEvaluateCondition(hpkg, "one >> two");
1554 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1556 MsiSetProperty(hpkg, "one", "there");
1557 MsiSetProperty(hpkg, "two", "");
1558 r = MsiEvaluateCondition(hpkg, "one >> two");
1559 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1561 MsiSetProperty(hpkg, "one", "");
1562 MsiSetProperty(hpkg, "two", "");
1563 r = MsiEvaluateCondition(hpkg, "one >> two");
1564 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1566 MsiSetProperty(hpkg, "one", "1234");
1567 MsiSetProperty(hpkg, "two", "4");
1568 r = MsiEvaluateCondition(hpkg, "one >> two");
1569 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1571 MsiSetProperty(hpkg, "one", "one 1234");
1572 MsiSetProperty(hpkg, "two", "4");
1573 r = MsiEvaluateCondition(hpkg, "one >> two");
1574 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1576 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1578 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1579 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1581 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1582 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1584 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1585 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1587 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1588 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1590 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1591 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1593 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1594 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1596 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1597 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1599 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1600 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1602 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1603 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1605 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1606 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1608 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1609 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1611 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1612 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1614 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1615 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1617 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1618 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1620 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1621 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1623 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1624 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1626 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1627 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1629 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1630 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1632 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1633 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1635 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1636 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1638 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1639 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1641 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1642 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1644 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1645 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1647 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1648 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1650 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1651 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1653 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1654 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1656 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1657 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1659 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1660 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1662 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1663 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1665 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1666 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1668 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1669 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1671 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1672 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1674 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1675 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1677 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1678 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1680 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1681 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1683 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1684 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1686 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1687 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1689 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1690 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1691 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1693 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1694 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1696 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1697 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1699 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1700 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1702 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1703 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1705 MsiSetProperty(hpkg, "one", "1");
1706 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1707 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1709 MsiSetProperty(hpkg, "X", "5.0");
1711 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1712 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1714 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1715 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1717 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1718 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1720 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1721 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1723 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1724 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1726 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1727 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1729 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1730 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1732 /* feature doesn't exist */
1733 r = MsiEvaluateCondition(hpkg, "&nofeature");
1734 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1736 MsiSetProperty(hpkg, "A", "2");
1737 MsiSetProperty(hpkg, "X", "50");
1739 r = MsiEvaluateCondition(hpkg, "2 <= X");
1740 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1742 r = MsiEvaluateCondition(hpkg, "A <= X");
1743 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1745 r = MsiEvaluateCondition(hpkg, "A <= 50");
1746 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1748 MsiSetProperty(hpkg, "X", "50val");
1750 r = MsiEvaluateCondition(hpkg, "2 <= X");
1751 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1753 r = MsiEvaluateCondition(hpkg, "A <= X");
1754 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1756 MsiSetProperty(hpkg, "A", "7");
1757 MsiSetProperty(hpkg, "X", "50");
1759 r = MsiEvaluateCondition(hpkg, "7 <= X");
1760 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1762 r = MsiEvaluateCondition(hpkg, "A <= X");
1763 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1765 r = MsiEvaluateCondition(hpkg, "A <= 50");
1766 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1768 MsiSetProperty(hpkg, "X", "50val");
1770 r = MsiEvaluateCondition(hpkg, "2 <= X");
1771 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1773 r = MsiEvaluateCondition(hpkg, "A <= X");
1774 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1776 MsiCloseHandle( hpkg );
1777 DeleteFile(msifile);
1780 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1788 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1789 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1792 static void test_props(void)
1794 MSIHANDLE hpkg, hdb;
1799 hdb = create_package_db();
1801 "CREATE TABLE `Property` ( "
1802 "`Property` CHAR(255) NOT NULL, "
1803 "`Value` CHAR(255) "
1804 "PRIMARY KEY `Property`)" );
1805 ok( r == ERROR_SUCCESS , "Failed\n" );
1808 "INSERT INTO `Property` "
1809 "(`Property`, `Value`) "
1810 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1811 ok( r == ERROR_SUCCESS , "Failed\n" );
1813 hpkg = package_from_db( hdb );
1814 ok( hpkg, "failed to create package\n");
1816 /* test invalid values */
1817 r = MsiGetProperty( 0, NULL, NULL, NULL );
1818 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1820 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1821 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1823 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1824 ok( r == ERROR_SUCCESS, "wrong return val\n");
1826 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1827 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1829 /* test retrieving an empty/nonexistent property */
1831 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1832 ok( r == ERROR_SUCCESS, "wrong return val\n");
1833 ok( sz == 0, "wrong size returned\n");
1835 check_prop_empty( hpkg, "boo");
1838 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1839 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1840 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1841 ok( sz == 0, "wrong size returned\n");
1845 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1846 ok( r == ERROR_SUCCESS, "wrong return val\n");
1847 ok( buffer[0] == 0, "buffer was not changed\n");
1848 ok( sz == 0, "wrong size returned\n");
1850 /* set the property to something */
1851 r = MsiSetProperty( 0, NULL, NULL );
1852 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1854 r = MsiSetProperty( hpkg, NULL, NULL );
1855 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1857 r = MsiSetProperty( hpkg, "", NULL );
1858 ok( r == ERROR_SUCCESS, "wrong return val\n");
1860 /* try set and get some illegal property identifiers */
1861 r = MsiSetProperty( hpkg, "", "asdf" );
1862 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1864 r = MsiSetProperty( hpkg, "=", "asdf" );
1865 ok( r == ERROR_SUCCESS, "wrong return val\n");
1867 r = MsiSetProperty( hpkg, " ", "asdf" );
1868 ok( r == ERROR_SUCCESS, "wrong return val\n");
1870 r = MsiSetProperty( hpkg, "'", "asdf" );
1871 ok( r == ERROR_SUCCESS, "wrong return val\n");
1875 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1876 ok( r == ERROR_SUCCESS, "wrong return val\n");
1877 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1879 /* set empty values */
1880 r = MsiSetProperty( hpkg, "boo", NULL );
1881 ok( r == ERROR_SUCCESS, "wrong return val\n");
1882 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1884 r = MsiSetProperty( hpkg, "boo", "" );
1885 ok( r == ERROR_SUCCESS, "wrong return val\n");
1886 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1888 /* set a non-empty value */
1889 r = MsiSetProperty( hpkg, "boo", "xyz" );
1890 ok( r == ERROR_SUCCESS, "wrong return val\n");
1894 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1895 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1896 ok( buffer[0] == 0, "buffer was not changed\n");
1897 ok( sz == 3, "wrong size returned\n");
1901 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1902 ok( r == ERROR_SUCCESS, "wrong return val\n");
1903 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1904 ok( sz == 3, "wrong size returned\n");
1908 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1909 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1910 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1911 ok( sz == 3, "wrong size returned\n");
1913 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1914 ok( r == ERROR_SUCCESS, "wrong return val\n");
1917 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1918 ok( r == ERROR_SUCCESS, "wrong return val\n");
1919 ok( !strcmp(buffer,""), "buffer wrong\n");
1920 ok( sz == 0, "wrong size returned\n");
1923 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1924 ok( r == ERROR_SUCCESS, "wrong return val\n");
1925 ok( !strcmp(buffer,""), "buffer wrong\n");
1926 ok( sz == 0, "wrong size returned\n");
1929 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1930 ok( r == ERROR_SUCCESS, "wrong return val\n");
1931 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1932 ok( sz == 3, "wrong size returned\n");
1934 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1935 ok( r == ERROR_SUCCESS, "wrong return val\n");
1938 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1939 ok( r == ERROR_SUCCESS, "return wrong\n");
1940 ok( sz == 13, "size wrong (%d)\n", sz);
1943 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1944 ok( r == ERROR_MORE_DATA, "return wrong\n");
1945 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1947 r = MsiSetProperty(hpkg, "property", "value");
1948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1951 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1952 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1953 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1955 r = MsiSetProperty(hpkg, "property", NULL);
1956 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1959 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1961 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1963 MsiCloseHandle( hpkg );
1964 DeleteFile(msifile);
1967 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1969 MSIHANDLE hview, hrec;
1971 CHAR buffer[MAX_PATH];
1975 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1976 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1977 r = MsiViewExecute(hview, 0);
1978 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1981 while (r == ERROR_SUCCESS && !found)
1983 r = MsiViewFetch(hview, &hrec);
1984 if (r != ERROR_SUCCESS) break;
1987 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1988 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1991 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1992 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1996 MsiCloseHandle(hrec);
1999 MsiViewClose(hview);
2000 MsiCloseHandle(hview);
2005 static void test_property_table(void)
2009 MSIHANDLE hpkg, hdb, hrec;
2010 char buffer[MAX_PATH];
2014 hdb = create_package_db();
2015 ok( hdb, "failed to create package\n");
2017 hpkg = package_from_db(hdb);
2018 ok( hpkg, "failed to create package\n");
2020 MsiCloseHandle(hdb);
2022 hdb = MsiGetActiveDatabase(hpkg);
2024 query = "CREATE TABLE `_Property` ( "
2025 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2026 r = run_query(hdb, query);
2027 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2029 MsiCloseHandle(hdb);
2030 MsiCloseHandle(hpkg);
2031 DeleteFile(msifile);
2033 hdb = create_package_db();
2034 ok( hdb, "failed to create package\n");
2036 query = "CREATE TABLE `_Property` ( "
2037 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2038 r = run_query(hdb, query);
2039 ok(r == ERROR_SUCCESS, "failed to create table\n");
2041 query = "ALTER `_Property` ADD `foo` INTEGER";
2042 r = run_query(hdb, query);
2043 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2045 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2046 r = run_query(hdb, query);
2047 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2049 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2050 r = run_query(hdb, query);
2051 ok(r == ERROR_SUCCESS, "failed to add column\n");
2053 hpkg = package_from_db(hdb);
2056 ok(!hpkg, "package should not be created\n");
2059 MsiCloseHandle(hdb);
2060 MsiCloseHandle(hpkg);
2061 DeleteFile(msifile);
2063 hdb = create_package_db();
2064 ok (hdb, "failed to create package database\n");
2066 r = create_property_table(hdb);
2067 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2069 r = add_property_entry(hdb, "'prop', 'val'");
2070 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2072 hpkg = package_from_db(hdb);
2073 ok(hpkg, "failed to create package\n");
2075 MsiCloseHandle(hdb);
2078 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2079 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2080 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2082 hdb = MsiGetActiveDatabase(hpkg);
2084 found = find_prop_in_property(hdb, "prop", "val");
2085 ok(found, "prop should be in the _Property table\n");
2087 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2088 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2090 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2091 r = do_query(hdb, query, &hrec);
2092 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2094 found = find_prop_in_property(hdb, "dantes", "mercedes");
2095 ok(found == FALSE, "dantes should not be in the _Property table\n");
2098 lstrcpy(buffer, "aaa");
2099 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2100 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2101 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2103 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2104 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2106 found = find_prop_in_property(hdb, "dantes", "mercedes");
2107 ok(found == TRUE, "dantes should be in the _Property table\n");
2109 MsiCloseHandle(hdb);
2110 MsiCloseHandle(hpkg);
2111 DeleteFile(msifile);
2114 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2119 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2120 if( res == ERROR_SUCCESS )
2124 r = MsiViewExecute( htab, hrec );
2125 if( r != ERROR_SUCCESS )
2128 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2131 r = MsiViewClose( htab );
2132 if( r != ERROR_SUCCESS )
2135 r = MsiCloseHandle( htab );
2136 if( r != ERROR_SUCCESS )
2142 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2144 return try_query_param( hdb, szQuery, 0 );
2147 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2152 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2155 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2158 r = MsiSummaryInfoPersist(summary);
2159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2161 MsiCloseHandle(summary);
2164 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2169 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2170 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2172 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2173 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2175 r = MsiSummaryInfoPersist(summary);
2176 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2178 MsiCloseHandle(summary);
2181 static void test_msipackage(void)
2183 MSIHANDLE hdb = 0, hpack = 100;
2188 /* NULL szPackagePath */
2189 r = MsiOpenPackage(NULL, &hpack);
2190 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2192 /* empty szPackagePath */
2193 r = MsiOpenPackage("", &hpack);
2196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2199 if (r == ERROR_SUCCESS)
2200 MsiCloseHandle(hpack);
2202 /* nonexistent szPackagePath */
2203 r = MsiOpenPackage("nonexistent", &hpack);
2204 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2207 r = MsiOpenPackage(msifile, NULL);
2208 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2212 r = MsiOpenPackage(name, &hpack);
2213 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2215 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2216 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2218 /* database exists, but is emtpy */
2219 sprintf(name, "#%d", hdb);
2220 r = MsiOpenPackage(name, &hpack);
2221 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2222 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2224 query = "CREATE TABLE `Property` ( "
2225 "`Property` CHAR(72), `Value` CHAR(0) "
2226 "PRIMARY KEY `Property`)";
2227 r = try_query(hdb, query);
2228 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2230 query = "CREATE TABLE `InstallExecuteSequence` ("
2231 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2232 "PRIMARY KEY `Action`)";
2233 r = try_query(hdb, query);
2234 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2236 /* a few key tables exist */
2237 sprintf(name, "#%d", hdb);
2238 r = MsiOpenPackage(name, &hpack);
2239 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2240 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2242 MsiCloseHandle(hdb);
2243 DeleteFile(msifile);
2245 /* start with a clean database to show what constitutes a valid package */
2246 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2247 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2249 sprintf(name, "#%d", hdb);
2251 /* The following summary information props must exist:
2256 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2257 r = MsiOpenPackage(name, &hpack);
2258 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2259 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2261 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2262 r = MsiOpenPackage(name, &hpack);
2263 ok(r == ERROR_SUCCESS,
2264 "Expected ERROR_SUCCESS, got %d\n", r);
2266 MsiCloseHandle(hpack);
2267 MsiCloseHandle(hdb);
2268 DeleteFile(msifile);
2271 static void test_formatrecord2(void)
2273 MSIHANDLE hpkg, hrec ;
2278 hpkg = package_from_db(create_package_db());
2279 ok( hpkg, "failed to create package\n");
2281 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2282 ok( r == ERROR_SUCCESS, "set property failed\n");
2284 hrec = MsiCreateRecord(2);
2285 ok(hrec, "create record failed\n");
2287 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2288 ok( r == ERROR_SUCCESS, "format record failed\n");
2292 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2294 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2295 r = MsiRecordSetString(hrec, 1, "hoo");
2297 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2298 ok( sz == 3, "size wrong\n");
2299 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2300 ok( r == ERROR_SUCCESS, "format failed\n");
2302 r = MsiRecordSetString(hrec, 0, "x[~]x");
2304 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2305 ok( sz == 3, "size wrong\n");
2306 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2307 ok( r == ERROR_SUCCESS, "format failed\n");
2309 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2310 r = MsiRecordSetString(hrec, 1, "hoo");
2312 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2313 ok( sz == 3, "size wrong\n");
2314 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2315 ok( r == ERROR_SUCCESS, "format failed\n");
2317 r = MsiRecordSetString(hrec, 0, "[\\[]");
2319 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2320 ok( sz == 1, "size wrong\n");
2321 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2322 ok( r == ERROR_SUCCESS, "format failed\n");
2324 SetEnvironmentVariable("FOO", "BAR");
2325 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2327 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2328 ok( sz == 3, "size wrong\n");
2329 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2330 ok( r == ERROR_SUCCESS, "format failed\n");
2332 r = MsiRecordSetString(hrec, 0, "[[1]]");
2333 r = MsiRecordSetString(hrec, 1, "%FOO");
2335 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2336 ok( sz == 3, "size wrong\n");
2337 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2338 ok( r == ERROR_SUCCESS, "format failed\n");
2340 MsiCloseHandle( hrec );
2341 MsiCloseHandle( hpkg );
2342 DeleteFile(msifile);
2345 static void test_states(void)
2350 INSTALLSTATE state, action;
2352 static const CHAR msifile2[] = "winetest2-package.msi";
2353 static const CHAR msifile3[] = "winetest3-package.msi";
2354 static const CHAR msifile4[] = "winetest4-package.msi";
2356 hdb = create_package_db();
2357 ok ( hdb, "failed to create package database\n" );
2359 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2360 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2362 r = create_property_table( hdb );
2363 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2365 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2366 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2368 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2369 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2371 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2372 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2374 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2375 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2377 r = create_install_execute_sequence_table( hdb );
2378 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2380 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2381 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2383 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2384 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2386 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2387 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2389 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2390 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2392 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2393 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2395 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2396 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2398 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2399 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2401 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2402 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2404 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2405 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2407 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2408 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2410 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2411 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2413 r = create_media_table( hdb );
2414 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2416 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2417 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2419 r = create_feature_table( hdb );
2420 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2422 r = create_component_table( hdb );
2423 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2425 /* msidbFeatureAttributesFavorLocal */
2426 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2427 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2429 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2430 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2431 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2433 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2434 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2435 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2437 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2438 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2439 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2441 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2442 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2443 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2445 /* msidbFeatureAttributesFavorSource */
2446 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2447 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2449 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2450 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2451 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2453 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2454 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2455 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2457 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2458 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2459 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2461 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2462 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2463 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2465 /* msidbFeatureAttributesFavorSource */
2466 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2467 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2469 /* msidbFeatureAttributesFavorLocal */
2470 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2471 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2474 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2475 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2477 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2478 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2479 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2481 /* no feature parent:msidbComponentAttributesLocalOnly */
2482 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2483 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2485 /* msidbFeatureAttributesFavorLocal:removed */
2486 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2487 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2489 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2490 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2491 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2493 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2494 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2495 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2497 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2498 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2499 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2501 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2502 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2503 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2505 /* msidbFeatureAttributesFavorSource:removed */
2506 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2507 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2509 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2510 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2511 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2513 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2514 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2515 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2517 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2518 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2519 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2521 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2522 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2523 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2525 /* msidbFeatureAttributesFavorLocal */
2526 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2527 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2529 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2530 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2532 /* msidbFeatureAttributesFavorSource */
2533 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2534 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2536 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2537 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2539 /* msidbFeatureAttributesFavorAdvertise */
2540 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2541 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2543 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2544 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2546 r = create_feature_components_table( hdb );
2547 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2549 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2550 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2552 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2553 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2555 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2556 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2558 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2559 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2561 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2562 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2564 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2565 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2567 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2568 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2570 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2571 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2573 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2574 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2576 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2577 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2579 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2580 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2582 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2583 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2585 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2586 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2588 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2589 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2591 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2592 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2594 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2595 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2597 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2598 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2600 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2601 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2603 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2604 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2606 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2607 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2609 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2610 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2612 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2613 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2615 r = create_file_table( hdb );
2616 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2618 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2619 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2621 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2622 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2624 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2625 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2627 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2628 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2630 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2631 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2633 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2634 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2636 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2637 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2639 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2640 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2642 /* compressed file */
2643 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2644 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2646 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2647 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2649 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2650 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2652 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2653 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2655 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2656 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2658 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2659 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2661 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2662 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2664 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2665 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2667 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2668 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2670 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2671 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2673 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2674 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2676 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2677 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2679 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2680 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2682 MsiDatabaseCommit(hdb);
2684 /* these properties must not be in the saved msi file */
2685 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2686 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2688 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2689 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2691 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2692 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2694 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2695 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2697 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2698 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2700 hpkg = package_from_db( hdb );
2701 ok( hpkg, "failed to create package\n");
2703 MsiCloseHandle(hdb);
2705 CopyFileA(msifile, msifile2, FALSE);
2706 CopyFileA(msifile, msifile3, FALSE);
2707 CopyFileA(msifile, msifile4, FALSE);
2711 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2712 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2713 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2714 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2718 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2719 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2720 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2721 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2725 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2726 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2727 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2728 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2732 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2733 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2734 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2735 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2739 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2740 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2741 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2742 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2746 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2747 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2748 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2749 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2753 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2754 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2755 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2756 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2760 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2761 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2762 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2763 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2767 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2768 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2769 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2770 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2774 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2775 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2776 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2777 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2781 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2782 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2783 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2784 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2788 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2789 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2790 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2791 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2795 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2796 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2797 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2798 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2802 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2803 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2804 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2805 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2809 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2810 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2811 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2812 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2816 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2817 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2818 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2819 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2823 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2824 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2825 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2826 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2830 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2831 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2832 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2833 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2837 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2838 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2839 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2840 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2844 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2845 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2846 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2847 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2851 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2852 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2853 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2854 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2858 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2859 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2860 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2861 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2865 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2866 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2867 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2868 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2872 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2873 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2874 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2875 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2879 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2880 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2881 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2882 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2886 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2887 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2888 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2889 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2893 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2894 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2895 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2896 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2900 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2901 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2902 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2903 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2907 r = MsiGetComponentState(hpkg, "tau", &state, &action);
2908 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2909 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2910 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2914 r = MsiGetComponentState(hpkg, "phi", &state, &action);
2915 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2916 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2917 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2921 r = MsiGetComponentState(hpkg, "chi", &state, &action);
2922 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2923 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2924 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2926 r = MsiDoAction( hpkg, "CostInitialize");
2927 ok( r == ERROR_SUCCESS, "cost init failed\n");
2931 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2932 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2933 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2934 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2938 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2939 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2940 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2941 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2945 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2947 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2948 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2952 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2953 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2954 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2955 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2959 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2961 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2962 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2966 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2968 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2969 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2973 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2975 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2976 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2980 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2982 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2983 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2987 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2989 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2990 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2994 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2996 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2997 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3001 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3002 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3003 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3004 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3008 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3009 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3010 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3011 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3015 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3016 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3017 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3018 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3022 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3023 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3024 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3025 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3029 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3030 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3031 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3032 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3036 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3037 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3038 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3039 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3043 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3044 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3045 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3046 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3050 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3051 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3052 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3053 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3057 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3058 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3059 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3060 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3064 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3065 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3066 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3067 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3071 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3072 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3073 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3074 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3078 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3079 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3080 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3081 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3085 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3086 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3087 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3088 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3092 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3094 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3095 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3099 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3101 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3102 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3106 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3108 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3113 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3115 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3116 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3120 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3122 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3127 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3134 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3141 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3146 r = MsiDoAction( hpkg, "FileCost");
3147 ok( r == ERROR_SUCCESS, "file cost failed\n");
3151 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3152 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3153 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3154 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3158 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3159 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3160 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3161 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3165 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3166 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3167 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3168 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3172 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3173 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3174 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3175 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3179 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3180 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3181 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3182 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3186 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3187 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3188 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3189 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3193 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3194 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3195 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3196 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3200 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3202 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3203 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3207 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3209 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3210 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3214 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3215 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3216 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3217 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3221 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3222 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3223 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3224 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3228 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3229 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3230 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3231 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3235 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3236 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3237 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3238 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3242 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3243 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3244 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3245 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3249 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3250 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3251 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3252 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3256 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3257 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3258 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3259 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3263 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3264 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3265 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3266 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3270 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3271 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3272 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3273 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3277 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3278 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3279 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3280 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3284 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3285 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3286 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3287 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3291 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3292 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3293 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3294 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3298 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3299 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3300 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3301 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3305 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3306 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3307 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3308 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3312 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3313 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3314 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3315 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3319 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3320 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3321 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3322 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3326 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3328 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3329 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3333 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3334 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3335 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3336 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3340 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3342 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3343 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3347 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3349 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3350 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3354 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3356 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3361 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3363 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3366 r = MsiDoAction( hpkg, "CostFinalize");
3367 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3371 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3372 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3373 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3374 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3378 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3379 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3380 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3381 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3385 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3386 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3387 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3388 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3392 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3393 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3394 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3395 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3399 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3400 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3401 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3402 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3406 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3407 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3408 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3409 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3413 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3414 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3415 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3416 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3420 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3421 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3422 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3423 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3427 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3428 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3429 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3430 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3434 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3435 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3436 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3437 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3441 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3442 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3443 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3444 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3448 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3449 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3450 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3451 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3455 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3456 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3457 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3458 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3462 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3464 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3465 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3469 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3470 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3471 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3472 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3476 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3478 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3479 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3483 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3484 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3485 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3486 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3490 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3491 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3492 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3493 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3497 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3499 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3500 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3504 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3505 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3506 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3507 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3511 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3513 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3514 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3518 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3520 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3521 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3525 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3526 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3527 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3528 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3532 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3534 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3535 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3539 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3541 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3542 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3546 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3548 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3549 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3553 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3555 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3556 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3560 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3562 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3563 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3567 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3569 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3570 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3574 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3576 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3577 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3581 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3583 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3584 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3586 MsiCloseHandle( hpkg );
3588 /* publish the features and components */
3589 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3592 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3593 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3595 /* these properties must not be in the saved msi file */
3596 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3597 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3599 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3600 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3602 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3603 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3605 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3606 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3608 hpkg = package_from_db( hdb );
3609 ok( hpkg, "failed to create package\n");
3611 MsiCloseHandle(hdb);
3615 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3616 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3617 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3618 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3622 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3623 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3624 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3625 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3629 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3630 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3631 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3632 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3636 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3637 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3638 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3639 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3643 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3644 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3645 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3646 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3650 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3651 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3652 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3653 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3657 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3658 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3659 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3660 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3664 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3665 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3666 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3667 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3671 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3672 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3673 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3674 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3678 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3679 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3680 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3681 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3685 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3686 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3687 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3688 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3692 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3693 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3694 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3695 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3699 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3700 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3701 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3702 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3706 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3707 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3708 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3709 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3713 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3714 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3715 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3716 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3720 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3721 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3722 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3723 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3727 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3728 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3729 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3730 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3734 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3735 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3736 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3737 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3741 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3742 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3743 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3744 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3748 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3749 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3750 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3751 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3755 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3756 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3757 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3758 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3762 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3763 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3764 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3765 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3769 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3770 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3771 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3772 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3776 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3777 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3778 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3779 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3783 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3784 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3785 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3786 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3790 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3791 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3792 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3793 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3797 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3798 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3799 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3800 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3804 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3805 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3806 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3807 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3811 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3812 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3813 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3814 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3818 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3819 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3820 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3821 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3825 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3826 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3827 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3828 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3830 r = MsiDoAction( hpkg, "CostInitialize");
3831 ok( r == ERROR_SUCCESS, "cost init failed\n");
3835 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3836 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3837 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3838 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3842 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3843 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3844 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3845 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3849 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3850 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3851 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3852 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3856 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3858 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3859 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3863 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3864 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3865 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3866 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3870 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3871 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3872 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3873 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3877 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3879 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3880 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3884 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3886 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3887 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3891 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3893 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3894 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3898 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3900 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3901 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3905 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3906 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3907 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3908 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3912 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3913 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3914 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3915 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3919 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3920 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3921 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3922 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3926 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3927 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3928 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3929 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3933 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3934 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3935 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3936 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3940 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3941 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3942 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3943 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3947 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3949 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3950 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3954 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3956 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3957 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3961 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3963 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3964 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3968 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3970 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3971 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3975 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3977 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3978 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3982 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3983 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3984 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3985 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3989 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3990 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3991 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3992 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3996 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3997 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3998 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3999 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4003 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4004 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4005 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4006 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4010 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4011 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4012 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4013 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4017 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4018 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4019 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4020 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4024 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4026 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4027 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4031 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4032 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4033 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4034 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4038 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4040 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4041 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4045 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4047 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4048 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4050 r = MsiDoAction( hpkg, "FileCost");
4051 ok( r == ERROR_SUCCESS, "file cost failed\n");
4055 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4056 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4057 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4058 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4062 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4063 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4064 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4065 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4069 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4071 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4072 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4076 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4077 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4078 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4079 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4083 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4084 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4085 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4086 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4090 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4092 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4093 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4097 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4099 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4100 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4104 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4106 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4107 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4111 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4112 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4113 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4114 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4118 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4120 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4121 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4125 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4126 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4127 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4128 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4132 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4133 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4134 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4135 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4139 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4140 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4141 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4142 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4146 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4147 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4148 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4149 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4153 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4155 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4156 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4160 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4161 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4162 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4163 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4167 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4168 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4169 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4170 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4174 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4175 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4176 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4177 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4181 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4182 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4183 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4184 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4188 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4190 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4191 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4195 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4197 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4198 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4202 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4204 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4205 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4209 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4211 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4212 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4216 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4218 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4219 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4223 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4224 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4225 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4226 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4230 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4232 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4233 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4237 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4238 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4239 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4240 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4244 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4245 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4246 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4247 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4251 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4253 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4254 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4258 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4260 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4261 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4263 r = MsiDoAction( hpkg, "CostFinalize");
4264 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4268 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4269 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4270 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4271 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4275 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4276 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4277 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4278 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4282 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4283 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4284 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4285 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4289 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4290 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4291 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4292 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4296 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4297 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4298 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4299 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4303 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4304 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4305 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4306 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4310 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4311 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4312 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4313 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4317 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4318 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4319 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4320 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4324 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4325 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4326 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4327 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4331 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4332 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4333 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4334 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4338 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4339 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4340 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4341 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4345 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4346 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4347 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4348 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4352 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4353 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4354 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4355 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4359 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4360 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4361 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4362 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4366 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4367 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4368 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4369 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4373 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4374 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4375 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4376 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4380 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4381 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4382 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4383 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4387 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4388 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4389 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4390 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4394 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4395 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4396 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4397 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4401 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4402 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4403 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4404 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4408 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4409 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4410 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4411 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4415 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4416 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4417 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4418 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4422 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4423 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4424 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4425 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4429 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4430 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4431 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4432 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4436 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4437 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4438 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4439 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4443 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4444 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4445 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4446 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4450 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4451 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4452 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4453 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4457 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4458 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4459 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4460 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4464 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4465 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4466 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4467 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4471 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4472 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4473 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4474 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4478 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4479 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4480 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4481 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4483 MsiCloseHandle(hpkg);
4485 /* uninstall the product */
4486 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4489 /* all features installed locally */
4490 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4493 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4494 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4496 /* these properties must not be in the saved msi file */
4497 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4498 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4500 hpkg = package_from_db( hdb );
4501 ok( hpkg, "failed to create package\n");
4505 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4506 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4507 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4508 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4512 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4513 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4514 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4515 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4519 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4520 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4521 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4522 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4526 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4527 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4528 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4529 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4533 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4534 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4535 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4536 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4540 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4541 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4542 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4543 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4547 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4548 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4549 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4550 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4554 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4555 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4556 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4557 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4561 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4562 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4563 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4564 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4568 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4569 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4570 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4571 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4575 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4576 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4577 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4578 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4582 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4583 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4584 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4585 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4589 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4590 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4591 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4592 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4596 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4597 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4598 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4599 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4603 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4604 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4605 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4606 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4610 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4611 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4612 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4613 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4617 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4618 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4619 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4620 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4624 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4625 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4626 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4627 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4631 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4632 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4633 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4634 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4638 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4639 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4640 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4641 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4645 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4646 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4647 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4648 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4652 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4653 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4654 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4655 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4659 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4660 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4661 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4662 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4666 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4667 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4668 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4669 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4673 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4674 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4675 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4676 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4680 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4681 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4682 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4683 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4687 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4688 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4689 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4690 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4694 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4695 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4696 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4697 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4701 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4702 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4703 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4704 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4708 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4709 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4710 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4711 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4715 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4716 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4717 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4718 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4720 r = MsiDoAction( hpkg, "CostInitialize");
4721 ok( r == ERROR_SUCCESS, "cost init failed\n");
4725 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4726 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4727 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4728 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4732 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4733 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4734 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4735 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4739 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4740 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4741 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4742 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4746 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4747 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4748 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4749 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4753 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4754 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4755 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4756 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4760 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4761 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4762 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4763 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4767 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4768 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4769 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4770 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4774 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4775 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4776 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4777 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4781 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4783 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4784 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4788 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4790 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4791 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4795 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4797 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4798 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4802 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4803 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4804 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4805 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4809 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4810 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4811 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4812 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4816 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4817 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4818 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4819 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4823 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4824 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4825 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4826 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4830 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4831 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4832 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4833 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4837 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4839 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4840 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4844 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4845 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4846 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4847 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4851 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4852 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4853 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4854 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4858 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4859 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4860 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4861 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4865 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4866 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4867 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4868 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4872 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4873 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4874 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4875 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4879 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4880 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4881 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4882 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4886 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4887 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4888 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4889 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4893 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4894 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4895 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4896 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4900 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4901 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4902 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4903 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4907 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4908 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4909 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4910 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4914 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4915 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4916 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4917 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4921 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4922 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4923 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4924 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4928 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4929 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4930 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4931 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4935 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4936 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4937 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4938 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4940 r = MsiDoAction( hpkg, "FileCost");
4941 ok( r == ERROR_SUCCESS, "file cost failed\n");
4945 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4947 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4948 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4952 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4953 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4954 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4955 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4959 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4961 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4962 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4966 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4968 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4969 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4973 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4975 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4976 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4980 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4982 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4983 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4987 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4989 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4990 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4994 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4996 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4997 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5001 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5002 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5003 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5004 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5008 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5009 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5010 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5011 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5015 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5016 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5017 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5018 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5022 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5023 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5024 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5025 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5029 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5030 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5031 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5032 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5036 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5037 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5038 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5039 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5043 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5044 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5045 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5046 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5050 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5051 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5052 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5053 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5057 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5058 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5059 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5060 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5064 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5065 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5066 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5067 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5071 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5072 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5073 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5074 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5078 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5079 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5080 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5081 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5085 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5086 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5087 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5088 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5092 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5094 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5095 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5099 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5101 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5102 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5106 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5108 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5113 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5115 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5116 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5120 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5122 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5127 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5134 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5141 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5148 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5155 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5160 r = MsiDoAction( hpkg, "CostFinalize");
5161 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5165 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5166 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5167 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5168 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5172 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5173 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5174 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5175 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5179 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5180 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5181 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5182 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5186 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5187 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5188 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5189 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5193 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5194 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5195 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5196 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5200 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5202 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5203 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5207 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5209 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5210 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5214 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5215 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5216 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5217 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5221 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5222 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5223 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5224 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5228 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5229 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5230 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5231 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5235 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5236 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5237 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5238 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5242 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5243 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5244 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5245 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5249 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5250 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5251 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5252 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5256 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5257 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5258 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5259 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5263 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5264 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5265 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5266 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5270 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5271 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5272 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5273 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5277 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5278 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5279 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5280 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5284 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5285 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5286 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5287 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5291 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5292 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5293 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5294 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5298 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5299 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5300 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5301 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5305 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5306 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5307 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5308 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5312 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5313 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5314 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5315 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5319 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5320 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5321 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5322 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5326 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5328 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5329 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5333 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5334 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5335 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5336 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5340 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5342 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5343 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5347 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5349 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5350 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5354 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5356 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5357 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5361 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5363 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5364 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5368 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5370 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5371 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5375 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5377 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5378 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5380 MsiCloseHandle(hpkg);
5382 /* uninstall the product */
5383 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5384 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5386 /* all features installed from source */
5387 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5390 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5391 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5393 /* this property must not be in the saved msi file */
5394 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5395 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5397 hpkg = package_from_db( hdb );
5398 ok( hpkg, "failed to create package\n");
5402 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5403 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5404 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5405 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5409 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5410 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5411 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5412 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5416 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5417 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5418 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5419 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5423 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5424 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5425 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5426 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5430 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5431 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5432 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5433 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5437 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5438 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5439 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5440 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5444 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5445 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5446 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5447 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5451 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5452 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5453 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5454 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5458 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5459 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5460 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5461 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5465 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5466 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5467 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5468 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5472 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5473 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5474 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5475 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5479 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5480 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5481 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5482 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5486 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5487 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5488 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5489 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5493 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5494 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5495 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5496 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5500 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5501 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5502 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5503 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5507 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5508 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5509 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5510 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5514 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5515 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5516 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5517 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5521 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5522 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5523 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5524 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5528 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5529 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5530 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5531 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5535 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5536 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5537 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5538 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5542 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5543 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5544 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5545 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5549 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5550 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5551 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5552 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5556 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5557 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5558 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5559 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5563 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5564 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5565 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5566 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5570 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5571 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5572 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5573 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5577 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5578 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5579 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5580 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5584 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5585 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5586 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5587 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5591 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5592 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5593 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5594 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5598 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5599 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5600 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5601 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5605 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5606 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5607 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5608 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5612 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5613 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5614 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5615 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5617 r = MsiDoAction( hpkg, "CostInitialize");
5618 ok( r == ERROR_SUCCESS, "cost init failed\n");
5622 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5623 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5624 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5625 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5629 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5630 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5631 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5632 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5636 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5637 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5638 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5639 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5643 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5644 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5645 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5646 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5650 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5652 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5653 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5657 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5659 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5660 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5664 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5665 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5666 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5667 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5671 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5673 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5674 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5678 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5679 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5680 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5681 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5685 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5687 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5688 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5692 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5693 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5694 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5695 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5699 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5700 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5701 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5702 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5706 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5707 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5708 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5709 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5713 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5714 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5715 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5716 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5720 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5721 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5722 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5723 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5727 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5728 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5729 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5730 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5734 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5735 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5736 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5737 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5741 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5743 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5744 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5748 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5749 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5750 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5751 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5755 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5756 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5757 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5758 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5762 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5763 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5764 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5765 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5769 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5770 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5771 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5772 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5776 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5777 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5778 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5779 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5783 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5784 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5785 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5786 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5790 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5791 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5792 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5793 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5797 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5798 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5799 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5800 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5804 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5805 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5806 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5807 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5811 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5812 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5813 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5814 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5818 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5819 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5820 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5821 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5825 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5826 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5827 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5828 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5832 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5833 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5834 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5835 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5837 r = MsiDoAction( hpkg, "FileCost");
5838 ok( r == ERROR_SUCCESS, "file cost failed\n");
5842 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5843 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5844 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5845 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5849 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5850 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5851 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5852 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5856 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5858 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5859 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5863 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5864 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5865 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5866 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5870 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5871 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5872 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5873 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5877 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5879 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5880 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5884 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5886 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5887 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5891 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5893 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5894 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5898 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5900 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5901 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5905 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5906 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5907 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5908 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5912 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5913 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5914 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5915 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5919 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5920 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5921 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5922 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5926 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5927 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5928 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5929 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5933 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5934 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5935 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5936 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5940 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5941 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5942 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5943 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5947 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5949 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5950 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5954 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5956 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5957 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5961 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5963 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5964 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5968 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5970 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5971 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5975 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5977 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5978 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5982 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5983 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5984 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5985 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5989 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5990 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5991 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5992 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5996 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5997 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5998 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5999 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6003 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6004 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6005 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6006 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6010 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6011 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6012 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6013 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6017 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6018 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6019 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6020 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6024 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6026 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6027 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6031 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6032 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6033 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6034 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6038 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6040 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6041 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6045 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6047 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6048 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6052 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6054 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6057 r = MsiDoAction( hpkg, "CostFinalize");
6058 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6062 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6063 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6064 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6065 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6069 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6071 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6072 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6076 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6077 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6078 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6079 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6083 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6084 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6085 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6086 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6090 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6092 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6093 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6097 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6099 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6100 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6104 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6106 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6107 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6111 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6112 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6113 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6114 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6118 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6120 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6121 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6125 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6126 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6127 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6128 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6132 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6133 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6134 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6135 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6139 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6140 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6141 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6142 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6146 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6147 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6148 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6149 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6153 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6155 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6156 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6160 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6161 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6162 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6163 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6167 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6168 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6169 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6170 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6174 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6175 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6176 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6177 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6181 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6182 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6183 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6184 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6188 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6190 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6191 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6195 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6197 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6198 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6202 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6204 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6205 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6209 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6211 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6212 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6216 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6218 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6219 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6223 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6224 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6225 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6226 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6230 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6232 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6233 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6237 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6238 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6239 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6240 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6244 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6245 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6246 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6247 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6251 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6252 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6253 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6254 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6258 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6259 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6260 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6261 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6265 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6266 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6267 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6268 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6272 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6274 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6275 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6277 MsiCloseHandle(hpkg);
6279 /* reinstall the product */
6280 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6281 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6283 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6284 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6286 /* this property must not be in the saved msi file */
6287 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6288 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6290 hpkg = package_from_db( hdb );
6291 ok( hpkg, "failed to create package\n");
6295 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6296 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6297 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6298 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6302 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6303 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6304 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6305 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6309 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6310 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6311 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6312 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6316 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6317 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6318 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6319 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6323 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6324 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6325 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6326 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6330 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6331 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6332 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6333 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6337 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6338 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6339 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6340 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6344 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6345 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6346 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6347 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6351 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6352 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6353 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6354 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6358 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6359 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6360 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6361 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6365 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6366 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6367 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6368 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6372 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6373 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6374 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6375 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6379 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6380 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6381 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6382 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6386 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6387 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6388 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6389 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6393 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6394 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6395 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6396 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6400 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6401 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6402 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6403 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6407 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6408 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6409 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6410 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6414 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6415 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6416 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6417 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6421 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6422 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6423 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6424 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6428 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6429 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6430 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6431 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6435 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6436 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6437 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6438 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6442 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6443 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6444 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6445 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6449 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6450 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6451 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6452 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6456 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6457 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6458 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6459 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6463 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6464 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6465 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6466 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6470 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6471 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6472 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6473 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6477 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6478 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6479 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6480 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6484 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6485 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6486 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6487 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6491 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6492 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6493 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6494 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6498 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6499 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6500 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6501 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6505 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6506 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6507 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6508 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6510 r = MsiDoAction( hpkg, "CostInitialize");
6511 ok( r == ERROR_SUCCESS, "cost init failed\n");
6515 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6516 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6517 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6518 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6522 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6524 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6525 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6529 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6530 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6531 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6532 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6536 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6537 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6538 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6539 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6543 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6545 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6546 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6550 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6551 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6552 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6553 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6557 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6558 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6559 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6560 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6564 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6565 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6566 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6567 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6571 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6572 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6573 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6574 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6578 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6579 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6580 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6581 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6585 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6586 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6587 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6588 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6592 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6593 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6594 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6595 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6599 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6600 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6601 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6602 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6606 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6607 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6608 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6609 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6613 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6614 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6615 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6616 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6620 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6621 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6622 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6623 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6627 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6628 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6629 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6630 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6634 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6635 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6636 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6637 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6641 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6642 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6643 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6644 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6648 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6649 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6650 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6651 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6655 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6656 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6657 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6658 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6662 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6663 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6664 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6665 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6669 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6670 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6671 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6672 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6676 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6677 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6678 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6679 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6683 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6684 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6685 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6686 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6690 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6691 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6692 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6693 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6697 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6698 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6699 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6700 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6704 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6705 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6706 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6707 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6711 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6712 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6713 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6714 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6718 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6719 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6720 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6721 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6725 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6726 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6727 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6728 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6730 r = MsiDoAction( hpkg, "FileCost");
6731 ok( r == ERROR_SUCCESS, "file cost failed\n");
6735 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6736 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6737 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6738 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6742 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6743 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6744 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6745 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6749 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6751 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6752 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6756 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6757 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6758 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6759 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6763 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6764 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6765 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6766 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6770 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6771 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6772 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6773 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6777 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6778 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6779 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6780 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6784 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6785 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6786 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6787 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6791 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6792 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6793 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6794 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6798 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6799 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6800 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6801 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6805 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6806 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6807 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6808 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6812 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6814 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6815 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6819 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6820 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6821 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6822 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6826 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6828 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6829 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6833 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6835 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6836 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6840 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6842 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6843 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6847 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6849 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6850 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6854 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6855 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6856 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6857 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6861 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6863 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6864 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6868 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6869 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6870 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6871 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6875 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6876 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6877 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6878 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6882 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6883 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6884 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6885 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6889 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6890 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6891 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6892 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6896 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6897 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6898 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6899 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6903 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6904 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6905 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6906 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6910 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6911 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6912 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6913 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6917 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6918 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6919 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6920 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6924 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6925 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6926 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6927 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6931 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6932 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6933 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6934 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6938 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6939 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6940 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6941 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6945 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6947 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6948 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6950 r = MsiDoAction( hpkg, "CostFinalize");
6951 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6955 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6956 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6957 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6958 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6962 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6963 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6964 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6965 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6969 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6970 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6971 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6972 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6976 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6977 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6978 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6979 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6983 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6984 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6985 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6986 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6990 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6991 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6992 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6993 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6997 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6998 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6999 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7000 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7004 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7005 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7006 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7007 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7011 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7012 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7013 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7014 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7018 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7019 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7020 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7021 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7025 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7026 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7027 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7028 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7032 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7033 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7034 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7035 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7039 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7040 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7041 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7042 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7046 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7047 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7048 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7049 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7053 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7054 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7055 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7056 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7060 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7061 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7062 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7063 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7067 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7068 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7069 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7070 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7074 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7075 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7076 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7077 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7081 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7082 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7083 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7084 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7088 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7089 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7090 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7091 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7095 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7096 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7097 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7098 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7102 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7103 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7104 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7105 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7109 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7110 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7111 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7112 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7116 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7117 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7118 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7119 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7123 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7124 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7125 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7126 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7130 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7131 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7132 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7133 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7137 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7138 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7139 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7140 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7144 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7145 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7146 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7147 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7151 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7152 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7153 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7154 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7158 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7159 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7160 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7161 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7165 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7166 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7167 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7168 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7170 MsiCloseHandle(hpkg);
7172 /* uninstall the product */
7173 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7176 DeleteFileA(msifile);
7177 DeleteFileA(msifile2);
7178 DeleteFileA(msifile3);
7179 DeleteFileA(msifile4);
7182 static void test_getproperty(void)
7184 MSIHANDLE hPackage = 0;
7186 static CHAR empty[] = "";
7190 hPackage = package_from_db(create_package_db());
7191 ok( hPackage != 0, " Failed to create package\n");
7193 /* set the property */
7194 r = MsiSetProperty(hPackage, "Name", "Value");
7195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7197 /* retrieve the size, NULL pointer */
7199 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7201 ok( size == 5, "Expected 5, got %d\n", size);
7203 /* retrieve the size, empty string */
7205 r = MsiGetProperty(hPackage, "Name", empty, &size);
7206 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7207 ok( size == 5, "Expected 5, got %d\n", size);
7209 /* don't change size */
7210 r = MsiGetProperty(hPackage, "Name", prop, &size);
7211 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7212 ok( size == 5, "Expected 5, got %d\n", size);
7213 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7215 /* increase the size by 1 */
7217 r = MsiGetProperty(hPackage, "Name", prop, &size);
7218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7219 ok( size == 5, "Expected 5, got %d\n", size);
7220 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7222 r = MsiCloseHandle( hPackage);
7223 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7224 DeleteFile(msifile);
7227 static void test_removefiles(void)
7233 hdb = create_package_db();
7234 ok ( hdb, "failed to create package database\n" );
7236 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7237 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7239 r = create_feature_table( hdb );
7240 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7242 r = create_component_table( hdb );
7243 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7245 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7246 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7248 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7249 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7251 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7252 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7254 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7255 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7257 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7258 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7260 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7261 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7263 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7264 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7266 r = create_feature_components_table( hdb );
7267 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7269 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7270 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7272 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7273 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7275 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7276 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7278 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7279 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7281 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7282 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7284 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7285 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7287 r = create_file_table( hdb );
7288 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7290 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7291 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7293 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7294 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7296 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7297 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7299 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7300 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7302 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7303 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7305 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7306 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7308 r = create_remove_file_table( hdb );
7309 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7311 hpkg = package_from_db( hdb );
7312 ok( hpkg, "failed to create package\n");
7314 MsiCloseHandle( hdb );
7316 create_test_file( "hydrogen.txt" );
7317 create_test_file( "helium.txt" );
7318 create_test_file( "lithium.txt" );
7319 create_test_file( "beryllium.txt" );
7320 create_test_file( "boron.txt" );
7321 create_test_file( "carbon.txt" );
7323 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7324 ok( r == ERROR_SUCCESS, "set property failed\n");
7326 r = MsiDoAction( hpkg, "CostInitialize");
7327 ok( r == ERROR_SUCCESS, "cost init failed\n");
7329 r = MsiDoAction( hpkg, "FileCost");
7330 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7332 r = MsiDoAction( hpkg, "CostFinalize");
7333 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7335 r = MsiDoAction( hpkg, "InstallValidate");
7336 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7338 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7339 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7341 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7342 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7344 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7345 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7347 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7348 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7350 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7351 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7353 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7354 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7356 r = MsiDoAction( hpkg, "RemoveFiles");
7357 ok( r == ERROR_SUCCESS, "remove files failed\n");
7359 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7360 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7361 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7362 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7363 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7364 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7366 MsiCloseHandle( hpkg );
7367 DeleteFileA(msifile);
7370 static void test_appsearch(void)
7375 CHAR prop[MAX_PATH];
7376 DWORD size = MAX_PATH;
7378 hdb = create_package_db();
7379 ok ( hdb, "failed to create package database\n" );
7381 r = create_appsearch_table( hdb );
7382 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7384 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7385 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7387 r = create_reglocator_table( hdb );
7388 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7390 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7391 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7393 r = create_signature_table( hdb );
7394 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7396 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7397 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7399 hpkg = package_from_db( hdb );
7400 ok( hpkg, "failed to create package\n");
7402 MsiCloseHandle( hdb );
7404 r = MsiDoAction( hpkg, "AppSearch" );
7405 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7407 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7408 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7411 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7414 MsiCloseHandle( hpkg );
7415 DeleteFileA(msifile);
7418 static void test_appsearch_complocator(void)
7420 MSIHANDLE hpkg, hdb;
7421 CHAR path[MAX_PATH];
7422 CHAR prop[MAX_PATH];
7427 if (!get_user_sid(&usersid))
7430 create_test_file("FileName1");
7431 create_test_file("FileName4");
7432 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7433 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7435 create_test_file("FileName2");
7436 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7437 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7439 create_test_file("FileName3");
7440 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7441 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7443 create_test_file("FileName5");
7444 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7445 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7447 create_test_file("FileName6");
7448 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7449 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7451 create_test_file("FileName7");
7452 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7453 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7455 /* dir is FALSE, but we're pretending it's a directory */
7456 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7457 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7459 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7460 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7461 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7463 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7464 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7465 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7467 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7468 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7469 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7471 hdb = create_package_db();
7472 ok(hdb, "Expected a valid database handle\n");
7474 r = create_appsearch_table(hdb);
7475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7477 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7480 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7483 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7486 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7489 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7492 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7495 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7498 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7501 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7502 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7504 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7507 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7510 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7513 r = create_complocator_table(hdb);
7514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7516 /* published component, machine, file, signature, misdbLocatorTypeFile */
7517 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7520 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7521 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7524 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7525 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7528 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7529 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7532 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7533 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7536 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7537 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7540 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7541 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7542 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7544 /* unpublished component, no signature, misdbLocatorTypeDir */
7545 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7548 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7549 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7552 /* published component, signature w/ ver, misdbLocatorTypeFile */
7553 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7554 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7556 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7557 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7560 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7561 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7562 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7564 r = create_signature_table(hdb);
7565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7567 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7568 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7570 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7573 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7576 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7577 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7579 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7580 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7582 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7583 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7585 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7586 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7588 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7589 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7591 hpkg = package_from_db(hdb);
7592 ok(hpkg, "Expected a valid package handle\n");
7594 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
7595 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7597 r = MsiDoAction(hpkg, "AppSearch");
7598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7601 sprintf(path, "%s\\FileName1", CURR_DIR);
7602 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7603 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7604 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7607 sprintf(path, "%s\\FileName2", CURR_DIR);
7608 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7610 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7613 sprintf(path, "%s\\FileName3", CURR_DIR);
7614 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7616 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7619 sprintf(path, "%s\\FileName4", CURR_DIR);
7620 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
7621 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7622 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7625 sprintf(path, "%s\\FileName5", CURR_DIR);
7626 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7628 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7631 sprintf(path, "%s\\", CURR_DIR);
7632 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7634 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7637 sprintf(path, "%s\\", CURR_DIR);
7638 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7640 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7643 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7644 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7645 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
7648 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7649 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7650 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7653 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
7654 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7656 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7659 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
7660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7661 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7664 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
7665 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
7666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7667 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7669 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7670 MSIINSTALLCONTEXT_MACHINE, NULL);
7671 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7672 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
7673 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7674 MSIINSTALLCONTEXT_USERMANAGED, usersid);
7675 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7676 MSIINSTALLCONTEXT_MACHINE, NULL);
7677 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7678 MSIINSTALLCONTEXT_MACHINE, NULL);
7679 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7680 MSIINSTALLCONTEXT_MACHINE, NULL);
7681 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7682 MSIINSTALLCONTEXT_MACHINE, NULL);
7683 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7684 MSIINSTALLCONTEXT_MACHINE, NULL);
7685 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7686 MSIINSTALLCONTEXT_MACHINE, NULL);
7687 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7688 MSIINSTALLCONTEXT_MACHINE, NULL);
7690 DeleteFileA("FileName1");
7691 DeleteFileA("FileName2");
7692 DeleteFileA("FileName3");
7693 DeleteFileA("FileName4");
7694 DeleteFileA("FileName5");
7695 DeleteFileA("FileName6");
7696 DeleteFileA("FileName7");
7697 DeleteFileA("FileName8.dll");
7698 DeleteFileA("FileName9.dll");
7699 DeleteFileA("FileName10.dll");
7700 MsiCloseHandle(hpkg);
7701 DeleteFileA(msifile);
7705 static void test_appsearch_reglocator(void)
7707 MSIHANDLE hpkg, hdb;
7708 CHAR path[MAX_PATH];
7709 CHAR prop[MAX_PATH];
7712 BOOL space, version;
7723 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7726 DeleteFileA("test.dll");
7728 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
7729 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7731 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
7732 (const BYTE *)"regszdata", 10);
7733 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7735 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
7736 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7738 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
7739 (const BYTE *)"regszdata", 10);
7740 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7743 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
7744 ok(res == ERROR_SUCCESS ||
7745 broken(res == ERROR_INVALID_PARAMETER),
7746 "Expected ERROR_SUCCESS, got %d\n", res);
7748 if (res == ERROR_SUCCESS)
7750 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
7751 (const BYTE *)"regszdata", 10);
7752 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7755 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
7756 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7758 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
7759 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7761 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
7762 (const BYTE *)"regszdata", 10);
7763 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7766 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
7767 (const BYTE *)&val, sizeof(DWORD));
7768 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7771 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
7772 (const BYTE *)&val, sizeof(DWORD));
7773 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7775 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
7776 (const BYTE *)"%PATH%", 7);
7777 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7779 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
7780 (const BYTE *)"my%NOVAR%", 10);
7781 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7783 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
7784 (const BYTE *)"one\0two\0", 9);
7785 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7787 binary[0] = 0x1234abcd;
7788 binary[1] = 0x567890ef;
7789 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
7790 (const BYTE *)binary, sizeof(binary));
7791 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7793 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
7794 (const BYTE *)"#regszdata", 11);
7795 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7797 create_test_file("FileName1");
7798 sprintf(path, "%s\\FileName1", CURR_DIR);
7799 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
7800 (const BYTE *)path, lstrlenA(path) + 1);
7801 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7803 sprintf(path, "%s\\FileName2", CURR_DIR);
7804 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
7805 (const BYTE *)path, lstrlenA(path) + 1);
7806 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7808 lstrcpyA(path, CURR_DIR);
7809 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
7810 (const BYTE *)path, lstrlenA(path) + 1);
7811 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7813 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
7814 (const BYTE *)"", 1);
7815 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7817 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7818 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
7819 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
7820 (const BYTE *)path, lstrlenA(path) + 1);
7821 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7823 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7824 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
7825 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
7826 (const BYTE *)path, lstrlenA(path) + 1);
7827 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7829 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7830 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
7831 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
7832 (const BYTE *)path, lstrlenA(path) + 1);
7833 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7835 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
7836 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
7837 (const BYTE *)path, lstrlenA(path) + 1);
7839 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
7840 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
7841 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
7842 (const BYTE *)path, lstrlenA(path) + 1);
7844 hdb = create_package_db();
7845 ok(hdb, "Expected a valid database handle\n");
7847 r = create_appsearch_table(hdb);
7848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7850 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7853 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7856 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7857 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7859 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7860 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7862 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7865 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7866 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7868 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7869 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7871 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7872 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7874 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7875 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7877 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7878 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7880 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7881 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7883 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7884 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7886 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
7887 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7889 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
7890 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7892 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
7893 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7895 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
7896 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7898 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
7899 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7901 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
7902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7904 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
7905 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7907 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
7908 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7910 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
7911 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7913 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
7914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7916 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
7917 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7919 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
7920 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7922 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
7923 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7925 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
7926 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7928 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
7929 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7931 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
7932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7934 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
7935 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7937 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
7938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7940 r = create_reglocator_table(hdb);
7941 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7943 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
7944 str = "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
7945 r = add_reglocator_entry(hdb, str);
7946 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7948 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
7949 str = "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
7950 r = add_reglocator_entry(hdb, str);
7951 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7953 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
7954 str = "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
7955 r = add_reglocator_entry(hdb, str);
7956 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7958 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7959 str = "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
7960 r = add_reglocator_entry(hdb, str);
7961 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7963 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7964 str = "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
7965 r = add_reglocator_entry(hdb, str);
7966 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7968 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
7969 str = "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
7970 r = add_reglocator_entry(hdb, str);
7971 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7973 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
7974 str = "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
7975 r = add_reglocator_entry(hdb, str);
7976 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7978 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
7979 str = "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
7980 r = add_reglocator_entry(hdb, str);
7981 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7983 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
7984 str = "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
7985 r = add_reglocator_entry(hdb, str);
7986 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7988 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
7989 str = "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
7990 r = add_reglocator_entry(hdb, str);
7991 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7993 /* HKLM, msidbLocatorTypeFileName, no signature */
7994 str = "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
7995 r = add_reglocator_entry(hdb, str);
7996 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7998 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
7999 str = "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
8000 r = add_reglocator_entry(hdb, str);
8001 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8003 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8004 str = "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
8005 r = add_reglocator_entry(hdb, str);
8006 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8008 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8009 str = "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
8010 r = add_reglocator_entry(hdb, str);
8011 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8013 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8014 str = "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
8015 r = add_reglocator_entry(hdb, str);
8016 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8018 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8019 str = "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
8020 r = add_reglocator_entry(hdb, str);
8021 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8023 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8024 str = "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
8025 r = add_reglocator_entry(hdb, str);
8026 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8028 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8029 str = "'NewSignature18', 2, 'Software\\Wine', '', 2";
8030 r = add_reglocator_entry(hdb, str);
8031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8033 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8034 str = "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
8035 r = add_reglocator_entry(hdb, str);
8036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8038 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8039 str = "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
8040 r = add_reglocator_entry(hdb, str);
8041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8043 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8044 str = "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
8045 r = add_reglocator_entry(hdb, str);
8046 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8048 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8049 str = "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
8050 r = add_reglocator_entry(hdb, str);
8051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8053 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8054 str = "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
8055 r = add_reglocator_entry(hdb, str);
8056 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8058 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8059 str = "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
8060 r = add_reglocator_entry(hdb, str);
8061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8063 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8064 str = "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
8065 r = add_reglocator_entry(hdb, str);
8066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8068 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8069 str = "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
8070 r = add_reglocator_entry(hdb, str);
8071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8073 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8074 str = "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
8075 r = add_reglocator_entry(hdb, str);
8076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8078 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8079 str = "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
8080 r = add_reglocator_entry(hdb, str);
8081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8083 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8084 str = "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
8085 r = add_reglocator_entry(hdb, str);
8086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8088 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8089 str = "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
8090 r = add_reglocator_entry(hdb, str);
8091 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8093 r = create_signature_table(hdb);
8094 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8096 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8097 r = add_signature_entry(hdb, str);
8098 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8100 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8101 r = add_signature_entry(hdb, str);
8102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8104 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8105 r = add_signature_entry(hdb, str);
8106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8108 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8109 r = add_signature_entry(hdb, str);
8110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8112 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8113 r = add_signature_entry(hdb, str);
8114 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8116 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8117 r = add_signature_entry(hdb, str);
8118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8120 ptr = strrchr(CURR_DIR, '\\') + 1;
8121 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8122 r = add_signature_entry(hdb, path);
8123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8125 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8126 r = add_signature_entry(hdb, str);
8127 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8129 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8130 r = add_signature_entry(hdb, str);
8131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8133 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8134 r = add_signature_entry(hdb, str);
8135 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8137 hpkg = package_from_db(hdb);
8138 ok(hpkg, "Expected a valid package handle\n");
8140 r = MsiDoAction(hpkg, "AppSearch");
8141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8144 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8146 ok(!lstrcmpA(prop, "regszdata"),
8147 "Expected \"regszdata\", got \"%s\"\n", prop);
8150 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8151 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8152 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8155 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8157 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8159 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8160 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8162 /* Workaround for Win95 */
8164 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8166 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8167 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8170 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8173 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8174 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8176 ok(!lstrcmpA(pathdata, pathvar),
8177 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8179 HeapFree(GetProcessHeap(), 0, pathvar);
8180 HeapFree(GetProcessHeap(), 0, pathdata);
8183 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8184 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8186 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8189 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8193 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8194 "Expected \"\\0one\\0two\\0\\0\"\n");
8198 lstrcpyA(path, "#xCDAB3412EF907856");
8199 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8200 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8201 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8204 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8205 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8206 ok(!lstrcmpA(prop, "##regszdata"),
8207 "Expected \"##regszdata\", got \"%s\"\n", prop);
8210 sprintf(path, "%s\\FileName1", CURR_DIR);
8211 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8213 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8216 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8217 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8218 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8221 sprintf(path, "%s\\", CURR_DIR);
8222 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8223 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8224 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8227 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8228 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8229 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8232 sprintf(path, "%s\\", CURR_DIR);
8233 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8234 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8235 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8238 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8239 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8240 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8243 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8245 ok(!lstrcmpA(prop, "regszdata"),
8246 "Expected \"regszdata\", got \"%s\"\n", prop);
8249 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8251 ok(!lstrcmpA(prop, "regszdata"),
8252 "Expected \"regszdata\", got \"%s\"\n", prop);
8257 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8258 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8259 ok(!lstrcmpA(prop, "regszdata"),
8260 "Expected \"regszdata\", got \"%s\"\n", prop);
8264 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8265 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8266 ok(!lstrcmpA(prop, "defvalue"),
8267 "Expected \"defvalue\", got \"%s\"\n", prop);
8270 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8271 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8272 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8275 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8276 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8277 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8282 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8283 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8284 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8285 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8288 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8289 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8290 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8293 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8294 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8295 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8296 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8300 lstrcpyA(path, CURR_DIR);
8301 ptr = strrchr(path, '\\') + 1;
8303 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8304 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8305 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8308 sprintf(path, "%s\\", CURR_DIR);
8309 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8310 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8311 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8314 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8315 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8316 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8319 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8321 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8324 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8325 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8326 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8329 sprintf(path, "%s\\FileName1", CURR_DIR);
8330 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8331 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8332 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8335 sprintf(path, "%s\\FileName1", CURR_DIR);
8336 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8337 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8339 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8341 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8343 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8344 RegDeleteValueA(hklm, "Value1");
8345 RegDeleteValueA(hklm, "Value2");
8346 RegDeleteValueA(hklm, "Value3");
8347 RegDeleteValueA(hklm, "Value4");
8348 RegDeleteValueA(hklm, "Value5");
8349 RegDeleteValueA(hklm, "Value6");
8350 RegDeleteValueA(hklm, "Value7");
8351 RegDeleteValueA(hklm, "Value8");
8352 RegDeleteValueA(hklm, "Value9");
8353 RegDeleteValueA(hklm, "Value10");
8354 RegDeleteValueA(hklm, "Value11");
8355 RegDeleteValueA(hklm, "Value12");
8356 RegDeleteValueA(hklm, "Value13");
8357 RegDeleteValueA(hklm, "Value14");
8358 RegDeleteValueA(hklm, "Value15");
8359 RegDeleteValueA(hklm, "Value16");
8360 RegDeleteValueA(hklm, "Value17");
8361 RegDeleteKeyA(hklm, "");
8364 RegDeleteValueA(classes, "Value1");
8365 RegDeleteKeyA(classes, "");
8366 RegCloseKey(classes);
8368 RegDeleteValueA(hkcu, "Value1");
8369 RegDeleteKeyA(hkcu, "");
8372 RegDeleteValueA(users, "Value1");
8373 RegDeleteKeyA(users, "");
8376 DeleteFileA("FileName1");
8377 DeleteFileA("FileName3.dll");
8378 DeleteFileA("FileName4.dll");
8379 DeleteFileA("FileName5.dll");
8380 MsiCloseHandle(hpkg);
8381 DeleteFileA(msifile);
8384 static void delete_win_ini(LPCSTR file)
8386 CHAR path[MAX_PATH];
8388 GetWindowsDirectoryA(path, MAX_PATH);
8389 lstrcatA(path, "\\");
8390 lstrcatA(path, file);
8395 static void test_appsearch_inilocator(void)
8397 MSIHANDLE hpkg, hdb;
8398 CHAR path[MAX_PATH];
8399 CHAR prop[MAX_PATH];
8407 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8410 DeleteFileA("test.dll");
8412 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8414 create_test_file("FileName1");
8415 sprintf(path, "%s\\FileName1", CURR_DIR);
8416 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8418 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8420 sprintf(path, "%s\\IDontExist", CURR_DIR);
8421 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8423 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8424 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8425 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8427 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8428 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8429 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8431 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8432 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8433 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8435 hdb = create_package_db();
8436 ok(hdb, "Expected a valid database handle\n");
8438 r = create_appsearch_table(hdb);
8439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8441 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8444 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8447 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8450 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8453 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8456 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8459 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8462 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8465 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8468 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8471 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8474 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8477 r = create_inilocator_table(hdb);
8478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8480 /* msidbLocatorTypeRawValue, field 1 */
8481 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8482 r = add_inilocator_entry(hdb, str);
8483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8485 /* msidbLocatorTypeRawValue, field 2 */
8486 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8487 r = add_inilocator_entry(hdb, str);
8488 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8490 /* msidbLocatorTypeRawValue, entire field */
8491 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8492 r = add_inilocator_entry(hdb, str);
8493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8495 /* msidbLocatorTypeFile */
8496 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8497 r = add_inilocator_entry(hdb, str);
8498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8500 /* msidbLocatorTypeDirectory, file */
8501 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8502 r = add_inilocator_entry(hdb, str);
8503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8505 /* msidbLocatorTypeDirectory, directory */
8506 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8507 r = add_inilocator_entry(hdb, str);
8508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8510 /* msidbLocatorTypeFile, file, no signature */
8511 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8512 r = add_inilocator_entry(hdb, str);
8513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8515 /* msidbLocatorTypeFile, dir, no signature */
8516 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8517 r = add_inilocator_entry(hdb, str);
8518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8520 /* msidbLocatorTypeFile, file does not exist */
8521 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8522 r = add_inilocator_entry(hdb, str);
8523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8525 /* msidbLocatorTypeFile, signature with version */
8526 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8527 r = add_inilocator_entry(hdb, str);
8528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8530 /* msidbLocatorTypeFile, signature with version, ver > max */
8531 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8532 r = add_inilocator_entry(hdb, str);
8533 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8535 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8536 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8537 r = add_inilocator_entry(hdb, str);
8538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8540 r = create_signature_table(hdb);
8541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8543 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8546 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8549 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8552 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8555 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8556 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8558 hpkg = package_from_db(hdb);
8559 ok(hpkg, "Expected a valid package handle\n");
8561 r = MsiDoAction(hpkg, "AppSearch");
8562 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8565 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8566 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8567 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
8570 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8572 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
8575 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8577 ok(!lstrcmpA(prop, "keydata,field2"),
8578 "Expected \"keydata,field2\", got \"%s\"\n", prop);
8581 sprintf(path, "%s\\FileName1", CURR_DIR);
8582 r = MsiGetPropertyA(hpkg, "SIGPROP4", 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, "SIGPROP5", 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\\", CURR_DIR);
8593 r = MsiGetPropertyA(hpkg, "SIGPROP6", 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 sprintf(path, "%s\\", CURR_DIR);
8599 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8600 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8601 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8604 lstrcpyA(path, CURR_DIR);
8605 ptr = strrchr(path, '\\');
8607 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8608 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8609 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8612 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8614 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8619 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8620 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8621 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8622 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8625 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8626 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8627 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8630 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8631 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8632 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8633 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8636 delete_win_ini("IniFile.ini");
8637 DeleteFileA("FileName1");
8638 DeleteFileA("FileName2.dll");
8639 DeleteFileA("FileName3.dll");
8640 DeleteFileA("FileName4.dll");
8641 MsiCloseHandle(hpkg);
8642 DeleteFileA(msifile);
8646 * MSI AppSearch action on DrLocator table always returns absolute paths.
8647 * If a relative path was set, it returns the first absolute path that
8648 * matches or an empty string if it didn't find anything.
8649 * This helper function replicates this behaviour.
8651 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
8656 size = lstrlenA(relative);
8657 drives = GetLogicalDrives();
8658 lstrcpyA(absolute, "A:\\");
8659 for (i = 0; i < 26; absolute[0] = '\0', i++)
8661 if (!(drives & (1 << i)))
8664 absolute[0] = 'A' + i;
8665 if (GetDriveType(absolute) != DRIVE_FIXED)
8668 lstrcpynA(absolute + 3, relative, size + 1);
8669 attr = GetFileAttributesA(absolute);
8670 if (attr != INVALID_FILE_ATTRIBUTES &&
8671 (attr & FILE_ATTRIBUTE_DIRECTORY))
8673 if (absolute[3 + size - 1] != '\\')
8674 lstrcatA(absolute, "\\");
8681 static void test_appsearch_drlocator(void)
8683 MSIHANDLE hpkg, hdb;
8684 CHAR path[MAX_PATH];
8685 CHAR prop[MAX_PATH];
8692 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8695 DeleteFileA("test.dll");
8697 create_test_file("FileName1");
8698 CreateDirectoryA("one", NULL);
8699 CreateDirectoryA("one\\two", NULL);
8700 CreateDirectoryA("one\\two\\three", NULL);
8701 create_test_file("one\\two\\three\\FileName2");
8702 CreateDirectoryA("another", NULL);
8703 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8704 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8705 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8707 hdb = create_package_db();
8708 ok(hdb, "Expected a valid database handle\n");
8710 r = create_appsearch_table(hdb);
8711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8713 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8716 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8719 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8722 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8725 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8728 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8731 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8734 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8735 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8737 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8738 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8740 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8741 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8743 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8744 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8746 r = create_drlocator_table(hdb);
8747 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8749 /* no parent, full path, depth 0, signature */
8750 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
8751 r = add_drlocator_entry(hdb, path);
8752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8754 /* no parent, full path, depth 0, no signature */
8755 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
8756 r = add_drlocator_entry(hdb, path);
8757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8759 /* no parent, relative path, depth 0, no signature */
8760 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
8761 r = add_drlocator_entry(hdb, path);
8762 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8764 /* no parent, full path, depth 2, signature */
8765 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
8766 r = add_drlocator_entry(hdb, path);
8767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8769 /* no parent, full path, depth 3, signature */
8770 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
8771 r = add_drlocator_entry(hdb, path);
8772 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8774 /* no parent, full path, depth 1, signature is dir */
8775 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
8776 r = add_drlocator_entry(hdb, path);
8777 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8779 /* parent is in DrLocator, relative path, depth 0, signature */
8780 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8781 r = add_drlocator_entry(hdb, path);
8782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8784 /* no parent, full path, depth 0, signature w/ version */
8785 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
8786 r = add_drlocator_entry(hdb, path);
8787 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8789 /* no parent, full path, depth 0, signature w/ version, ver > max */
8790 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
8791 r = add_drlocator_entry(hdb, path);
8792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8794 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8795 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
8796 r = add_drlocator_entry(hdb, path);
8797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8799 /* no parent, relative empty path, depth 0, no signature */
8800 sprintf(path, "'NewSignature11', '', '', 0");
8801 r = add_drlocator_entry(hdb, path);
8802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8804 r = create_signature_table(hdb);
8805 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8807 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
8808 r = add_signature_entry(hdb, str);
8809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8811 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
8812 r = add_signature_entry(hdb, str);
8813 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8815 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
8816 r = add_signature_entry(hdb, str);
8817 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8819 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
8820 r = add_signature_entry(hdb, str);
8821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8823 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
8824 r = add_signature_entry(hdb, str);
8825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8827 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8828 r = add_signature_entry(hdb, str);
8829 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8831 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8832 r = add_signature_entry(hdb, str);
8833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8835 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8836 r = add_signature_entry(hdb, str);
8837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8839 hpkg = package_from_db(hdb);
8840 ok(hpkg, "Expected a valid package handle\n");
8842 r = MsiDoAction(hpkg, "AppSearch");
8843 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8846 sprintf(path, "%s\\FileName1", CURR_DIR);
8847 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8849 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8852 sprintf(path, "%s\\", CURR_DIR);
8853 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8855 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8858 search_absolute_directory(path, CURR_DIR + 3);
8859 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8860 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8861 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8864 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8866 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8869 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8870 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8871 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8872 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8875 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8876 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8877 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8880 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8881 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8882 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8883 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8888 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8889 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8890 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8891 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8894 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8895 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8896 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8899 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8900 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8901 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8905 search_absolute_directory(path, "");
8906 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8907 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8908 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8910 DeleteFileA("FileName1");
8911 DeleteFileA("FileName3.dll");
8912 DeleteFileA("FileName4.dll");
8913 DeleteFileA("FileName5.dll");
8914 DeleteFileA("one\\two\\three\\FileName2");
8915 RemoveDirectoryA("one\\two\\three");
8916 RemoveDirectoryA("one\\two");
8917 RemoveDirectoryA("one");
8918 RemoveDirectoryA("another");
8919 MsiCloseHandle(hpkg);
8920 DeleteFileA(msifile);
8923 static void test_featureparents(void)
8928 INSTALLSTATE state, action;
8930 hdb = create_package_db();
8931 ok ( hdb, "failed to create package database\n" );
8933 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
8934 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
8936 r = create_feature_table( hdb );
8937 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
8939 r = create_component_table( hdb );
8940 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
8942 r = create_feature_components_table( hdb );
8943 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
8945 r = create_file_table( hdb );
8946 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
8948 /* msidbFeatureAttributesFavorLocal */
8949 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
8950 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8952 /* msidbFeatureAttributesFavorSource */
8953 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
8954 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8956 /* msidbFeatureAttributesFavorLocal */
8957 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
8958 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8960 /* disabled because of install level */
8961 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
8962 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8964 /* child feature of disabled feature */
8965 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
8966 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8968 /* component of disabled feature (install level) */
8969 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
8970 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8972 /* component of disabled child feature (install level) */
8973 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
8974 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8976 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8977 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
8978 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8980 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8981 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
8982 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8984 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8985 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
8986 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8988 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
8989 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
8990 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8992 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
8993 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
8994 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8996 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
8997 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
8998 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9000 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9001 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9002 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9004 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9005 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9006 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9008 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9009 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9011 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9012 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9014 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9015 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9017 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9018 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9020 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9021 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9023 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9024 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9026 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9027 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9029 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9030 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9032 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9033 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9035 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9036 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9038 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9039 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9041 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9042 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9044 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9045 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9047 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9048 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9050 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9051 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9053 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9054 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9056 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9057 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9059 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9060 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9062 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9063 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9065 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9066 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9068 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9069 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9071 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9072 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9074 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9075 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9077 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9078 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9080 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9081 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9083 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9084 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9086 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9087 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9089 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9090 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9092 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9093 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9095 hpkg = package_from_db( hdb );
9096 ok( hpkg, "failed to create package\n");
9098 MsiCloseHandle( hdb );
9100 r = MsiDoAction( hpkg, "CostInitialize");
9101 ok( r == ERROR_SUCCESS, "cost init failed\n");
9103 r = MsiDoAction( hpkg, "FileCost");
9104 ok( r == ERROR_SUCCESS, "file cost failed\n");
9106 r = MsiDoAction( hpkg, "CostFinalize");
9107 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9111 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9112 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9113 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9114 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9118 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9120 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9121 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9125 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9126 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9127 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9128 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9132 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9133 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9134 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9135 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9139 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9140 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9141 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9142 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9146 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9147 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9148 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9149 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9153 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9155 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9156 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9160 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9161 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9162 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9163 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9167 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9168 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9169 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9170 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9174 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9175 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9176 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9177 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9181 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9182 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9183 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9184 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9188 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9190 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9191 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9195 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9197 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9198 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9202 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9204 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9205 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9209 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9211 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9212 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9216 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9218 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9219 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9221 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9222 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9226 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9227 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9228 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9229 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9233 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9234 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9235 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9236 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9240 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9241 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9242 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9243 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9247 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9248 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9249 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9250 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9254 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9255 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9256 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9257 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9261 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9262 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9263 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9264 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9268 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9269 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9270 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9271 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9275 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9276 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9277 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9278 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9282 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9283 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9284 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9285 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9289 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9290 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9291 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9292 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9296 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9297 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9298 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9299 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9303 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9304 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9305 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9306 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9310 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9311 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9312 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9313 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9317 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9318 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9319 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9320 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9322 MsiCloseHandle(hpkg);
9323 DeleteFileA(msifile);
9326 static void test_installprops(void)
9328 MSIHANDLE hpkg, hdb;
9329 CHAR path[MAX_PATH];
9337 GetCurrentDirectory(MAX_PATH, path);
9338 lstrcat(path, "\\");
9339 lstrcat(path, msifile);
9341 hdb = create_package_db();
9342 ok( hdb, "failed to create database\n");
9344 hpkg = package_from_db(hdb);
9345 ok( hpkg, "failed to create package\n");
9347 MsiCloseHandle(hdb);
9350 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
9351 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9352 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9354 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
9356 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
9361 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9365 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
9368 /* win9x doesn't set this */
9372 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
9373 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9374 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9380 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9384 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
9390 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
9391 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9392 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9396 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
9397 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9398 trace("VersionDatabase = %s\n", buf);
9401 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
9402 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9403 trace("VersionMsi = %s\n", buf);
9406 r = MsiGetProperty(hpkg, "Date", buf, &size);
9407 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9408 trace("Date = %s\n", buf);
9411 r = MsiGetProperty(hpkg, "Time", buf, &size);
9412 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9413 trace("Time = %s\n", buf);
9416 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
9417 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9418 trace("PackageCode = %s\n", buf);
9420 langid = GetUserDefaultLangID();
9421 sprintf(path, "%d", langid);
9424 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
9425 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9426 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
9428 res = GetSystemMetrics(SM_CXSCREEN);
9430 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
9431 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9433 res = GetSystemMetrics(SM_CYSCREEN);
9435 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
9436 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9440 MsiCloseHandle(hpkg);
9441 DeleteFile(msifile);
9444 static void test_launchconditions(void)
9450 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9452 hdb = create_package_db();
9453 ok( hdb, "failed to create package database\n" );
9455 r = create_launchcondition_table( hdb );
9456 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
9458 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
9459 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9461 /* invalid condition */
9462 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
9463 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9465 hpkg = package_from_db( hdb );
9466 ok( hpkg, "failed to create package\n");
9468 MsiCloseHandle( hdb );
9470 r = MsiSetProperty( hpkg, "X", "1" );
9471 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9473 /* invalid conditions are ignored */
9474 r = MsiDoAction( hpkg, "LaunchConditions" );
9475 ok( r == ERROR_SUCCESS, "cost init failed\n" );
9477 /* verify LaunchConditions still does some verification */
9478 r = MsiSetProperty( hpkg, "X", "2" );
9479 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9481 r = MsiDoAction( hpkg, "LaunchConditions" );
9482 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
9484 MsiCloseHandle( hpkg );
9485 DeleteFile( msifile );
9488 static void test_ccpsearch(void)
9490 MSIHANDLE hdb, hpkg;
9491 CHAR prop[MAX_PATH];
9492 DWORD size = MAX_PATH;
9495 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9497 hdb = create_package_db();
9498 ok(hdb, "failed to create package database\n");
9500 r = create_ccpsearch_table(hdb);
9501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9503 r = add_ccpsearch_entry(hdb, "'CCP_random'");
9504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9506 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
9507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9509 r = create_reglocator_table(hdb);
9510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9512 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9515 r = create_drlocator_table(hdb);
9516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9518 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
9519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9521 r = create_signature_table(hdb);
9522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9524 hpkg = package_from_db(hdb);
9525 ok(hpkg, "failed to create package\n");
9527 MsiCloseHandle(hdb);
9529 r = MsiDoAction(hpkg, "CCPSearch");
9530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9532 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
9533 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9534 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
9536 MsiCloseHandle(hpkg);
9537 DeleteFileA(msifile);
9540 static void test_complocator(void)
9542 MSIHANDLE hdb, hpkg;
9544 CHAR prop[MAX_PATH];
9545 CHAR expected[MAX_PATH];
9546 DWORD size = MAX_PATH;
9548 hdb = create_package_db();
9549 ok(hdb, "failed to create package database\n");
9551 r = create_appsearch_table(hdb);
9552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9554 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
9555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9557 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
9558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9560 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
9561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9563 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
9564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9566 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
9567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9569 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
9570 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9572 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
9573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9575 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
9576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9578 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
9579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9581 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
9582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9584 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
9585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9587 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
9588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9590 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
9591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9593 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
9594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9596 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
9597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9599 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
9600 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9602 r = create_complocator_table(hdb);
9603 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9605 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9608 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9611 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9612 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9614 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9617 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9618 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9620 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9621 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9623 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9626 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9629 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9632 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9635 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9638 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9641 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9644 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9647 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9650 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9653 r = create_signature_table(hdb);
9654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9656 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9659 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9662 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9665 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9668 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9671 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9672 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9674 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9677 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9678 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9680 hpkg = package_from_db(hdb);
9681 ok(hpkg, "failed to create package\n");
9683 MsiCloseHandle(hdb);
9685 create_test_file("abelisaurus");
9686 create_test_file("bactrosaurus");
9687 create_test_file("camelotia");
9688 create_test_file("diclonius");
9689 create_test_file("echinodon");
9690 create_test_file("falcarius");
9691 create_test_file("gallimimus");
9692 create_test_file("hagryphus");
9693 CreateDirectoryA("iguanodon", NULL);
9694 CreateDirectoryA("jobaria", NULL);
9695 CreateDirectoryA("kakuru", NULL);
9696 CreateDirectoryA("labocania", NULL);
9697 CreateDirectoryA("megaraptor", NULL);
9698 CreateDirectoryA("neosodon", NULL);
9699 CreateDirectoryA("olorotitan", NULL);
9700 CreateDirectoryA("pantydraco", NULL);
9702 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
9703 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
9704 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
9705 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
9706 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
9707 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
9708 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
9709 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
9710 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
9711 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
9712 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
9713 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
9714 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
9715 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
9716 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
9717 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
9719 r = MsiDoAction(hpkg, "AppSearch");
9720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9723 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
9724 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9726 lstrcpyA(expected, CURR_DIR);
9727 lstrcatA(expected, "\\abelisaurus");
9728 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9729 "Expected %s or empty string, got %s\n", expected, prop);
9732 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
9733 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9734 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9737 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
9738 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9739 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9742 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
9743 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9744 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9747 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
9748 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9750 lstrcpyA(expected, CURR_DIR);
9751 lstrcatA(expected, "\\");
9752 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9753 "Expected %s or empty string, got %s\n", expected, prop);
9756 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
9757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9758 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9761 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
9762 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9763 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9766 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
9767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9768 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9771 r = MsiGetPropertyA(hpkg, "IGUANODON", 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, "JOBARIA", prop, &size);
9777 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9778 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9781 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
9782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9783 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9786 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
9787 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9788 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9791 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
9792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9794 lstrcpyA(expected, CURR_DIR);
9795 lstrcatA(expected, "\\");
9796 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9797 "Expected %s or empty string, got %s\n", expected, prop);
9800 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
9801 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9803 lstrcpyA(expected, CURR_DIR);
9804 lstrcatA(expected, "\\neosodon\\");
9805 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9806 "Expected %s or empty string, got %s\n", expected, prop);
9809 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
9810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9811 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9814 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
9815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9816 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9818 MsiCloseHandle(hpkg);
9819 DeleteFileA("abelisaurus");
9820 DeleteFileA("bactrosaurus");
9821 DeleteFileA("camelotia");
9822 DeleteFileA("diclonius");
9823 DeleteFileA("echinodon");
9824 DeleteFileA("falcarius");
9825 DeleteFileA("gallimimus");
9826 DeleteFileA("hagryphus");
9827 RemoveDirectoryA("iguanodon");
9828 RemoveDirectoryA("jobaria");
9829 RemoveDirectoryA("kakuru");
9830 RemoveDirectoryA("labocania");
9831 RemoveDirectoryA("megaraptor");
9832 RemoveDirectoryA("neosodon");
9833 RemoveDirectoryA("olorotitan");
9834 RemoveDirectoryA("pantydraco");
9835 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
9836 MSIINSTALLCONTEXT_MACHINE, NULL);
9837 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
9838 MSIINSTALLCONTEXT_MACHINE, NULL);
9839 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
9840 MSIINSTALLCONTEXT_MACHINE, NULL);
9841 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
9842 MSIINSTALLCONTEXT_MACHINE, NULL);
9843 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
9844 MSIINSTALLCONTEXT_MACHINE, NULL);
9845 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
9846 MSIINSTALLCONTEXT_MACHINE, NULL);
9847 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
9848 MSIINSTALLCONTEXT_MACHINE, NULL);
9849 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
9850 MSIINSTALLCONTEXT_MACHINE, NULL);
9851 DeleteFileA(msifile);
9854 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
9859 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
9860 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9862 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
9863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9865 r = MsiSummaryInfoPersist(summary);
9866 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9868 MsiCloseHandle(summary);
9871 static void test_MsiGetSourcePath(void)
9873 MSIHANDLE hdb, hpkg;
9874 CHAR path[MAX_PATH];
9876 CHAR subsrc[MAX_PATH];
9877 CHAR sub2[MAX_PATH];
9881 lstrcpyA(cwd, CURR_DIR);
9882 lstrcatA(cwd, "\\");
9884 lstrcpyA(subsrc, cwd);
9885 lstrcatA(subsrc, "subsource");
9886 lstrcatA(subsrc, "\\");
9888 lstrcpyA(sub2, subsrc);
9889 lstrcatA(sub2, "sub2");
9890 lstrcatA(sub2, "\\");
9892 /* uncompressed source */
9894 hdb = create_package_db();
9895 ok( hdb, "failed to create database\n");
9897 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
9899 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
9900 ok(r == S_OK, "failed\n");
9902 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
9903 ok(r == S_OK, "failed\n");
9905 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
9906 ok(r == S_OK, "failed\n");
9908 r = MsiDatabaseCommit(hdb);
9909 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
9911 hpkg = package_from_db(hdb);
9912 ok(hpkg, "failed to create package\n");
9914 MsiCloseHandle(hdb);
9916 /* invalid database handle */
9918 lstrcpyA(path, "kiwi");
9919 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
9920 ok(r == ERROR_INVALID_HANDLE,
9921 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
9922 ok(!lstrcmpA(path, "kiwi"),
9923 "Expected path to be unchanged, got \"%s\"\n", path);
9924 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9928 lstrcpyA(path, "kiwi");
9929 r = MsiGetSourcePath(hpkg, NULL, path, &size);
9930 ok(r == ERROR_INVALID_PARAMETER,
9931 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
9932 ok(!lstrcmpA(path, "kiwi"),
9933 "Expected path to be unchanged, got \"%s\"\n", path);
9934 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9936 /* empty szFolder */
9938 lstrcpyA(path, "kiwi");
9939 r = MsiGetSourcePath(hpkg, "", path, &size);
9940 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9941 ok(!lstrcmpA(path, "kiwi"),
9942 "Expected path to be unchanged, got \"%s\"\n", path);
9943 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9947 lstrcpyA(path, "kiwi");
9948 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9949 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9950 ok(!lstrcmpA(path, "kiwi"),
9951 "Expected path to be unchanged, got \"%s\"\n", path);
9952 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9956 lstrcpyA(path, "kiwi");
9957 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9958 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9959 ok(!lstrcmpA(path, "kiwi"),
9960 "Expected path to be unchanged, got \"%s\"\n", path);
9961 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9965 lstrcpyA(path, "kiwi");
9966 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9967 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9968 ok(!lstrcmpA(path, "kiwi"),
9969 "Expected path to be unchanged, got \"%s\"\n", path);
9970 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9972 /* source path does not exist, but the property exists */
9974 lstrcpyA(path, "kiwi");
9975 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9976 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9977 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9978 ok(size == 0, "Expected 0, got %d\n", size);
9982 lstrcpyA(path, "kiwi");
9983 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9984 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9985 ok(!lstrcmpA(path, "kiwi"),
9986 "Expected path to be unchanged, got \"%s\"\n", path);
9987 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9991 lstrcpyA(path, "kiwi");
9992 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9993 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9994 ok(!lstrcmpA(path, "kiwi"),
9995 "Expected path to be unchanged, got \"%s\"\n", path);
9996 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9998 r = MsiDoAction(hpkg, "CostInitialize");
9999 ok(r == ERROR_SUCCESS, "cost init failed\n");
10001 /* try TARGETDIR after CostInitialize */
10003 lstrcpyA(path, "kiwi");
10004 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10006 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10007 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10009 /* try SourceDir after CostInitialize */
10011 lstrcpyA(path, "kiwi");
10012 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10013 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10014 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10015 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10017 /* try SOURCEDIR after CostInitialize */
10019 lstrcpyA(path, "kiwi");
10020 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10021 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10022 ok(!lstrcmpA(path, "kiwi"),
10023 "Expected path to be unchanged, got \"%s\"\n", path);
10024 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10026 /* source path does not exist, but the property exists */
10028 lstrcpyA(path, "kiwi");
10029 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10030 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10033 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10034 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10037 /* try SubDir after CostInitialize */
10039 lstrcpyA(path, "kiwi");
10040 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10042 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10043 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10045 /* try SubDir2 after CostInitialize */
10047 lstrcpyA(path, "kiwi");
10048 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10050 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10051 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10053 r = MsiDoAction(hpkg, "ResolveSource");
10054 ok(r == ERROR_SUCCESS, "file cost failed\n");
10056 /* try TARGETDIR after ResolveSource */
10058 lstrcpyA(path, "kiwi");
10059 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10061 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10062 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10064 /* try SourceDir after ResolveSource */
10066 lstrcpyA(path, "kiwi");
10067 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10068 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10069 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10070 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10072 /* try SOURCEDIR after ResolveSource */
10074 lstrcpyA(path, "kiwi");
10075 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10076 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10077 ok(!lstrcmpA(path, "kiwi"),
10078 "Expected path to be unchanged, got \"%s\"\n", path);
10079 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10081 /* source path does not exist, but the property exists */
10083 lstrcpyA(path, "kiwi");
10084 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10086 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10087 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10089 /* try SubDir after ResolveSource */
10091 lstrcpyA(path, "kiwi");
10092 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10094 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10095 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10097 /* try SubDir2 after ResolveSource */
10099 lstrcpyA(path, "kiwi");
10100 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10102 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10103 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10105 r = MsiDoAction(hpkg, "FileCost");
10106 ok(r == ERROR_SUCCESS, "file cost failed\n");
10108 /* try TARGETDIR after FileCost */
10110 lstrcpyA(path, "kiwi");
10111 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10112 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10113 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10114 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10116 /* try SourceDir after FileCost */
10118 lstrcpyA(path, "kiwi");
10119 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10121 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10122 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10124 /* try SOURCEDIR after FileCost */
10126 lstrcpyA(path, "kiwi");
10127 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10128 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10129 ok(!lstrcmpA(path, "kiwi"),
10130 "Expected path to be unchanged, got \"%s\"\n", path);
10131 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10133 /* source path does not exist, but the property exists */
10135 lstrcpyA(path, "kiwi");
10136 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10137 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10138 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10139 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10141 /* try SubDir after FileCost */
10143 lstrcpyA(path, "kiwi");
10144 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10146 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10147 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10149 /* try SubDir2 after FileCost */
10151 lstrcpyA(path, "kiwi");
10152 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10154 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10155 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10157 r = MsiDoAction(hpkg, "CostFinalize");
10158 ok(r == ERROR_SUCCESS, "file cost failed\n");
10160 /* try TARGETDIR after CostFinalize */
10162 lstrcpyA(path, "kiwi");
10163 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10164 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10165 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10166 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10168 /* try SourceDir after CostFinalize */
10170 lstrcpyA(path, "kiwi");
10171 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10172 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10173 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10174 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10176 /* try SOURCEDIR after CostFinalize */
10178 lstrcpyA(path, "kiwi");
10179 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10180 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10181 ok(!lstrcmpA(path, "kiwi"),
10182 "Expected path to be unchanged, got \"%s\"\n", path);
10183 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10185 /* source path does not exist, but the property exists */
10187 lstrcpyA(path, "kiwi");
10188 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10190 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10191 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10193 /* try SubDir after CostFinalize */
10195 lstrcpyA(path, "kiwi");
10196 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10197 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10198 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10199 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10201 /* try SubDir2 after CostFinalize */
10203 lstrcpyA(path, "kiwi");
10204 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10205 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10206 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10207 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10209 /* nonexistent directory */
10211 lstrcpyA(path, "kiwi");
10212 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
10213 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10214 ok(!lstrcmpA(path, "kiwi"),
10215 "Expected path to be unchanged, got \"%s\"\n", path);
10216 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10218 /* NULL szPathBuf */
10220 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
10221 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10222 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10224 /* NULL pcchPathBuf */
10225 lstrcpyA(path, "kiwi");
10226 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
10227 ok(r == ERROR_INVALID_PARAMETER,
10228 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10229 ok(!lstrcmpA(path, "kiwi"),
10230 "Expected path to be unchanged, got \"%s\"\n", path);
10232 /* pcchPathBuf is 0 */
10234 lstrcpyA(path, "kiwi");
10235 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10236 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10237 ok(!lstrcmpA(path, "kiwi"),
10238 "Expected path to be unchanged, got \"%s\"\n", path);
10239 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10241 /* pcchPathBuf does not have room for NULL terminator */
10242 size = lstrlenA(cwd);
10243 lstrcpyA(path, "kiwi");
10244 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10245 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10246 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
10247 "Expected path with no backslash, got \"%s\"\n", path);
10248 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10250 /* pcchPathBuf has room for NULL terminator */
10251 size = lstrlenA(cwd) + 1;
10252 lstrcpyA(path, "kiwi");
10253 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10254 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10255 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10256 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10258 MsiCloseHandle(hpkg);
10260 /* compressed source */
10262 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10263 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10265 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
10267 hpkg = package_from_db(hdb);
10268 ok(hpkg, "failed to create package\n");
10270 /* try TARGETDIR */
10272 lstrcpyA(path, "kiwi");
10273 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10274 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10275 ok(!lstrcmpA(path, "kiwi"),
10276 "Expected path to be unchanged, got \"%s\"\n", path);
10277 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10279 /* try SourceDir */
10281 lstrcpyA(path, "kiwi");
10282 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10283 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10284 ok(!lstrcmpA(path, "kiwi"),
10285 "Expected path to be unchanged, got \"%s\"\n", path);
10286 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10288 /* try SOURCEDIR */
10290 lstrcpyA(path, "kiwi");
10291 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10292 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10293 ok(!lstrcmpA(path, "kiwi"),
10294 "Expected path to be unchanged, got \"%s\"\n", path);
10295 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10297 /* source path nor the property exist */
10299 lstrcpyA(path, "kiwi");
10300 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10301 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10302 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10303 ok(size == 0, "Expected 0, got %d\n", size);
10307 lstrcpyA(path, "kiwi");
10308 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10309 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10310 ok(!lstrcmpA(path, "kiwi"),
10311 "Expected path to be unchanged, got \"%s\"\n", path);
10312 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10316 lstrcpyA(path, "kiwi");
10317 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10318 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10319 ok(!lstrcmpA(path, "kiwi"),
10320 "Expected path to be unchanged, got \"%s\"\n", path);
10321 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10323 r = MsiDoAction(hpkg, "CostInitialize");
10324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10326 /* try TARGETDIR after CostInitialize */
10328 lstrcpyA(path, "kiwi");
10329 r = MsiGetSourcePath(hpkg, "TARGETDIR", 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 SourceDir after CostInitialize */
10336 lstrcpyA(path, "kiwi");
10337 r = MsiGetSourcePath(hpkg, "SourceDir", 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 /* try SOURCEDIR after CostInitialize */
10344 lstrcpyA(path, "kiwi");
10345 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10348 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10349 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10350 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10353 /* source path does not exist, but the property exists */
10355 lstrcpyA(path, "kiwi");
10356 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10360 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10361 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10364 /* try SubDir after CostInitialize */
10366 lstrcpyA(path, "kiwi");
10367 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10368 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10369 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10370 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10372 /* try SubDir2 after CostInitialize */
10374 lstrcpyA(path, "kiwi");
10375 r = MsiGetSourcePath(hpkg, "SubDir2", 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 r = MsiDoAction(hpkg, "ResolveSource");
10381 ok(r == ERROR_SUCCESS, "file cost failed\n");
10383 /* try TARGETDIR after ResolveSource */
10385 lstrcpyA(path, "kiwi");
10386 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10388 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10389 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10391 /* try SourceDir after ResolveSource */
10393 lstrcpyA(path, "kiwi");
10394 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10396 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10397 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10399 /* try SOURCEDIR after ResolveSource */
10401 lstrcpyA(path, "kiwi");
10402 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10405 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10406 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10407 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10410 /* source path and the property exist */
10412 lstrcpyA(path, "kiwi");
10413 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10415 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10416 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10418 /* try SubDir after ResolveSource */
10420 lstrcpyA(path, "kiwi");
10421 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10423 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10424 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10426 /* try SubDir2 after ResolveSource */
10428 lstrcpyA(path, "kiwi");
10429 r = MsiGetSourcePath(hpkg, "SubDir2", 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 r = MsiDoAction(hpkg, "FileCost");
10435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10437 /* try TARGETDIR after CostFinalize */
10439 lstrcpyA(path, "kiwi");
10440 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10442 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10443 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10445 /* try SourceDir after CostFinalize */
10447 lstrcpyA(path, "kiwi");
10448 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10450 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10451 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10453 /* try SOURCEDIR after CostFinalize */
10455 lstrcpyA(path, "kiwi");
10456 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10460 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10461 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10464 /* source path and the property exist */
10466 lstrcpyA(path, "kiwi");
10467 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10469 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10470 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10472 /* try SubDir after CostFinalize */
10474 lstrcpyA(path, "kiwi");
10475 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10476 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10477 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10478 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10480 /* try SubDir2 after CostFinalize */
10482 lstrcpyA(path, "kiwi");
10483 r = MsiGetSourcePath(hpkg, "SubDir2", 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 r = MsiDoAction(hpkg, "CostFinalize");
10489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10491 /* try TARGETDIR after CostFinalize */
10493 lstrcpyA(path, "kiwi");
10494 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10496 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10497 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10499 /* try SourceDir after CostFinalize */
10501 lstrcpyA(path, "kiwi");
10502 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10504 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10505 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10507 /* try SOURCEDIR after CostFinalize */
10509 lstrcpyA(path, "kiwi");
10510 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10514 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10515 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10518 /* source path and the property exist */
10520 lstrcpyA(path, "kiwi");
10521 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10523 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10524 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10526 /* try SubDir after CostFinalize */
10528 lstrcpyA(path, "kiwi");
10529 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10531 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10532 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10534 /* try SubDir2 after CostFinalize */
10536 lstrcpyA(path, "kiwi");
10537 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10539 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10540 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10542 MsiCloseHandle(hpkg);
10543 DeleteFile(msifile);
10546 static void test_shortlongsource(void)
10548 MSIHANDLE hdb, hpkg;
10549 CHAR path[MAX_PATH];
10550 CHAR cwd[MAX_PATH];
10551 CHAR subsrc[MAX_PATH];
10555 lstrcpyA(cwd, CURR_DIR);
10556 lstrcatA(cwd, "\\");
10558 lstrcpyA(subsrc, cwd);
10559 lstrcatA(subsrc, "long");
10560 lstrcatA(subsrc, "\\");
10562 /* long file names */
10564 hdb = create_package_db();
10565 ok( hdb, "failed to create database\n");
10567 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10569 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10570 ok(r == S_OK, "failed\n");
10572 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
10573 ok(r == S_OK, "failed\n");
10575 /* CostInitialize:short */
10576 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
10577 ok(r == S_OK, "failed\n");
10579 /* CostInitialize:long */
10580 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
10581 ok(r == S_OK, "failed\n");
10583 /* FileCost:short */
10584 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
10585 ok(r == S_OK, "failed\n");
10587 /* FileCost:long */
10588 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
10589 ok(r == S_OK, "failed\n");
10591 /* CostFinalize:short */
10592 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
10593 ok(r == S_OK, "failed\n");
10595 /* CostFinalize:long */
10596 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
10597 ok(r == S_OK, "failed\n");
10599 MsiDatabaseCommit(hdb);
10601 hpkg = package_from_db(hdb);
10602 ok(hpkg, "failed to create package\n");
10604 MsiCloseHandle(hdb);
10606 CreateDirectoryA("one", NULL);
10607 CreateDirectoryA("four", NULL);
10609 r = MsiDoAction(hpkg, "CostInitialize");
10610 ok(r == ERROR_SUCCESS, "file cost failed\n");
10612 CreateDirectory("five", NULL);
10613 CreateDirectory("eight", NULL);
10615 r = MsiDoAction(hpkg, "FileCost");
10616 ok(r == ERROR_SUCCESS, "file cost failed\n");
10618 CreateDirectory("nine", NULL);
10619 CreateDirectory("twelve", NULL);
10621 r = MsiDoAction(hpkg, "CostFinalize");
10622 ok(r == ERROR_SUCCESS, "file cost failed\n");
10624 /* neither short nor long source directories exist */
10626 lstrcpyA(path, "kiwi");
10627 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10628 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10629 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10630 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10632 CreateDirectoryA("short", NULL);
10634 /* short source directory exists */
10636 lstrcpyA(path, "kiwi");
10637 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10638 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10639 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10640 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10642 CreateDirectoryA("long", NULL);
10644 /* both short and long source directories exist */
10646 lstrcpyA(path, "kiwi");
10647 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10649 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10650 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10652 lstrcpyA(subsrc, cwd);
10653 lstrcatA(subsrc, "two");
10654 lstrcatA(subsrc, "\\");
10656 /* short dir exists before CostInitialize */
10658 lstrcpyA(path, "kiwi");
10659 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10661 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10662 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10664 lstrcpyA(subsrc, cwd);
10665 lstrcatA(subsrc, "four");
10666 lstrcatA(subsrc, "\\");
10668 /* long dir exists before CostInitialize */
10670 lstrcpyA(path, "kiwi");
10671 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10672 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10673 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10674 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10676 lstrcpyA(subsrc, cwd);
10677 lstrcatA(subsrc, "six");
10678 lstrcatA(subsrc, "\\");
10680 /* short dir exists before FileCost */
10682 lstrcpyA(path, "kiwi");
10683 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10684 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10685 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10686 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10688 lstrcpyA(subsrc, cwd);
10689 lstrcatA(subsrc, "eight");
10690 lstrcatA(subsrc, "\\");
10692 /* long dir exists before FileCost */
10694 lstrcpyA(path, "kiwi");
10695 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10697 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10698 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10700 lstrcpyA(subsrc, cwd);
10701 lstrcatA(subsrc, "ten");
10702 lstrcatA(subsrc, "\\");
10704 /* short dir exists before CostFinalize */
10706 lstrcpyA(path, "kiwi");
10707 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10709 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10710 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10712 lstrcpyA(subsrc, cwd);
10713 lstrcatA(subsrc, "twelve");
10714 lstrcatA(subsrc, "\\");
10716 /* long dir exists before CostFinalize */
10718 lstrcpyA(path, "kiwi");
10719 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10721 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10722 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10724 MsiCloseHandle(hpkg);
10725 RemoveDirectoryA("short");
10726 RemoveDirectoryA("long");
10727 RemoveDirectoryA("one");
10728 RemoveDirectoryA("four");
10729 RemoveDirectoryA("five");
10730 RemoveDirectoryA("eight");
10731 RemoveDirectoryA("nine");
10732 RemoveDirectoryA("twelve");
10734 /* short file names */
10736 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10737 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10739 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
10741 hpkg = package_from_db(hdb);
10742 ok(hpkg, "failed to create package\n");
10744 MsiCloseHandle(hdb);
10746 CreateDirectoryA("one", NULL);
10747 CreateDirectoryA("four", NULL);
10749 r = MsiDoAction(hpkg, "CostInitialize");
10750 ok(r == ERROR_SUCCESS, "file cost failed\n");
10752 CreateDirectory("five", NULL);
10753 CreateDirectory("eight", NULL);
10755 r = MsiDoAction(hpkg, "FileCost");
10756 ok(r == ERROR_SUCCESS, "file cost failed\n");
10758 CreateDirectory("nine", NULL);
10759 CreateDirectory("twelve", NULL);
10761 r = MsiDoAction(hpkg, "CostFinalize");
10762 ok(r == ERROR_SUCCESS, "file cost failed\n");
10764 lstrcpyA(subsrc, cwd);
10765 lstrcatA(subsrc, "short");
10766 lstrcatA(subsrc, "\\");
10768 /* neither short nor long source directories exist */
10770 lstrcpyA(path, "kiwi");
10771 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10772 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10773 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10774 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10776 CreateDirectoryA("short", NULL);
10778 /* short source directory exists */
10780 lstrcpyA(path, "kiwi");
10781 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10783 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10784 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10786 CreateDirectoryA("long", NULL);
10788 /* both short and long source directories exist */
10790 lstrcpyA(path, "kiwi");
10791 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10793 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10794 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10796 lstrcpyA(subsrc, cwd);
10797 lstrcatA(subsrc, "one");
10798 lstrcatA(subsrc, "\\");
10800 /* short dir exists before CostInitialize */
10802 lstrcpyA(path, "kiwi");
10803 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10805 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10806 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10808 lstrcpyA(subsrc, cwd);
10809 lstrcatA(subsrc, "three");
10810 lstrcatA(subsrc, "\\");
10812 /* long dir exists before CostInitialize */
10814 lstrcpyA(path, "kiwi");
10815 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10816 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10817 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10818 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10820 lstrcpyA(subsrc, cwd);
10821 lstrcatA(subsrc, "five");
10822 lstrcatA(subsrc, "\\");
10824 /* short dir exists before FileCost */
10826 lstrcpyA(path, "kiwi");
10827 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10829 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10830 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10832 lstrcpyA(subsrc, cwd);
10833 lstrcatA(subsrc, "seven");
10834 lstrcatA(subsrc, "\\");
10836 /* long dir exists before FileCost */
10838 lstrcpyA(path, "kiwi");
10839 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10840 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10841 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10842 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10844 lstrcpyA(subsrc, cwd);
10845 lstrcatA(subsrc, "nine");
10846 lstrcatA(subsrc, "\\");
10848 /* short dir exists before CostFinalize */
10850 lstrcpyA(path, "kiwi");
10851 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10853 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10854 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10856 lstrcpyA(subsrc, cwd);
10857 lstrcatA(subsrc, "eleven");
10858 lstrcatA(subsrc, "\\");
10860 /* long dir exists before CostFinalize */
10862 lstrcpyA(path, "kiwi");
10863 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10864 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10865 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10866 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10868 MsiCloseHandle(hpkg);
10869 RemoveDirectoryA("short");
10870 RemoveDirectoryA("long");
10871 RemoveDirectoryA("one");
10872 RemoveDirectoryA("four");
10873 RemoveDirectoryA("five");
10874 RemoveDirectoryA("eight");
10875 RemoveDirectoryA("nine");
10876 RemoveDirectoryA("twelve");
10877 DeleteFileA(msifile);
10880 static void test_sourcedir(void)
10882 MSIHANDLE hdb, hpkg;
10884 CHAR path[MAX_PATH];
10885 CHAR cwd[MAX_PATH];
10886 CHAR subsrc[MAX_PATH];
10890 lstrcpyA(cwd, CURR_DIR);
10891 lstrcatA(cwd, "\\");
10893 lstrcpyA(subsrc, cwd);
10894 lstrcatA(subsrc, "long");
10895 lstrcatA(subsrc, "\\");
10897 hdb = create_package_db();
10898 ok( hdb, "failed to create database\n");
10900 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10901 ok(r == S_OK, "failed\n");
10903 sprintf(package, "#%i", hdb);
10904 r = MsiOpenPackage(package, &hpkg);
10905 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10907 /* properties only */
10909 /* SourceDir prop */
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 prop */
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, "CostInitialize");
10926 ok(r == ERROR_SUCCESS, "file cost failed\n");
10928 /* SourceDir after CostInitialize */
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 CostInitialize */
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, "FileCost");
10945 ok(r == ERROR_SUCCESS, "file cost failed\n");
10947 /* SourceDir after FileCost */
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, ""), "Expected \"\", got \"%s\"\n", path);
10953 ok(size == 0, "Expected 0, got %d\n", size);
10955 /* SOURCEDIR after FileCost */
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, ""), "Expected \"\", got \"%s\"\n", path);
10961 ok(size == 0, "Expected 0, got %d\n", size);
10963 r = MsiDoAction(hpkg, "CostFinalize");
10964 ok(r == ERROR_SUCCESS, "file cost failed\n");
10966 /* SourceDir after CostFinalize */
10968 lstrcpyA(path, "kiwi");
10969 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10970 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10971 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10972 ok(size == 0, "Expected 0, got %d\n", size);
10974 /* SOURCEDIR after CostFinalize */
10976 lstrcpyA(path, "kiwi");
10977 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10978 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10979 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10980 ok(size == 0, "Expected 0, got %d\n", size);
10982 r = MsiDoAction(hpkg, "ResolveSource");
10983 ok(r == ERROR_SUCCESS, "file cost failed\n");
10985 /* SourceDir after ResolveSource */
10987 lstrcpyA(path, "kiwi");
10988 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10989 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10990 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10991 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10993 /* SOURCEDIR after ResolveSource */
10995 lstrcpyA(path, "kiwi");
10996 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10997 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10998 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10999 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11001 /* random casing */
11003 lstrcpyA(path, "kiwi");
11004 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
11005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11006 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11007 ok(size == 0, "Expected 0, got %d\n", size);
11009 MsiCloseHandle(hpkg);
11011 /* reset the package state */
11012 sprintf(package, "#%i", hdb);
11013 r = MsiOpenPackage(package, &hpkg);
11014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11016 /* test how MsiGetSourcePath affects the properties */
11018 /* SourceDir prop */
11020 lstrcpyA(path, "kiwi");
11021 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11025 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11026 ok(size == 0, "Expected 0, got %d\n", size);
11030 lstrcpyA(path, "kiwi");
11031 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11032 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11033 ok(!lstrcmpA(path, "kiwi"),
11034 "Expected path to be unchanged, got \"%s\"\n", path);
11035 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11037 /* SourceDir after MsiGetSourcePath */
11039 lstrcpyA(path, "kiwi");
11040 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11044 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11045 ok(size == 0, "Expected 0, got %d\n", size);
11048 /* SOURCEDIR prop */
11050 lstrcpyA(path, "kiwi");
11051 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11052 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11055 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11056 ok(size == 0, "Expected 0, got %d\n", size);
11060 lstrcpyA(path, "kiwi");
11061 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11062 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11063 ok(!lstrcmpA(path, "kiwi"),
11064 "Expected path to be unchanged, got \"%s\"\n", path);
11065 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11067 /* SOURCEDIR prop after MsiGetSourcePath */
11069 lstrcpyA(path, "kiwi");
11070 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11074 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11075 ok(size == 0, "Expected 0, got %d\n", size);
11078 r = MsiDoAction(hpkg, "CostInitialize");
11079 ok(r == ERROR_SUCCESS, "file cost failed\n");
11081 /* SourceDir after CostInitialize */
11083 lstrcpyA(path, "kiwi");
11084 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11088 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11089 ok(size == 0, "Expected 0, got %d\n", size);
11093 lstrcpyA(path, "kiwi");
11094 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11096 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11097 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11099 /* SourceDir after MsiGetSourcePath */
11101 lstrcpyA(path, "kiwi");
11102 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11104 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11105 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11107 /* SOURCEDIR after CostInitialize */
11109 lstrcpyA(path, "kiwi");
11110 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11112 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11113 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11115 /* SOURCEDIR source path still does not exist */
11117 lstrcpyA(path, "kiwi");
11118 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11119 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11120 ok(!lstrcmpA(path, "kiwi"),
11121 "Expected path to be unchanged, got \"%s\"\n", path);
11122 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11124 r = MsiDoAction(hpkg, "FileCost");
11125 ok(r == ERROR_SUCCESS, "file cost failed\n");
11127 /* SourceDir after FileCost */
11129 lstrcpyA(path, "kiwi");
11130 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11132 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11133 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11135 /* SOURCEDIR after FileCost */
11137 lstrcpyA(path, "kiwi");
11138 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11140 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11141 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11143 /* SOURCEDIR source path still does not exist */
11145 lstrcpyA(path, "kiwi");
11146 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11147 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11148 ok(!lstrcmpA(path, "kiwi"),
11149 "Expected path to be unchanged, got \"%s\"\n", path);
11150 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11152 r = MsiDoAction(hpkg, "CostFinalize");
11153 ok(r == ERROR_SUCCESS, "file cost failed\n");
11155 /* SourceDir after CostFinalize */
11157 lstrcpyA(path, "kiwi");
11158 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11160 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11161 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11163 /* SOURCEDIR after CostFinalize */
11165 lstrcpyA(path, "kiwi");
11166 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11167 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11168 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11169 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11171 /* SOURCEDIR source path still does not exist */
11173 lstrcpyA(path, "kiwi");
11174 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11175 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11176 ok(!lstrcmpA(path, "kiwi"),
11177 "Expected path to be unchanged, got \"%s\"\n", path);
11178 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11180 r = MsiDoAction(hpkg, "ResolveSource");
11181 ok(r == ERROR_SUCCESS, "file cost failed\n");
11183 /* SourceDir after ResolveSource */
11185 lstrcpyA(path, "kiwi");
11186 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11187 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11188 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11189 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11191 /* SOURCEDIR after ResolveSource */
11193 lstrcpyA(path, "kiwi");
11194 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11195 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11196 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11197 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11199 /* SOURCEDIR source path still does not exist */
11201 lstrcpyA(path, "kiwi");
11202 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11203 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11204 ok(!lstrcmpA(path, "kiwi"),
11205 "Expected path to be unchanged, got \"%s\"\n", path);
11206 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11208 MsiCloseHandle(hdb);
11209 MsiCloseHandle(hpkg);
11210 DeleteFileA(msifile);
11220 static const struct access_res create[16] =
11222 { TRUE, ERROR_SUCCESS, TRUE },
11223 { TRUE, ERROR_SUCCESS, TRUE },
11224 { TRUE, ERROR_SUCCESS, FALSE },
11225 { TRUE, ERROR_SUCCESS, FALSE },
11226 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11227 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11228 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11229 { TRUE, ERROR_SUCCESS, FALSE },
11230 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11231 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11232 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11233 { TRUE, ERROR_SUCCESS, TRUE },
11234 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11235 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11236 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11237 { TRUE, ERROR_SUCCESS, TRUE }
11240 static const struct access_res create_commit[16] =
11242 { TRUE, ERROR_SUCCESS, TRUE },
11243 { TRUE, ERROR_SUCCESS, TRUE },
11244 { TRUE, ERROR_SUCCESS, FALSE },
11245 { TRUE, ERROR_SUCCESS, FALSE },
11246 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11247 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11248 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11249 { TRUE, ERROR_SUCCESS, FALSE },
11250 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11251 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11252 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11253 { TRUE, ERROR_SUCCESS, TRUE },
11254 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11255 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11256 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11257 { TRUE, ERROR_SUCCESS, TRUE }
11260 static const struct access_res create_close[16] =
11262 { TRUE, ERROR_SUCCESS, FALSE },
11263 { TRUE, ERROR_SUCCESS, FALSE },
11264 { TRUE, ERROR_SUCCESS, FALSE },
11265 { TRUE, ERROR_SUCCESS, FALSE },
11266 { TRUE, ERROR_SUCCESS, FALSE },
11267 { TRUE, ERROR_SUCCESS, FALSE },
11268 { TRUE, ERROR_SUCCESS, FALSE },
11269 { TRUE, ERROR_SUCCESS, FALSE },
11270 { TRUE, ERROR_SUCCESS, FALSE },
11271 { TRUE, ERROR_SUCCESS, FALSE },
11272 { TRUE, ERROR_SUCCESS, FALSE },
11273 { TRUE, ERROR_SUCCESS, FALSE },
11274 { TRUE, ERROR_SUCCESS, FALSE },
11275 { TRUE, ERROR_SUCCESS, FALSE },
11276 { TRUE, ERROR_SUCCESS, FALSE },
11277 { TRUE, ERROR_SUCCESS }
11280 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
11282 DWORD access = 0, share = 0;
11287 for (i = 0; i < 4; i++)
11289 if (i == 0) access = 0;
11290 if (i == 1) access = GENERIC_READ;
11291 if (i == 2) access = GENERIC_WRITE;
11292 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
11294 for (j = 0; j < 4; j++)
11296 if (ares[idx].ignore)
11299 if (j == 0) share = 0;
11300 if (j == 1) share = FILE_SHARE_READ;
11301 if (j == 2) share = FILE_SHARE_WRITE;
11302 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
11304 SetLastError(0xdeadbeef);
11305 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
11306 FILE_ATTRIBUTE_NORMAL, 0);
11307 lasterr = GetLastError();
11309 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
11310 "(%d, handle, %d): Expected %d, got %d\n",
11311 line, idx, ares[idx].gothandle,
11312 (hfile != INVALID_HANDLE_VALUE));
11314 ok(lasterr == ares[idx].lasterr ||
11315 lasterr == 0xdeadbeef, /* win9x */
11316 "(%d, lasterr, %d): Expected %d, got %d\n",
11317 line, idx, ares[idx].lasterr, lasterr);
11319 CloseHandle(hfile);
11325 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
11327 static void test_access(void)
11332 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
11333 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11335 test_file_access(msifile, create);
11337 r = MsiDatabaseCommit(hdb);
11338 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11340 test_file_access(msifile, create_commit);
11342 MsiCloseHandle(hdb);
11344 test_file_access(msifile, create_close);
11346 DeleteFileA(msifile);
11348 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
11349 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11351 test_file_access(msifile, create);
11353 r = MsiDatabaseCommit(hdb);
11354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11356 test_file_access(msifile, create_commit);
11358 MsiCloseHandle(hdb);
11360 test_file_access(msifile, create_close);
11362 DeleteFileA(msifile);
11365 static void test_emptypackage(void)
11367 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
11368 MSIHANDLE hview = 0, hrec = 0;
11369 MSICONDITION condition;
11370 CHAR buffer[MAX_PATH];
11374 r = MsiOpenPackageA("", &hpkg);
11377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11380 hdb = MsiGetActiveDatabase(hpkg);
11383 ok(hdb != 0, "Expected a valid database handle\n");
11386 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
11389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11391 r = MsiViewExecute(hview, 0);
11394 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11397 r = MsiViewFetch(hview, &hrec);
11400 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11405 r = MsiRecordGetString(hrec, 1, buffer, &size);
11408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11409 ok(!lstrcmpA(buffer, "_Property"),
11410 "Expected \"_Property\", got \"%s\"\n", buffer);
11413 MsiCloseHandle(hrec);
11415 r = MsiViewFetch(hview, &hrec);
11418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11422 r = MsiRecordGetString(hrec, 1, buffer, &size);
11425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11426 ok(!lstrcmpA(buffer, "#_FolderCache"),
11427 "Expected \"_Property\", got \"%s\"\n", buffer);
11430 MsiCloseHandle(hrec);
11431 MsiViewClose(hview);
11432 MsiCloseHandle(hview);
11434 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
11437 ok(condition == MSICONDITION_FALSE,
11438 "Expected MSICONDITION_FALSE, got %d\n", condition);
11441 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
11444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11446 r = MsiViewExecute(hview, 0);
11449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11452 /* _Property table is not empty */
11453 r = MsiViewFetch(hview, &hrec);
11456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11459 MsiCloseHandle(hrec);
11460 MsiViewClose(hview);
11461 MsiCloseHandle(hview);
11463 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
11466 ok(condition == MSICONDITION_FALSE,
11467 "Expected MSICONDITION_FALSE, got %d\n", condition);
11470 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
11473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11475 r = MsiViewExecute(hview, 0);
11478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11481 /* #_FolderCache is not empty */
11482 r = MsiViewFetch(hview, &hrec);
11485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11488 MsiCloseHandle(hrec);
11489 MsiViewClose(hview);
11490 MsiCloseHandle(hview);
11492 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
11495 ok(r == ERROR_BAD_QUERY_SYNTAX,
11496 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11499 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
11502 ok(r == ERROR_BAD_QUERY_SYNTAX,
11503 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11506 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
11509 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
11510 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
11513 MsiCloseHandle(hsuminfo);
11515 r = MsiDatabaseCommit(hdb);
11518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11521 MsiCloseHandle(hdb);
11522 MsiCloseHandle(hpkg);
11525 static void test_MsiGetProductProperty(void)
11527 MSIHANDLE hprod, hdb;
11528 CHAR val[MAX_PATH];
11529 CHAR path[MAX_PATH];
11530 CHAR query[MAX_PATH];
11531 CHAR keypath[MAX_PATH*2];
11532 CHAR prodcode[MAX_PATH];
11533 CHAR prod_squashed[MAX_PATH];
11534 HKEY prodkey, userkey, props;
11540 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
11541 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
11543 win_skip("Different registry keys on Win9x and WinMe\n");
11546 CloseServiceHandle(scm);
11548 GetCurrentDirectoryA(MAX_PATH, path);
11549 lstrcatA(path, "\\");
11551 create_test_guid(prodcode, prod_squashed);
11553 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
11554 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11556 r = MsiDatabaseCommit(hdb);
11557 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11559 r = set_summary_info(hdb);
11560 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11563 "CREATE TABLE `Directory` ( "
11564 "`Directory` CHAR(255) NOT NULL, "
11565 "`Directory_Parent` CHAR(255), "
11566 "`DefaultDir` CHAR(255) NOT NULL "
11567 "PRIMARY KEY `Directory`)");
11568 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11571 "CREATE TABLE `Property` ( "
11572 "`Property` CHAR(72) NOT NULL, "
11573 "`Value` CHAR(255) "
11574 "PRIMARY KEY `Property`)");
11575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11577 sprintf(query, "INSERT INTO `Property` "
11578 "(`Property`, `Value`) "
11579 "VALUES( 'ProductCode', '%s' )", prodcode);
11580 r = run_query(hdb, query);
11581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11583 r = MsiDatabaseCommit(hdb);
11584 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11586 MsiCloseHandle(hdb);
11588 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
11589 lstrcatA(keypath, prod_squashed);
11591 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &prodkey);
11592 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11594 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
11595 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
11596 lstrcatA(keypath, prod_squashed);
11598 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &userkey);
11599 if (res == ERROR_ACCESS_DENIED)
11601 skip("Not enough rights to perform tests\n");
11602 RegDeleteKeyA(prodkey, "");
11603 RegCloseKey(prodkey);
11606 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11608 res = RegCreateKeyA(userkey, "InstallProperties", &props);
11609 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11611 lstrcpyA(val, path);
11612 lstrcatA(val, "\\");
11613 lstrcatA(val, msifile);
11614 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
11615 (const BYTE *)val, lstrlenA(val) + 1);
11616 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11618 hprod = 0xdeadbeef;
11619 r = MsiOpenProductA(prodcode, &hprod);
11620 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11621 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
11623 /* hProduct is invalid */
11625 lstrcpyA(val, "apple");
11626 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
11627 ok(r == ERROR_INVALID_HANDLE,
11628 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11629 ok(!lstrcmpA(val, "apple"),
11630 "Expected val to be unchanged, got \"%s\"\n", val);
11631 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11633 /* szProperty is NULL */
11635 lstrcpyA(val, "apple");
11636 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
11637 ok(r == ERROR_INVALID_PARAMETER,
11638 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11639 ok(!lstrcmpA(val, "apple"),
11640 "Expected val to be unchanged, got \"%s\"\n", val);
11641 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11643 /* szProperty is empty */
11645 lstrcpyA(val, "apple");
11646 r = MsiGetProductPropertyA(hprod, "", val, &size);
11647 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11648 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11649 ok(size == 0, "Expected 0, got %d\n", size);
11651 /* get the property */
11653 lstrcpyA(val, "apple");
11654 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11656 ok(!lstrcmpA(val, prodcode),
11657 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11658 ok(size == lstrlenA(prodcode),
11659 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11661 /* lpValueBuf is NULL */
11663 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
11664 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11665 ok(size == lstrlenA(prodcode),
11666 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11668 /* pcchValueBuf is NULL */
11669 lstrcpyA(val, "apple");
11670 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
11671 ok(r == ERROR_INVALID_PARAMETER,
11672 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11673 ok(!lstrcmpA(val, "apple"),
11674 "Expected val to be unchanged, got \"%s\"\n", val);
11675 ok(size == lstrlenA(prodcode),
11676 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11678 /* pcchValueBuf is too small */
11680 lstrcpyA(val, "apple");
11681 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11682 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11683 ok(!strncmp(val, prodcode, 3),
11684 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
11685 ok(size == lstrlenA(prodcode),
11686 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11688 /* pcchValueBuf does not leave room for NULL terminator */
11689 size = lstrlenA(prodcode);
11690 lstrcpyA(val, "apple");
11691 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11692 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11693 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
11694 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
11695 ok(size == lstrlenA(prodcode),
11696 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11698 /* pcchValueBuf has enough room for NULL terminator */
11699 size = lstrlenA(prodcode) + 1;
11700 lstrcpyA(val, "apple");
11701 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11702 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11703 ok(!lstrcmpA(val, prodcode),
11704 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11705 ok(size == lstrlenA(prodcode),
11706 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11708 /* nonexistent property */
11710 lstrcpyA(val, "apple");
11711 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
11712 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11713 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11714 ok(size == 0, "Expected 0, got %d\n", size);
11716 r = MsiSetPropertyA(hprod, "NewProperty", "value");
11717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11719 /* non-product property set */
11721 lstrcpyA(val, "apple");
11722 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
11723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11724 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11725 ok(size == 0, "Expected 0, got %d\n", size);
11727 r = MsiSetPropertyA(hprod, "ProductCode", "value");
11728 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11730 /* non-product property that is also a product property set */
11732 lstrcpyA(val, "apple");
11733 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11735 ok(!lstrcmpA(val, prodcode),
11736 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11737 ok(size == lstrlenA(prodcode),
11738 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11740 MsiCloseHandle(hprod);
11742 RegDeleteValueA(props, "LocalPackage");
11743 RegDeleteKeyA(props, "");
11744 RegCloseKey(props);
11745 RegDeleteKeyA(userkey, "");
11746 RegCloseKey(userkey);
11747 RegDeleteKeyA(prodkey, "");
11748 RegCloseKey(prodkey);
11749 DeleteFileA(msifile);
11752 static void test_MsiSetProperty(void)
11754 MSIHANDLE hpkg, hdb, hrec;
11755 CHAR buf[MAX_PATH];
11760 hpkg = package_from_db(create_package_db());
11761 ok(hpkg != 0, "Expected a valid package\n");
11763 /* invalid hInstall */
11764 r = MsiSetPropertyA(0, "Prop", "Val");
11765 ok(r == ERROR_INVALID_HANDLE,
11766 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11768 /* invalid hInstall */
11769 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
11770 ok(r == ERROR_INVALID_HANDLE,
11771 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11773 /* szName is NULL */
11774 r = MsiSetPropertyA(hpkg, NULL, "Val");
11775 ok(r == ERROR_INVALID_PARAMETER,
11776 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11778 /* both szName and szValue are NULL */
11779 r = MsiSetPropertyA(hpkg, NULL, NULL);
11780 ok(r == ERROR_INVALID_PARAMETER,
11781 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11783 /* szName is empty */
11784 r = MsiSetPropertyA(hpkg, "", "Val");
11785 ok(r == ERROR_FUNCTION_FAILED,
11786 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
11788 /* szName is empty and szValue is NULL */
11789 r = MsiSetPropertyA(hpkg, "", NULL);
11790 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11792 /* set a property */
11793 r = MsiSetPropertyA(hpkg, "Prop", "Val");
11794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11796 /* get the property */
11798 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11799 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11800 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
11801 ok(size == 3, "Expected 3, got %d\n", size);
11803 /* update the property */
11804 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
11805 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11807 /* get the property */
11809 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11811 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
11812 ok(size == 4, "Expected 4, got %d\n", size);
11814 hdb = MsiGetActiveDatabase(hpkg);
11815 ok(hdb != 0, "Expected a valid database handle\n");
11817 /* set prop is not in the _Property table */
11818 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
11819 r = do_query(hdb, query, &hrec);
11820 ok(r == ERROR_BAD_QUERY_SYNTAX,
11821 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11823 /* set prop is not in the Property table */
11824 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
11825 r = do_query(hdb, query, &hrec);
11826 ok(r == ERROR_BAD_QUERY_SYNTAX,
11827 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11829 MsiCloseHandle(hdb);
11831 /* szValue is an empty string */
11832 r = MsiSetPropertyA(hpkg, "Prop", "");
11833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11835 /* try to get the property */
11837 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11838 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11839 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11840 ok(size == 0, "Expected 0, got %d\n", size);
11842 /* reset the property */
11843 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
11844 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11846 /* delete the property */
11847 r = MsiSetPropertyA(hpkg, "Prop", NULL);
11848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11850 /* try to get the property */
11852 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11853 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11854 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11855 ok(size == 0, "Expected 0, got %d\n", size);
11857 MsiCloseHandle(hpkg);
11858 DeleteFileA(msifile);
11861 static void test_MsiApplyMultiplePatches(void)
11863 UINT r, type = GetDriveType(NULL);
11865 if (!pMsiApplyMultiplePatchesA) {
11866 win_skip("MsiApplyMultiplePatchesA not found\n");
11870 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
11871 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11873 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
11874 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11876 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
11879 if (type == DRIVE_FIXED)
11880 ok(r == ERROR_PATH_NOT_FOUND,
11881 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11883 ok(r == ERROR_INVALID_NAME,
11884 "Expected ERROR_INVALID_NAME, got %u\n", r);
11887 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
11890 if (type == DRIVE_FIXED)
11891 ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED,
11892 "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
11894 ok(r == ERROR_INVALID_NAME,
11895 "Expected ERROR_INVALID_NAME, got %u\n", r);
11898 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
11901 if (type == DRIVE_FIXED)
11902 ok(r == ERROR_PATH_NOT_FOUND,
11903 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11905 ok(r == ERROR_INVALID_NAME,
11906 "Expected ERROR_INVALID_NAME, got %u\n", r);
11909 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
11910 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11912 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
11915 if (type == DRIVE_FIXED)
11916 ok(r == ERROR_PATH_NOT_FOUND,
11917 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11919 ok(r == ERROR_INVALID_NAME,
11920 "Expected ERROR_INVALID_NAME, got %u\n", r);
11923 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
11924 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11926 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
11927 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11930 static void test_MsiApplyPatch(void)
11934 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
11935 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11937 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
11938 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11941 START_TEST(package)
11943 STATEMGRSTATUS status;
11946 init_functionpointers();
11948 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
11950 /* Create a restore point ourselves so we circumvent the multitude of restore points
11951 * that would have been created by all the installation and removal tests.
11953 if (pSRSetRestorePointA)
11955 memset(&status, 0, sizeof(status));
11956 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
11959 test_createpackage();
11961 test_gettargetpath_bad();
11962 test_settargetpath();
11964 test_property_table();
11967 test_formatrecord2();
11969 test_getproperty();
11970 test_removefiles();
11972 test_appsearch_complocator();
11973 test_appsearch_reglocator();
11974 test_appsearch_inilocator();
11975 test_appsearch_drlocator();
11976 test_featureparents();
11977 test_installprops();
11978 test_launchconditions();
11980 test_complocator();
11981 test_MsiGetSourcePath();
11982 test_shortlongsource();
11985 test_emptypackage();
11986 test_MsiGetProductProperty();
11987 test_MsiSetProperty();
11988 test_MsiApplyMultiplePatches();
11989 test_MsiApplyPatch();
11991 if (pSRSetRestorePointA && ret)
11993 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
11995 remove_restore_point(status.llSequenceNumber);