2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include <srrestoreptapi.h>
31 #include "wine/test.h"
33 static const char msifile[] = "winetest.msi";
34 char CURR_DIR[MAX_PATH];
36 static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
38 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
40 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
41 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
43 static void init_functionpointers(void)
45 HMODULE hmsi = GetModuleHandleA("msi.dll");
46 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
49 #define GET_PROC(mod, func) \
50 p ## func = (void*)GetProcAddress(mod, #func);
52 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
54 GET_PROC(hadvapi32, ConvertSidToStringSidA);
56 hsrclient = LoadLibraryA("srclient.dll");
57 GET_PROC(hsrclient, SRRemoveRestorePoint);
58 GET_PROC(hsrclient, SRSetRestorePointA);
63 static LPSTR get_user_sid(LPSTR *usersid)
70 if (!pConvertSidToStringSidA)
72 win_skip("ConvertSidToStringSidA is not available\n");
77 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
79 GetTokenInformation(token, TokenUser, buf, size, &size);
80 user = (PTOKEN_USER)buf;
81 pConvertSidToStringSidA(user->User.Sid, usersid);
82 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
87 /* RegDeleteTreeW from dlls/advapi32/registry.c */
88 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
91 DWORD dwMaxSubkeyLen, dwMaxValueLen;
92 DWORD dwMaxLen, dwSize;
93 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
98 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
102 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
103 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
104 if (ret) goto cleanup;
108 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
109 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
111 /* Name too big: alloc a buffer for it */
112 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
114 ret = ERROR_NOT_ENOUGH_MEMORY;
119 /* Recursively delete all the subkeys */
123 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
124 NULL, NULL, NULL)) break;
126 ret = package_RegDeleteTreeW(hSubKey, lpszName);
127 if (ret) goto cleanup;
131 ret = RegDeleteKeyW(hKey, lpszSubKey);
136 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
137 NULL, NULL, NULL, NULL)) break;
139 ret = RegDeleteValueW(hKey, lpszName);
140 if (ret) goto cleanup;
144 if (lpszName != szNameBuf)
145 HeapFree(GetProcessHeap(), 0, lpszName);
147 RegCloseKey(hSubKey);
151 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
156 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
170 out[17+i*2] = in[n++];
171 out[16+i*2] = in[n++];
176 out[17+i*2] = in[n++];
177 out[16+i*2] = in[n++];
183 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
185 WCHAR guidW[MAX_PATH];
186 WCHAR squashedW[MAX_PATH];
191 hr = CoCreateGuid(&guid);
192 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
194 size = StringFromGUID2(&guid, guidW, MAX_PATH);
195 ok(size == 39, "Expected 39, got %d\n", hr);
197 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
198 squash_guid(guidW, squashedW);
199 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
202 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
203 LPCSTR guid, LPSTR usersid, BOOL dir)
205 WCHAR guidW[MAX_PATH];
206 WCHAR squashedW[MAX_PATH];
207 CHAR squashed[MAX_PATH];
208 CHAR comppath[MAX_PATH];
209 CHAR prodpath[MAX_PATH];
214 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
215 squash_guid(guidW, squashedW);
216 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
218 if (context == MSIINSTALLCONTEXT_MACHINE)
220 prod = "3D0DAE300FACA1300AD792060BCDAA92";
222 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
223 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
225 "SOFTWARE\\Classes\\Installer\\"
226 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
228 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
230 prod = "7D2F387510109040002000060BECB6AB";
232 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
233 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
235 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
236 "Installer\\%s\\Installer\\Products\\"
237 "7D2F387510109040002000060BECB6AB", usersid);
239 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
241 prod = "7D2F387510109040002000060BECB6AB";
243 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
244 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
246 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
247 "Installer\\Managed\\%s\\Installer\\Products\\"
248 "7D2F387510109040002000060BECB6AB", usersid);
251 RegCreateKeyA(HKEY_LOCAL_MACHINE, comppath, &hkey);
253 lstrcpyA(path, CURR_DIR);
254 lstrcatA(path, "\\");
255 if (!dir) lstrcatA(path, filename);
257 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
260 RegCreateKeyA(HKEY_LOCAL_MACHINE, prodpath, &hkey);
264 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
266 WCHAR guidW[MAX_PATH];
267 WCHAR squashedW[MAX_PATH];
268 WCHAR substrW[MAX_PATH];
269 CHAR squashed[MAX_PATH];
270 CHAR comppath[MAX_PATH];
271 CHAR prodpath[MAX_PATH];
273 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
274 squash_guid(guidW, squashedW);
275 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
277 if (context == MSIINSTALLCONTEXT_MACHINE)
280 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
281 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
283 "SOFTWARE\\Classes\\Installer\\"
284 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
286 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
289 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
290 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
292 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
293 "Installer\\%s\\Installer\\Products\\"
294 "7D2F387510109040002000060BECB6AB", usersid);
296 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
299 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
300 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
302 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
303 "Installer\\Managed\\%s\\Installer\\Products\\"
304 "7D2F387510109040002000060BECB6AB", usersid);
307 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
308 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
310 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
311 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
314 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
319 /* open a select query */
320 r = MsiDatabaseOpenView(hdb, query, &hview);
321 if (r != ERROR_SUCCESS)
323 r = MsiViewExecute(hview, 0);
324 if (r != ERROR_SUCCESS)
326 ret = MsiViewFetch(hview, phrec);
327 r = MsiViewClose(hview);
328 if (r != ERROR_SUCCESS)
330 r = MsiCloseHandle(hview);
331 if (r != ERROR_SUCCESS)
336 static UINT run_query( MSIHANDLE hdb, const char *query )
341 r = MsiDatabaseOpenView(hdb, query, &hview);
342 if( r != ERROR_SUCCESS )
345 r = MsiViewExecute(hview, 0);
346 if( r == ERROR_SUCCESS )
347 r = MsiViewClose(hview);
348 MsiCloseHandle(hview);
352 static UINT create_component_table( MSIHANDLE hdb )
354 return run_query( hdb,
355 "CREATE TABLE `Component` ( "
356 "`Component` CHAR(72) NOT NULL, "
357 "`ComponentId` CHAR(38), "
358 "`Directory_` CHAR(72) NOT NULL, "
359 "`Attributes` SHORT NOT NULL, "
360 "`Condition` CHAR(255), "
361 "`KeyPath` CHAR(72) "
362 "PRIMARY KEY `Component`)" );
365 static UINT create_feature_table( MSIHANDLE hdb )
367 return run_query( hdb,
368 "CREATE TABLE `Feature` ( "
369 "`Feature` CHAR(38) NOT NULL, "
370 "`Feature_Parent` CHAR(38), "
372 "`Description` CHAR(255), "
373 "`Display` SHORT NOT NULL, "
374 "`Level` SHORT NOT NULL, "
375 "`Directory_` CHAR(72), "
376 "`Attributes` SHORT NOT NULL "
377 "PRIMARY KEY `Feature`)" );
380 static UINT create_feature_components_table( MSIHANDLE hdb )
382 return run_query( hdb,
383 "CREATE TABLE `FeatureComponents` ( "
384 "`Feature_` CHAR(38) NOT NULL, "
385 "`Component_` CHAR(72) NOT NULL "
386 "PRIMARY KEY `Feature_`, `Component_` )" );
389 static UINT create_file_table( MSIHANDLE hdb )
391 return run_query( hdb,
392 "CREATE TABLE `File` ("
393 "`File` CHAR(72) NOT NULL, "
394 "`Component_` CHAR(72) NOT NULL, "
395 "`FileName` CHAR(255) NOT NULL, "
396 "`FileSize` LONG NOT NULL, "
397 "`Version` CHAR(72), "
398 "`Language` CHAR(20), "
399 "`Attributes` SHORT, "
400 "`Sequence` SHORT NOT NULL "
401 "PRIMARY KEY `File`)" );
404 static UINT create_remove_file_table( MSIHANDLE hdb )
406 return run_query( hdb,
407 "CREATE TABLE `RemoveFile` ("
408 "`FileKey` CHAR(72) NOT NULL, "
409 "`Component_` CHAR(72) NOT NULL, "
410 "`FileName` CHAR(255) LOCALIZABLE, "
411 "`DirProperty` CHAR(72) NOT NULL, "
412 "`InstallMode` SHORT NOT NULL "
413 "PRIMARY KEY `FileKey`)" );
416 static UINT create_appsearch_table( MSIHANDLE hdb )
418 return run_query( hdb,
419 "CREATE TABLE `AppSearch` ("
420 "`Property` CHAR(72) NOT NULL, "
421 "`Signature_` CHAR(72) NOT NULL "
422 "PRIMARY KEY `Property`, `Signature_`)" );
425 static UINT create_reglocator_table( MSIHANDLE hdb )
427 return run_query( hdb,
428 "CREATE TABLE `RegLocator` ("
429 "`Signature_` CHAR(72) NOT NULL, "
430 "`Root` SHORT NOT NULL, "
431 "`Key` CHAR(255) NOT NULL, "
434 "PRIMARY KEY `Signature_`)" );
437 static UINT create_signature_table( MSIHANDLE hdb )
439 return run_query( hdb,
440 "CREATE TABLE `Signature` ("
441 "`Signature` CHAR(72) NOT NULL, "
442 "`FileName` CHAR(255) NOT NULL, "
443 "`MinVersion` CHAR(20), "
444 "`MaxVersion` CHAR(20), "
449 "`Languages` CHAR(255) "
450 "PRIMARY KEY `Signature`)" );
453 static UINT create_launchcondition_table( MSIHANDLE hdb )
455 return run_query( hdb,
456 "CREATE TABLE `LaunchCondition` ("
457 "`Condition` CHAR(255) NOT NULL, "
458 "`Description` CHAR(255) NOT NULL "
459 "PRIMARY KEY `Condition`)" );
462 static UINT create_property_table( MSIHANDLE hdb )
464 return run_query( hdb,
465 "CREATE TABLE `Property` ("
466 "`Property` CHAR(72) NOT NULL, "
468 "PRIMARY KEY `Property`)" );
471 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
473 return run_query( hdb,
474 "CREATE TABLE `InstallExecuteSequence` ("
475 "`Action` CHAR(72) NOT NULL, "
476 "`Condition` CHAR(255), "
478 "PRIMARY KEY `Action`)" );
481 static UINT create_media_table( MSIHANDLE hdb )
483 return run_query( hdb,
484 "CREATE TABLE `Media` ("
485 "`DiskId` SHORT NOT NULL, "
486 "`LastSequence` SHORT NOT NULL, "
487 "`DiskPrompt` CHAR(64), "
488 "`Cabinet` CHAR(255), "
489 "`VolumeLabel` CHAR(32), "
491 "PRIMARY KEY `DiskId`)" );
494 static UINT create_ccpsearch_table( MSIHANDLE hdb )
496 return run_query( hdb,
497 "CREATE TABLE `CCPSearch` ("
498 "`Signature_` CHAR(72) NOT NULL "
499 "PRIMARY KEY `Signature_`)" );
502 static UINT create_drlocator_table( MSIHANDLE hdb )
504 return run_query( hdb,
505 "CREATE TABLE `DrLocator` ("
506 "`Signature_` CHAR(72) NOT NULL, "
507 "`Parent` CHAR(72), "
510 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
513 static UINT create_complocator_table( MSIHANDLE hdb )
515 return run_query( hdb,
516 "CREATE TABLE `CompLocator` ("
517 "`Signature_` CHAR(72) NOT NULL, "
518 "`ComponentId` CHAR(38) NOT NULL, "
520 "PRIMARY KEY `Signature_`)" );
523 static UINT create_inilocator_table( MSIHANDLE hdb )
525 return run_query( hdb,
526 "CREATE TABLE `IniLocator` ("
527 "`Signature_` CHAR(72) NOT NULL, "
528 "`FileName` CHAR(255) NOT NULL, "
529 "`Section` CHAR(96)NOT NULL, "
530 "`Key` CHAR(128)NOT NULL, "
533 "PRIMARY KEY `Signature_`)" );
536 #define make_add_entry(type, qtext) \
537 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
539 char insert[] = qtext; \
542 sz = strlen(values) + sizeof insert; \
543 query = HeapAlloc(GetProcessHeap(),0,sz); \
544 sprintf(query,insert,values); \
545 r = run_query( hdb, query ); \
546 HeapFree(GetProcessHeap(), 0, query); \
550 make_add_entry(component,
551 "INSERT INTO `Component` "
552 "(`Component`, `ComponentId`, `Directory_`, "
553 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
555 make_add_entry(directory,
556 "INSERT INTO `Directory` "
557 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
559 make_add_entry(feature,
560 "INSERT INTO `Feature` "
561 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
562 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
564 make_add_entry(feature_components,
565 "INSERT INTO `FeatureComponents` "
566 "(`Feature_`, `Component_`) VALUES( %s )")
569 "INSERT INTO `File` "
570 "(`File`, `Component_`, `FileName`, `FileSize`, "
571 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
573 make_add_entry(appsearch,
574 "INSERT INTO `AppSearch` "
575 "(`Property`, `Signature_`) VALUES( %s )")
577 make_add_entry(reglocator,
578 "INSERT INTO `RegLocator` "
579 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES( %s )")
581 make_add_entry(signature,
582 "INSERT INTO `Signature` "
583 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
584 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
587 make_add_entry(launchcondition,
588 "INSERT INTO `LaunchCondition` "
589 "(`Condition`, `Description`) VALUES( %s )")
591 make_add_entry(property,
592 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
594 make_add_entry(install_execute_sequence,
595 "INSERT INTO `InstallExecuteSequence` "
596 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
598 make_add_entry(media,
599 "INSERT INTO `Media` "
600 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
601 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
603 make_add_entry(ccpsearch,
604 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
606 make_add_entry(drlocator,
607 "INSERT INTO `DrLocator` "
608 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
610 make_add_entry(complocator,
611 "INSERT INTO `CompLocator` "
612 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
614 make_add_entry(inilocator,
615 "INSERT INTO `IniLocator` "
616 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
619 static UINT set_summary_info(MSIHANDLE hdb)
624 /* build summary info */
625 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
626 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
628 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
629 "Installation Database");
630 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
632 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
633 "Installation Database");
634 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
636 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
638 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
640 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
642 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
644 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
645 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
646 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
648 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
649 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
651 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
652 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
654 res = MsiSummaryInfoPersist(suminfo);
655 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
657 res = MsiCloseHandle( suminfo);
658 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
664 static MSIHANDLE create_package_db(void)
671 /* create an empty database */
672 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
673 ok( res == ERROR_SUCCESS , "Failed to create database\n" );
674 if( res != ERROR_SUCCESS )
677 res = MsiDatabaseCommit( hdb );
678 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
680 res = set_summary_info(hdb);
682 res = run_query( hdb,
683 "CREATE TABLE `Directory` ( "
684 "`Directory` CHAR(255) NOT NULL, "
685 "`Directory_Parent` CHAR(255), "
686 "`DefaultDir` CHAR(255) NOT NULL "
687 "PRIMARY KEY `Directory`)" );
688 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
693 static MSIHANDLE package_from_db(MSIHANDLE hdb)
699 sprintf(szPackage,"#%i",hdb);
700 res = MsiOpenPackage(szPackage,&hPackage);
701 if (res != ERROR_SUCCESS)
704 res = MsiCloseHandle(hdb);
705 if (res != ERROR_SUCCESS)
711 static void create_test_file(const CHAR *name)
716 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
717 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
718 WriteFile(file, name, strlen(name), &written, NULL);
719 WriteFile(file, "\n", strlen("\n"), &written, NULL);
723 typedef struct _tagVS_VERSIONINFO
730 VS_FIXEDFILEINFO Value;
735 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
736 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
738 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
740 VS_VERSIONINFO *pVerInfo;
741 VS_FIXEDFILEINFO *pFixedInfo;
748 GetSystemDirectory(path, MAX_PATH);
749 /* Some dlls can't be updated on Vista/W2K8 */
750 lstrcatA(path, "\\version.dll");
752 CopyFileA(path, name, FALSE);
754 size = GetFileVersionInfoSize(path, &handle);
755 buffer = HeapAlloc(GetProcessHeap(), 0, size);
757 GetFileVersionInfoA(path, 0, size, buffer);
759 pVerInfo = (VS_VERSIONINFO *)buffer;
760 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
761 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
763 pFixedInfo->dwFileVersionMS = ms;
764 pFixedInfo->dwFileVersionLS = ls;
765 pFixedInfo->dwProductVersionMS = ms;
766 pFixedInfo->dwProductVersionLS = ls;
768 resource = BeginUpdateResource(name, FALSE);
772 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
773 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
776 if (!EndUpdateResource(resource, FALSE))
782 HeapFree(GetProcessHeap(), 0, buffer);
786 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
788 RESTOREPOINTINFOA spec;
790 spec.dwEventType = event_type;
791 spec.dwRestorePtType = APPLICATION_INSTALL;
792 spec.llSequenceNumber = status->llSequenceNumber;
793 lstrcpyA(spec.szDescription, "msitest restore point");
795 return pSRSetRestorePointA(&spec, status);
798 static void remove_restore_point(DWORD seq_number)
802 res = pSRRemoveRestorePoint(seq_number);
803 if (res != ERROR_SUCCESS)
804 trace("Failed to remove the restore point : %08x\n", res);
807 static void test_createpackage(void)
809 MSIHANDLE hPackage = 0;
812 hPackage = package_from_db(create_package_db());
813 ok( hPackage != 0, " Failed to create package\n");
815 res = MsiCloseHandle( hPackage);
816 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
820 static void test_doaction( void )
825 r = MsiDoAction( -1, NULL );
826 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
828 hpkg = package_from_db(create_package_db());
829 ok( hpkg, "failed to create package\n");
831 r = MsiDoAction(hpkg, NULL);
832 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
834 r = MsiDoAction(0, "boo");
835 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
837 r = MsiDoAction(hpkg, "boo");
838 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
840 MsiCloseHandle( hpkg );
844 static void test_gettargetpath_bad(void)
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 MsiCloseHandle( hpkg );
1053 static void test_condition(void)
1058 hpkg = package_from_db(create_package_db());
1059 ok( hpkg, "failed to create package\n");
1061 r = MsiEvaluateCondition(0, NULL);
1062 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1064 r = MsiEvaluateCondition(hpkg, NULL);
1065 ok( r == MSICONDITION_NONE, "wrong return val\n");
1067 r = MsiEvaluateCondition(hpkg, "");
1068 ok( r == MSICONDITION_NONE, "wrong return val\n");
1070 r = MsiEvaluateCondition(hpkg, "1");
1071 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1073 r = MsiEvaluateCondition(hpkg, "0");
1074 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1076 r = MsiEvaluateCondition(hpkg, "-1");
1077 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1079 r = MsiEvaluateCondition(hpkg, "0 = 0");
1080 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1082 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1083 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1085 r = MsiEvaluateCondition(hpkg, "0 = 1");
1086 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1088 r = MsiEvaluateCondition(hpkg, "0 > 1");
1089 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1091 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1092 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1094 r = MsiEvaluateCondition(hpkg, "1 > 1");
1095 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1097 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1098 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1100 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1101 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1103 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1104 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1106 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1107 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1109 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1110 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1112 r = MsiEvaluateCondition(hpkg, "0 < 1");
1113 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1115 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1116 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1118 r = MsiEvaluateCondition(hpkg, "1 < 1");
1119 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1121 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1122 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1124 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1125 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1127 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1128 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1130 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1131 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1133 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1134 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1136 r = MsiEvaluateCondition(hpkg, "0 >=");
1137 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1139 r = MsiEvaluateCondition(hpkg, " ");
1140 ok( r == MSICONDITION_NONE, "wrong return val\n");
1142 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1143 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1145 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1146 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1148 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1149 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1151 r = MsiEvaluateCondition(hpkg, "not 0");
1152 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1154 r = MsiEvaluateCondition(hpkg, "not LicView");
1155 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1157 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1158 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1160 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1161 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1163 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1164 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1166 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1167 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1169 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1170 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1172 r = MsiEvaluateCondition(hpkg, "\"0\"");
1173 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1175 r = MsiEvaluateCondition(hpkg, "1 and 2");
1176 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1178 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1179 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1181 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1182 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1184 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1185 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1187 r = MsiEvaluateCondition(hpkg, "(0)");
1188 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1190 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1191 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1193 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1194 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1196 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1197 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1199 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1200 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1202 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1203 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1205 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1206 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1208 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1209 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1211 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1212 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1214 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1215 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1217 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1218 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1220 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1221 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1223 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1224 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1226 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1227 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1229 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1230 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1232 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1233 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1235 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1236 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1238 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1239 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1241 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1242 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1244 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1245 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1247 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1248 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1250 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1251 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1253 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1254 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1256 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1257 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1259 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1260 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1262 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1263 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1265 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1266 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1268 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1269 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1271 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1272 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1274 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1275 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1277 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1278 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1280 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1281 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1283 MsiSetProperty(hpkg, "mm", "5" );
1285 r = MsiEvaluateCondition(hpkg, "mm = 5");
1286 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1288 r = MsiEvaluateCondition(hpkg, "mm < 6");
1289 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1291 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1292 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1294 r = MsiEvaluateCondition(hpkg, "mm > 4");
1295 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1297 r = MsiEvaluateCondition(hpkg, "mm < 12");
1298 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1300 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1301 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1303 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1304 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1306 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1307 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1309 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1310 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1312 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1313 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1315 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1316 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1318 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1319 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1321 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1322 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1324 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1325 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1327 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1328 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1330 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1331 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1333 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1334 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1336 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1337 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1339 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1340 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1342 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1343 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1345 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1346 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1348 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1349 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1351 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1352 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1354 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1355 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1357 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1358 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1360 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1361 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1363 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1364 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1366 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1367 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1369 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1370 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1372 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1373 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1375 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1376 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1378 MsiSetProperty(hpkg, "bandalmael", "0" );
1379 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1380 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1382 MsiSetProperty(hpkg, "bandalmael", "" );
1383 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1384 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1386 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1387 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1388 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1390 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1391 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1392 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1394 MsiSetProperty(hpkg, "bandalmael", "0 " );
1395 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1396 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1398 MsiSetProperty(hpkg, "bandalmael", "-0" );
1399 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1400 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1402 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1403 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1404 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1406 MsiSetProperty(hpkg, "bandalmael", "--0" );
1407 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1408 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1410 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1411 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1412 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1414 MsiSetProperty(hpkg, "bandalmael", "-" );
1415 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1416 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1418 MsiSetProperty(hpkg, "bandalmael", "+0" );
1419 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1420 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1422 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1423 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1424 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1425 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1426 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1428 MsiSetProperty(hpkg, "one", "hi");
1429 MsiSetProperty(hpkg, "two", "hithere");
1430 r = MsiEvaluateCondition(hpkg, "one >< two");
1431 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1433 MsiSetProperty(hpkg, "one", "hithere");
1434 MsiSetProperty(hpkg, "two", "hi");
1435 r = MsiEvaluateCondition(hpkg, "one >< two");
1436 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1438 MsiSetProperty(hpkg, "one", "hello");
1439 MsiSetProperty(hpkg, "two", "hi");
1440 r = MsiEvaluateCondition(hpkg, "one >< two");
1441 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1443 MsiSetProperty(hpkg, "one", "hellohithere");
1444 MsiSetProperty(hpkg, "two", "hi");
1445 r = MsiEvaluateCondition(hpkg, "one >< two");
1446 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1448 MsiSetProperty(hpkg, "one", "");
1449 MsiSetProperty(hpkg, "two", "hi");
1450 r = MsiEvaluateCondition(hpkg, "one >< two");
1451 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1453 MsiSetProperty(hpkg, "one", "hi");
1454 MsiSetProperty(hpkg, "two", "");
1455 r = MsiEvaluateCondition(hpkg, "one >< two");
1456 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1458 MsiSetProperty(hpkg, "one", "");
1459 MsiSetProperty(hpkg, "two", "");
1460 r = MsiEvaluateCondition(hpkg, "one >< two");
1461 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1463 MsiSetProperty(hpkg, "one", "1234");
1464 MsiSetProperty(hpkg, "two", "1");
1465 r = MsiEvaluateCondition(hpkg, "one >< two");
1466 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1468 MsiSetProperty(hpkg, "one", "one 1234");
1469 MsiSetProperty(hpkg, "two", "1");
1470 r = MsiEvaluateCondition(hpkg, "one >< two");
1471 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1473 MsiSetProperty(hpkg, "one", "hithere");
1474 MsiSetProperty(hpkg, "two", "hi");
1475 r = MsiEvaluateCondition(hpkg, "one << two");
1476 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1478 MsiSetProperty(hpkg, "one", "hi");
1479 MsiSetProperty(hpkg, "two", "hithere");
1480 r = MsiEvaluateCondition(hpkg, "one << two");
1481 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1483 MsiSetProperty(hpkg, "one", "hi");
1484 MsiSetProperty(hpkg, "two", "hi");
1485 r = MsiEvaluateCondition(hpkg, "one << two");
1486 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1488 MsiSetProperty(hpkg, "one", "abcdhithere");
1489 MsiSetProperty(hpkg, "two", "hi");
1490 r = MsiEvaluateCondition(hpkg, "one << two");
1491 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1493 MsiSetProperty(hpkg, "one", "");
1494 MsiSetProperty(hpkg, "two", "hi");
1495 r = MsiEvaluateCondition(hpkg, "one << two");
1496 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1498 MsiSetProperty(hpkg, "one", "hithere");
1499 MsiSetProperty(hpkg, "two", "");
1500 r = MsiEvaluateCondition(hpkg, "one << two");
1501 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1503 MsiSetProperty(hpkg, "one", "");
1504 MsiSetProperty(hpkg, "two", "");
1505 r = MsiEvaluateCondition(hpkg, "one << two");
1506 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1508 MsiSetProperty(hpkg, "one", "1234");
1509 MsiSetProperty(hpkg, "two", "1");
1510 r = MsiEvaluateCondition(hpkg, "one << two");
1511 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1513 MsiSetProperty(hpkg, "one", "1234 one");
1514 MsiSetProperty(hpkg, "two", "1");
1515 r = MsiEvaluateCondition(hpkg, "one << two");
1516 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1518 MsiSetProperty(hpkg, "one", "hithere");
1519 MsiSetProperty(hpkg, "two", "there");
1520 r = MsiEvaluateCondition(hpkg, "one >> two");
1521 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1523 MsiSetProperty(hpkg, "one", "hithere");
1524 MsiSetProperty(hpkg, "two", "hi");
1525 r = MsiEvaluateCondition(hpkg, "one >> two");
1526 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1528 MsiSetProperty(hpkg, "one", "there");
1529 MsiSetProperty(hpkg, "two", "hithere");
1530 r = MsiEvaluateCondition(hpkg, "one >> two");
1531 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1533 MsiSetProperty(hpkg, "one", "there");
1534 MsiSetProperty(hpkg, "two", "there");
1535 r = MsiEvaluateCondition(hpkg, "one >> two");
1536 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1538 MsiSetProperty(hpkg, "one", "abcdhithere");
1539 MsiSetProperty(hpkg, "two", "hi");
1540 r = MsiEvaluateCondition(hpkg, "one >> two");
1541 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1543 MsiSetProperty(hpkg, "one", "");
1544 MsiSetProperty(hpkg, "two", "there");
1545 r = MsiEvaluateCondition(hpkg, "one >> two");
1546 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1548 MsiSetProperty(hpkg, "one", "there");
1549 MsiSetProperty(hpkg, "two", "");
1550 r = MsiEvaluateCondition(hpkg, "one >> two");
1551 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1553 MsiSetProperty(hpkg, "one", "");
1554 MsiSetProperty(hpkg, "two", "");
1555 r = MsiEvaluateCondition(hpkg, "one >> two");
1556 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1558 MsiSetProperty(hpkg, "one", "1234");
1559 MsiSetProperty(hpkg, "two", "4");
1560 r = MsiEvaluateCondition(hpkg, "one >> two");
1561 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1563 MsiSetProperty(hpkg, "one", "one 1234");
1564 MsiSetProperty(hpkg, "two", "4");
1565 r = MsiEvaluateCondition(hpkg, "one >> two");
1566 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1568 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1570 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1571 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1573 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1574 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1576 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1577 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1579 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1580 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1582 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1583 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1585 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1586 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1588 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1589 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1591 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1592 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1594 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1595 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1597 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1598 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1600 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1601 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1603 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1604 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1606 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1607 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1609 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1610 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1612 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1613 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1615 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1616 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1618 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1619 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1621 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1622 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1624 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1625 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1627 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1628 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1630 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1631 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1633 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1634 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1636 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1637 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1639 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1640 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1642 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1643 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1645 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1646 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1648 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1649 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1651 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1652 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1654 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1655 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1657 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1658 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1660 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1661 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1663 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1664 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1666 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1667 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1669 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1670 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1672 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1673 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1675 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1676 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1678 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1679 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1681 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1682 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1683 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1685 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1686 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1688 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1689 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1691 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1692 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1694 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1695 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1697 MsiSetProperty(hpkg, "one", "1");
1698 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1699 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1701 MsiSetProperty(hpkg, "X", "5.0");
1703 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1704 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1706 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1707 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1709 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1710 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1712 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1713 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1715 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1716 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1718 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1719 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1721 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1722 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1724 /* feature doesn't exist */
1725 r = MsiEvaluateCondition(hpkg, "&nofeature");
1726 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1728 MsiSetProperty(hpkg, "A", "2");
1729 MsiSetProperty(hpkg, "X", "50");
1731 r = MsiEvaluateCondition(hpkg, "2 <= X");
1732 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1734 r = MsiEvaluateCondition(hpkg, "A <= X");
1735 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1737 r = MsiEvaluateCondition(hpkg, "A <= 50");
1738 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1740 MsiSetProperty(hpkg, "X", "50val");
1742 r = MsiEvaluateCondition(hpkg, "2 <= X");
1743 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1745 r = MsiEvaluateCondition(hpkg, "A <= X");
1746 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1748 MsiSetProperty(hpkg, "A", "7");
1749 MsiSetProperty(hpkg, "X", "50");
1751 r = MsiEvaluateCondition(hpkg, "7 <= X");
1752 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1754 r = MsiEvaluateCondition(hpkg, "A <= X");
1755 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1757 r = MsiEvaluateCondition(hpkg, "A <= 50");
1758 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1760 MsiSetProperty(hpkg, "X", "50val");
1762 r = MsiEvaluateCondition(hpkg, "2 <= X");
1763 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1765 r = MsiEvaluateCondition(hpkg, "A <= X");
1766 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1768 MsiCloseHandle( hpkg );
1769 DeleteFile(msifile);
1772 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1780 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1781 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1784 static void test_props(void)
1786 MSIHANDLE hpkg, hdb;
1791 hdb = create_package_db();
1793 "CREATE TABLE `Property` ( "
1794 "`Property` CHAR(255) NOT NULL, "
1795 "`Value` CHAR(255) "
1796 "PRIMARY KEY `Property`)" );
1797 ok( r == ERROR_SUCCESS , "Failed\n" );
1800 "INSERT INTO `Property` "
1801 "(`Property`, `Value`) "
1802 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1803 ok( r == ERROR_SUCCESS , "Failed\n" );
1805 hpkg = package_from_db( hdb );
1806 ok( hpkg, "failed to create package\n");
1808 /* test invalid values */
1809 r = MsiGetProperty( 0, NULL, NULL, NULL );
1810 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1812 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1813 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1815 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1816 ok( r == ERROR_SUCCESS, "wrong return val\n");
1818 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1819 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1821 /* test retrieving an empty/nonexistent property */
1823 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1824 ok( r == ERROR_SUCCESS, "wrong return val\n");
1825 ok( sz == 0, "wrong size returned\n");
1827 check_prop_empty( hpkg, "boo");
1830 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1831 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1832 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1833 ok( sz == 0, "wrong size returned\n");
1837 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1838 ok( r == ERROR_SUCCESS, "wrong return val\n");
1839 ok( buffer[0] == 0, "buffer was not changed\n");
1840 ok( sz == 0, "wrong size returned\n");
1842 /* set the property to something */
1843 r = MsiSetProperty( 0, NULL, NULL );
1844 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1846 r = MsiSetProperty( hpkg, NULL, NULL );
1847 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1849 r = MsiSetProperty( hpkg, "", NULL );
1850 ok( r == ERROR_SUCCESS, "wrong return val\n");
1852 /* try set and get some illegal property identifiers */
1853 r = MsiSetProperty( hpkg, "", "asdf" );
1854 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1856 r = MsiSetProperty( hpkg, "=", "asdf" );
1857 ok( r == ERROR_SUCCESS, "wrong return val\n");
1859 r = MsiSetProperty( hpkg, " ", "asdf" );
1860 ok( r == ERROR_SUCCESS, "wrong return val\n");
1862 r = MsiSetProperty( hpkg, "'", "asdf" );
1863 ok( r == ERROR_SUCCESS, "wrong return val\n");
1867 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1868 ok( r == ERROR_SUCCESS, "wrong return val\n");
1869 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1871 /* set empty values */
1872 r = MsiSetProperty( hpkg, "boo", NULL );
1873 ok( r == ERROR_SUCCESS, "wrong return val\n");
1874 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1876 r = MsiSetProperty( hpkg, "boo", "" );
1877 ok( r == ERROR_SUCCESS, "wrong return val\n");
1878 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1880 /* set a non-empty value */
1881 r = MsiSetProperty( hpkg, "boo", "xyz" );
1882 ok( r == ERROR_SUCCESS, "wrong return val\n");
1886 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1887 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1888 ok( buffer[0] == 0, "buffer was not changed\n");
1889 ok( sz == 3, "wrong size returned\n");
1893 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1894 ok( r == ERROR_SUCCESS, "wrong return val\n");
1895 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1896 ok( sz == 3, "wrong size returned\n");
1900 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1901 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1902 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1903 ok( sz == 3, "wrong size returned\n");
1905 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1906 ok( r == ERROR_SUCCESS, "wrong return val\n");
1909 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1910 ok( r == ERROR_SUCCESS, "wrong return val\n");
1911 ok( !strcmp(buffer,""), "buffer wrong\n");
1912 ok( sz == 0, "wrong size returned\n");
1915 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1916 ok( r == ERROR_SUCCESS, "wrong return val\n");
1917 ok( !strcmp(buffer,""), "buffer wrong\n");
1918 ok( sz == 0, "wrong size returned\n");
1921 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1922 ok( r == ERROR_SUCCESS, "wrong return val\n");
1923 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1924 ok( sz == 3, "wrong size returned\n");
1926 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1927 ok( r == ERROR_SUCCESS, "wrong return val\n");
1930 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1931 ok( r == ERROR_SUCCESS, "return wrong\n");
1932 ok( sz == 13, "size wrong (%d)\n", sz);
1935 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1936 ok( r == ERROR_MORE_DATA, "return wrong\n");
1937 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1939 r = MsiSetProperty(hpkg, "property", "value");
1940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1943 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1944 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1945 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1947 r = MsiSetProperty(hpkg, "property", NULL);
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( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1955 MsiCloseHandle( hpkg );
1956 DeleteFile(msifile);
1959 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1961 MSIHANDLE hview, hrec;
1963 CHAR buffer[MAX_PATH];
1967 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1968 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1969 r = MsiViewExecute(hview, 0);
1970 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1973 while (r == ERROR_SUCCESS && !found)
1975 r = MsiViewFetch(hview, &hrec);
1976 if (r != ERROR_SUCCESS) break;
1979 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1980 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1983 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1984 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1988 MsiCloseHandle(hrec);
1991 MsiViewClose(hview);
1992 MsiCloseHandle(hview);
1997 static void test_property_table(void)
2001 MSIHANDLE hpkg, hdb, hrec;
2002 char buffer[MAX_PATH];
2006 hdb = create_package_db();
2007 ok( hdb, "failed to create package\n");
2009 hpkg = package_from_db(hdb);
2010 ok( hpkg, "failed to create package\n");
2012 MsiCloseHandle(hdb);
2014 hdb = MsiGetActiveDatabase(hpkg);
2016 query = "CREATE TABLE `_Property` ( "
2017 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2018 r = run_query(hdb, query);
2019 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2021 MsiCloseHandle(hdb);
2022 MsiCloseHandle(hpkg);
2023 DeleteFile(msifile);
2025 hdb = create_package_db();
2026 ok( hdb, "failed to create package\n");
2028 query = "CREATE TABLE `_Property` ( "
2029 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2030 r = run_query(hdb, query);
2031 ok(r == ERROR_SUCCESS, "failed to create table\n");
2033 query = "ALTER `_Property` ADD `foo` INTEGER";
2034 r = run_query(hdb, query);
2035 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2037 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2038 r = run_query(hdb, query);
2039 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2041 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2042 r = run_query(hdb, query);
2043 ok(r == ERROR_SUCCESS, "failed to add column\n");
2045 hpkg = package_from_db(hdb);
2048 ok(!hpkg, "package should not be created\n");
2051 MsiCloseHandle(hdb);
2052 MsiCloseHandle(hpkg);
2053 DeleteFile(msifile);
2055 hdb = create_package_db();
2056 ok (hdb, "failed to create package database\n");
2058 r = create_property_table(hdb);
2059 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2061 r = add_property_entry(hdb, "'prop', 'val'");
2062 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2064 hpkg = package_from_db(hdb);
2065 ok(hpkg, "failed to create package\n");
2067 MsiCloseHandle(hdb);
2070 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2072 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2074 hdb = MsiGetActiveDatabase(hpkg);
2076 found = find_prop_in_property(hdb, "prop", "val");
2077 ok(found, "prop should be in the _Property table\n");
2079 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2080 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2082 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2083 r = do_query(hdb, query, &hrec);
2084 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2086 found = find_prop_in_property(hdb, "dantes", "mercedes");
2087 ok(found == FALSE, "dantes should not be in the _Property table\n");
2090 lstrcpy(buffer, "aaa");
2091 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2093 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2095 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2096 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2098 found = find_prop_in_property(hdb, "dantes", "mercedes");
2099 ok(found == TRUE, "dantes should be in the _Property table\n");
2101 MsiCloseHandle(hdb);
2102 MsiCloseHandle(hpkg);
2103 DeleteFile(msifile);
2106 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2111 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2112 if( res == ERROR_SUCCESS )
2116 r = MsiViewExecute( htab, hrec );
2117 if( r != ERROR_SUCCESS )
2120 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2123 r = MsiViewClose( htab );
2124 if( r != ERROR_SUCCESS )
2127 r = MsiCloseHandle( htab );
2128 if( r != ERROR_SUCCESS )
2134 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2136 return try_query_param( hdb, szQuery, 0 );
2139 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2144 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2147 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2150 r = MsiSummaryInfoPersist(summary);
2151 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2153 MsiCloseHandle(summary);
2156 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2161 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2162 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2164 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2167 r = MsiSummaryInfoPersist(summary);
2168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2170 MsiCloseHandle(summary);
2173 static void test_msipackage(void)
2175 MSIHANDLE hdb = 0, hpack = 100;
2180 /* NULL szPackagePath */
2181 r = MsiOpenPackage(NULL, &hpack);
2182 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2184 /* empty szPackagePath */
2185 r = MsiOpenPackage("", &hpack);
2188 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2191 if (r == ERROR_SUCCESS)
2192 MsiCloseHandle(hpack);
2194 /* nonexistent szPackagePath */
2195 r = MsiOpenPackage("nonexistent", &hpack);
2196 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2199 r = MsiOpenPackage(msifile, NULL);
2200 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2204 r = MsiOpenPackage(name, &hpack);
2205 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2207 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2210 /* database exists, but is emtpy */
2211 sprintf(name, "#%d", hdb);
2212 r = MsiOpenPackage(name, &hpack);
2213 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2214 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2216 query = "CREATE TABLE `Property` ( "
2217 "`Property` CHAR(72), `Value` CHAR(0) "
2218 "PRIMARY KEY `Property`)";
2219 r = try_query(hdb, query);
2220 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2222 query = "CREATE TABLE `InstallExecuteSequence` ("
2223 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2224 "PRIMARY KEY `Action`)";
2225 r = try_query(hdb, query);
2226 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2228 /* a few key tables exist */
2229 sprintf(name, "#%d", hdb);
2230 r = MsiOpenPackage(name, &hpack);
2231 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2232 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2234 MsiCloseHandle(hdb);
2235 DeleteFile(msifile);
2237 /* start with a clean database to show what constitutes a valid package */
2238 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2239 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2241 sprintf(name, "#%d", hdb);
2243 /* The following summary information props must exist:
2248 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2249 r = MsiOpenPackage(name, &hpack);
2250 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2251 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2253 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2254 r = MsiOpenPackage(name, &hpack);
2255 ok(r == ERROR_SUCCESS,
2256 "Expected ERROR_SUCCESS, got %d\n", r);
2258 MsiCloseHandle(hpack);
2259 MsiCloseHandle(hdb);
2260 DeleteFile(msifile);
2263 static void test_formatrecord2(void)
2265 MSIHANDLE hpkg, hrec ;
2270 hpkg = package_from_db(create_package_db());
2271 ok( hpkg, "failed to create package\n");
2273 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2274 ok( r == ERROR_SUCCESS, "set property failed\n");
2276 hrec = MsiCreateRecord(2);
2277 ok(hrec, "create record failed\n");
2279 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2280 ok( r == ERROR_SUCCESS, "format record failed\n");
2284 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2286 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2287 r = MsiRecordSetString(hrec, 1, "hoo");
2289 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2290 ok( sz == 3, "size wrong\n");
2291 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2292 ok( r == ERROR_SUCCESS, "format failed\n");
2294 r = MsiRecordSetString(hrec, 0, "x[~]x");
2296 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2297 ok( sz == 3, "size wrong\n");
2298 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2299 ok( r == ERROR_SUCCESS, "format failed\n");
2301 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2302 r = MsiRecordSetString(hrec, 1, "hoo");
2304 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2305 ok( sz == 3, "size wrong\n");
2306 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2307 ok( r == ERROR_SUCCESS, "format failed\n");
2309 r = MsiRecordSetString(hrec, 0, "[\\[]");
2311 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2312 ok( sz == 1, "size wrong\n");
2313 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2314 ok( r == ERROR_SUCCESS, "format failed\n");
2316 SetEnvironmentVariable("FOO", "BAR");
2317 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2319 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2320 ok( sz == 3, "size wrong\n");
2321 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2322 ok( r == ERROR_SUCCESS, "format failed\n");
2324 r = MsiRecordSetString(hrec, 0, "[[1]]");
2325 r = MsiRecordSetString(hrec, 1, "%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 MsiCloseHandle( hrec );
2333 MsiCloseHandle( hpkg );
2334 DeleteFile(msifile);
2337 static void test_states(void)
2342 INSTALLSTATE state, action;
2344 static const CHAR msifile2[] = "winetest2.msi";
2345 static const CHAR msifile3[] = "winetest3.msi";
2346 static const CHAR msifile4[] = "winetest4.msi";
2348 hdb = create_package_db();
2349 ok ( hdb, "failed to create package database\n" );
2351 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2352 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2354 r = create_property_table( hdb );
2355 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2357 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2358 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2360 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2361 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2363 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2364 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2366 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2367 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2369 r = create_install_execute_sequence_table( hdb );
2370 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2372 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2373 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2375 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2376 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2378 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2379 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2381 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2382 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2384 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2385 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2387 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2388 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2390 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2391 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2393 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2394 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2396 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2397 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2399 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2400 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2402 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2403 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2405 r = create_media_table( hdb );
2406 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2408 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2409 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2411 r = create_feature_table( hdb );
2412 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2414 r = create_component_table( hdb );
2415 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2417 /* msidbFeatureAttributesFavorLocal */
2418 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2419 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2421 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2422 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2423 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2425 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2426 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2427 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2429 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2430 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2431 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2433 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2434 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2435 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2437 /* msidbFeatureAttributesFavorSource */
2438 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2439 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2441 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2442 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2443 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2445 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2446 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2447 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2449 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2450 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2451 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2453 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2454 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2455 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2457 /* msidbFeatureAttributesFavorSource */
2458 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2459 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2461 /* msidbFeatureAttributesFavorLocal */
2462 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2463 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2466 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2467 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2469 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2470 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2471 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2473 /* no feature parent:msidbComponentAttributesLocalOnly */
2474 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2475 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2477 /* msidbFeatureAttributesFavorLocal:removed */
2478 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2479 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2481 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2482 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2483 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2485 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2486 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2487 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2489 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2490 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2491 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2493 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2494 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2495 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2497 /* msidbFeatureAttributesFavorSource:removed */
2498 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2499 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2501 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2502 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2503 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2505 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2506 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2507 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2509 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2510 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2511 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2513 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2514 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2515 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2517 /* msidbFeatureAttributesFavorLocal */
2518 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2519 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2521 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2522 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2524 /* msidbFeatureAttributesFavorSource */
2525 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2526 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2528 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2529 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2531 /* msidbFeatureAttributesFavorAdvertise */
2532 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2533 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2535 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2536 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2538 r = create_feature_components_table( hdb );
2539 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2541 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2542 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2544 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2545 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2547 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2548 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2550 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2551 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2553 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2554 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2556 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2557 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2559 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2560 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2562 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2563 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2565 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2566 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2568 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2569 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2571 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2572 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2574 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2575 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2577 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2578 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2580 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2581 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2583 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2584 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2586 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2587 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2589 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2590 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2592 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2593 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2595 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2596 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2598 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2599 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2601 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2602 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2604 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2605 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2607 r = create_file_table( hdb );
2608 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2610 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2611 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2613 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2614 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2616 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2617 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2619 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2620 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2622 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2623 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2625 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2626 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2628 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2629 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2631 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2632 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2634 /* compressed file */
2635 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2636 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2638 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2639 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2641 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2642 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2644 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2645 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2647 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2648 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2650 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2651 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2653 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2654 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2656 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2657 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2659 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2660 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2662 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2663 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2665 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2666 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2668 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2669 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2671 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2672 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2674 MsiDatabaseCommit(hdb);
2676 /* these properties must not be in the saved msi file */
2677 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2678 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2680 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2681 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2683 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2684 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2686 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2687 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2689 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2690 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2692 hpkg = package_from_db( hdb );
2693 ok( hpkg, "failed to create package\n");
2695 MsiCloseHandle(hdb);
2697 CopyFileA(msifile, msifile2, FALSE);
2698 CopyFileA(msifile, msifile3, FALSE);
2699 CopyFileA(msifile, msifile4, FALSE);
2703 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2704 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2705 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2706 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2710 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2711 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2712 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2713 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2717 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2718 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2719 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2720 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2724 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2725 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2726 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2727 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2731 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2732 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2733 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2734 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2738 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2739 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2740 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2741 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2745 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2746 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2747 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2748 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2752 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2753 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2754 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2755 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2759 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2760 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2761 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2762 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2766 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2767 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2768 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2769 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2773 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2774 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2775 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2776 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2780 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2781 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2782 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2783 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2787 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2788 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2789 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2790 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2794 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2795 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2796 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2797 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2801 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2802 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2803 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2804 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2808 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2809 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2810 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2811 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2815 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2816 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2817 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2818 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2822 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2823 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2824 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2825 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2829 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2830 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2831 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2832 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2836 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2837 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2838 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2839 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2843 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2844 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2845 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2846 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2850 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2851 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2852 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2853 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2857 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2858 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2859 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2860 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2864 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2865 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2866 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2867 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2871 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2872 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2873 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2874 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2878 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2879 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2880 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2881 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2885 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2886 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2887 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2888 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2892 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2893 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2894 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2895 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2899 r = MsiGetComponentState(hpkg, "tau", &state, &action);
2900 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2901 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2902 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2906 r = MsiGetComponentState(hpkg, "phi", &state, &action);
2907 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2913 r = MsiGetComponentState(hpkg, "chi", &state, &action);
2914 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2918 r = MsiDoAction( hpkg, "CostInitialize");
2919 ok( r == ERROR_SUCCESS, "cost init failed\n");
2923 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2924 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2925 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2926 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2930 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2931 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2932 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2933 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2937 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2938 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2939 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2940 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2944 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2945 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2946 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2947 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2951 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2952 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2953 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2954 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2958 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2959 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2960 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2961 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2965 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2966 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2967 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2968 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2972 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2973 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2974 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2975 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2979 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2981 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2982 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2986 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2988 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2989 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2993 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2995 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2996 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3000 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3002 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3003 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3007 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3009 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3010 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3014 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3016 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3017 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3021 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3023 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3024 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3028 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3030 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3031 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3035 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3037 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3038 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3042 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3044 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3045 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3049 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3051 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3056 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3063 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3070 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3077 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3084 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3091 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3098 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3105 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3112 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3119 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3126 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3133 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3138 r = MsiDoAction( hpkg, "FileCost");
3139 ok( r == ERROR_SUCCESS, "file cost failed\n");
3143 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3145 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3146 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3150 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3152 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3153 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3157 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3159 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3160 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3164 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3166 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3167 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3171 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3173 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3174 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3178 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3180 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3181 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3185 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3187 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3192 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3199 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3206 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3213 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3220 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3227 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3234 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3241 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3248 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3250 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3251 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3255 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3262 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3269 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3276 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3283 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3290 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3297 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3304 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3311 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3318 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3325 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3332 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3339 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3346 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3353 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3358 r = MsiDoAction( hpkg, "CostFinalize");
3359 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3363 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3365 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3366 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3370 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3372 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3373 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3377 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3378 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3379 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3380 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3384 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3386 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3387 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3391 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3393 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3394 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3398 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3400 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3401 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3405 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3407 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3408 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3412 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3414 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3415 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3419 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3421 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3422 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3426 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3428 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3429 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3433 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3435 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3436 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3440 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3442 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3443 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3447 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3449 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3450 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3454 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3456 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3457 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3461 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3463 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3464 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3468 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3470 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3471 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3475 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3477 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3478 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3482 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3484 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3485 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3489 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3491 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3492 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3496 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3498 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3499 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3503 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3505 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3506 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3510 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3512 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3513 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3517 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3519 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3520 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3524 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3526 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3527 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3531 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3533 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3534 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3538 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3540 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3541 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3545 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3547 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3548 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3552 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3554 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3555 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3559 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3561 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3562 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3566 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3568 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3569 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3573 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3575 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3576 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3578 MsiCloseHandle( hpkg );
3580 /* publish the features and components */
3581 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3584 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3585 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3587 /* these properties must not be in the saved msi file */
3588 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3589 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3591 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3592 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3594 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3595 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3597 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3598 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3600 hpkg = package_from_db( hdb );
3601 ok( hpkg, "failed to create package\n");
3603 MsiCloseHandle(hdb);
3607 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3608 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3609 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3610 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3614 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3615 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3616 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3617 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3621 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3622 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3623 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3624 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3628 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3629 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3630 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3631 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3635 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3636 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3637 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3638 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3642 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3643 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3644 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3645 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3649 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3650 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3651 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3652 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3656 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3657 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3658 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3659 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3663 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3664 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3665 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3666 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3670 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3671 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3672 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3673 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3677 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3678 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3679 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3680 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3684 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3685 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3686 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3687 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3691 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3692 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3693 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3694 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3698 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3699 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3700 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3701 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3705 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3706 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3707 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3708 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3712 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3713 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3714 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3715 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3719 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3720 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3721 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3722 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3726 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3727 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3728 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3729 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3733 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3734 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3735 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3736 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3740 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3741 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3742 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3743 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3747 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3748 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3749 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3750 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3754 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3755 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3756 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3757 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3761 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3762 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3763 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3764 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3768 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3769 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3770 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3771 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3775 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3776 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3777 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3778 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3782 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3783 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3784 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3785 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3789 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3790 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3791 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3792 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3796 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3797 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3798 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3799 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3803 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3804 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3805 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3806 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3810 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3811 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3812 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3813 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3817 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3818 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3819 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3820 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3822 r = MsiDoAction( hpkg, "CostInitialize");
3823 ok( r == ERROR_SUCCESS, "cost init failed\n");
3827 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3828 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3829 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3830 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3834 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3835 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3836 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3837 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3841 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3842 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3843 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3844 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3848 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3850 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3851 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3855 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3856 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3857 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3858 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3862 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3863 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3864 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3865 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3869 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3870 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3871 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3872 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3876 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3877 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3878 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3879 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3883 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3884 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3885 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3886 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3890 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3891 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3892 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3893 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3897 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3898 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3899 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3900 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3904 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3905 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3906 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3907 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3911 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3912 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3913 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3914 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3918 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3920 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3921 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3925 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3927 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3928 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3932 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3934 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3935 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3939 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3941 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3942 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3946 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3947 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3948 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3949 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3953 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3955 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3956 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3960 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3961 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3962 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3963 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3967 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3968 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3969 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3970 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3974 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3976 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3977 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3981 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3983 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3984 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3988 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3989 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3990 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3991 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3995 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3996 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3997 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3998 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4002 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4003 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4004 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4005 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4009 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4011 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4012 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4016 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4018 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4019 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4023 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4025 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4030 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4032 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4037 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4039 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4040 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4042 r = MsiDoAction( hpkg, "FileCost");
4043 ok( r == ERROR_SUCCESS, "file cost failed\n");
4047 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4048 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4049 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4050 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4054 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4056 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4057 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4061 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4063 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4064 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4068 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4070 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4071 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4075 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4077 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4078 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4082 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4084 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4089 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4091 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4092 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4096 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4098 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4099 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4103 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4105 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4106 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4110 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4112 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4113 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4117 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4119 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4120 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4124 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4126 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4127 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4131 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4133 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4138 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4140 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4145 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4147 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4152 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4154 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4155 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4159 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4161 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4166 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4168 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4173 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4175 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4176 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4180 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4182 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4183 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4187 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4189 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4190 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4194 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4196 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4197 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4201 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4203 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4204 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4208 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4210 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4215 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4217 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4218 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4222 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4224 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4225 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4229 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4231 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4232 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4236 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4238 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4239 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4243 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4245 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4246 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4250 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4252 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4253 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4255 r = MsiDoAction( hpkg, "CostFinalize");
4256 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4260 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4262 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4263 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4267 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4269 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4270 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4274 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4275 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4276 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4277 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4281 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4283 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4284 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4288 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4290 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4291 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4295 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4297 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4298 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4302 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4304 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4305 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4309 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4310 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4311 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4312 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4316 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4318 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4319 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4323 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4325 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4326 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4330 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4332 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4333 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4337 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4339 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4340 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4344 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4346 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4347 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4351 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4353 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4354 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4358 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4360 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4361 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4365 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4367 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4368 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4372 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4374 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4375 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4379 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4381 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4382 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4386 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4388 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4389 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4393 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4394 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4395 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4396 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4400 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4401 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4402 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4403 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4407 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4408 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4409 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4410 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4414 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4415 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4416 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4417 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4421 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4422 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4423 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4424 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4428 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4429 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4430 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4431 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4435 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4436 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4437 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4438 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4442 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4444 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4445 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4449 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4451 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4452 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4456 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4458 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4459 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4463 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4464 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4465 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4466 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4470 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4472 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4473 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4475 MsiCloseHandle(hpkg);
4477 /* uninstall the product */
4478 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4481 /* all features installed locally */
4482 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4485 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4486 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4488 /* these properties must not be in the saved msi file */
4489 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4490 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4492 hpkg = package_from_db( hdb );
4493 ok( hpkg, "failed to create package\n");
4497 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4498 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4499 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4500 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4504 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4505 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4506 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4507 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4511 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4512 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4513 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4514 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4518 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4519 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4520 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4521 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4525 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4526 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4527 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4528 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4532 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4533 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4534 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4535 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4539 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4540 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4541 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4542 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4546 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4547 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4548 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4549 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4553 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4554 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4555 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4556 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4560 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4561 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4562 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4563 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4567 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4568 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4569 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4570 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4574 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4575 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4576 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4577 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4581 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4582 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4583 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4584 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4588 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4589 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4590 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4591 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4595 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4596 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4597 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4598 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4602 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4603 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4604 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4605 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4609 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4610 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4611 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4612 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4616 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4617 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4618 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4619 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4623 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4624 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4625 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4626 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4630 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4631 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4632 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4633 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4637 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4638 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4639 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4640 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4644 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4645 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4646 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4647 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4651 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4652 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4653 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4654 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4658 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4659 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4660 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4661 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4665 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4666 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4667 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4668 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4672 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4673 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4674 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4675 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4679 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4680 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4681 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4682 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4686 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4687 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4688 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4689 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4693 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4694 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4695 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4696 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4700 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4701 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4702 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4703 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4707 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4708 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4709 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4710 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4712 r = MsiDoAction( hpkg, "CostInitialize");
4713 ok( r == ERROR_SUCCESS, "cost init failed\n");
4717 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4718 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4719 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4720 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4724 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4725 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4726 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4727 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4731 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4732 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4733 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4734 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4738 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4739 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4740 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4741 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4745 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4746 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4747 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4748 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4752 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4753 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4754 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4755 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4759 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4760 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4761 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4762 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4766 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4767 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4768 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4769 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4773 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4774 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4775 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4776 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4780 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4781 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4782 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4783 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4787 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4788 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4789 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4790 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4794 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4795 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4796 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4797 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4801 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4802 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4803 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4804 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4808 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4809 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4810 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4811 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4815 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4816 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4817 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4818 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4822 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4823 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4824 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4825 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4829 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4830 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4831 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4832 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4836 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4837 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4838 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4839 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4843 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4844 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4845 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4846 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4850 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4851 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4852 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4853 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4857 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4858 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4859 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4860 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4864 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4865 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4866 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4867 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4871 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4872 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4873 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4874 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4878 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4879 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4880 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4881 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4885 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4886 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4887 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4888 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4892 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4893 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4894 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4895 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4899 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4900 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4901 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4902 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4906 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4907 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4908 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4909 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4913 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4914 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4915 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4916 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4920 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4921 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4922 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4923 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4927 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4928 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4929 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4930 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4932 r = MsiDoAction( hpkg, "FileCost");
4933 ok( r == ERROR_SUCCESS, "file cost failed\n");
4937 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4938 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4939 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4940 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4944 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4945 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4946 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4947 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4951 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4952 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4953 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4954 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4958 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4959 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4960 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4961 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4965 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4966 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4967 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4968 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4972 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4973 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4974 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4975 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4979 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4981 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4982 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4986 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4988 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4989 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4993 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4995 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4996 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5000 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5002 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5003 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5007 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5009 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5010 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5014 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5016 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5017 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5021 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5023 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5024 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5028 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5030 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5031 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5035 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5037 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5038 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5042 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5044 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5045 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5049 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5051 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5056 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5063 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5070 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5077 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5084 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5091 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5098 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5105 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5112 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5119 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5126 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5133 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5140 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5147 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5152 r = MsiDoAction( hpkg, "CostFinalize");
5153 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5157 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5159 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5160 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5164 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5166 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5167 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5171 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5173 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5174 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5178 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5180 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5181 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5185 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5187 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5192 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5194 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5195 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5199 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5201 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5202 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5206 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5208 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5209 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5213 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5215 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5216 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5220 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5222 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5223 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5227 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5229 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5230 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5234 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5236 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5237 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5241 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5243 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5244 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5248 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5250 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5251 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5255 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5257 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5258 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5262 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5264 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5265 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5269 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5271 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5272 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5276 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5278 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5279 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5283 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5285 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5286 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5290 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5292 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5297 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5299 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5300 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5304 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5306 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5307 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5311 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5313 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5314 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5318 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5320 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5321 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5325 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5327 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5328 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5332 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5334 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5335 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5339 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5341 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5342 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5346 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5348 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5349 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5353 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5355 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5356 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5360 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5362 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5363 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5367 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5369 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5370 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5372 MsiCloseHandle(hpkg);
5374 /* uninstall the product */
5375 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5378 /* all features installed from source */
5379 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5382 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5383 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5385 /* this property must not be in the saved msi file */
5386 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5387 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5389 hpkg = package_from_db( hdb );
5390 ok( hpkg, "failed to create package\n");
5394 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5395 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5396 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5397 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5401 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5402 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5403 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5404 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5408 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5409 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5410 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5411 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5415 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5416 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5417 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5418 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5422 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5423 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5424 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5425 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5429 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5430 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5431 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5432 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5436 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5437 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5438 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5439 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5443 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5444 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5445 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5446 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5450 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5451 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5452 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5453 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5457 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5458 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5459 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5460 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5464 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5465 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5466 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5467 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5471 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5472 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5473 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5474 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5478 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5479 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5480 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5481 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5485 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5486 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5487 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5488 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5492 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5493 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5494 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5495 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5499 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5500 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5501 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5502 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5506 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5507 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5508 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5509 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5513 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5514 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5515 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5516 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5520 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5521 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5522 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5523 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5527 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5528 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5529 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5530 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5534 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5535 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5536 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5537 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5541 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5542 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5543 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5544 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5548 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5549 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5550 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5551 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5555 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5556 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5557 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5558 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5562 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5563 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5564 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5565 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5569 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5570 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5571 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5572 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5576 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5577 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5578 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5579 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5583 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5584 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5585 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5586 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5590 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5591 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5592 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5593 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5597 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5598 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5599 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5600 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5604 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5605 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5606 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5607 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5609 r = MsiDoAction( hpkg, "CostInitialize");
5610 ok( r == ERROR_SUCCESS, "cost init failed\n");
5614 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5615 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5616 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5617 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5621 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5622 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5623 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5624 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5628 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5629 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5630 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5631 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5635 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5636 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5637 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5638 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5642 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5643 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5644 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5645 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5649 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5650 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5651 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5652 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5656 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5657 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5658 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5659 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5663 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5664 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5665 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5666 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5670 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5671 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5672 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5673 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5677 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5678 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5679 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5680 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5684 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5685 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5686 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5687 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5691 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5692 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5693 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5694 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5698 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5699 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5700 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5701 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5705 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5706 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5707 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5708 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5712 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5713 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5714 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5715 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5719 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5720 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5721 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5722 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5726 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5727 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5728 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5729 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5733 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5734 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5735 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5736 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5740 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5741 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5742 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5743 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5747 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5748 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5749 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5750 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5754 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5755 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5756 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5757 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5761 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5762 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5763 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5764 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5768 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5769 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5770 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5771 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5775 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5776 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5777 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5778 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5782 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5784 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5785 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5789 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5790 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5791 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5792 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5796 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5797 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5798 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5799 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5803 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5804 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5805 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5806 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5810 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5811 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5812 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5813 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5817 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5818 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5819 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5820 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5824 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5825 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5826 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5827 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5829 r = MsiDoAction( hpkg, "FileCost");
5830 ok( r == ERROR_SUCCESS, "file cost failed\n");
5834 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5835 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5836 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5837 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5841 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5842 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5843 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5844 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5848 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5850 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5851 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5855 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5856 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5857 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5858 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5862 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5863 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5864 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5865 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5869 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5870 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5871 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5872 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5876 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5877 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5878 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5879 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5883 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5884 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5885 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5886 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5890 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5891 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5892 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5893 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5897 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5898 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5899 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5900 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5904 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5905 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5906 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5907 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5911 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5912 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5913 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5914 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5918 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5920 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5921 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5925 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5927 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5928 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5932 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5934 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5935 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5939 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5941 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5942 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5946 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5947 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5948 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5949 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5953 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5955 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5956 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5960 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5961 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5962 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5963 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5967 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5968 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5969 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5970 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5974 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5976 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5977 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5981 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5983 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5984 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5988 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5989 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5990 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5991 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5995 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5996 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5997 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5998 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6002 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6003 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6004 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6005 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6009 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6011 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6012 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6016 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6018 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6019 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6023 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6025 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6030 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6032 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6037 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6039 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6040 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6044 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6046 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6047 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6049 r = MsiDoAction( hpkg, "CostFinalize");
6050 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6054 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6056 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6057 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6061 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6063 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6064 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6068 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6070 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6071 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6075 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6077 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6078 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6082 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6084 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6089 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6091 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6092 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6096 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6098 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6099 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6103 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6105 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6106 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6110 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6112 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6113 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6117 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6119 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6120 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6124 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6126 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6127 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6131 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6133 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6138 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6140 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6145 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6147 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6148 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6152 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6154 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6155 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6159 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6161 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6166 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6168 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6173 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6175 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6176 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6180 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6182 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6183 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6187 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6189 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6190 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6194 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6196 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6197 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6201 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6203 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6204 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6208 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6210 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6215 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6217 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6218 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6222 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6224 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6225 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6229 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6231 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6232 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6236 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6238 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6239 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6243 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6245 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6246 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6250 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6252 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6253 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6257 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6259 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6260 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6264 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6266 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6267 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6269 MsiCloseHandle(hpkg);
6271 /* reinstall the product */
6272 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6273 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6275 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6276 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6278 /* this property must not be in the saved msi file */
6279 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6280 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6282 hpkg = package_from_db( hdb );
6283 ok( hpkg, "failed to create package\n");
6287 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6288 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6289 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6290 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6294 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6295 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6296 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6297 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6301 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6302 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6303 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6304 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6308 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6309 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6310 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6311 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6315 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6316 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6317 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6318 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6322 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6323 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6324 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6325 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6329 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6330 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6331 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6332 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6336 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6337 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6338 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6339 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6343 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6344 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6345 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6346 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6350 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6351 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6352 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6353 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6357 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6358 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6359 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6360 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6364 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6365 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6366 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6367 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6371 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6372 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6373 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6374 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6378 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6379 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6380 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6381 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6385 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6386 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6387 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6388 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6392 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6393 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6394 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6395 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6399 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6400 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6401 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6402 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6406 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6407 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6408 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6409 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6413 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6414 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6415 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6416 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6420 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6421 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6422 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6423 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6427 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6428 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6429 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6430 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6434 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6435 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6436 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6437 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6441 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6442 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6443 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6444 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6448 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6449 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6450 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6451 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6455 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6456 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6457 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6458 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6462 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6463 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6464 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6465 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6469 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6470 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6471 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6472 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6476 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6477 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6478 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6479 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6483 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6484 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6485 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6486 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6490 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6491 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6492 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6493 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6497 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6498 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6499 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6500 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6502 r = MsiDoAction( hpkg, "CostInitialize");
6503 ok( r == ERROR_SUCCESS, "cost init failed\n");
6507 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6508 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6509 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6510 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6514 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6515 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6516 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6517 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6521 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6522 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6523 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6524 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6528 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6529 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6530 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6531 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6535 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6536 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6537 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6538 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6542 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6543 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6544 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6545 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6549 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6550 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6551 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6552 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6556 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6557 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6558 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6559 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6563 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6564 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6565 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6566 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6570 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6571 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6572 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6573 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6577 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6578 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6579 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6580 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6584 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6585 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6586 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6587 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6591 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6592 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6593 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6594 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6598 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6599 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6600 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6601 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6605 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6606 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6607 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6608 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6612 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6613 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6614 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6615 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6619 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6620 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6621 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6622 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6626 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6627 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6628 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6629 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6633 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6634 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6635 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6636 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6640 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6641 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6642 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6643 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6647 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6648 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6649 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6650 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6654 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6655 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6656 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6657 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6661 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6662 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6663 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6664 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6668 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6669 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6670 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6671 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6675 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6676 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6677 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6678 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6682 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6683 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6684 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6685 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6689 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6690 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6691 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6692 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6696 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6697 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6698 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6699 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6703 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6704 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6705 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6706 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6710 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6711 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6712 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6713 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6717 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6718 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6719 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6720 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6722 r = MsiDoAction( hpkg, "FileCost");
6723 ok( r == ERROR_SUCCESS, "file cost failed\n");
6727 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6728 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6729 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6730 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6734 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6735 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6736 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6737 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6741 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6743 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6744 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6748 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6749 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6750 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6751 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6755 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6756 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6757 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6758 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6762 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6763 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6764 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6765 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6769 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6770 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6771 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6772 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6776 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6777 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6778 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6779 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6783 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6784 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6785 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6786 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6790 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6791 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6792 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6793 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6797 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6798 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6799 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6800 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6804 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6805 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6806 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6807 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6811 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6812 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6813 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6814 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6818 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6819 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6820 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6821 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6825 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6826 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6827 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6828 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6832 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6833 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6834 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6835 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6839 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6840 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6841 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6842 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6846 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6847 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6848 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6849 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6853 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6854 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6855 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6856 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6860 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6861 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6862 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6863 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6867 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6868 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6869 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6870 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6874 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6875 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6876 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6877 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6881 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6882 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6883 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6884 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6888 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6889 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6890 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6891 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6895 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6896 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6897 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6898 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6902 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6903 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6904 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6905 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6909 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6910 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6911 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6912 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6916 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6917 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6918 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6919 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6923 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6924 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6925 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6926 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6930 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6931 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6932 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6933 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6937 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6938 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6939 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6940 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6942 r = MsiDoAction( hpkg, "CostFinalize");
6943 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6947 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6949 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6950 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6954 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6956 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6957 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6961 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6963 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6964 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6968 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6970 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6971 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6975 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6977 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6978 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6982 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6983 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6984 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6985 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6989 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6990 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6991 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6992 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6996 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6997 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6998 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6999 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7003 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7004 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7005 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7006 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7010 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7011 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7012 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7013 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7017 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7018 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7019 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7020 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7024 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7026 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7027 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7031 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7032 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7033 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7034 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7038 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7040 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7041 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7045 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7047 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7048 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7052 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7054 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7059 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7060 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7061 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7062 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7066 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7068 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7069 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7073 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7075 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7076 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7080 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7082 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7083 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7087 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7089 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7090 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7094 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7096 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7097 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7101 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7103 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7104 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7108 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7110 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7111 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7115 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7117 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7118 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7122 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7124 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7125 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7129 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7131 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7132 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7136 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7138 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7139 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7143 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7145 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7146 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7150 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7152 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7153 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7157 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7159 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7160 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7162 MsiCloseHandle(hpkg);
7164 /* uninstall the product */
7165 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7168 DeleteFileA(msifile);
7169 DeleteFileA(msifile2);
7170 DeleteFileA(msifile3);
7171 DeleteFileA(msifile4);
7174 static void test_getproperty(void)
7176 MSIHANDLE hPackage = 0;
7178 static CHAR empty[] = "";
7182 hPackage = package_from_db(create_package_db());
7183 ok( hPackage != 0, " Failed to create package\n");
7185 /* set the property */
7186 r = MsiSetProperty(hPackage, "Name", "Value");
7187 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7189 /* retrieve the size, NULL pointer */
7191 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7193 ok( size == 5, "Expected 5, got %d\n", size);
7195 /* retrieve the size, empty string */
7197 r = MsiGetProperty(hPackage, "Name", empty, &size);
7198 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7199 ok( size == 5, "Expected 5, got %d\n", size);
7201 /* don't change size */
7202 r = MsiGetProperty(hPackage, "Name", prop, &size);
7203 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7204 ok( size == 5, "Expected 5, got %d\n", size);
7205 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7207 /* increase the size by 1 */
7209 r = MsiGetProperty(hPackage, "Name", prop, &size);
7210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7211 ok( size == 5, "Expected 5, got %d\n", size);
7212 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7214 r = MsiCloseHandle( hPackage);
7215 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7216 DeleteFile(msifile);
7219 static void test_removefiles(void)
7225 hdb = create_package_db();
7226 ok ( hdb, "failed to create package database\n" );
7228 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7229 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7231 r = create_feature_table( hdb );
7232 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7234 r = create_component_table( hdb );
7235 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7237 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7238 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7240 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7241 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7243 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7244 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7246 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7247 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7249 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7250 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7252 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7253 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7255 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7256 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7258 r = create_feature_components_table( hdb );
7259 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7261 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7262 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7264 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7265 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7267 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7268 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7270 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7271 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7273 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7274 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7276 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7277 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7279 r = create_file_table( hdb );
7280 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7282 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7283 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7285 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7286 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7288 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7289 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7291 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7292 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7294 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7295 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7297 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7298 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7300 r = create_remove_file_table( hdb );
7301 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7303 hpkg = package_from_db( hdb );
7304 ok( hpkg, "failed to create package\n");
7306 MsiCloseHandle( hdb );
7308 create_test_file( "hydrogen.txt" );
7309 create_test_file( "helium.txt" );
7310 create_test_file( "lithium.txt" );
7311 create_test_file( "beryllium.txt" );
7312 create_test_file( "boron.txt" );
7313 create_test_file( "carbon.txt" );
7315 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7316 ok( r == ERROR_SUCCESS, "set property failed\n");
7318 r = MsiDoAction( hpkg, "CostInitialize");
7319 ok( r == ERROR_SUCCESS, "cost init failed\n");
7321 r = MsiDoAction( hpkg, "FileCost");
7322 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7324 r = MsiDoAction( hpkg, "CostFinalize");
7325 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7327 r = MsiDoAction( hpkg, "InstallValidate");
7328 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7330 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7331 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7333 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7334 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7336 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7337 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7339 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7340 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7342 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7343 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7345 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7346 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7348 r = MsiDoAction( hpkg, "RemoveFiles");
7349 ok( r == ERROR_SUCCESS, "remove files failed\n");
7351 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7352 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7353 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7354 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7355 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7356 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7358 MsiCloseHandle( hpkg );
7359 DeleteFileA(msifile);
7362 static void test_appsearch(void)
7367 CHAR prop[MAX_PATH];
7368 DWORD size = MAX_PATH;
7370 hdb = create_package_db();
7371 ok ( hdb, "failed to create package database\n" );
7373 r = create_appsearch_table( hdb );
7374 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7376 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7377 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7379 r = create_reglocator_table( hdb );
7380 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7382 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7383 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7385 r = create_signature_table( hdb );
7386 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7388 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7389 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7391 hpkg = package_from_db( hdb );
7392 ok( hpkg, "failed to create package\n");
7394 MsiCloseHandle( hdb );
7396 r = MsiDoAction( hpkg, "AppSearch" );
7397 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7399 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7400 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7403 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7406 MsiCloseHandle( hpkg );
7407 DeleteFileA(msifile);
7410 static void test_appsearch_complocator(void)
7412 MSIHANDLE hpkg, hdb;
7413 CHAR path[MAX_PATH];
7414 CHAR prop[MAX_PATH];
7419 if (!get_user_sid(&usersid))
7422 create_test_file("FileName1");
7423 create_test_file("FileName4");
7424 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7425 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7427 create_test_file("FileName2");
7428 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7429 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7431 create_test_file("FileName3");
7432 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7433 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7435 create_test_file("FileName5");
7436 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7437 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7439 create_test_file("FileName6");
7440 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7441 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7443 create_test_file("FileName7");
7444 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7445 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7447 /* dir is FALSE, but we're pretending it's a directory */
7448 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7449 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7451 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7452 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7453 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7455 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7456 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7457 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7459 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7460 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7461 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7463 hdb = create_package_db();
7464 ok(hdb, "Expected a valid database handle\n");
7466 r = create_appsearch_table(hdb);
7467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7469 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7470 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7472 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7475 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7476 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7478 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7481 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7484 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7487 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7488 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7490 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7493 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7496 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7499 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7502 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7505 r = create_complocator_table(hdb);
7506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7508 /* published component, machine, file, signature, misdbLocatorTypeFile */
7509 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7512 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7513 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7516 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7517 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7520 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7521 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7524 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7525 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7528 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7529 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7532 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7533 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7536 /* unpublished component, no signature, misdbLocatorTypeDir */
7537 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7540 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7541 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7542 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7544 /* published component, signature w/ ver, misdbLocatorTypeFile */
7545 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7548 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7549 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7552 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7553 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7554 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7556 r = create_signature_table(hdb);
7557 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7559 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7560 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7562 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7563 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7565 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7566 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7568 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7569 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7571 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7572 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7574 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7577 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7578 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7580 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7583 hpkg = package_from_db(hdb);
7584 ok(hpkg, "Expected a valid package handle\n");
7586 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
7587 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7589 r = MsiDoAction(hpkg, "AppSearch");
7590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7593 sprintf(path, "%s\\FileName1", CURR_DIR);
7594 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7595 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7596 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7599 sprintf(path, "%s\\FileName2", CURR_DIR);
7600 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7601 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7602 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7605 sprintf(path, "%s\\FileName3", CURR_DIR);
7606 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7608 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7611 sprintf(path, "%s\\FileName4", CURR_DIR);
7612 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
7613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7614 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7617 sprintf(path, "%s\\FileName5", CURR_DIR);
7618 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7619 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7620 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7623 sprintf(path, "%s\\", CURR_DIR);
7624 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7625 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7626 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7629 sprintf(path, "%s\\", CURR_DIR);
7630 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7632 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7635 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7637 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
7640 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7642 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7645 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
7646 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7647 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7648 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7651 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
7652 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7653 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7656 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
7657 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
7658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7659 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7661 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7662 MSIINSTALLCONTEXT_MACHINE, NULL);
7663 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7664 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
7665 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7666 MSIINSTALLCONTEXT_USERMANAGED, usersid);
7667 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7668 MSIINSTALLCONTEXT_MACHINE, NULL);
7669 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7670 MSIINSTALLCONTEXT_MACHINE, NULL);
7671 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7672 MSIINSTALLCONTEXT_MACHINE, NULL);
7673 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7674 MSIINSTALLCONTEXT_MACHINE, NULL);
7675 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7676 MSIINSTALLCONTEXT_MACHINE, NULL);
7677 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7678 MSIINSTALLCONTEXT_MACHINE, NULL);
7679 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7680 MSIINSTALLCONTEXT_MACHINE, NULL);
7682 DeleteFileA("FileName1");
7683 DeleteFileA("FileName2");
7684 DeleteFileA("FileName3");
7685 DeleteFileA("FileName4");
7686 DeleteFileA("FileName5");
7687 DeleteFileA("FileName6");
7688 DeleteFileA("FileName7");
7689 DeleteFileA("FileName8.dll");
7690 DeleteFileA("FileName9.dll");
7691 DeleteFileA("FileName10.dll");
7692 MsiCloseHandle(hpkg);
7693 DeleteFileA(msifile);
7696 static void test_appsearch_reglocator(void)
7698 MSIHANDLE hpkg, hdb;
7699 CHAR path[MAX_PATH];
7700 CHAR prop[MAX_PATH];
7703 BOOL space, version;
7714 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7717 DeleteFileA("test.dll");
7719 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
7720 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7722 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
7723 (const BYTE *)"regszdata", 10);
7724 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7726 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
7727 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7729 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
7730 (const BYTE *)"regszdata", 10);
7731 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7734 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
7735 ok(res == ERROR_SUCCESS ||
7736 broken(res == ERROR_INVALID_PARAMETER),
7737 "Expected ERROR_SUCCESS, got %d\n", res);
7739 if (res == ERROR_SUCCESS)
7741 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
7742 (const BYTE *)"regszdata", 10);
7743 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7746 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
7747 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7749 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
7750 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7752 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
7753 (const BYTE *)"regszdata", 10);
7754 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7757 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
7758 (const BYTE *)&val, sizeof(DWORD));
7759 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7762 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
7763 (const BYTE *)&val, sizeof(DWORD));
7764 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7766 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
7767 (const BYTE *)"%PATH%", 7);
7768 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7770 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
7771 (const BYTE *)"my%NOVAR%", 10);
7772 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7774 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
7775 (const BYTE *)"one\0two\0", 9);
7776 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7778 binary[0] = 0x1234abcd;
7779 binary[1] = 0x567890ef;
7780 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
7781 (const BYTE *)binary, sizeof(binary));
7782 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7784 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
7785 (const BYTE *)"#regszdata", 11);
7786 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7788 create_test_file("FileName1");
7789 sprintf(path, "%s\\FileName1", CURR_DIR);
7790 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
7791 (const BYTE *)path, lstrlenA(path) + 1);
7792 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7794 sprintf(path, "%s\\FileName2", CURR_DIR);
7795 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
7796 (const BYTE *)path, lstrlenA(path) + 1);
7797 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7799 lstrcpyA(path, CURR_DIR);
7800 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
7801 (const BYTE *)path, lstrlenA(path) + 1);
7802 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7804 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
7805 (const BYTE *)"", 1);
7806 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7808 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7809 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
7810 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
7811 (const BYTE *)path, lstrlenA(path) + 1);
7812 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7814 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7815 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
7816 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
7817 (const BYTE *)path, lstrlenA(path) + 1);
7818 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7820 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7821 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
7822 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
7823 (const BYTE *)path, lstrlenA(path) + 1);
7824 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7826 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
7827 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
7828 (const BYTE *)path, lstrlenA(path) + 1);
7830 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
7831 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
7832 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
7833 (const BYTE *)path, lstrlenA(path) + 1);
7835 hdb = create_package_db();
7836 ok(hdb, "Expected a valid database handle\n");
7838 r = create_appsearch_table(hdb);
7839 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7841 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7844 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7847 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7850 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7853 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7856 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7857 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7859 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7860 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7862 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7865 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7866 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7868 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7869 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7871 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7872 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7874 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7875 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7877 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
7878 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7880 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
7881 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7883 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
7884 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7886 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
7887 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7889 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
7890 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7892 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
7893 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7895 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
7896 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7898 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
7899 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7901 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
7902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7904 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
7905 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7907 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
7908 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7910 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
7911 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7913 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
7914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7916 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
7917 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7919 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
7920 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7922 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
7923 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7925 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
7926 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7928 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
7929 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7931 r = create_reglocator_table(hdb);
7932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7934 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
7935 str = "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
7936 r = add_reglocator_entry(hdb, str);
7937 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7939 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
7940 str = "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
7941 r = add_reglocator_entry(hdb, str);
7942 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7944 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
7945 str = "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
7946 r = add_reglocator_entry(hdb, str);
7947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7949 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7950 str = "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
7951 r = add_reglocator_entry(hdb, str);
7952 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7954 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7955 str = "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
7956 r = add_reglocator_entry(hdb, str);
7957 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7959 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
7960 str = "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
7961 r = add_reglocator_entry(hdb, str);
7962 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7964 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
7965 str = "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
7966 r = add_reglocator_entry(hdb, str);
7967 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7969 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
7970 str = "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
7971 r = add_reglocator_entry(hdb, str);
7972 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7974 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
7975 str = "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
7976 r = add_reglocator_entry(hdb, str);
7977 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7979 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
7980 str = "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
7981 r = add_reglocator_entry(hdb, str);
7982 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7984 /* HKLM, msidbLocatorTypeFileName, no signature */
7985 str = "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
7986 r = add_reglocator_entry(hdb, str);
7987 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7989 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
7990 str = "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
7991 r = add_reglocator_entry(hdb, str);
7992 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7994 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
7995 str = "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
7996 r = add_reglocator_entry(hdb, str);
7997 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7999 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8000 str = "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
8001 r = add_reglocator_entry(hdb, str);
8002 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8004 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8005 str = "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
8006 r = add_reglocator_entry(hdb, str);
8007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8009 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8010 str = "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
8011 r = add_reglocator_entry(hdb, str);
8012 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8014 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8015 str = "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
8016 r = add_reglocator_entry(hdb, str);
8017 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8019 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8020 str = "'NewSignature18', 2, 'Software\\Wine', '', 2";
8021 r = add_reglocator_entry(hdb, str);
8022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8024 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8025 str = "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
8026 r = add_reglocator_entry(hdb, str);
8027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8029 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8030 str = "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
8031 r = add_reglocator_entry(hdb, str);
8032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8034 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8035 str = "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
8036 r = add_reglocator_entry(hdb, str);
8037 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8039 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8040 str = "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
8041 r = add_reglocator_entry(hdb, str);
8042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8044 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8045 str = "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
8046 r = add_reglocator_entry(hdb, str);
8047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8049 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8050 str = "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
8051 r = add_reglocator_entry(hdb, str);
8052 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8054 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8055 str = "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
8056 r = add_reglocator_entry(hdb, str);
8057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8059 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8060 str = "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
8061 r = add_reglocator_entry(hdb, str);
8062 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8064 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8065 str = "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
8066 r = add_reglocator_entry(hdb, str);
8067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8069 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8070 str = "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
8071 r = add_reglocator_entry(hdb, str);
8072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8074 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8075 str = "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
8076 r = add_reglocator_entry(hdb, str);
8077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8079 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8080 str = "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
8081 r = add_reglocator_entry(hdb, str);
8082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8084 r = create_signature_table(hdb);
8085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8087 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8088 r = add_signature_entry(hdb, str);
8089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8091 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8092 r = add_signature_entry(hdb, str);
8093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8095 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8096 r = add_signature_entry(hdb, str);
8097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8099 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8100 r = add_signature_entry(hdb, str);
8101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8103 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8104 r = add_signature_entry(hdb, str);
8105 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8107 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8108 r = add_signature_entry(hdb, str);
8109 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8111 ptr = strrchr(CURR_DIR, '\\') + 1;
8112 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8113 r = add_signature_entry(hdb, path);
8114 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8116 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8117 r = add_signature_entry(hdb, str);
8118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8120 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8121 r = add_signature_entry(hdb, str);
8122 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8124 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8125 r = add_signature_entry(hdb, str);
8126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8128 hpkg = package_from_db(hdb);
8129 ok(hpkg, "Expected a valid package handle\n");
8131 r = MsiDoAction(hpkg, "AppSearch");
8132 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8135 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8137 ok(!lstrcmpA(prop, "regszdata"),
8138 "Expected \"regszdata\", got \"%s\"\n", prop);
8141 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8142 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8143 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8146 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8148 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8150 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8151 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8153 /* Workaround for Win95 */
8155 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8157 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8158 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8161 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8162 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8164 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8165 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8167 ok(!lstrcmpA(pathdata, pathvar),
8168 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8170 HeapFree(GetProcessHeap(), 0, pathvar);
8171 HeapFree(GetProcessHeap(), 0, pathdata);
8174 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8177 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8180 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8184 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8185 "Expected \"\\0one\\0two\\0\\0\"\n");
8189 lstrcpyA(path, "#xCDAB3412EF907856");
8190 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8191 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8192 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8195 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8197 ok(!lstrcmpA(prop, "##regszdata"),
8198 "Expected \"##regszdata\", got \"%s\"\n", prop);
8201 sprintf(path, "%s\\FileName1", CURR_DIR);
8202 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8203 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8204 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8207 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8209 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8212 sprintf(path, "%s\\", CURR_DIR);
8213 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8214 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8215 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8218 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8219 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8220 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8223 sprintf(path, "%s\\", CURR_DIR);
8224 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8225 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8226 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8229 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8230 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8231 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8234 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8235 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8236 ok(!lstrcmpA(prop, "regszdata"),
8237 "Expected \"regszdata\", got \"%s\"\n", prop);
8240 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8241 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8242 ok(!lstrcmpA(prop, "regszdata"),
8243 "Expected \"regszdata\", got \"%s\"\n", prop);
8248 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8250 ok(!lstrcmpA(prop, "regszdata"),
8251 "Expected \"regszdata\", got \"%s\"\n", prop);
8255 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8256 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8257 ok(!lstrcmpA(prop, "defvalue"),
8258 "Expected \"defvalue\", got \"%s\"\n", prop);
8261 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8262 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8263 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8266 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8267 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8268 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8273 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8274 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8275 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8276 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8279 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8280 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8281 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8284 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8285 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8286 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8287 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8291 lstrcpyA(path, CURR_DIR);
8292 ptr = strrchr(path, '\\') + 1;
8294 r = MsiGetPropertyA(hpkg, "SIGPROP24", 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);
8299 sprintf(path, "%s\\", CURR_DIR);
8300 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8301 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8302 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8305 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8306 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8307 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8310 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8312 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8315 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8317 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8320 sprintf(path, "%s\\FileName1", CURR_DIR);
8321 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8323 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8326 sprintf(path, "%s\\FileName1", CURR_DIR);
8327 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8328 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8330 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8332 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8334 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8335 RegDeleteValueA(hklm, "Value1");
8336 RegDeleteValueA(hklm, "Value2");
8337 RegDeleteValueA(hklm, "Value3");
8338 RegDeleteValueA(hklm, "Value4");
8339 RegDeleteValueA(hklm, "Value5");
8340 RegDeleteValueA(hklm, "Value6");
8341 RegDeleteValueA(hklm, "Value7");
8342 RegDeleteValueA(hklm, "Value8");
8343 RegDeleteValueA(hklm, "Value9");
8344 RegDeleteValueA(hklm, "Value10");
8345 RegDeleteValueA(hklm, "Value11");
8346 RegDeleteValueA(hklm, "Value12");
8347 RegDeleteValueA(hklm, "Value13");
8348 RegDeleteValueA(hklm, "Value14");
8349 RegDeleteValueA(hklm, "Value15");
8350 RegDeleteValueA(hklm, "Value16");
8351 RegDeleteValueA(hklm, "Value17");
8352 RegDeleteKeyA(hklm, "");
8355 RegDeleteValueA(classes, "Value1");
8356 RegDeleteKeyA(classes, "");
8357 RegCloseKey(classes);
8359 RegDeleteValueA(hkcu, "Value1");
8360 RegDeleteKeyA(hkcu, "");
8363 RegDeleteValueA(users, "Value1");
8364 RegDeleteKeyA(users, "");
8367 DeleteFileA("FileName1");
8368 DeleteFileA("FileName3.dll");
8369 DeleteFileA("FileName4.dll");
8370 DeleteFileA("FileName5.dll");
8371 MsiCloseHandle(hpkg);
8372 DeleteFileA(msifile);
8375 static void delete_win_ini(LPCSTR file)
8377 CHAR path[MAX_PATH];
8379 GetWindowsDirectoryA(path, MAX_PATH);
8380 lstrcatA(path, "\\");
8381 lstrcatA(path, file);
8386 static void test_appsearch_inilocator(void)
8388 MSIHANDLE hpkg, hdb;
8389 CHAR path[MAX_PATH];
8390 CHAR prop[MAX_PATH];
8398 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8401 DeleteFileA("test.dll");
8403 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8405 create_test_file("FileName1");
8406 sprintf(path, "%s\\FileName1", CURR_DIR);
8407 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8409 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8411 sprintf(path, "%s\\IDontExist", CURR_DIR);
8412 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8414 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8415 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8416 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8418 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8419 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8420 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8422 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8423 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8424 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8426 hdb = create_package_db();
8427 ok(hdb, "Expected a valid database handle\n");
8429 r = create_appsearch_table(hdb);
8430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8432 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8435 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8438 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8441 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8444 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8447 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8450 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8453 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8456 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8459 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8462 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8465 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8468 r = create_inilocator_table(hdb);
8469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8471 /* msidbLocatorTypeRawValue, field 1 */
8472 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8473 r = add_inilocator_entry(hdb, str);
8474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8476 /* msidbLocatorTypeRawValue, field 2 */
8477 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8478 r = add_inilocator_entry(hdb, str);
8479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8481 /* msidbLocatorTypeRawValue, entire field */
8482 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8483 r = add_inilocator_entry(hdb, str);
8484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8486 /* msidbLocatorTypeFile */
8487 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8488 r = add_inilocator_entry(hdb, str);
8489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8491 /* msidbLocatorTypeDirectory, file */
8492 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8493 r = add_inilocator_entry(hdb, str);
8494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8496 /* msidbLocatorTypeDirectory, directory */
8497 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8498 r = add_inilocator_entry(hdb, str);
8499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8501 /* msidbLocatorTypeFile, file, no signature */
8502 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8503 r = add_inilocator_entry(hdb, str);
8504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8506 /* msidbLocatorTypeFile, dir, no signature */
8507 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8508 r = add_inilocator_entry(hdb, str);
8509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8511 /* msidbLocatorTypeFile, file does not exist */
8512 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8513 r = add_inilocator_entry(hdb, str);
8514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8516 /* msidbLocatorTypeFile, signature with version */
8517 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8518 r = add_inilocator_entry(hdb, str);
8519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8521 /* msidbLocatorTypeFile, signature with version, ver > max */
8522 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8523 r = add_inilocator_entry(hdb, str);
8524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8526 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8527 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8528 r = add_inilocator_entry(hdb, str);
8529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8531 r = create_signature_table(hdb);
8532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8534 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8537 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8540 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8543 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8546 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8549 hpkg = package_from_db(hdb);
8550 ok(hpkg, "Expected a valid package handle\n");
8552 r = MsiDoAction(hpkg, "AppSearch");
8553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8556 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8557 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8558 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
8561 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8562 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8563 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
8566 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8568 ok(!lstrcmpA(prop, "keydata,field2"),
8569 "Expected \"keydata,field2\", got \"%s\"\n", prop);
8572 sprintf(path, "%s\\FileName1", CURR_DIR);
8573 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8575 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8578 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8580 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8583 sprintf(path, "%s\\", CURR_DIR);
8584 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8586 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8589 sprintf(path, "%s\\", CURR_DIR);
8590 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8592 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8595 lstrcpyA(path, CURR_DIR);
8596 ptr = strrchr(path, '\\');
8598 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8599 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8600 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8603 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8604 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8605 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8610 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8611 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8612 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8613 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8616 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8617 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8618 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8621 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8622 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8623 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8624 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8627 delete_win_ini("IniFile.ini");
8628 DeleteFileA("FileName1");
8629 DeleteFileA("FileName2.dll");
8630 DeleteFileA("FileName3.dll");
8631 DeleteFileA("FileName4.dll");
8632 MsiCloseHandle(hpkg);
8633 DeleteFileA(msifile);
8637 * MSI AppSearch action on DrLocator table always returns absolute paths.
8638 * If a relative path was set, it returns the first absolute path that
8639 * matches or an empty string if it didn't find anything.
8640 * This helper function replicates this behaviour.
8642 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
8647 size = lstrlenA(relative);
8648 drives = GetLogicalDrives();
8649 lstrcpyA(absolute, "A:\\");
8650 for (i = 0; i < 26; absolute[0] = '\0', i++)
8652 if (!(drives & (1 << i)))
8655 absolute[0] = 'A' + i;
8656 if (GetDriveType(absolute) != DRIVE_FIXED)
8659 lstrcpynA(absolute + 3, relative, size + 1);
8660 attr = GetFileAttributesA(absolute);
8661 if (attr != INVALID_FILE_ATTRIBUTES &&
8662 (attr & FILE_ATTRIBUTE_DIRECTORY))
8664 if (absolute[3 + size - 1] != '\\')
8665 lstrcatA(absolute, "\\");
8672 static void test_appsearch_drlocator(void)
8674 MSIHANDLE hpkg, hdb;
8675 CHAR path[MAX_PATH];
8676 CHAR prop[MAX_PATH];
8683 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8686 DeleteFileA("test.dll");
8688 create_test_file("FileName1");
8689 CreateDirectoryA("one", NULL);
8690 CreateDirectoryA("one\\two", NULL);
8691 CreateDirectoryA("one\\two\\three", NULL);
8692 create_test_file("one\\two\\three\\FileName2");
8693 CreateDirectoryA("another", NULL);
8694 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8695 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8696 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8698 hdb = create_package_db();
8699 ok(hdb, "Expected a valid database handle\n");
8701 r = create_appsearch_table(hdb);
8702 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8704 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8707 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8710 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8713 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8716 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8719 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8722 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8725 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8728 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8731 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8734 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8735 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8737 r = create_drlocator_table(hdb);
8738 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8740 /* no parent, full path, depth 0, signature */
8741 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
8742 r = add_drlocator_entry(hdb, path);
8743 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8745 /* no parent, full path, depth 0, no signature */
8746 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
8747 r = add_drlocator_entry(hdb, path);
8748 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8750 /* no parent, relative path, depth 0, no signature */
8751 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
8752 r = add_drlocator_entry(hdb, path);
8753 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8755 /* no parent, full path, depth 2, signature */
8756 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
8757 r = add_drlocator_entry(hdb, path);
8758 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8760 /* no parent, full path, depth 3, signature */
8761 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
8762 r = add_drlocator_entry(hdb, path);
8763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8765 /* no parent, full path, depth 1, signature is dir */
8766 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
8767 r = add_drlocator_entry(hdb, path);
8768 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8770 /* parent is in DrLocator, relative path, depth 0, signature */
8771 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8772 r = add_drlocator_entry(hdb, path);
8773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8775 /* no parent, full path, depth 0, signature w/ version */
8776 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
8777 r = add_drlocator_entry(hdb, path);
8778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8780 /* no parent, full path, depth 0, signature w/ version, ver > max */
8781 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
8782 r = add_drlocator_entry(hdb, path);
8783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8785 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8786 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
8787 r = add_drlocator_entry(hdb, path);
8788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8790 /* no parent, relative empty path, depth 0, no signature */
8791 sprintf(path, "'NewSignature11', '', '', 0");
8792 r = add_drlocator_entry(hdb, path);
8793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8795 r = create_signature_table(hdb);
8796 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8798 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
8799 r = add_signature_entry(hdb, str);
8800 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8802 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
8803 r = add_signature_entry(hdb, str);
8804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8806 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
8807 r = add_signature_entry(hdb, str);
8808 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8810 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
8811 r = add_signature_entry(hdb, str);
8812 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8814 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
8815 r = add_signature_entry(hdb, str);
8816 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8818 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8819 r = add_signature_entry(hdb, str);
8820 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8822 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8823 r = add_signature_entry(hdb, str);
8824 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8826 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8827 r = add_signature_entry(hdb, str);
8828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8830 hpkg = package_from_db(hdb);
8831 ok(hpkg, "Expected a valid package handle\n");
8833 r = MsiDoAction(hpkg, "AppSearch");
8834 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8837 sprintf(path, "%s\\FileName1", CURR_DIR);
8838 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8839 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8840 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8843 sprintf(path, "%s\\", CURR_DIR);
8844 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8846 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8849 search_absolute_directory(path, CURR_DIR + 3);
8850 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8852 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8855 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8856 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8857 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8860 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8861 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8862 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8863 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8866 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8868 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8871 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8872 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8873 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8874 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8879 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8880 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8881 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8882 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8885 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8886 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8887 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8890 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8892 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8896 search_absolute_directory(path, "");
8897 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8898 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8899 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8901 DeleteFileA("FileName1");
8902 DeleteFileA("FileName3.dll");
8903 DeleteFileA("FileName4.dll");
8904 DeleteFileA("FileName5.dll");
8905 DeleteFileA("one\\two\\three\\FileName2");
8906 RemoveDirectoryA("one\\two\\three");
8907 RemoveDirectoryA("one\\two");
8908 RemoveDirectoryA("one");
8909 RemoveDirectoryA("another");
8910 MsiCloseHandle(hpkg);
8911 DeleteFileA(msifile);
8914 static void test_featureparents(void)
8919 INSTALLSTATE state, action;
8921 hdb = create_package_db();
8922 ok ( hdb, "failed to create package database\n" );
8924 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
8925 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
8927 r = create_feature_table( hdb );
8928 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
8930 r = create_component_table( hdb );
8931 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
8933 r = create_feature_components_table( hdb );
8934 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
8936 r = create_file_table( hdb );
8937 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
8939 /* msidbFeatureAttributesFavorLocal */
8940 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
8941 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8943 /* msidbFeatureAttributesFavorSource */
8944 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
8945 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8947 /* msidbFeatureAttributesFavorLocal */
8948 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
8949 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8951 /* disabled because of install level */
8952 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
8953 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8955 /* child feature of disabled feature */
8956 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
8957 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8959 /* component of disabled feature (install level) */
8960 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
8961 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8963 /* component of disabled child feature (install level) */
8964 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
8965 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8967 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8968 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
8969 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8971 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8972 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
8973 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8975 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8976 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
8977 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8979 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
8980 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
8981 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8983 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
8984 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
8985 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8987 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
8988 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
8989 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8991 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8992 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
8993 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8995 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8996 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
8997 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8999 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9000 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9002 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9003 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9005 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9006 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9008 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9009 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9011 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9012 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9014 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9015 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9017 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9018 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9020 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9021 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9023 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9024 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9026 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9027 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9029 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9030 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9032 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9033 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9035 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9036 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9038 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9039 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9041 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9042 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9044 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9045 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9047 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9048 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9050 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9051 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9053 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9054 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9056 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9057 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9059 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9060 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9062 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9063 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9065 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9066 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9068 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9069 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9071 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9072 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9074 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9075 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9077 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9078 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9080 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9081 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9083 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9084 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9086 hpkg = package_from_db( hdb );
9087 ok( hpkg, "failed to create package\n");
9089 MsiCloseHandle( hdb );
9091 r = MsiDoAction( hpkg, "CostInitialize");
9092 ok( r == ERROR_SUCCESS, "cost init failed\n");
9094 r = MsiDoAction( hpkg, "FileCost");
9095 ok( r == ERROR_SUCCESS, "file cost failed\n");
9097 r = MsiDoAction( hpkg, "CostFinalize");
9098 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9102 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9103 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9104 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9105 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9109 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9110 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9111 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9112 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9116 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9117 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9118 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9119 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9123 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9124 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9125 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9126 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9130 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9131 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9132 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9133 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9137 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9138 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9139 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9140 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9144 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9145 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9146 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9147 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9151 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9152 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9153 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9154 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9158 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9159 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9160 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9161 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9165 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9166 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9167 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9168 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9172 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9173 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9174 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9175 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9179 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9180 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9181 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9182 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9186 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9187 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9188 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9189 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9193 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9194 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9195 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9196 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9200 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9202 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9203 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9207 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9209 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9210 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9212 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9213 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9217 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9219 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9220 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9224 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9225 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9226 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9227 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9231 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9233 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9234 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9238 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9240 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9241 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9245 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9247 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9248 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9252 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9253 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9254 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9255 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9259 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9260 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9261 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9262 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9266 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9268 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9269 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9273 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9274 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9275 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9276 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9280 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9281 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9282 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9283 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9287 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9288 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9289 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9290 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9294 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9295 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9296 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9297 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9301 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9302 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9303 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9304 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9308 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9309 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9310 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9311 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9313 MsiCloseHandle(hpkg);
9314 DeleteFileA(msifile);
9317 static void test_installprops(void)
9319 MSIHANDLE hpkg, hdb;
9320 CHAR path[MAX_PATH];
9328 GetCurrentDirectory(MAX_PATH, path);
9329 lstrcat(path, "\\");
9330 lstrcat(path, msifile);
9332 hdb = create_package_db();
9333 ok( hdb, "failed to create database\n");
9335 hpkg = package_from_db(hdb);
9336 ok( hpkg, "failed to create package\n");
9338 MsiCloseHandle(hdb);
9341 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
9342 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9343 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9345 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
9347 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
9352 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9356 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
9359 /* win9x doesn't set this */
9363 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
9364 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9365 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9371 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9375 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
9381 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
9382 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9383 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9387 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
9388 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9389 trace("VersionDatabase = %s\n", buf);
9392 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
9393 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9394 trace("VersionMsi = %s\n", buf);
9397 r = MsiGetProperty(hpkg, "Date", buf, &size);
9398 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9399 trace("Date = %s\n", buf);
9402 r = MsiGetProperty(hpkg, "Time", buf, &size);
9403 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9404 trace("Time = %s\n", buf);
9407 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
9408 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9409 trace("PackageCode = %s\n", buf);
9411 langid = GetUserDefaultLangID();
9412 sprintf(path, "%d", langid);
9415 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
9416 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9417 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
9419 res = GetSystemMetrics(SM_CXSCREEN);
9421 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
9422 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9424 res = GetSystemMetrics(SM_CYSCREEN);
9426 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
9427 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9431 MsiCloseHandle(hpkg);
9432 DeleteFile(msifile);
9435 static void test_launchconditions(void)
9441 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9443 hdb = create_package_db();
9444 ok( hdb, "failed to create package database\n" );
9446 r = create_launchcondition_table( hdb );
9447 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
9449 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
9450 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9452 /* invalid condition */
9453 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
9454 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9456 hpkg = package_from_db( hdb );
9457 ok( hpkg, "failed to create package\n");
9459 MsiCloseHandle( hdb );
9461 r = MsiSetProperty( hpkg, "X", "1" );
9462 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9464 /* invalid conditions are ignored */
9465 r = MsiDoAction( hpkg, "LaunchConditions" );
9466 ok( r == ERROR_SUCCESS, "cost init failed\n" );
9468 /* verify LaunchConditions still does some verification */
9469 r = MsiSetProperty( hpkg, "X", "2" );
9470 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9472 r = MsiDoAction( hpkg, "LaunchConditions" );
9473 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
9475 MsiCloseHandle( hpkg );
9476 DeleteFile( msifile );
9479 static void test_ccpsearch(void)
9481 MSIHANDLE hdb, hpkg;
9482 CHAR prop[MAX_PATH];
9483 DWORD size = MAX_PATH;
9486 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9488 hdb = create_package_db();
9489 ok(hdb, "failed to create package database\n");
9491 r = create_ccpsearch_table(hdb);
9492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9494 r = add_ccpsearch_entry(hdb, "'CCP_random'");
9495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9497 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
9498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9500 r = create_reglocator_table(hdb);
9501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9503 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9506 r = create_drlocator_table(hdb);
9507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9509 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
9510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9512 r = create_signature_table(hdb);
9513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9515 hpkg = package_from_db(hdb);
9516 ok(hpkg, "failed to create package\n");
9518 MsiCloseHandle(hdb);
9520 r = MsiDoAction(hpkg, "CCPSearch");
9521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9523 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
9524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9525 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
9527 MsiCloseHandle(hpkg);
9528 DeleteFileA(msifile);
9531 static void test_complocator(void)
9533 MSIHANDLE hdb, hpkg;
9535 CHAR prop[MAX_PATH];
9536 CHAR expected[MAX_PATH];
9537 DWORD size = MAX_PATH;
9539 hdb = create_package_db();
9540 ok(hdb, "failed to create package database\n");
9542 r = create_appsearch_table(hdb);
9543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9545 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
9546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9548 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
9549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9551 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
9552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9554 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
9555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9557 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
9558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9560 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
9561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9563 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
9564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9566 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
9567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9569 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
9570 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9572 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
9573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9575 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
9576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9578 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
9579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9581 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
9582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9584 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
9585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9587 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
9588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9590 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
9591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9593 r = create_complocator_table(hdb);
9594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9596 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9599 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9600 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9602 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9603 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9605 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9608 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9611 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9612 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9614 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9617 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9618 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9620 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9621 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9623 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9626 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9629 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9632 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9635 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9638 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9641 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9644 r = create_signature_table(hdb);
9645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9647 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9650 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9653 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9656 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9659 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9662 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9665 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9668 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9671 hpkg = package_from_db(hdb);
9672 ok(hpkg, "failed to create package\n");
9674 MsiCloseHandle(hdb);
9676 create_test_file("abelisaurus");
9677 create_test_file("bactrosaurus");
9678 create_test_file("camelotia");
9679 create_test_file("diclonius");
9680 create_test_file("echinodon");
9681 create_test_file("falcarius");
9682 create_test_file("gallimimus");
9683 create_test_file("hagryphus");
9684 CreateDirectoryA("iguanodon", NULL);
9685 CreateDirectoryA("jobaria", NULL);
9686 CreateDirectoryA("kakuru", NULL);
9687 CreateDirectoryA("labocania", NULL);
9688 CreateDirectoryA("megaraptor", NULL);
9689 CreateDirectoryA("neosodon", NULL);
9690 CreateDirectoryA("olorotitan", NULL);
9691 CreateDirectoryA("pantydraco", NULL);
9693 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
9694 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
9695 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
9696 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
9697 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
9698 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
9699 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
9700 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
9701 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
9702 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
9703 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
9704 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
9705 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
9706 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
9707 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
9708 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
9710 r = MsiDoAction(hpkg, "AppSearch");
9711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9714 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
9715 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9717 lstrcpyA(expected, CURR_DIR);
9718 lstrcatA(expected, "\\abelisaurus");
9719 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9720 "Expected %s or empty string, got %s\n", expected, prop);
9723 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
9724 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9725 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9728 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
9729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9730 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9733 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
9734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9735 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9738 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
9739 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9741 lstrcpyA(expected, CURR_DIR);
9742 lstrcatA(expected, "\\");
9743 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9744 "Expected %s or empty string, got %s\n", expected, prop);
9747 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
9748 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9749 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9752 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
9753 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9754 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9757 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
9758 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9759 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9762 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
9763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9764 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9767 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
9768 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9769 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9772 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
9773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9774 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9777 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
9778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9779 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9782 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
9783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9785 lstrcpyA(expected, CURR_DIR);
9786 lstrcatA(expected, "\\");
9787 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9788 "Expected %s or empty string, got %s\n", expected, prop);
9791 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
9792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9794 lstrcpyA(expected, CURR_DIR);
9795 lstrcatA(expected, "\\neosodon\\");
9796 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9797 "Expected %s or empty string, got %s\n", expected, prop);
9800 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
9801 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9802 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9805 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
9806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9807 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9809 MsiCloseHandle(hpkg);
9810 DeleteFileA("abelisaurus");
9811 DeleteFileA("bactrosaurus");
9812 DeleteFileA("camelotia");
9813 DeleteFileA("diclonius");
9814 DeleteFileA("echinodon");
9815 DeleteFileA("falcarius");
9816 DeleteFileA("gallimimus");
9817 DeleteFileA("hagryphus");
9818 RemoveDirectoryA("iguanodon");
9819 RemoveDirectoryA("jobaria");
9820 RemoveDirectoryA("kakuru");
9821 RemoveDirectoryA("labocania");
9822 RemoveDirectoryA("megaraptor");
9823 RemoveDirectoryA("neosodon");
9824 RemoveDirectoryA("olorotitan");
9825 RemoveDirectoryA("pantydraco");
9826 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
9827 MSIINSTALLCONTEXT_MACHINE, NULL);
9828 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
9829 MSIINSTALLCONTEXT_MACHINE, NULL);
9830 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
9831 MSIINSTALLCONTEXT_MACHINE, NULL);
9832 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
9833 MSIINSTALLCONTEXT_MACHINE, NULL);
9834 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
9835 MSIINSTALLCONTEXT_MACHINE, NULL);
9836 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
9837 MSIINSTALLCONTEXT_MACHINE, NULL);
9838 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
9839 MSIINSTALLCONTEXT_MACHINE, NULL);
9840 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
9841 MSIINSTALLCONTEXT_MACHINE, NULL);
9842 DeleteFileA(msifile);
9845 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
9850 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
9851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9853 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
9854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9856 r = MsiSummaryInfoPersist(summary);
9857 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9859 MsiCloseHandle(summary);
9862 static void test_MsiGetSourcePath(void)
9864 MSIHANDLE hdb, hpkg;
9865 CHAR path[MAX_PATH];
9867 CHAR subsrc[MAX_PATH];
9868 CHAR sub2[MAX_PATH];
9872 lstrcpyA(cwd, CURR_DIR);
9873 lstrcatA(cwd, "\\");
9875 lstrcpyA(subsrc, cwd);
9876 lstrcatA(subsrc, "subsource");
9877 lstrcatA(subsrc, "\\");
9879 lstrcpyA(sub2, subsrc);
9880 lstrcatA(sub2, "sub2");
9881 lstrcatA(sub2, "\\");
9883 /* uncompressed source */
9885 hdb = create_package_db();
9886 ok( hdb, "failed to create database\n");
9888 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
9890 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
9891 ok(r == S_OK, "failed\n");
9893 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
9894 ok(r == S_OK, "failed\n");
9896 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
9897 ok(r == S_OK, "failed\n");
9899 r = MsiDatabaseCommit(hdb);
9900 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
9902 hpkg = package_from_db(hdb);
9903 ok(hpkg, "failed to create package\n");
9905 MsiCloseHandle(hdb);
9907 /* invalid database handle */
9909 lstrcpyA(path, "kiwi");
9910 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
9911 ok(r == ERROR_INVALID_HANDLE,
9912 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
9913 ok(!lstrcmpA(path, "kiwi"),
9914 "Expected path to be unchanged, got \"%s\"\n", path);
9915 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9919 lstrcpyA(path, "kiwi");
9920 r = MsiGetSourcePath(hpkg, NULL, path, &size);
9921 ok(r == ERROR_INVALID_PARAMETER,
9922 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
9923 ok(!lstrcmpA(path, "kiwi"),
9924 "Expected path to be unchanged, got \"%s\"\n", path);
9925 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9927 /* empty szFolder */
9929 lstrcpyA(path, "kiwi");
9930 r = MsiGetSourcePath(hpkg, "", path, &size);
9931 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, 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);
9938 lstrcpyA(path, "kiwi");
9939 r = MsiGetSourcePath(hpkg, "TARGETDIR", 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, "SourceDir", 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);
9963 /* source path does not exist, but the property exists */
9965 lstrcpyA(path, "kiwi");
9966 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9967 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9968 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9969 ok(size == 0, "Expected 0, got %d\n", size);
9973 lstrcpyA(path, "kiwi");
9974 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9975 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9976 ok(!lstrcmpA(path, "kiwi"),
9977 "Expected path to be unchanged, got \"%s\"\n", path);
9978 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9982 lstrcpyA(path, "kiwi");
9983 r = MsiGetSourcePath(hpkg, "SubDir2", 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);
9989 r = MsiDoAction(hpkg, "CostInitialize");
9990 ok(r == ERROR_SUCCESS, "cost init failed\n");
9992 /* try TARGETDIR after CostInitialize */
9994 lstrcpyA(path, "kiwi");
9995 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9996 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9997 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9998 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10000 /* try SourceDir after CostInitialize */
10002 lstrcpyA(path, "kiwi");
10003 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10004 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10005 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10006 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10008 /* try SOURCEDIR after CostInitialize */
10010 lstrcpyA(path, "kiwi");
10011 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10012 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10013 ok(!lstrcmpA(path, "kiwi"),
10014 "Expected path to be unchanged, got \"%s\"\n", path);
10015 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10017 /* source path does not exist, but the property exists */
10019 lstrcpyA(path, "kiwi");
10020 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10021 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10024 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10025 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10028 /* try SubDir after CostInitialize */
10030 lstrcpyA(path, "kiwi");
10031 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10033 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10034 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10036 /* try SubDir2 after CostInitialize */
10038 lstrcpyA(path, "kiwi");
10039 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10041 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10042 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10044 r = MsiDoAction(hpkg, "ResolveSource");
10045 ok(r == ERROR_SUCCESS, "file cost failed\n");
10047 /* try TARGETDIR after ResolveSource */
10049 lstrcpyA(path, "kiwi");
10050 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10052 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10053 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10055 /* try SourceDir after ResolveSource */
10057 lstrcpyA(path, "kiwi");
10058 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10059 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10060 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10061 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10063 /* try SOURCEDIR after ResolveSource */
10065 lstrcpyA(path, "kiwi");
10066 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10067 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10068 ok(!lstrcmpA(path, "kiwi"),
10069 "Expected path to be unchanged, got \"%s\"\n", path);
10070 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10072 /* source path does not exist, but the property exists */
10074 lstrcpyA(path, "kiwi");
10075 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10077 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10078 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10080 /* try SubDir after ResolveSource */
10082 lstrcpyA(path, "kiwi");
10083 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10085 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10086 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10088 /* try SubDir2 after ResolveSource */
10090 lstrcpyA(path, "kiwi");
10091 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10093 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10094 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10096 r = MsiDoAction(hpkg, "FileCost");
10097 ok(r == ERROR_SUCCESS, "file cost failed\n");
10099 /* try TARGETDIR after FileCost */
10101 lstrcpyA(path, "kiwi");
10102 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10104 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10105 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10107 /* try SourceDir after FileCost */
10109 lstrcpyA(path, "kiwi");
10110 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10112 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10113 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10115 /* try SOURCEDIR after FileCost */
10117 lstrcpyA(path, "kiwi");
10118 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10119 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10120 ok(!lstrcmpA(path, "kiwi"),
10121 "Expected path to be unchanged, got \"%s\"\n", path);
10122 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10124 /* source path does not exist, but the property exists */
10126 lstrcpyA(path, "kiwi");
10127 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10128 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10129 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10130 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10132 /* try SubDir after FileCost */
10134 lstrcpyA(path, "kiwi");
10135 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10137 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10138 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10140 /* try SubDir2 after FileCost */
10142 lstrcpyA(path, "kiwi");
10143 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10144 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10145 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10146 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10148 r = MsiDoAction(hpkg, "CostFinalize");
10149 ok(r == ERROR_SUCCESS, "file cost failed\n");
10151 /* try TARGETDIR after CostFinalize */
10153 lstrcpyA(path, "kiwi");
10154 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10155 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10156 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10157 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10159 /* try SourceDir after CostFinalize */
10161 lstrcpyA(path, "kiwi");
10162 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10163 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10164 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10165 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10167 /* try SOURCEDIR after CostFinalize */
10169 lstrcpyA(path, "kiwi");
10170 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10171 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10172 ok(!lstrcmpA(path, "kiwi"),
10173 "Expected path to be unchanged, got \"%s\"\n", path);
10174 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10176 /* source path does not exist, but the property exists */
10178 lstrcpyA(path, "kiwi");
10179 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10181 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10182 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10184 /* try SubDir after CostFinalize */
10186 lstrcpyA(path, "kiwi");
10187 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10188 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10189 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10190 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10192 /* try SubDir2 after CostFinalize */
10194 lstrcpyA(path, "kiwi");
10195 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10197 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10198 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10200 /* nonexistent directory */
10202 lstrcpyA(path, "kiwi");
10203 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
10204 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10205 ok(!lstrcmpA(path, "kiwi"),
10206 "Expected path to be unchanged, got \"%s\"\n", path);
10207 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10209 /* NULL szPathBuf */
10211 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
10212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10213 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10215 /* NULL pcchPathBuf */
10216 lstrcpyA(path, "kiwi");
10217 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
10218 ok(r == ERROR_INVALID_PARAMETER,
10219 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10220 ok(!lstrcmpA(path, "kiwi"),
10221 "Expected path to be unchanged, got \"%s\"\n", path);
10223 /* pcchPathBuf is 0 */
10225 lstrcpyA(path, "kiwi");
10226 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10227 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10228 ok(!lstrcmpA(path, "kiwi"),
10229 "Expected path to be unchanged, got \"%s\"\n", path);
10230 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10232 /* pcchPathBuf does not have room for NULL terminator */
10233 size = lstrlenA(cwd);
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(!strncmp(path, cwd, lstrlenA(cwd) - 1),
10238 "Expected path with no backslash, got \"%s\"\n", path);
10239 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10241 /* pcchPathBuf has room for NULL terminator */
10242 size = lstrlenA(cwd) + 1;
10243 lstrcpyA(path, "kiwi");
10244 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10245 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10246 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10247 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10249 MsiCloseHandle(hpkg);
10251 /* compressed source */
10253 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10254 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10256 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
10258 hpkg = package_from_db(hdb);
10259 ok(hpkg, "failed to create package\n");
10261 /* try TARGETDIR */
10263 lstrcpyA(path, "kiwi");
10264 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10265 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10266 ok(!lstrcmpA(path, "kiwi"),
10267 "Expected path to be unchanged, got \"%s\"\n", path);
10268 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10270 /* try SourceDir */
10272 lstrcpyA(path, "kiwi");
10273 r = MsiGetSourcePath(hpkg, "SourceDir", 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 /* source path nor the property exist */
10290 lstrcpyA(path, "kiwi");
10291 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10293 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10294 ok(size == 0, "Expected 0, got %d\n", size);
10298 lstrcpyA(path, "kiwi");
10299 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10300 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10301 ok(!lstrcmpA(path, "kiwi"),
10302 "Expected path to be unchanged, got \"%s\"\n", path);
10303 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10307 lstrcpyA(path, "kiwi");
10308 r = MsiGetSourcePath(hpkg, "SubDir2", 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);
10314 r = MsiDoAction(hpkg, "CostInitialize");
10315 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10317 /* try TARGETDIR after CostInitialize */
10319 lstrcpyA(path, "kiwi");
10320 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10321 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10322 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10323 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10325 /* try SourceDir after CostInitialize */
10327 lstrcpyA(path, "kiwi");
10328 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10329 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10330 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10331 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10333 /* try SOURCEDIR after CostInitialize */
10335 lstrcpyA(path, "kiwi");
10336 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10340 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10341 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10344 /* source path does not exist, but the property exists */
10346 lstrcpyA(path, "kiwi");
10347 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10348 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10351 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10352 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10355 /* try SubDir after CostInitialize */
10357 lstrcpyA(path, "kiwi");
10358 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10359 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);
10363 /* try SubDir2 after CostInitialize */
10365 lstrcpyA(path, "kiwi");
10366 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10368 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10369 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10371 r = MsiDoAction(hpkg, "ResolveSource");
10372 ok(r == ERROR_SUCCESS, "file cost failed\n");
10374 /* try TARGETDIR after ResolveSource */
10376 lstrcpyA(path, "kiwi");
10377 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10378 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10379 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10380 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10382 /* try SourceDir after ResolveSource */
10384 lstrcpyA(path, "kiwi");
10385 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10387 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10388 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10390 /* try SOURCEDIR after ResolveSource */
10392 lstrcpyA(path, "kiwi");
10393 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10397 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10398 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10401 /* source path and the property exist */
10403 lstrcpyA(path, "kiwi");
10404 r = MsiGetProperty(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);
10409 /* try SubDir after ResolveSource */
10411 lstrcpyA(path, "kiwi");
10412 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10414 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10415 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10417 /* try SubDir2 after ResolveSource */
10419 lstrcpyA(path, "kiwi");
10420 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10422 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10423 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10425 r = MsiDoAction(hpkg, "FileCost");
10426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10428 /* try TARGETDIR after CostFinalize */
10430 lstrcpyA(path, "kiwi");
10431 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10433 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10434 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10436 /* try SourceDir after CostFinalize */
10438 lstrcpyA(path, "kiwi");
10439 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10441 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10442 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10444 /* try SOURCEDIR after CostFinalize */
10446 lstrcpyA(path, "kiwi");
10447 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10451 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10452 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10455 /* source path and the property exist */
10457 lstrcpyA(path, "kiwi");
10458 r = MsiGetProperty(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);
10463 /* try SubDir after CostFinalize */
10465 lstrcpyA(path, "kiwi");
10466 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10468 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10469 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10471 /* try SubDir2 after CostFinalize */
10473 lstrcpyA(path, "kiwi");
10474 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10476 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10477 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10479 r = MsiDoAction(hpkg, "CostFinalize");
10480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10482 /* try TARGETDIR after CostFinalize */
10484 lstrcpyA(path, "kiwi");
10485 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10487 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10488 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10490 /* try SourceDir after CostFinalize */
10492 lstrcpyA(path, "kiwi");
10493 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10495 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10496 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10498 /* try SOURCEDIR after CostFinalize */
10500 lstrcpyA(path, "kiwi");
10501 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10505 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10506 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10509 /* source path and the property exist */
10511 lstrcpyA(path, "kiwi");
10512 r = MsiGetProperty(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);
10517 /* try SubDir after CostFinalize */
10519 lstrcpyA(path, "kiwi");
10520 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10522 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10523 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10525 /* try SubDir2 after CostFinalize */
10527 lstrcpyA(path, "kiwi");
10528 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10530 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10531 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10533 MsiCloseHandle(hpkg);
10534 DeleteFile(msifile);
10537 static void test_shortlongsource(void)
10539 MSIHANDLE hdb, hpkg;
10540 CHAR path[MAX_PATH];
10541 CHAR cwd[MAX_PATH];
10542 CHAR subsrc[MAX_PATH];
10546 lstrcpyA(cwd, CURR_DIR);
10547 lstrcatA(cwd, "\\");
10549 lstrcpyA(subsrc, cwd);
10550 lstrcatA(subsrc, "long");
10551 lstrcatA(subsrc, "\\");
10553 /* long file names */
10555 hdb = create_package_db();
10556 ok( hdb, "failed to create database\n");
10558 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10560 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10561 ok(r == S_OK, "failed\n");
10563 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
10564 ok(r == S_OK, "failed\n");
10566 /* CostInitialize:short */
10567 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
10568 ok(r == S_OK, "failed\n");
10570 /* CostInitialize:long */
10571 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
10572 ok(r == S_OK, "failed\n");
10574 /* FileCost:short */
10575 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
10576 ok(r == S_OK, "failed\n");
10578 /* FileCost:long */
10579 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
10580 ok(r == S_OK, "failed\n");
10582 /* CostFinalize:short */
10583 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
10584 ok(r == S_OK, "failed\n");
10586 /* CostFinalize:long */
10587 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
10588 ok(r == S_OK, "failed\n");
10590 MsiDatabaseCommit(hdb);
10592 hpkg = package_from_db(hdb);
10593 ok(hpkg, "failed to create package\n");
10595 MsiCloseHandle(hdb);
10597 CreateDirectoryA("one", NULL);
10598 CreateDirectoryA("four", NULL);
10600 r = MsiDoAction(hpkg, "CostInitialize");
10601 ok(r == ERROR_SUCCESS, "file cost failed\n");
10603 CreateDirectory("five", NULL);
10604 CreateDirectory("eight", NULL);
10606 r = MsiDoAction(hpkg, "FileCost");
10607 ok(r == ERROR_SUCCESS, "file cost failed\n");
10609 CreateDirectory("nine", NULL);
10610 CreateDirectory("twelve", NULL);
10612 r = MsiDoAction(hpkg, "CostFinalize");
10613 ok(r == ERROR_SUCCESS, "file cost failed\n");
10615 /* neither short nor long source directories exist */
10617 lstrcpyA(path, "kiwi");
10618 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10619 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10620 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10621 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10623 CreateDirectoryA("short", NULL);
10625 /* short source directory exists */
10627 lstrcpyA(path, "kiwi");
10628 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10630 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10631 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10633 CreateDirectoryA("long", NULL);
10635 /* both short and long source directories exist */
10637 lstrcpyA(path, "kiwi");
10638 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10640 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10641 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10643 lstrcpyA(subsrc, cwd);
10644 lstrcatA(subsrc, "two");
10645 lstrcatA(subsrc, "\\");
10647 /* short dir exists before CostInitialize */
10649 lstrcpyA(path, "kiwi");
10650 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10652 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10653 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10655 lstrcpyA(subsrc, cwd);
10656 lstrcatA(subsrc, "four");
10657 lstrcatA(subsrc, "\\");
10659 /* long dir exists before CostInitialize */
10661 lstrcpyA(path, "kiwi");
10662 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10664 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10665 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10667 lstrcpyA(subsrc, cwd);
10668 lstrcatA(subsrc, "six");
10669 lstrcatA(subsrc, "\\");
10671 /* short dir exists before FileCost */
10673 lstrcpyA(path, "kiwi");
10674 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10676 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10677 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10679 lstrcpyA(subsrc, cwd);
10680 lstrcatA(subsrc, "eight");
10681 lstrcatA(subsrc, "\\");
10683 /* long dir exists before FileCost */
10685 lstrcpyA(path, "kiwi");
10686 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10687 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10688 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10689 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10691 lstrcpyA(subsrc, cwd);
10692 lstrcatA(subsrc, "ten");
10693 lstrcatA(subsrc, "\\");
10695 /* short dir exists before CostFinalize */
10697 lstrcpyA(path, "kiwi");
10698 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10700 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10701 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10703 lstrcpyA(subsrc, cwd);
10704 lstrcatA(subsrc, "twelve");
10705 lstrcatA(subsrc, "\\");
10707 /* long dir exists before CostFinalize */
10709 lstrcpyA(path, "kiwi");
10710 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10712 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10713 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10715 MsiCloseHandle(hpkg);
10716 RemoveDirectoryA("short");
10717 RemoveDirectoryA("long");
10718 RemoveDirectoryA("one");
10719 RemoveDirectoryA("four");
10720 RemoveDirectoryA("five");
10721 RemoveDirectoryA("eight");
10722 RemoveDirectoryA("nine");
10723 RemoveDirectoryA("twelve");
10725 /* short file names */
10727 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10728 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10730 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
10732 hpkg = package_from_db(hdb);
10733 ok(hpkg, "failed to create package\n");
10735 MsiCloseHandle(hdb);
10737 CreateDirectoryA("one", NULL);
10738 CreateDirectoryA("four", NULL);
10740 r = MsiDoAction(hpkg, "CostInitialize");
10741 ok(r == ERROR_SUCCESS, "file cost failed\n");
10743 CreateDirectory("five", NULL);
10744 CreateDirectory("eight", NULL);
10746 r = MsiDoAction(hpkg, "FileCost");
10747 ok(r == ERROR_SUCCESS, "file cost failed\n");
10749 CreateDirectory("nine", NULL);
10750 CreateDirectory("twelve", NULL);
10752 r = MsiDoAction(hpkg, "CostFinalize");
10753 ok(r == ERROR_SUCCESS, "file cost failed\n");
10755 lstrcpyA(subsrc, cwd);
10756 lstrcatA(subsrc, "short");
10757 lstrcatA(subsrc, "\\");
10759 /* neither short nor long source directories exist */
10761 lstrcpyA(path, "kiwi");
10762 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10764 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10765 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10767 CreateDirectoryA("short", NULL);
10769 /* short source directory exists */
10771 lstrcpyA(path, "kiwi");
10772 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10774 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10775 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10777 CreateDirectoryA("long", NULL);
10779 /* both short and long source directories exist */
10781 lstrcpyA(path, "kiwi");
10782 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10784 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10785 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10787 lstrcpyA(subsrc, cwd);
10788 lstrcatA(subsrc, "one");
10789 lstrcatA(subsrc, "\\");
10791 /* short dir exists before CostInitialize */
10793 lstrcpyA(path, "kiwi");
10794 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10796 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10797 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10799 lstrcpyA(subsrc, cwd);
10800 lstrcatA(subsrc, "three");
10801 lstrcatA(subsrc, "\\");
10803 /* long dir exists before CostInitialize */
10805 lstrcpyA(path, "kiwi");
10806 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10807 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10808 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10809 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10811 lstrcpyA(subsrc, cwd);
10812 lstrcatA(subsrc, "five");
10813 lstrcatA(subsrc, "\\");
10815 /* short dir exists before FileCost */
10817 lstrcpyA(path, "kiwi");
10818 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10819 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10820 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10821 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10823 lstrcpyA(subsrc, cwd);
10824 lstrcatA(subsrc, "seven");
10825 lstrcatA(subsrc, "\\");
10827 /* long dir exists before FileCost */
10829 lstrcpyA(path, "kiwi");
10830 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10832 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10833 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10835 lstrcpyA(subsrc, cwd);
10836 lstrcatA(subsrc, "nine");
10837 lstrcatA(subsrc, "\\");
10839 /* short dir exists before CostFinalize */
10841 lstrcpyA(path, "kiwi");
10842 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10843 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10844 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10845 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10847 lstrcpyA(subsrc, cwd);
10848 lstrcatA(subsrc, "eleven");
10849 lstrcatA(subsrc, "\\");
10851 /* long dir exists before CostFinalize */
10853 lstrcpyA(path, "kiwi");
10854 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10855 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10856 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10857 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10859 MsiCloseHandle(hpkg);
10860 RemoveDirectoryA("short");
10861 RemoveDirectoryA("long");
10862 RemoveDirectoryA("one");
10863 RemoveDirectoryA("four");
10864 RemoveDirectoryA("five");
10865 RemoveDirectoryA("eight");
10866 RemoveDirectoryA("nine");
10867 RemoveDirectoryA("twelve");
10868 DeleteFileA(msifile);
10871 static void test_sourcedir(void)
10873 MSIHANDLE hdb, hpkg;
10875 CHAR path[MAX_PATH];
10876 CHAR cwd[MAX_PATH];
10877 CHAR subsrc[MAX_PATH];
10881 lstrcpyA(cwd, CURR_DIR);
10882 lstrcatA(cwd, "\\");
10884 lstrcpyA(subsrc, cwd);
10885 lstrcatA(subsrc, "long");
10886 lstrcatA(subsrc, "\\");
10888 hdb = create_package_db();
10889 ok( hdb, "failed to create database\n");
10891 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10892 ok(r == S_OK, "failed\n");
10894 sprintf(package, "#%i", hdb);
10895 r = MsiOpenPackage(package, &hpkg);
10896 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10898 /* properties only */
10900 /* SourceDir prop */
10902 lstrcpyA(path, "kiwi");
10903 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10904 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10905 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10906 ok(size == 0, "Expected 0, got %d\n", size);
10908 /* SOURCEDIR prop */
10910 lstrcpyA(path, "kiwi");
10911 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10913 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10914 ok(size == 0, "Expected 0, got %d\n", size);
10916 r = MsiDoAction(hpkg, "CostInitialize");
10917 ok(r == ERROR_SUCCESS, "file cost failed\n");
10919 /* SourceDir after CostInitialize */
10921 lstrcpyA(path, "kiwi");
10922 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10923 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10924 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10925 ok(size == 0, "Expected 0, got %d\n", size);
10927 /* SOURCEDIR after CostInitialize */
10929 lstrcpyA(path, "kiwi");
10930 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10931 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10932 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10933 ok(size == 0, "Expected 0, got %d\n", size);
10935 r = MsiDoAction(hpkg, "FileCost");
10936 ok(r == ERROR_SUCCESS, "file cost failed\n");
10938 /* SourceDir after FileCost */
10940 lstrcpyA(path, "kiwi");
10941 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10942 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10943 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10944 ok(size == 0, "Expected 0, got %d\n", size);
10946 /* SOURCEDIR after FileCost */
10948 lstrcpyA(path, "kiwi");
10949 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10951 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10952 ok(size == 0, "Expected 0, got %d\n", size);
10954 r = MsiDoAction(hpkg, "CostFinalize");
10955 ok(r == ERROR_SUCCESS, "file cost failed\n");
10957 /* SourceDir after CostFinalize */
10959 lstrcpyA(path, "kiwi");
10960 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10961 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10962 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10963 ok(size == 0, "Expected 0, got %d\n", size);
10965 /* SOURCEDIR after CostFinalize */
10967 lstrcpyA(path, "kiwi");
10968 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10969 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10970 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10971 ok(size == 0, "Expected 0, got %d\n", size);
10973 r = MsiDoAction(hpkg, "ResolveSource");
10974 ok(r == ERROR_SUCCESS, "file cost failed\n");
10976 /* SourceDir after ResolveSource */
10978 lstrcpyA(path, "kiwi");
10979 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10981 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10982 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10984 /* SOURCEDIR after ResolveSource */
10986 lstrcpyA(path, "kiwi");
10987 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10988 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10989 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10990 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10992 /* random casing */
10994 lstrcpyA(path, "kiwi");
10995 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
10996 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10997 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10998 ok(size == 0, "Expected 0, got %d\n", size);
11000 MsiCloseHandle(hpkg);
11002 /* reset the package state */
11003 sprintf(package, "#%i", hdb);
11004 r = MsiOpenPackage(package, &hpkg);
11005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11007 /* test how MsiGetSourcePath affects the properties */
11009 /* SourceDir prop */
11011 lstrcpyA(path, "kiwi");
11012 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11013 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11016 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11017 ok(size == 0, "Expected 0, got %d\n", size);
11021 lstrcpyA(path, "kiwi");
11022 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11023 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11024 ok(!lstrcmpA(path, "kiwi"),
11025 "Expected path to be unchanged, got \"%s\"\n", path);
11026 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11028 /* SourceDir after MsiGetSourcePath */
11030 lstrcpyA(path, "kiwi");
11031 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11035 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11036 ok(size == 0, "Expected 0, got %d\n", size);
11039 /* SOURCEDIR prop */
11041 lstrcpyA(path, "kiwi");
11042 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11043 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11046 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11047 ok(size == 0, "Expected 0, got %d\n", size);
11051 lstrcpyA(path, "kiwi");
11052 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11053 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11054 ok(!lstrcmpA(path, "kiwi"),
11055 "Expected path to be unchanged, got \"%s\"\n", path);
11056 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11058 /* SOURCEDIR prop after MsiGetSourcePath */
11060 lstrcpyA(path, "kiwi");
11061 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11062 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11065 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11066 ok(size == 0, "Expected 0, got %d\n", size);
11069 r = MsiDoAction(hpkg, "CostInitialize");
11070 ok(r == ERROR_SUCCESS, "file cost failed\n");
11072 /* SourceDir after CostInitialize */
11074 lstrcpyA(path, "kiwi");
11075 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11079 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11080 ok(size == 0, "Expected 0, got %d\n", size);
11084 lstrcpyA(path, "kiwi");
11085 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11087 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11088 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11090 /* SourceDir after MsiGetSourcePath */
11092 lstrcpyA(path, "kiwi");
11093 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11094 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11095 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11096 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11098 /* SOURCEDIR after CostInitialize */
11100 lstrcpyA(path, "kiwi");
11101 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11103 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11104 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11106 /* SOURCEDIR source path still does not exist */
11108 lstrcpyA(path, "kiwi");
11109 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11110 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11111 ok(!lstrcmpA(path, "kiwi"),
11112 "Expected path to be unchanged, got \"%s\"\n", path);
11113 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11115 r = MsiDoAction(hpkg, "FileCost");
11116 ok(r == ERROR_SUCCESS, "file cost failed\n");
11118 /* SourceDir after FileCost */
11120 lstrcpyA(path, "kiwi");
11121 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11122 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11123 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11124 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11126 /* SOURCEDIR after FileCost */
11128 lstrcpyA(path, "kiwi");
11129 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11131 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11132 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11134 /* SOURCEDIR source path still does not exist */
11136 lstrcpyA(path, "kiwi");
11137 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11138 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11139 ok(!lstrcmpA(path, "kiwi"),
11140 "Expected path to be unchanged, got \"%s\"\n", path);
11141 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11143 r = MsiDoAction(hpkg, "CostFinalize");
11144 ok(r == ERROR_SUCCESS, "file cost failed\n");
11146 /* SourceDir after CostFinalize */
11148 lstrcpyA(path, "kiwi");
11149 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11151 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11152 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11154 /* SOURCEDIR after CostFinalize */
11156 lstrcpyA(path, "kiwi");
11157 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11158 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11159 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11160 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11162 /* SOURCEDIR source path still does not exist */
11164 lstrcpyA(path, "kiwi");
11165 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11166 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11167 ok(!lstrcmpA(path, "kiwi"),
11168 "Expected path to be unchanged, got \"%s\"\n", path);
11169 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11171 r = MsiDoAction(hpkg, "ResolveSource");
11172 ok(r == ERROR_SUCCESS, "file cost failed\n");
11174 /* SourceDir after ResolveSource */
11176 lstrcpyA(path, "kiwi");
11177 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11179 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11180 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11182 /* SOURCEDIR after ResolveSource */
11184 lstrcpyA(path, "kiwi");
11185 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11186 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11187 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11188 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11190 /* SOURCEDIR source path still does not exist */
11192 lstrcpyA(path, "kiwi");
11193 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11194 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11195 ok(!lstrcmpA(path, "kiwi"),
11196 "Expected path to be unchanged, got \"%s\"\n", path);
11197 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11199 MsiCloseHandle(hdb);
11200 MsiCloseHandle(hpkg);
11201 DeleteFileA(msifile);
11211 static const struct access_res create[16] =
11213 { TRUE, ERROR_SUCCESS, TRUE },
11214 { TRUE, ERROR_SUCCESS, TRUE },
11215 { TRUE, ERROR_SUCCESS, FALSE },
11216 { TRUE, ERROR_SUCCESS, FALSE },
11217 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11218 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11219 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11220 { TRUE, ERROR_SUCCESS, FALSE },
11221 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11222 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11223 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11224 { TRUE, ERROR_SUCCESS, TRUE },
11225 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11226 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11227 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11228 { TRUE, ERROR_SUCCESS, TRUE }
11231 static const struct access_res create_commit[16] =
11233 { TRUE, ERROR_SUCCESS, TRUE },
11234 { TRUE, ERROR_SUCCESS, TRUE },
11235 { TRUE, ERROR_SUCCESS, FALSE },
11236 { TRUE, ERROR_SUCCESS, FALSE },
11237 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11238 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11239 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11240 { TRUE, ERROR_SUCCESS, FALSE },
11241 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11242 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11243 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11244 { TRUE, ERROR_SUCCESS, TRUE },
11245 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11246 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11247 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
11248 { TRUE, ERROR_SUCCESS, TRUE }
11251 static const struct access_res create_close[16] =
11253 { TRUE, ERROR_SUCCESS, FALSE },
11254 { TRUE, ERROR_SUCCESS, FALSE },
11255 { TRUE, ERROR_SUCCESS, FALSE },
11256 { TRUE, ERROR_SUCCESS, FALSE },
11257 { TRUE, ERROR_SUCCESS, FALSE },
11258 { TRUE, ERROR_SUCCESS, FALSE },
11259 { TRUE, ERROR_SUCCESS, FALSE },
11260 { TRUE, ERROR_SUCCESS, FALSE },
11261 { TRUE, ERROR_SUCCESS, FALSE },
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 }
11271 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
11273 DWORD access = 0, share = 0;
11278 for (i = 0; i < 4; i++)
11280 if (i == 0) access = 0;
11281 if (i == 1) access = GENERIC_READ;
11282 if (i == 2) access = GENERIC_WRITE;
11283 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
11285 for (j = 0; j < 4; j++)
11287 if (ares[idx].ignore)
11290 if (j == 0) share = 0;
11291 if (j == 1) share = FILE_SHARE_READ;
11292 if (j == 2) share = FILE_SHARE_WRITE;
11293 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
11295 SetLastError(0xdeadbeef);
11296 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
11297 FILE_ATTRIBUTE_NORMAL, 0);
11298 lasterr = GetLastError();
11300 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
11301 "(%d, handle, %d): Expected %d, got %d\n",
11302 line, idx, ares[idx].gothandle,
11303 (hfile != INVALID_HANDLE_VALUE));
11305 ok(lasterr == ares[idx].lasterr ||
11306 lasterr == 0xdeadbeef, /* win9x */
11307 "(%d, lasterr, %d): Expected %d, got %d\n",
11308 line, idx, ares[idx].lasterr, lasterr);
11310 CloseHandle(hfile);
11316 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
11318 static void test_access(void)
11323 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
11324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11326 test_file_access(msifile, create);
11328 r = MsiDatabaseCommit(hdb);
11329 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11331 test_file_access(msifile, create_commit);
11333 MsiCloseHandle(hdb);
11335 test_file_access(msifile, create_close);
11337 DeleteFileA(msifile);
11339 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
11340 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11342 test_file_access(msifile, create);
11344 r = MsiDatabaseCommit(hdb);
11345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11347 test_file_access(msifile, create_commit);
11349 MsiCloseHandle(hdb);
11351 test_file_access(msifile, create_close);
11353 DeleteFileA(msifile);
11356 static void test_emptypackage(void)
11358 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
11359 MSIHANDLE hview = 0, hrec = 0;
11360 MSICONDITION condition;
11361 CHAR buffer[MAX_PATH];
11365 r = MsiOpenPackageA("", &hpkg);
11368 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11371 hdb = MsiGetActiveDatabase(hpkg);
11374 ok(hdb != 0, "Expected a valid database handle\n");
11377 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
11380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11382 r = MsiViewExecute(hview, 0);
11385 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11388 r = MsiViewFetch(hview, &hrec);
11391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11395 r = MsiRecordGetString(hrec, 1, buffer, &size);
11398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11399 ok(!lstrcmpA(buffer, "_Property"),
11400 "Expected \"_Property\", got \"%s\"\n", buffer);
11403 MsiCloseHandle(hrec);
11405 r = MsiViewFetch(hview, &hrec);
11408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11412 r = MsiRecordGetString(hrec, 1, buffer, &size);
11415 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11416 ok(!lstrcmpA(buffer, "#_FolderCache"),
11417 "Expected \"_Property\", got \"%s\"\n", buffer);
11420 MsiCloseHandle(hrec);
11421 MsiViewClose(hview);
11422 MsiCloseHandle(hview);
11424 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
11427 ok(condition == MSICONDITION_FALSE,
11428 "Expected MSICONDITION_FALSE, got %d\n", condition);
11431 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
11434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11436 r = MsiViewExecute(hview, 0);
11439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11442 /* _Property table is not empty */
11443 r = MsiViewFetch(hview, &hrec);
11446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11449 MsiCloseHandle(hrec);
11450 MsiViewClose(hview);
11451 MsiCloseHandle(hview);
11453 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
11456 ok(condition == MSICONDITION_FALSE,
11457 "Expected MSICONDITION_FALSE, got %d\n", condition);
11460 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
11463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11465 r = MsiViewExecute(hview, 0);
11468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11471 /* #_FolderCache is not empty */
11472 r = MsiViewFetch(hview, &hrec);
11475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11478 MsiCloseHandle(hrec);
11479 MsiViewClose(hview);
11480 MsiCloseHandle(hview);
11482 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
11485 ok(r == ERROR_BAD_QUERY_SYNTAX,
11486 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11489 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
11492 ok(r == ERROR_BAD_QUERY_SYNTAX,
11493 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11496 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
11499 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
11500 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
11503 MsiCloseHandle(hsuminfo);
11505 r = MsiDatabaseCommit(hdb);
11508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11511 MsiCloseHandle(hdb);
11512 MsiCloseHandle(hpkg);
11515 static void test_MsiGetProductProperty(void)
11517 MSIHANDLE hprod, hdb;
11518 CHAR val[MAX_PATH];
11519 CHAR path[MAX_PATH];
11520 CHAR query[MAX_PATH];
11521 CHAR keypath[MAX_PATH*2];
11522 CHAR prodcode[MAX_PATH];
11523 CHAR prod_squashed[MAX_PATH];
11524 HKEY prodkey, userkey, props;
11530 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
11531 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
11533 win_skip("Different registry keys on Win9x and WinMe\n");
11536 CloseServiceHandle(scm);
11538 GetCurrentDirectoryA(MAX_PATH, path);
11539 lstrcatA(path, "\\");
11541 create_test_guid(prodcode, prod_squashed);
11543 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
11544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11546 r = MsiDatabaseCommit(hdb);
11547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11549 r = set_summary_info(hdb);
11550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11553 "CREATE TABLE `Directory` ( "
11554 "`Directory` CHAR(255) NOT NULL, "
11555 "`Directory_Parent` CHAR(255), "
11556 "`DefaultDir` CHAR(255) NOT NULL "
11557 "PRIMARY KEY `Directory`)");
11558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11561 "CREATE TABLE `Property` ( "
11562 "`Property` CHAR(72) NOT NULL, "
11563 "`Value` CHAR(255) "
11564 "PRIMARY KEY `Property`)");
11565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11567 sprintf(query, "INSERT INTO `Property` "
11568 "(`Property`, `Value`) "
11569 "VALUES( 'ProductCode', '%s' )", prodcode);
11570 r = run_query(hdb, query);
11571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11573 r = MsiDatabaseCommit(hdb);
11574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11576 MsiCloseHandle(hdb);
11578 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
11579 lstrcatA(keypath, prod_squashed);
11581 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &prodkey);
11582 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11584 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
11585 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
11586 lstrcatA(keypath, prod_squashed);
11588 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &userkey);
11589 if (res == ERROR_ACCESS_DENIED)
11591 skip("Not enough rights to perform tests\n");
11592 RegDeleteKeyA(prodkey, "");
11593 RegCloseKey(prodkey);
11596 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11598 res = RegCreateKeyA(userkey, "InstallProperties", &props);
11599 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11601 lstrcpyA(val, path);
11602 lstrcatA(val, "\\winetest.msi");
11603 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
11604 (const BYTE *)val, lstrlenA(val) + 1);
11605 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11607 hprod = 0xdeadbeef;
11608 r = MsiOpenProductA(prodcode, &hprod);
11609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11610 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
11612 /* hProduct is invalid */
11614 lstrcpyA(val, "apple");
11615 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
11616 ok(r == ERROR_INVALID_HANDLE,
11617 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11618 ok(!lstrcmpA(val, "apple"),
11619 "Expected val to be unchanged, got \"%s\"\n", val);
11620 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11622 /* szProperty is NULL */
11624 lstrcpyA(val, "apple");
11625 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
11626 ok(r == ERROR_INVALID_PARAMETER,
11627 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11628 ok(!lstrcmpA(val, "apple"),
11629 "Expected val to be unchanged, got \"%s\"\n", val);
11630 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11632 /* szProperty is empty */
11634 lstrcpyA(val, "apple");
11635 r = MsiGetProductPropertyA(hprod, "", val, &size);
11636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11637 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11638 ok(size == 0, "Expected 0, got %d\n", size);
11640 /* get the property */
11642 lstrcpyA(val, "apple");
11643 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11644 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11645 ok(!lstrcmpA(val, prodcode),
11646 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11647 ok(size == lstrlenA(prodcode),
11648 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11650 /* lpValueBuf is NULL */
11652 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
11653 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11654 ok(size == lstrlenA(prodcode),
11655 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11657 /* pcchValueBuf is NULL */
11658 lstrcpyA(val, "apple");
11659 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
11660 ok(r == ERROR_INVALID_PARAMETER,
11661 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11662 ok(!lstrcmpA(val, "apple"),
11663 "Expected val to be unchanged, got \"%s\"\n", val);
11664 ok(size == lstrlenA(prodcode),
11665 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11667 /* pcchValueBuf is too small */
11669 lstrcpyA(val, "apple");
11670 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11671 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11672 ok(!strncmp(val, prodcode, 3),
11673 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
11674 ok(size == lstrlenA(prodcode),
11675 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11677 /* pcchValueBuf does not leave room for NULL terminator */
11678 size = lstrlenA(prodcode);
11679 lstrcpyA(val, "apple");
11680 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11681 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11682 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
11683 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
11684 ok(size == lstrlenA(prodcode),
11685 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11687 /* pcchValueBuf has enough room for NULL terminator */
11688 size = lstrlenA(prodcode) + 1;
11689 lstrcpyA(val, "apple");
11690 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11691 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11692 ok(!lstrcmpA(val, prodcode),
11693 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11694 ok(size == lstrlenA(prodcode),
11695 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11697 /* nonexistent property */
11699 lstrcpyA(val, "apple");
11700 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
11701 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11702 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11703 ok(size == 0, "Expected 0, got %d\n", size);
11705 r = MsiSetPropertyA(hprod, "NewProperty", "value");
11706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11708 /* non-product property set */
11710 lstrcpyA(val, "apple");
11711 r = MsiGetProductPropertyA(hprod, "NewProperty", 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, "ProductCode", "value");
11717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11719 /* non-product property that is also a product property set */
11721 lstrcpyA(val, "apple");
11722 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11724 ok(!lstrcmpA(val, prodcode),
11725 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11726 ok(size == lstrlenA(prodcode),
11727 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11729 MsiCloseHandle(hprod);
11731 RegDeleteValueA(props, "LocalPackage");
11732 RegDeleteKeyA(props, "");
11733 RegCloseKey(props);
11734 RegDeleteKeyA(userkey, "");
11735 RegCloseKey(userkey);
11736 RegDeleteKeyA(prodkey, "");
11737 RegCloseKey(prodkey);
11738 DeleteFileA(msifile);
11741 static void test_MsiSetProperty(void)
11743 MSIHANDLE hpkg, hdb, hrec;
11744 CHAR buf[MAX_PATH];
11749 hpkg = package_from_db(create_package_db());
11750 ok(hpkg != 0, "Expected a valid package\n");
11752 /* invalid hInstall */
11753 r = MsiSetPropertyA(0, "Prop", "Val");
11754 ok(r == ERROR_INVALID_HANDLE,
11755 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11757 /* invalid hInstall */
11758 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
11759 ok(r == ERROR_INVALID_HANDLE,
11760 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11762 /* szName is NULL */
11763 r = MsiSetPropertyA(hpkg, NULL, "Val");
11764 ok(r == ERROR_INVALID_PARAMETER,
11765 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11767 /* both szName and szValue are NULL */
11768 r = MsiSetPropertyA(hpkg, NULL, NULL);
11769 ok(r == ERROR_INVALID_PARAMETER,
11770 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11772 /* szName is empty */
11773 r = MsiSetPropertyA(hpkg, "", "Val");
11774 ok(r == ERROR_FUNCTION_FAILED,
11775 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
11777 /* szName is empty and szValue is NULL */
11778 r = MsiSetPropertyA(hpkg, "", NULL);
11779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11781 /* set a property */
11782 r = MsiSetPropertyA(hpkg, "Prop", "Val");
11783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11785 /* get the property */
11787 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11789 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
11790 ok(size == 3, "Expected 3, got %d\n", size);
11792 /* update the property */
11793 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
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, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
11801 ok(size == 4, "Expected 4, got %d\n", size);
11803 hdb = MsiGetActiveDatabase(hpkg);
11804 ok(hdb != 0, "Expected a valid database handle\n");
11806 /* set prop is not in the _Property table */
11807 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
11808 r = do_query(hdb, query, &hrec);
11809 ok(r == ERROR_BAD_QUERY_SYNTAX,
11810 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11812 /* set prop is not in the Property table */
11813 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
11814 r = do_query(hdb, query, &hrec);
11815 ok(r == ERROR_BAD_QUERY_SYNTAX,
11816 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11818 MsiCloseHandle(hdb);
11820 /* szValue is an empty string */
11821 r = MsiSetPropertyA(hpkg, "Prop", "");
11822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11824 /* try to get the property */
11826 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11828 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11829 ok(size == 0, "Expected 0, got %d\n", size);
11831 /* reset the property */
11832 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
11833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11835 /* delete the property */
11836 r = MsiSetPropertyA(hpkg, "Prop", NULL);
11837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11839 /* try to get the property */
11841 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11843 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11844 ok(size == 0, "Expected 0, got %d\n", size);
11846 MsiCloseHandle(hpkg);
11847 DeleteFileA(msifile);
11850 static void test_MsiApplyMultiplePatches(void)
11852 UINT r, type = GetDriveType(NULL);
11854 if (!pMsiApplyMultiplePatchesA) {
11855 win_skip("MsiApplyMultiplePatchesA not found\n");
11859 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
11860 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11862 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
11863 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11865 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
11868 if (type == DRIVE_FIXED)
11869 ok(r == ERROR_PATH_NOT_FOUND,
11870 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11872 ok(r == ERROR_INVALID_NAME,
11873 "Expected ERROR_INVALID_NAME, got %u\n", r);
11876 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
11879 if (type == DRIVE_FIXED)
11880 ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED,
11881 "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, 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_PATH_NOT_FOUND,
11892 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11894 ok(r == ERROR_INVALID_NAME,
11895 "Expected ERROR_INVALID_NAME, got %u\n", r);
11898 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
11899 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11901 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
11904 if (type == DRIVE_FIXED)
11905 ok(r == ERROR_PATH_NOT_FOUND,
11906 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
11908 ok(r == ERROR_INVALID_NAME,
11909 "Expected ERROR_INVALID_NAME, got %u\n", r);
11912 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
11913 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11915 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
11916 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
11919 static void test_MsiApplyPatch(void)
11923 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
11924 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11926 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
11927 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
11930 START_TEST(package)
11932 STATEMGRSTATUS status;
11935 init_functionpointers();
11937 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
11939 /* Create a restore point ourselves so we circumvent the multitude of restore points
11940 * that would have been created by all the installation and removal tests.
11942 if (pSRSetRestorePointA)
11944 memset(&status, 0, sizeof(status));
11945 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
11948 test_createpackage();
11950 test_gettargetpath_bad();
11951 test_settargetpath();
11953 test_property_table();
11956 test_formatrecord2();
11958 test_getproperty();
11959 test_removefiles();
11961 test_appsearch_complocator();
11962 test_appsearch_reglocator();
11963 test_appsearch_inilocator();
11964 test_appsearch_drlocator();
11965 test_featureparents();
11966 test_installprops();
11967 test_launchconditions();
11969 test_complocator();
11970 test_MsiGetSourcePath();
11971 test_shortlongsource();
11974 test_emptypackage();
11975 test_MsiGetProductProperty();
11976 test_MsiSetProperty();
11977 test_MsiApplyMultiplePatches();
11978 test_MsiApplyPatch();
11980 if (pSRSetRestorePointA && ret)
11982 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
11984 remove_restore_point(status.llSequenceNumber);