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
30 #include "wine/test.h"
32 static const char msifile[] = "winetest.msi";
33 char CURR_DIR[MAX_PATH];
35 static void get_user_sid(LPSTR *usersid)
41 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
42 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
45 pConvertSidToStringSidA = (void *)GetProcAddress(hadvapi32, "ConvertSidToStringSidA");
46 if (!pConvertSidToStringSidA)
49 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
51 GetTokenInformation(token, TokenUser, buf, size, &size);
52 user = (PTOKEN_USER)buf;
53 pConvertSidToStringSidA(user->User.Sid, usersid);
57 /* RegDeleteTreeW from dlls/advapi32/registry.c */
58 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
61 DWORD dwMaxSubkeyLen, dwMaxValueLen;
62 DWORD dwMaxLen, dwSize;
63 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
68 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
72 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
73 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
74 if (ret) goto cleanup;
78 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
79 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
81 /* Name too big: alloc a buffer for it */
82 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
84 ret = ERROR_NOT_ENOUGH_MEMORY;
89 /* Recursively delete all the subkeys */
93 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
94 NULL, NULL, NULL)) break;
96 ret = package_RegDeleteTreeW(hSubKey, lpszName);
97 if (ret) goto cleanup;
101 ret = RegDeleteKeyW(hKey, lpszSubKey);
106 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
107 NULL, NULL, NULL, NULL)) break;
109 ret = RegDeleteValueW(hKey, lpszName);
110 if (ret) goto cleanup;
114 if (lpszName != szNameBuf)
115 HeapFree(GetProcessHeap(), 0, lpszName);
117 RegCloseKey(hSubKey);
121 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
126 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
140 out[17+i*2] = in[n++];
141 out[16+i*2] = in[n++];
146 out[17+i*2] = in[n++];
147 out[16+i*2] = in[n++];
153 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
155 WCHAR guidW[MAX_PATH];
156 WCHAR squashedW[MAX_PATH];
161 hr = CoCreateGuid(&guid);
162 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
164 size = StringFromGUID2(&guid, guidW, MAX_PATH);
165 ok(size == 39, "Expected 39, got %d\n", hr);
167 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
168 squash_guid(guidW, squashedW);
169 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
172 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
173 LPCSTR guid, LPSTR usersid, BOOL dir)
175 WCHAR guidW[MAX_PATH];
176 WCHAR squashedW[MAX_PATH];
177 CHAR squashed[MAX_PATH];
178 CHAR comppath[MAX_PATH];
179 CHAR prodpath[MAX_PATH];
184 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
185 squash_guid(guidW, squashedW);
186 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
188 if (context == MSIINSTALLCONTEXT_MACHINE)
190 prod = "3D0DAE300FACA1300AD792060BCDAA92";
192 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
193 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
195 "SOFTWARE\\Classes\\Installer\\"
196 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
198 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
200 prod = "7D2F387510109040002000060BECB6AB";
202 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
203 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
205 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
206 "Installer\\%s\\Installer\\Products\\"
207 "7D2F387510109040002000060BECB6AB", usersid);
209 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
211 prod = "7D2F387510109040002000060BECB6AB";
213 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
214 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
216 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
217 "Installer\\Managed\\%s\\Installer\\Products\\"
218 "7D2F387510109040002000060BECB6AB", usersid);
221 RegCreateKeyA(HKEY_LOCAL_MACHINE, comppath, &hkey);
223 lstrcpyA(path, CURR_DIR);
224 lstrcatA(path, "\\");
225 if (!dir) lstrcatA(path, filename);
227 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
230 RegCreateKeyA(HKEY_LOCAL_MACHINE, prodpath, &hkey);
234 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
236 WCHAR guidW[MAX_PATH];
237 WCHAR squashedW[MAX_PATH];
238 WCHAR substrW[MAX_PATH];
239 CHAR squashed[MAX_PATH];
240 CHAR comppath[MAX_PATH];
241 CHAR prodpath[MAX_PATH];
243 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
244 squash_guid(guidW, squashedW);
245 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
247 if (context == MSIINSTALLCONTEXT_MACHINE)
250 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
251 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
253 "SOFTWARE\\Classes\\Installer\\"
254 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
256 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
259 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
260 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
262 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
263 "Installer\\%s\\Installer\\Products\\"
264 "7D2F387510109040002000060BECB6AB", usersid);
266 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
269 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
270 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
272 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
273 "Installer\\Managed\\%s\\Installer\\Products\\"
274 "7D2F387510109040002000060BECB6AB", usersid);
277 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
278 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
280 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
281 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
284 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
289 /* open a select query */
290 r = MsiDatabaseOpenView(hdb, query, &hview);
291 if (r != ERROR_SUCCESS)
293 r = MsiViewExecute(hview, 0);
294 if (r != ERROR_SUCCESS)
296 ret = MsiViewFetch(hview, phrec);
297 r = MsiViewClose(hview);
298 if (r != ERROR_SUCCESS)
300 r = MsiCloseHandle(hview);
301 if (r != ERROR_SUCCESS)
306 static UINT run_query( MSIHANDLE hdb, const char *query )
311 r = MsiDatabaseOpenView(hdb, query, &hview);
312 if( r != ERROR_SUCCESS )
315 r = MsiViewExecute(hview, 0);
316 if( r == ERROR_SUCCESS )
317 r = MsiViewClose(hview);
318 MsiCloseHandle(hview);
322 static UINT create_component_table( MSIHANDLE hdb )
324 return run_query( hdb,
325 "CREATE TABLE `Component` ( "
326 "`Component` CHAR(72) NOT NULL, "
327 "`ComponentId` CHAR(38), "
328 "`Directory_` CHAR(72) NOT NULL, "
329 "`Attributes` SHORT NOT NULL, "
330 "`Condition` CHAR(255), "
331 "`KeyPath` CHAR(72) "
332 "PRIMARY KEY `Component`)" );
335 static UINT create_feature_table( MSIHANDLE hdb )
337 return run_query( hdb,
338 "CREATE TABLE `Feature` ( "
339 "`Feature` CHAR(38) NOT NULL, "
340 "`Feature_Parent` CHAR(38), "
342 "`Description` CHAR(255), "
343 "`Display` SHORT NOT NULL, "
344 "`Level` SHORT NOT NULL, "
345 "`Directory_` CHAR(72), "
346 "`Attributes` SHORT NOT NULL "
347 "PRIMARY KEY `Feature`)" );
350 static UINT create_feature_components_table( MSIHANDLE hdb )
352 return run_query( hdb,
353 "CREATE TABLE `FeatureComponents` ( "
354 "`Feature_` CHAR(38) NOT NULL, "
355 "`Component_` CHAR(72) NOT NULL "
356 "PRIMARY KEY `Feature_`, `Component_` )" );
359 static UINT create_file_table( MSIHANDLE hdb )
361 return run_query( hdb,
362 "CREATE TABLE `File` ("
363 "`File` CHAR(72) NOT NULL, "
364 "`Component_` CHAR(72) NOT NULL, "
365 "`FileName` CHAR(255) NOT NULL, "
366 "`FileSize` LONG NOT NULL, "
367 "`Version` CHAR(72), "
368 "`Language` CHAR(20), "
369 "`Attributes` SHORT, "
370 "`Sequence` SHORT NOT NULL "
371 "PRIMARY KEY `File`)" );
374 static UINT create_remove_file_table( MSIHANDLE hdb )
376 return run_query( hdb,
377 "CREATE TABLE `RemoveFile` ("
378 "`FileKey` CHAR(72) NOT NULL, "
379 "`Component_` CHAR(72) NOT NULL, "
380 "`FileName` CHAR(255) LOCALIZABLE, "
381 "`DirProperty` CHAR(72) NOT NULL, "
382 "`InstallMode` SHORT NOT NULL "
383 "PRIMARY KEY `FileKey`)" );
386 static UINT create_appsearch_table( MSIHANDLE hdb )
388 return run_query( hdb,
389 "CREATE TABLE `AppSearch` ("
390 "`Property` CHAR(72) NOT NULL, "
391 "`Signature_` CHAR(72) NOT NULL "
392 "PRIMARY KEY `Property`, `Signature_`)" );
395 static UINT create_reglocator_table( MSIHANDLE hdb )
397 return run_query( hdb,
398 "CREATE TABLE `RegLocator` ("
399 "`Signature_` CHAR(72) NOT NULL, "
400 "`Root` SHORT NOT NULL, "
401 "`Key` CHAR(255) NOT NULL, "
404 "PRIMARY KEY `Signature_`)" );
407 static UINT create_signature_table( MSIHANDLE hdb )
409 return run_query( hdb,
410 "CREATE TABLE `Signature` ("
411 "`Signature` CHAR(72) NOT NULL, "
412 "`FileName` CHAR(255) NOT NULL, "
413 "`MinVersion` CHAR(20), "
414 "`MaxVersion` CHAR(20), "
419 "`Languages` CHAR(255) "
420 "PRIMARY KEY `Signature`)" );
423 static UINT create_launchcondition_table( MSIHANDLE hdb )
425 return run_query( hdb,
426 "CREATE TABLE `LaunchCondition` ("
427 "`Condition` CHAR(255) NOT NULL, "
428 "`Description` CHAR(255) NOT NULL "
429 "PRIMARY KEY `Condition`)" );
432 static UINT create_property_table( MSIHANDLE hdb )
434 return run_query( hdb,
435 "CREATE TABLE `Property` ("
436 "`Property` CHAR(72) NOT NULL, "
438 "PRIMARY KEY `Property`)" );
441 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
443 return run_query( hdb,
444 "CREATE TABLE `InstallExecuteSequence` ("
445 "`Action` CHAR(72) NOT NULL, "
446 "`Condition` CHAR(255), "
448 "PRIMARY KEY `Action`)" );
451 static UINT create_media_table( MSIHANDLE hdb )
453 return run_query( hdb,
454 "CREATE TABLE `Media` ("
455 "`DiskId` SHORT NOT NULL, "
456 "`LastSequence` SHORT NOT NULL, "
457 "`DiskPrompt` CHAR(64), "
458 "`Cabinet` CHAR(255), "
459 "`VolumeLabel` CHAR(32), "
461 "PRIMARY KEY `DiskId`)" );
464 static UINT create_ccpsearch_table( MSIHANDLE hdb )
466 return run_query( hdb,
467 "CREATE TABLE `CCPSearch` ("
468 "`Signature_` CHAR(72) NOT NULL "
469 "PRIMARY KEY `Signature_`)" );
472 static UINT create_drlocator_table( MSIHANDLE hdb )
474 return run_query( hdb,
475 "CREATE TABLE `DrLocator` ("
476 "`Signature_` CHAR(72) NOT NULL, "
477 "`Parent` CHAR(72), "
480 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
483 static UINT create_complocator_table( MSIHANDLE hdb )
485 return run_query( hdb,
486 "CREATE TABLE `CompLocator` ("
487 "`Signature_` CHAR(72) NOT NULL, "
488 "`ComponentId` CHAR(38) NOT NULL, "
490 "PRIMARY KEY `Signature_`)" );
493 static UINT create_inilocator_table( MSIHANDLE hdb )
495 return run_query( hdb,
496 "CREATE TABLE `IniLocator` ("
497 "`Signature_` CHAR(72) NOT NULL, "
498 "`FileName` CHAR(255) NOT NULL, "
499 "`Section` CHAR(96)NOT NULL, "
500 "`Key` CHAR(128)NOT NULL, "
503 "PRIMARY KEY `Signature_`)" );
506 #define make_add_entry(type, qtext) \
507 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
509 char insert[] = qtext; \
512 sz = strlen(values) + sizeof insert; \
513 query = HeapAlloc(GetProcessHeap(),0,sz); \
514 sprintf(query,insert,values); \
515 r = run_query( hdb, query ); \
516 HeapFree(GetProcessHeap(), 0, query); \
520 make_add_entry(component,
521 "INSERT INTO `Component` "
522 "(`Component`, `ComponentId`, `Directory_`, "
523 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
525 make_add_entry(directory,
526 "INSERT INTO `Directory` "
527 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
529 make_add_entry(feature,
530 "INSERT INTO `Feature` "
531 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
532 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
534 make_add_entry(feature_components,
535 "INSERT INTO `FeatureComponents` "
536 "(`Feature_`, `Component_`) VALUES( %s )")
539 "INSERT INTO `File` "
540 "(`File`, `Component_`, `FileName`, `FileSize`, "
541 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
543 make_add_entry(appsearch,
544 "INSERT INTO `AppSearch` "
545 "(`Property`, `Signature_`) VALUES( %s )")
547 make_add_entry(reglocator,
548 "INSERT INTO `RegLocator` "
549 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES( %s )")
551 make_add_entry(signature,
552 "INSERT INTO `Signature` "
553 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
554 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
557 make_add_entry(launchcondition,
558 "INSERT INTO `LaunchCondition` "
559 "(`Condition`, `Description`) VALUES( %s )")
561 make_add_entry(property,
562 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
564 make_add_entry(install_execute_sequence,
565 "INSERT INTO `InstallExecuteSequence` "
566 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
568 make_add_entry(media,
569 "INSERT INTO `Media` "
570 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
571 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
573 make_add_entry(ccpsearch,
574 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
576 make_add_entry(drlocator,
577 "INSERT INTO `DrLocator` "
578 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
580 make_add_entry(complocator,
581 "INSERT INTO `CompLocator` "
582 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
584 make_add_entry(inilocator,
585 "INSERT INTO `IniLocator` "
586 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
589 static UINT set_summary_info(MSIHANDLE hdb)
594 /* build summary info */
595 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
596 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
598 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
599 "Installation Database");
600 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
602 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
603 "Installation Database");
604 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
606 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
608 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
610 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
612 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
614 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
615 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
616 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
618 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
619 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
621 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
622 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
624 res = MsiSummaryInfoPersist(suminfo);
625 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
627 res = MsiCloseHandle( suminfo);
628 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
634 static MSIHANDLE create_package_db(void)
641 /* create an empty database */
642 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
643 ok( res == ERROR_SUCCESS , "Failed to create database\n" );
644 if( res != ERROR_SUCCESS )
647 res = MsiDatabaseCommit( hdb );
648 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
650 res = set_summary_info(hdb);
652 res = run_query( hdb,
653 "CREATE TABLE `Directory` ( "
654 "`Directory` CHAR(255) NOT NULL, "
655 "`Directory_Parent` CHAR(255), "
656 "`DefaultDir` CHAR(255) NOT NULL "
657 "PRIMARY KEY `Directory`)" );
658 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
663 static MSIHANDLE package_from_db(MSIHANDLE hdb)
669 sprintf(szPackage,"#%i",hdb);
670 res = MsiOpenPackage(szPackage,&hPackage);
671 if (res != ERROR_SUCCESS)
674 res = MsiCloseHandle(hdb);
675 if (res != ERROR_SUCCESS)
681 static void create_test_file(const CHAR *name)
686 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
687 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
688 WriteFile(file, name, strlen(name), &written, NULL);
689 WriteFile(file, "\n", strlen("\n"), &written, NULL);
693 typedef struct _tagVS_VERSIONINFO
700 VS_FIXEDFILEINFO Value;
705 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
706 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
708 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
710 VS_VERSIONINFO *pVerInfo;
711 VS_FIXEDFILEINFO *pFixedInfo;
718 GetSystemDirectory(path, MAX_PATH);
719 lstrcatA(path, "\\kernel32.dll");
721 CopyFileA(path, name, FALSE);
723 size = GetFileVersionInfoSize(path, &handle);
724 buffer = HeapAlloc(GetProcessHeap(), 0, size);
726 GetFileVersionInfoA(path, 0, size, buffer);
728 pVerInfo = (VS_VERSIONINFO *)buffer;
729 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
730 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
732 pFixedInfo->dwFileVersionMS = ms;
733 pFixedInfo->dwFileVersionLS = ls;
734 pFixedInfo->dwProductVersionMS = ms;
735 pFixedInfo->dwProductVersionLS = ls;
737 resource = BeginUpdateResource(name, FALSE);
741 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
742 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
745 if (!EndUpdateResource(resource, FALSE))
751 HeapFree(GetProcessHeap(), 0, buffer);
755 static void test_createpackage(void)
757 MSIHANDLE hPackage = 0;
760 hPackage = package_from_db(create_package_db());
761 ok( hPackage != 0, " Failed to create package\n");
763 res = MsiCloseHandle( hPackage);
764 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
768 static void test_doaction( void )
773 r = MsiDoAction( -1, NULL );
774 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
776 hpkg = package_from_db(create_package_db());
777 ok( hpkg, "failed to create package\n");
779 r = MsiDoAction(hpkg, NULL);
780 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
782 r = MsiDoAction(0, "boo");
783 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
785 r = MsiDoAction(hpkg, "boo");
786 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
788 MsiCloseHandle( hpkg );
792 static void test_gettargetpath_bad(void)
799 hpkg = package_from_db(create_package_db());
800 ok( hpkg, "failed to create package\n");
802 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
803 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
805 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
806 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
808 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
809 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
811 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
812 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
814 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
815 ok( r == ERROR_DIRECTORY, "wrong return val\n");
817 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
818 ok( r == ERROR_DIRECTORY, "wrong return val\n");
820 MsiCloseHandle( hpkg );
824 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
830 rec = MsiCreateRecord( 1 );
831 ok(rec, "MsiCreate record failed\n");
833 r = MsiRecordSetString( rec, 0, file );
834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
837 r = MsiFormatRecord( hpkg, rec, buff, &size );
838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
840 MsiCloseHandle( rec );
843 static void test_settargetpath(void)
845 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
851 hdb = create_package_db();
852 ok ( hdb, "failed to create package database\n" );
854 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
855 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
857 r = create_component_table( hdb );
858 ok( r == S_OK, "cannot create Component table: %d\n", r );
860 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
861 ok( r == S_OK, "cannot add dummy component: %d\n", r );
863 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
864 ok( r == S_OK, "cannot add test component: %d\n", r );
866 r = create_feature_table( hdb );
867 ok( r == S_OK, "cannot create Feature table: %d\n", r );
869 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
870 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
872 r = create_feature_components_table( hdb );
873 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
875 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
876 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
878 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
879 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
881 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
882 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
884 r = create_file_table( hdb );
885 ok( r == S_OK, "cannot create File table: %d\n", r );
887 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
888 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
890 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
891 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
893 hpkg = package_from_db( hdb );
894 ok( hpkg, "failed to create package\n");
896 r = MsiDoAction( hpkg, "CostInitialize");
897 ok( r == ERROR_SUCCESS, "cost init failed\n");
899 r = MsiDoAction( hpkg, "FileCost");
900 ok( r == ERROR_SUCCESS, "file cost failed\n");
902 r = MsiDoAction( hpkg, "CostFinalize");
903 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
905 r = MsiSetTargetPath( 0, NULL, NULL );
906 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
908 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
909 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
911 r = MsiSetTargetPath( hpkg, "boo", NULL );
912 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
914 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
915 ok( r == ERROR_DIRECTORY, "wrong return val\n");
917 sz = sizeof tempdir - 1;
918 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
919 sprintf( file, "%srootfile.txt", tempdir );
920 query_file_path( hpkg, "[#RootFile]", buffer );
921 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
922 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
924 GetTempFileName( tempdir, "_wt", 0, buffer );
925 sprintf( tempdir, "%s\\subdir", buffer );
927 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
928 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
929 "MsiSetTargetPath on file returned %d\n", r );
931 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
932 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
933 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
935 DeleteFile( buffer );
937 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
938 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
940 r = GetFileAttributes( buffer );
941 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
943 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
944 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
946 sz = sizeof buffer - 1;
947 lstrcat( tempdir, "\\" );
948 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
949 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
950 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
952 sprintf( file, "%srootfile.txt", tempdir );
953 query_file_path( hpkg, "[#RootFile]", buffer );
954 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
956 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
957 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
959 query_file_path( hpkg, "[#TestFile]", buffer );
960 ok( !lstrcmp(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
961 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
963 sz = sizeof buffer - 1;
964 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
965 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
966 ok( !lstrcmp(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
968 MsiCloseHandle( hpkg );
971 static void test_condition(void)
976 hpkg = package_from_db(create_package_db());
977 ok( hpkg, "failed to create package\n");
979 r = MsiEvaluateCondition(0, NULL);
980 ok( r == MSICONDITION_ERROR, "wrong return val\n");
982 r = MsiEvaluateCondition(hpkg, NULL);
983 ok( r == MSICONDITION_NONE, "wrong return val\n");
985 r = MsiEvaluateCondition(hpkg, "");
986 ok( r == MSICONDITION_NONE, "wrong return val\n");
988 r = MsiEvaluateCondition(hpkg, "1");
989 ok( r == MSICONDITION_TRUE, "wrong return val\n");
991 r = MsiEvaluateCondition(hpkg, "0");
992 ok( r == MSICONDITION_FALSE, "wrong return val\n");
994 r = MsiEvaluateCondition(hpkg, "-1");
995 ok( r == MSICONDITION_TRUE, "wrong return val\n");
997 r = MsiEvaluateCondition(hpkg, "0 = 0");
998 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1000 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1001 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1003 r = MsiEvaluateCondition(hpkg, "0 = 1");
1004 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1006 r = MsiEvaluateCondition(hpkg, "0 > 1");
1007 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1009 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1010 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1012 r = MsiEvaluateCondition(hpkg, "1 > 1");
1013 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1015 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1016 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1018 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1019 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1021 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1022 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1024 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1025 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1027 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1028 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1030 r = MsiEvaluateCondition(hpkg, "0 < 1");
1031 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1033 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1034 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1036 r = MsiEvaluateCondition(hpkg, "1 < 1");
1037 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1039 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1040 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1042 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1043 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1045 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1046 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1048 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1049 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1051 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1052 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1054 r = MsiEvaluateCondition(hpkg, "0 >=");
1055 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1057 r = MsiEvaluateCondition(hpkg, " ");
1058 ok( r == MSICONDITION_NONE, "wrong return val\n");
1060 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1061 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1063 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1064 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1066 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1067 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1069 r = MsiEvaluateCondition(hpkg, "not 0");
1070 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1072 r = MsiEvaluateCondition(hpkg, "not LicView");
1073 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1075 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1076 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1078 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1079 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1081 r = MsiEvaluateCondition(hpkg, "\"0\"");
1082 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1084 r = MsiEvaluateCondition(hpkg, "1 and 2");
1085 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1087 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1088 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1090 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1091 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1093 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1094 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1096 r = MsiEvaluateCondition(hpkg, "(0)");
1097 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1099 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1100 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1102 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1103 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1105 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1106 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1108 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1109 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1111 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1112 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1114 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1115 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1117 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1118 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1120 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1121 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1123 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1124 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1126 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1127 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1129 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1130 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1132 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1133 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1135 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1136 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1138 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1139 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1141 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1142 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1144 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1145 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1147 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1148 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1150 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1151 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1153 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1154 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1156 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1157 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1159 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1160 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1162 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1163 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1165 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1166 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1168 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1169 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1171 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1172 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1174 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1175 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1177 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1178 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1180 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1181 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1183 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1184 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1186 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1187 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1189 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1190 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1192 MsiSetProperty(hpkg, "mm", "5" );
1194 r = MsiEvaluateCondition(hpkg, "mm = 5");
1195 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1197 r = MsiEvaluateCondition(hpkg, "mm < 6");
1198 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1200 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1201 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1203 r = MsiEvaluateCondition(hpkg, "mm > 4");
1204 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1206 r = MsiEvaluateCondition(hpkg, "mm < 12");
1207 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1209 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1210 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1212 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1213 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1215 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1216 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1218 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1219 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1221 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1222 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1224 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1225 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1227 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1228 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1230 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1231 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1233 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1234 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1236 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1237 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1239 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1240 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1242 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1243 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1245 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1246 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1248 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1249 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1251 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1252 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1254 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1255 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1257 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1258 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1260 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1261 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1263 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1264 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1266 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1267 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1269 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1270 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1272 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1273 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1275 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1276 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1278 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1279 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1281 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1282 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1284 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1285 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1287 MsiSetProperty(hpkg, "bandalmael", "0" );
1288 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1289 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1291 MsiSetProperty(hpkg, "bandalmael", "" );
1292 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1293 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1295 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1296 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1297 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1299 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1300 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1301 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1303 MsiSetProperty(hpkg, "bandalmael", "0 " );
1304 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1305 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1307 MsiSetProperty(hpkg, "bandalmael", "-0" );
1308 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1309 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1311 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1312 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1313 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1315 MsiSetProperty(hpkg, "bandalmael", "--0" );
1316 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1317 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1319 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1320 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1321 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1323 MsiSetProperty(hpkg, "bandalmael", "-" );
1324 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1325 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1327 MsiSetProperty(hpkg, "bandalmael", "+0" );
1328 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1329 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1331 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1332 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1333 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1334 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1335 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1337 MsiSetProperty(hpkg, "one", "hi");
1338 MsiSetProperty(hpkg, "two", "hithere");
1339 r = MsiEvaluateCondition(hpkg, "one >< two");
1340 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1342 MsiSetProperty(hpkg, "one", "hithere");
1343 MsiSetProperty(hpkg, "two", "hi");
1344 r = MsiEvaluateCondition(hpkg, "one >< two");
1345 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1347 MsiSetProperty(hpkg, "one", "hello");
1348 MsiSetProperty(hpkg, "two", "hi");
1349 r = MsiEvaluateCondition(hpkg, "one >< two");
1350 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1352 MsiSetProperty(hpkg, "one", "hellohithere");
1353 MsiSetProperty(hpkg, "two", "hi");
1354 r = MsiEvaluateCondition(hpkg, "one >< two");
1355 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1357 MsiSetProperty(hpkg, "one", "");
1358 MsiSetProperty(hpkg, "two", "hi");
1359 r = MsiEvaluateCondition(hpkg, "one >< two");
1360 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1362 MsiSetProperty(hpkg, "one", "hi");
1363 MsiSetProperty(hpkg, "two", "");
1364 r = MsiEvaluateCondition(hpkg, "one >< two");
1365 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1367 MsiSetProperty(hpkg, "one", "");
1368 MsiSetProperty(hpkg, "two", "");
1369 r = MsiEvaluateCondition(hpkg, "one >< two");
1370 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1372 MsiSetProperty(hpkg, "one", "1234");
1373 MsiSetProperty(hpkg, "two", "1");
1374 r = MsiEvaluateCondition(hpkg, "one >< two");
1375 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1377 MsiSetProperty(hpkg, "one", "one 1234");
1378 MsiSetProperty(hpkg, "two", "1");
1379 r = MsiEvaluateCondition(hpkg, "one >< two");
1380 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1382 MsiSetProperty(hpkg, "one", "hithere");
1383 MsiSetProperty(hpkg, "two", "hi");
1384 r = MsiEvaluateCondition(hpkg, "one << two");
1385 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1387 MsiSetProperty(hpkg, "one", "hi");
1388 MsiSetProperty(hpkg, "two", "hithere");
1389 r = MsiEvaluateCondition(hpkg, "one << two");
1390 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1392 MsiSetProperty(hpkg, "one", "hi");
1393 MsiSetProperty(hpkg, "two", "hi");
1394 r = MsiEvaluateCondition(hpkg, "one << two");
1395 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1397 MsiSetProperty(hpkg, "one", "abcdhithere");
1398 MsiSetProperty(hpkg, "two", "hi");
1399 r = MsiEvaluateCondition(hpkg, "one << two");
1400 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1402 MsiSetProperty(hpkg, "one", "");
1403 MsiSetProperty(hpkg, "two", "hi");
1404 r = MsiEvaluateCondition(hpkg, "one << two");
1405 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1407 MsiSetProperty(hpkg, "one", "hithere");
1408 MsiSetProperty(hpkg, "two", "");
1409 r = MsiEvaluateCondition(hpkg, "one << two");
1410 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1412 MsiSetProperty(hpkg, "one", "");
1413 MsiSetProperty(hpkg, "two", "");
1414 r = MsiEvaluateCondition(hpkg, "one << two");
1415 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1417 MsiSetProperty(hpkg, "one", "1234");
1418 MsiSetProperty(hpkg, "two", "1");
1419 r = MsiEvaluateCondition(hpkg, "one << two");
1420 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1422 MsiSetProperty(hpkg, "one", "1234 one");
1423 MsiSetProperty(hpkg, "two", "1");
1424 r = MsiEvaluateCondition(hpkg, "one << two");
1425 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1427 MsiSetProperty(hpkg, "one", "hithere");
1428 MsiSetProperty(hpkg, "two", "there");
1429 r = MsiEvaluateCondition(hpkg, "one >> two");
1430 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1432 MsiSetProperty(hpkg, "one", "hithere");
1433 MsiSetProperty(hpkg, "two", "hi");
1434 r = MsiEvaluateCondition(hpkg, "one >> two");
1435 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1437 MsiSetProperty(hpkg, "one", "there");
1438 MsiSetProperty(hpkg, "two", "hithere");
1439 r = MsiEvaluateCondition(hpkg, "one >> two");
1440 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1442 MsiSetProperty(hpkg, "one", "there");
1443 MsiSetProperty(hpkg, "two", "there");
1444 r = MsiEvaluateCondition(hpkg, "one >> two");
1445 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1447 MsiSetProperty(hpkg, "one", "abcdhithere");
1448 MsiSetProperty(hpkg, "two", "hi");
1449 r = MsiEvaluateCondition(hpkg, "one >> two");
1450 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1452 MsiSetProperty(hpkg, "one", "");
1453 MsiSetProperty(hpkg, "two", "there");
1454 r = MsiEvaluateCondition(hpkg, "one >> two");
1455 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1457 MsiSetProperty(hpkg, "one", "there");
1458 MsiSetProperty(hpkg, "two", "");
1459 r = MsiEvaluateCondition(hpkg, "one >> two");
1460 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1462 MsiSetProperty(hpkg, "one", "");
1463 MsiSetProperty(hpkg, "two", "");
1464 r = MsiEvaluateCondition(hpkg, "one >> two");
1465 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1467 MsiSetProperty(hpkg, "one", "1234");
1468 MsiSetProperty(hpkg, "two", "4");
1469 r = MsiEvaluateCondition(hpkg, "one >> two");
1470 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1472 MsiSetProperty(hpkg, "one", "one 1234");
1473 MsiSetProperty(hpkg, "two", "4");
1474 r = MsiEvaluateCondition(hpkg, "one >> two");
1475 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1477 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1479 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1480 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1482 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1483 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1485 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1486 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1488 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1489 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1491 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1492 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1494 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1495 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1497 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1498 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1500 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1501 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1503 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1504 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1506 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1507 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1509 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1510 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1512 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1513 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1515 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1516 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1518 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1519 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1521 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1522 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1524 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1525 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1527 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1528 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1530 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1531 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1533 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1534 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1536 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1537 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1539 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1540 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1542 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1543 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1545 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1546 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1548 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1549 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1551 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1552 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1554 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1555 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1557 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1558 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1560 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1561 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1563 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1564 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1566 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1567 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1569 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1570 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1572 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1573 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1575 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1576 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1578 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1579 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1581 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1582 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1584 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1585 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1587 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1588 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1590 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1591 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1592 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1594 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1595 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1597 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1598 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1600 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1601 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1603 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1604 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1606 MsiSetProperty(hpkg, "one", "1");
1607 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1608 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1610 MsiSetProperty(hpkg, "X", "5.0");
1612 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1613 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1615 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1616 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1618 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1619 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1621 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1622 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1624 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1625 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1627 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1628 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1630 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1631 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1633 /* feature doesn't exist */
1634 r = MsiEvaluateCondition(hpkg, "&nofeature");
1635 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1637 MsiSetProperty(hpkg, "A", "2");
1638 MsiSetProperty(hpkg, "X", "50");
1640 r = MsiEvaluateCondition(hpkg, "2 <= X");
1641 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1643 r = MsiEvaluateCondition(hpkg, "A <= X");
1644 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1646 r = MsiEvaluateCondition(hpkg, "A <= 50");
1647 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1649 MsiSetProperty(hpkg, "X", "50val");
1651 r = MsiEvaluateCondition(hpkg, "2 <= X");
1652 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1654 r = MsiEvaluateCondition(hpkg, "A <= X");
1655 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1657 MsiSetProperty(hpkg, "A", "7");
1658 MsiSetProperty(hpkg, "X", "50");
1660 r = MsiEvaluateCondition(hpkg, "7 <= X");
1661 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1663 r = MsiEvaluateCondition(hpkg, "A <= X");
1664 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1666 r = MsiEvaluateCondition(hpkg, "A <= 50");
1667 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1669 MsiSetProperty(hpkg, "X", "50val");
1671 r = MsiEvaluateCondition(hpkg, "2 <= X");
1672 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1674 r = MsiEvaluateCondition(hpkg, "A <= X");
1675 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1677 MsiCloseHandle( hpkg );
1678 DeleteFile(msifile);
1681 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1689 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1690 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1693 static void test_props(void)
1695 MSIHANDLE hpkg, hdb;
1700 hdb = create_package_db();
1702 "CREATE TABLE `Property` ( "
1703 "`Property` CHAR(255) NOT NULL, "
1704 "`Value` CHAR(255) "
1705 "PRIMARY KEY `Property`)" );
1706 ok( r == ERROR_SUCCESS , "Failed\n" );
1709 "INSERT INTO `Property` "
1710 "(`Property`, `Value`) "
1711 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1712 ok( r == ERROR_SUCCESS , "Failed\n" );
1714 hpkg = package_from_db( hdb );
1715 ok( hpkg, "failed to create package\n");
1717 /* test invalid values */
1718 r = MsiGetProperty( 0, NULL, NULL, NULL );
1719 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1721 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1722 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1724 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1725 ok( r == ERROR_SUCCESS, "wrong return val\n");
1727 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1728 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1730 /* test retrieving an empty/nonexistent property */
1732 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1733 ok( r == ERROR_SUCCESS, "wrong return val\n");
1734 ok( sz == 0, "wrong size returned\n");
1736 check_prop_empty( hpkg, "boo");
1739 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1740 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1741 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1742 ok( sz == 0, "wrong size returned\n");
1746 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1747 ok( r == ERROR_SUCCESS, "wrong return val\n");
1748 ok( buffer[0] == 0, "buffer was not changed\n");
1749 ok( sz == 0, "wrong size returned\n");
1751 /* set the property to something */
1752 r = MsiSetProperty( 0, NULL, NULL );
1753 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1755 r = MsiSetProperty( hpkg, NULL, NULL );
1756 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1758 r = MsiSetProperty( hpkg, "", NULL );
1759 ok( r == ERROR_SUCCESS, "wrong return val\n");
1761 /* try set and get some illegal property identifiers */
1762 r = MsiSetProperty( hpkg, "", "asdf" );
1763 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1765 r = MsiSetProperty( hpkg, "=", "asdf" );
1766 ok( r == ERROR_SUCCESS, "wrong return val\n");
1768 r = MsiSetProperty( hpkg, " ", "asdf" );
1769 ok( r == ERROR_SUCCESS, "wrong return val\n");
1771 r = MsiSetProperty( hpkg, "'", "asdf" );
1772 ok( r == ERROR_SUCCESS, "wrong return val\n");
1776 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1777 ok( r == ERROR_SUCCESS, "wrong return val\n");
1778 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1780 /* set empty values */
1781 r = MsiSetProperty( hpkg, "boo", NULL );
1782 ok( r == ERROR_SUCCESS, "wrong return val\n");
1783 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1785 r = MsiSetProperty( hpkg, "boo", "" );
1786 ok( r == ERROR_SUCCESS, "wrong return val\n");
1787 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1789 /* set a non-empty value */
1790 r = MsiSetProperty( hpkg, "boo", "xyz" );
1791 ok( r == ERROR_SUCCESS, "wrong return val\n");
1795 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1796 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1797 ok( buffer[0] == 0, "buffer was not changed\n");
1798 ok( sz == 3, "wrong size returned\n");
1802 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1803 ok( r == ERROR_SUCCESS, "wrong return val\n");
1804 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1805 ok( sz == 3, "wrong size returned\n");
1809 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1810 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1811 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1812 ok( sz == 3, "wrong size returned\n");
1814 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1815 ok( r == ERROR_SUCCESS, "wrong return val\n");
1818 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1819 ok( r == ERROR_SUCCESS, "wrong return val\n");
1820 ok( !strcmp(buffer,""), "buffer wrong\n");
1821 ok( sz == 0, "wrong size returned\n");
1824 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1825 ok( r == ERROR_SUCCESS, "wrong return val\n");
1826 ok( !strcmp(buffer,""), "buffer wrong\n");
1827 ok( sz == 0, "wrong size returned\n");
1830 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1831 ok( r == ERROR_SUCCESS, "wrong return val\n");
1832 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1833 ok( sz == 3, "wrong size returned\n");
1835 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1836 ok( r == ERROR_SUCCESS, "wrong return val\n");
1839 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1840 ok( r == ERROR_SUCCESS, "return wrong\n");
1841 ok( sz == 13, "size wrong (%d)\n", sz);
1844 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1845 ok( r == ERROR_MORE_DATA, "return wrong\n");
1846 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1848 r = MsiSetProperty(hpkg, "property", "value");
1849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1852 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1853 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1854 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1856 r = MsiSetProperty(hpkg, "property", NULL);
1857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1860 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1861 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1862 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1864 MsiCloseHandle( hpkg );
1865 DeleteFile(msifile);
1868 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1870 MSIHANDLE hview, hrec;
1872 CHAR buffer[MAX_PATH];
1876 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1877 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1878 r = MsiViewExecute(hview, 0);
1879 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1882 while (r == ERROR_SUCCESS && !found)
1884 r = MsiViewFetch(hview, &hrec);
1885 if (r != ERROR_SUCCESS) break;
1888 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1889 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1892 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1893 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1897 MsiCloseHandle(hrec);
1900 MsiViewClose(hview);
1901 MsiCloseHandle(hview);
1906 static void test_property_table(void)
1910 MSIHANDLE hpkg, hdb, hrec;
1911 char buffer[MAX_PATH];
1915 hdb = create_package_db();
1916 ok( hdb, "failed to create package\n");
1918 hpkg = package_from_db(hdb);
1919 ok( hpkg, "failed to create package\n");
1921 MsiCloseHandle(hdb);
1923 hdb = MsiGetActiveDatabase(hpkg);
1925 query = "CREATE TABLE `_Property` ( "
1926 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1927 r = run_query(hdb, query);
1928 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1930 MsiCloseHandle(hdb);
1931 MsiCloseHandle(hpkg);
1932 DeleteFile(msifile);
1934 hdb = create_package_db();
1935 ok( hdb, "failed to create package\n");
1937 query = "CREATE TABLE `_Property` ( "
1938 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1939 r = run_query(hdb, query);
1940 ok(r == ERROR_SUCCESS, "failed to create table\n");
1942 query = "ALTER `_Property` ADD `foo` INTEGER";
1943 r = run_query(hdb, query);
1944 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1946 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
1947 r = run_query(hdb, query);
1948 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1950 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
1951 r = run_query(hdb, query);
1952 ok(r == ERROR_SUCCESS, "failed to add column\n");
1954 hpkg = package_from_db(hdb);
1957 ok(!hpkg, "package should not be created\n");
1960 MsiCloseHandle(hdb);
1961 MsiCloseHandle(hpkg);
1962 DeleteFile(msifile);
1964 hdb = create_package_db();
1965 ok (hdb, "failed to create package database\n");
1967 r = create_property_table(hdb);
1968 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
1970 r = add_property_entry(hdb, "'prop', 'val'");
1971 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1973 hpkg = package_from_db(hdb);
1974 ok(hpkg, "failed to create package\n");
1976 MsiCloseHandle(hdb);
1979 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
1980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1981 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
1983 hdb = MsiGetActiveDatabase(hpkg);
1985 found = find_prop_in_property(hdb, "prop", "val");
1986 ok(found, "prop should be in the _Property table\n");
1988 r = add_property_entry(hdb, "'dantes', 'mercedes'");
1989 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1991 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
1992 r = do_query(hdb, query, &hrec);
1993 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1995 found = find_prop_in_property(hdb, "dantes", "mercedes");
1996 ok(found == FALSE, "dantes should not be in the _Property table\n");
1999 lstrcpy(buffer, "aaa");
2000 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2001 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2002 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2004 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2007 found = find_prop_in_property(hdb, "dantes", "mercedes");
2008 ok(found == TRUE, "dantes should be in the _Property table\n");
2010 MsiCloseHandle(hdb);
2011 MsiCloseHandle(hpkg);
2012 DeleteFile(msifile);
2015 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2020 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2021 if( res == ERROR_SUCCESS )
2025 r = MsiViewExecute( htab, hrec );
2026 if( r != ERROR_SUCCESS )
2029 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2032 r = MsiViewClose( htab );
2033 if( r != ERROR_SUCCESS )
2036 r = MsiCloseHandle( htab );
2037 if( r != ERROR_SUCCESS )
2043 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2045 return try_query_param( hdb, szQuery, 0 );
2048 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2053 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2056 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2059 r = MsiSummaryInfoPersist(summary);
2060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2062 MsiCloseHandle(summary);
2065 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2070 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2073 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2074 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2076 r = MsiSummaryInfoPersist(summary);
2077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2079 MsiCloseHandle(summary);
2082 static void test_msipackage(void)
2084 MSIHANDLE hdb = 0, hpack = 100;
2089 /* NULL szPackagePath */
2090 r = MsiOpenPackage(NULL, &hpack);
2091 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2093 /* empty szPackagePath */
2094 r = MsiOpenPackage("", &hpack);
2097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2100 if (r == ERROR_SUCCESS)
2101 MsiCloseHandle(hpack);
2103 /* nonexistent szPackagePath */
2104 r = MsiOpenPackage("nonexistent", &hpack);
2105 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2108 r = MsiOpenPackage(msifile, NULL);
2109 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2113 r = MsiOpenPackage(name, &hpack);
2114 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2116 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2117 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2119 /* database exists, but is emtpy */
2120 sprintf(name, "#%d", hdb);
2121 r = MsiOpenPackage(name, &hpack);
2122 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2123 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2125 query = "CREATE TABLE `Property` ( "
2126 "`Property` CHAR(72), `Value` CHAR(0) "
2127 "PRIMARY KEY `Property`)";
2128 r = try_query(hdb, query);
2129 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2131 query = "CREATE TABLE `InstallExecuteSequence` ("
2132 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2133 "PRIMARY KEY `Action`)";
2134 r = try_query(hdb, query);
2135 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2137 /* a few key tables exist */
2138 sprintf(name, "#%d", hdb);
2139 r = MsiOpenPackage(name, &hpack);
2140 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2141 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2143 MsiCloseHandle(hdb);
2144 DeleteFile(msifile);
2146 /* start with a clean database to show what constitutes a valid package */
2147 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2150 sprintf(name, "#%d", hdb);
2152 /* The following summary information props must exist:
2157 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2158 r = MsiOpenPackage(name, &hpack);
2159 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2160 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2162 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2163 r = MsiOpenPackage(name, &hpack);
2164 ok(r == ERROR_SUCCESS,
2165 "Expected ERROR_SUCCESS, got %d\n", r);
2167 MsiCloseHandle(hpack);
2168 MsiCloseHandle(hdb);
2169 DeleteFile(msifile);
2172 static void test_formatrecord2(void)
2174 MSIHANDLE hpkg, hrec ;
2179 hpkg = package_from_db(create_package_db());
2180 ok( hpkg, "failed to create package\n");
2182 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2183 ok( r == ERROR_SUCCESS, "set property failed\n");
2185 hrec = MsiCreateRecord(2);
2186 ok(hrec, "create record failed\n");
2188 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2189 ok( r == ERROR_SUCCESS, "format record failed\n");
2193 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2195 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2196 r = MsiRecordSetString(hrec, 1, "hoo");
2198 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2199 ok( sz == 3, "size wrong\n");
2200 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2201 ok( r == ERROR_SUCCESS, "format failed\n");
2203 r = MsiRecordSetString(hrec, 0, "x[~]x");
2205 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2206 ok( sz == 3, "size wrong\n");
2207 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2208 ok( r == ERROR_SUCCESS, "format failed\n");
2210 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2211 r = MsiRecordSetString(hrec, 1, "hoo");
2213 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2214 ok( sz == 3, "size wrong\n");
2215 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2216 ok( r == ERROR_SUCCESS, "format failed\n");
2218 r = MsiRecordSetString(hrec, 0, "[\\[]");
2220 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2221 ok( sz == 1, "size wrong\n");
2222 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2223 ok( r == ERROR_SUCCESS, "format failed\n");
2225 SetEnvironmentVariable("FOO", "BAR");
2226 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2228 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2229 ok( sz == 3, "size wrong\n");
2230 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2231 ok( r == ERROR_SUCCESS, "format failed\n");
2233 r = MsiRecordSetString(hrec, 0, "[[1]]");
2234 r = MsiRecordSetString(hrec, 1, "%FOO");
2236 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2237 ok( sz == 3, "size wrong\n");
2238 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2239 ok( r == ERROR_SUCCESS, "format failed\n");
2241 MsiCloseHandle( hrec );
2242 MsiCloseHandle( hpkg );
2243 DeleteFile(msifile);
2246 static void test_states(void)
2251 INSTALLSTATE state, action;
2253 static const CHAR msifile2[] = "winetest2.msi";
2254 static const CHAR msifile3[] = "winetest3.msi";
2255 static const CHAR msifile4[] = "winetest4.msi";
2257 hdb = create_package_db();
2258 ok ( hdb, "failed to create package database\n" );
2260 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2261 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2263 r = create_property_table( hdb );
2264 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2266 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2267 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2269 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2270 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2272 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2273 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2275 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2276 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2278 r = create_install_execute_sequence_table( hdb );
2279 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2281 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2282 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2284 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2285 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2287 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2288 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2290 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2291 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2293 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2294 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2296 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2297 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2299 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2300 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2302 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2303 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2305 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2306 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2308 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2309 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2311 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2312 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2314 r = create_media_table( hdb );
2315 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2317 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2318 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2320 r = create_feature_table( hdb );
2321 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2323 r = create_component_table( hdb );
2324 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2326 /* msidbFeatureAttributesFavorLocal */
2327 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2328 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2330 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2331 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2332 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2334 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2335 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2336 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2338 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2339 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2340 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2342 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2343 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2344 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2346 /* msidbFeatureAttributesFavorSource */
2347 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2348 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2350 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2351 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2352 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2354 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2355 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2356 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2358 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2359 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2360 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2362 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2363 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2364 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2366 /* msidbFeatureAttributesFavorSource */
2367 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2368 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2370 /* msidbFeatureAttributesFavorLocal */
2371 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2372 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2375 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2376 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2378 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2379 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2380 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2382 /* no feature parent:msidbComponentAttributesLocalOnly */
2383 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2384 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2386 /* msidbFeatureAttributesFavorLocal:removed */
2387 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2388 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2390 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2391 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2392 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2394 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2395 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2396 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2398 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2399 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2400 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2402 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2403 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2404 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2406 /* msidbFeatureAttributesFavorSource:removed */
2407 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2408 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2410 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2411 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2412 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2414 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2415 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2416 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2418 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2419 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2420 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2422 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2423 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2424 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2426 /* msidbFeatureAttributesFavorLocal */
2427 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2428 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2430 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2431 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2433 /* msidbFeatureAttributesFavorSource */
2434 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2435 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2437 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2438 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2440 /* msidbFeatureAttributesFavorAdvertise */
2441 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2442 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2444 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2445 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2447 r = create_feature_components_table( hdb );
2448 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2450 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2451 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2453 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2454 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2456 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2457 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2459 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2460 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2462 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2463 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2465 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2466 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2468 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2469 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2471 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2472 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2474 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2475 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2477 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2478 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2480 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2481 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2483 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2484 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2486 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2487 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2489 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2490 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2492 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2493 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2495 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2496 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2498 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2499 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2501 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2502 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2504 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2505 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2507 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2508 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2510 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2511 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2513 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2514 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2516 r = create_file_table( hdb );
2517 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2519 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2520 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2522 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2523 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2525 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2526 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2528 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2529 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2531 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2532 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2534 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2535 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2537 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2538 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2540 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2541 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2543 /* compressed file */
2544 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2545 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2547 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2548 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2550 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2551 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2553 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2554 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2556 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2557 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2559 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2560 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2562 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2563 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2565 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2566 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2568 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2569 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2571 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2572 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2574 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2575 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2577 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2578 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2580 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2581 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2583 MsiDatabaseCommit(hdb);
2585 /* these properties must not be in the saved msi file */
2586 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2587 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2589 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2590 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2592 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2593 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2595 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2596 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2598 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2599 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2601 hpkg = package_from_db( hdb );
2602 ok( hpkg, "failed to create package\n");
2604 MsiCloseHandle(hdb);
2606 CopyFileA(msifile, msifile2, FALSE);
2607 CopyFileA(msifile, msifile3, FALSE);
2608 CopyFileA(msifile, msifile4, FALSE);
2612 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2613 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2614 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2615 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2619 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2620 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2621 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2622 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2626 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2627 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2628 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2629 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2633 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2634 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2635 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2636 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2640 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2641 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2642 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2643 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2647 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2648 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2649 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2650 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2654 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2655 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2656 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2657 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2661 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2662 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2663 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2664 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2668 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2669 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2670 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2671 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2675 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2676 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2677 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2678 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2682 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2683 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2684 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2685 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2689 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2690 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2691 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2692 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2696 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2697 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2698 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2699 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2703 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2704 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "delta", &state, &action);
2711 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2718 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "zeta", &state, &action);
2725 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "iota", &state, &action);
2732 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "eta", &state, &action);
2739 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "kappa", &state, &action);
2746 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "lambda", &state, &action);
2753 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "mu", &state, &action);
2760 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "nu", &state, &action);
2767 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
2827 r = MsiDoAction( hpkg, "CostInitialize");
2828 ok( r == ERROR_SUCCESS, "cost init failed\n");
2832 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2833 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2834 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2835 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2839 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2840 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2841 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2842 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2846 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2847 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2848 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2849 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2853 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2854 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2855 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2856 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2860 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2861 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2862 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2863 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2867 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2868 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2869 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2870 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2874 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2875 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2876 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2877 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2881 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2882 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2883 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2884 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2888 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2889 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2890 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2891 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2895 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2896 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2897 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2898 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2902 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2903 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2904 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2905 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2909 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2910 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2911 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2912 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2916 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2917 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2918 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2919 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2923 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
3047 r = MsiDoAction( hpkg, "FileCost");
3048 ok( r == ERROR_SUCCESS, "file cost failed\n");
3052 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3054 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3059 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3060 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3061 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3062 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3066 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3068 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3069 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3073 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3075 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3076 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3080 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3082 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3083 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3087 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3089 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3090 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3094 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3096 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3097 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3101 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3103 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3104 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3108 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3110 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3111 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3115 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3117 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3118 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3122 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3124 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3125 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3129 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3131 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3132 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3136 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3138 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3139 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3143 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &state, &action);
3200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3206 r = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
3267 r = MsiDoAction( hpkg, "CostFinalize");
3268 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3272 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3273 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3274 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3275 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3279 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3280 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3281 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3282 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3286 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3288 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3289 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3293 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3295 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3296 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3300 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3301 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3302 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3303 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3307 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3308 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3309 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3310 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3314 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3315 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3316 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3317 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3321 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3322 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3323 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3324 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3328 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3329 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3330 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3331 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3335 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3336 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3337 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3338 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3342 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3344 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3345 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3349 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3350 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3351 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3352 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3356 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3357 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3358 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3359 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3363 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3377 r = MsiGetComponentState(hpkg, "epsilon", &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_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3384 r = MsiGetComponentState(hpkg, "zeta", &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_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3391 r = MsiGetComponentState(hpkg, "iota", &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_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3398 r = MsiGetComponentState(hpkg, "eta", &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_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3405 r = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3440 r = MsiGetComponentState(hpkg, "omicron", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3447 r = MsiGetComponentState(hpkg, "pi", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3454 r = MsiGetComponentState(hpkg, "rho", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3461 r = MsiGetComponentState(hpkg, "sigma", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3468 r = MsiGetComponentState(hpkg, "tau", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3475 r = MsiGetComponentState(hpkg, "phi", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3482 r = MsiGetComponentState(hpkg, "chi", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3487 MsiCloseHandle( hpkg );
3489 /* publish the features and components */
3490 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3493 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3494 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3496 /* these properties must not be in the saved msi file */
3497 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3498 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3500 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3501 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3503 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3504 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3506 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3507 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3509 hpkg = package_from_db( hdb );
3510 ok( hpkg, "failed to create package\n");
3512 MsiCloseHandle(hdb);
3516 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3517 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3518 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3519 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3523 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3524 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3525 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3526 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3530 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3531 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3532 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3533 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3537 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3538 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3539 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3540 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3544 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3545 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3546 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3547 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3551 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3552 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3553 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3554 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3558 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3559 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3560 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3561 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3565 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3566 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3567 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3568 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3572 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3573 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3574 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3575 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3579 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3580 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3581 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3582 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3586 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3587 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3588 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3589 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3593 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3594 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3595 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3596 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3600 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3601 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3602 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3603 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3607 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3608 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "delta", &state, &action);
3615 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3622 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "zeta", &state, &action);
3629 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "iota", &state, &action);
3636 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "eta", &state, &action);
3643 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "kappa", &state, &action);
3650 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "lambda", &state, &action);
3657 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "mu", &state, &action);
3664 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "nu", &state, &action);
3671 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
3731 r = MsiDoAction( hpkg, "CostInitialize");
3732 ok( r == ERROR_SUCCESS, "cost init failed\n");
3736 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3737 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3738 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3739 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3743 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3744 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3745 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3746 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3750 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3751 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3752 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3753 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3757 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3758 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3759 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3760 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3764 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3765 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3766 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3767 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3771 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3772 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3773 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3774 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3778 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3779 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3780 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3781 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3785 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3786 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3787 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3788 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3792 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3793 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3794 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3795 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3799 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3800 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3801 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3802 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3806 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3807 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3808 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3809 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3813 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3814 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3815 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3816 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3820 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3821 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3822 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3823 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3827 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
3951 r = MsiDoAction( hpkg, "FileCost");
3952 ok( r == ERROR_SUCCESS, "file cost failed\n");
3956 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3957 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3958 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3959 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3963 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3964 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3965 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3966 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3970 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3971 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3972 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3973 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3977 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3978 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3979 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3980 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3984 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3985 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3986 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3987 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3991 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3992 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3993 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3994 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3998 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3999 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4000 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4001 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4005 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4006 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4007 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4008 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4012 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4013 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4014 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4015 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4019 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4020 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4021 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4022 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4026 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4027 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4028 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4029 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4033 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4034 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4035 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4036 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4040 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4041 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4042 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4043 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4047 r = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
4164 r = MsiDoAction( hpkg, "CostFinalize");
4165 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4169 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4171 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4172 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4176 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4178 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4179 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4183 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4185 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4186 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4190 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4192 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4193 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4197 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4199 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4200 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4204 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4206 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4207 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4211 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4212 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4213 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4214 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4218 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4219 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4220 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4221 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4225 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4226 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4227 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4228 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4232 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4234 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4235 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4239 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4241 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4242 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4246 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4248 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4249 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4253 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4255 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4256 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4260 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4262 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4263 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4267 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4269 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4270 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4274 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4275 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4276 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4277 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4281 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4283 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4284 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4288 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4290 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4291 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4295 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4297 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4298 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4302 r = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &state, &action);
4331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4332 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4333 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4337 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4339 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4340 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4344 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4346 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4347 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4351 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4353 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4354 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4358 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4360 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4361 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4365 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4367 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4368 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4372 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4374 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4375 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4379 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4381 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4382 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4384 MsiCloseHandle(hpkg);
4386 /* uninstall the product */
4387 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4390 /* all features installed locally */
4391 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4394 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4395 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4397 /* these properties must not be in the saved msi file */
4398 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4399 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4401 hpkg = package_from_db( hdb );
4402 ok( hpkg, "failed to create package\n");
4406 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4407 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4408 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4409 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4413 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4414 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4415 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4416 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4420 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4421 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4422 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4423 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4427 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4428 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4429 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4430 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4434 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4435 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4436 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4437 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4441 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4442 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4443 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4444 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4448 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4449 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4450 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4451 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4455 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4456 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4457 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4458 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4462 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4463 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4464 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4465 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4469 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4470 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4471 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4472 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4476 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4477 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4478 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4479 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4483 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4484 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4485 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4486 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4490 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4491 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4492 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4493 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4497 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4498 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "delta", &state, &action);
4505 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4512 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "zeta", &state, &action);
4519 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "iota", &state, &action);
4526 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "eta", &state, &action);
4533 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "kappa", &state, &action);
4540 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "lambda", &state, &action);
4547 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "mu", &state, &action);
4554 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "nu", &state, &action);
4561 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
4621 r = MsiDoAction( hpkg, "CostInitialize");
4622 ok( r == ERROR_SUCCESS, "cost init failed\n");
4626 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4627 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4628 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4629 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4633 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4634 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4635 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4636 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4640 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4641 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4642 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4643 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4647 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4648 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4649 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4650 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4654 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4655 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4656 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4657 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4661 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4662 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4663 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4664 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4668 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4669 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4670 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4671 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4675 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4676 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4677 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4678 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4682 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4683 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4684 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4685 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4689 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4690 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4691 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4692 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4696 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4697 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4698 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4699 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4703 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4704 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4705 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4706 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4710 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4711 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4712 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4713 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4717 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
4841 r = MsiDoAction( hpkg, "FileCost");
4842 ok( r == ERROR_SUCCESS, "file cost failed\n");
4846 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4847 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4848 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4849 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4853 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4854 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4855 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4856 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4860 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4861 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4862 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4863 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4867 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4868 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4869 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4870 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4874 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4875 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4876 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4877 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4881 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4882 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4883 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4884 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4888 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4889 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4890 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4891 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4895 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4896 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4897 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4898 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4902 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4903 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4904 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4905 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4909 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4910 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4911 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4912 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4916 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4917 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4918 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4919 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4923 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4924 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4925 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4926 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4930 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4931 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4932 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4933 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4937 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
5061 r = MsiDoAction( hpkg, "CostFinalize");
5062 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5066 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5068 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5069 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5073 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5075 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5076 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5080 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5082 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5083 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5087 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5089 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5090 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5094 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5096 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5097 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5101 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5103 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5104 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5108 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5110 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5111 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5115 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5117 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5118 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5122 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5124 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5125 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5129 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5131 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5132 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5136 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5138 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5139 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5143 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5145 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5146 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5150 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5152 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5153 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5157 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5159 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5160 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5164 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5166 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5167 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5171 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5173 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5174 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5178 r = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &state, &action);
5186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5187 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5188 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5192 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5194 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5195 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5199 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5201 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5206 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5208 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5209 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5213 r = MsiGetComponentState(hpkg, "mu", &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 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5220 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5222 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5223 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5227 r = MsiGetComponentState(hpkg, "xi", &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( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5234 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5236 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5237 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5241 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5243 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5244 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5248 r = MsiGetComponentState(hpkg, "rho", &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( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5255 r = MsiGetComponentState(hpkg, "sigma", &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( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5262 r = MsiGetComponentState(hpkg, "tau", &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( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5269 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5271 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5272 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5276 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5278 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5279 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5281 MsiCloseHandle(hpkg);
5283 /* uninstall the product */
5284 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5285 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5287 /* all features installed from source */
5288 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5289 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5291 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5292 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5294 /* this property must not be in the saved msi file */
5295 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5296 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5298 hpkg = package_from_db( hdb );
5299 ok( hpkg, "failed to create package\n");
5303 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5304 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5305 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5306 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5310 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5311 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5312 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5313 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5317 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5318 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5319 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5320 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5324 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5325 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5326 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5327 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5331 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5332 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5333 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5334 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5338 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5339 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5340 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5341 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5345 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5346 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5347 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5348 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5352 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5353 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5354 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5355 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5359 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5360 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5361 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5362 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5366 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5367 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5368 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5369 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5373 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5374 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5375 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5376 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5380 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5381 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5382 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5383 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5387 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5388 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5389 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5390 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5394 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5395 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "delta", &state, &action);
5402 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5409 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "zeta", &state, &action);
5416 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "iota", &state, &action);
5423 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "eta", &state, &action);
5430 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "kappa", &state, &action);
5437 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "lambda", &state, &action);
5444 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "mu", &state, &action);
5451 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "nu", &state, &action);
5458 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
5518 r = MsiDoAction( hpkg, "CostInitialize");
5519 ok( r == ERROR_SUCCESS, "cost init failed\n");
5523 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5524 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5525 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5526 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5530 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5531 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5532 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5533 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5537 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5538 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5539 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5540 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5544 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5545 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5546 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5547 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5551 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5552 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5553 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5554 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5558 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5559 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5560 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5561 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5565 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5566 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5567 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5568 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5572 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5573 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5574 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5575 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5579 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5580 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5581 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5582 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5586 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5587 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5588 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5589 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5593 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5594 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5595 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5596 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5600 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5601 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5602 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5603 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5607 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5608 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5609 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5610 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5614 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
5738 r = MsiDoAction( hpkg, "FileCost");
5739 ok( r == ERROR_SUCCESS, "file cost failed\n");
5743 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5744 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5745 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5746 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5750 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5751 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5752 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5753 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5757 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5758 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5759 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5760 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5764 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5765 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5766 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5767 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5771 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5772 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5773 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5774 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5778 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5779 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5780 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5781 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5785 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5786 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5787 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5788 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5792 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5793 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5794 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5795 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5799 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5800 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5801 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5802 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5806 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5807 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5808 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5809 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5813 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5814 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5815 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5816 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5820 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5821 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5822 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5823 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5827 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5828 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5829 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5830 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5834 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
5958 r = MsiDoAction( hpkg, "CostFinalize");
5959 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5963 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5964 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5965 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5966 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5970 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5971 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5972 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5973 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5977 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5978 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5979 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5980 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5984 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5985 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5986 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5987 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5991 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5992 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5993 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5994 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5998 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5999 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6000 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6001 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6005 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6006 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6007 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6008 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6012 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6013 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6014 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6015 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6019 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6020 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6021 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6022 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6026 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6027 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6028 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6029 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6033 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6034 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6035 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6036 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6040 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6041 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6042 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6043 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6047 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6048 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6049 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6050 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6054 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6056 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6057 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6061 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6063 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6064 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6068 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6070 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6071 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6075 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6077 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6078 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6082 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6084 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6085 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6089 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6091 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6092 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6096 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6098 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6099 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6103 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6105 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6106 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6110 r = MsiGetComponentState(hpkg, "mu", &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( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6117 r = MsiGetComponentState(hpkg, "nu", &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( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6124 r = MsiGetComponentState(hpkg, "xi", &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, "omicron", &state, &action);
6132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6133 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6134 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6138 r = MsiGetComponentState(hpkg, "pi", &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, "rho", &state, &action);
6146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6147 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6152 r = MsiGetComponentState(hpkg, "sigma", &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( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6159 r = MsiGetComponentState(hpkg, "tau", &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( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6166 r = MsiGetComponentState(hpkg, "phi", &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( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6173 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6175 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6176 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6178 MsiCloseHandle(hpkg);
6180 /* reinstall the product */
6181 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6182 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6184 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6185 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6187 /* this property must not be in the saved msi file */
6188 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6189 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6191 hpkg = package_from_db( hdb );
6192 ok( hpkg, "failed to create package\n");
6196 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6197 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6198 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6199 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6203 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6204 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6205 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6206 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6210 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6211 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6212 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6213 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6217 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6218 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6219 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6220 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6224 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6225 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6226 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6227 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6231 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6232 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6233 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6234 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6238 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6239 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6240 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6241 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6245 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6246 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6247 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6248 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6252 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6253 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6254 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6255 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6259 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6260 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6261 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6262 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6266 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6267 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6268 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6269 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6273 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6274 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6275 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6276 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6280 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6281 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6282 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6283 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6287 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6288 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "delta", &state, &action);
6295 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6302 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "zeta", &state, &action);
6309 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "iota", &state, &action);
6316 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "eta", &state, &action);
6323 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "kappa", &state, &action);
6330 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "lambda", &state, &action);
6337 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "mu", &state, &action);
6344 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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 = MsiGetComponentState(hpkg, "nu", &state, &action);
6351 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, 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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
6411 r = MsiDoAction( hpkg, "CostInitialize");
6412 ok( r == ERROR_SUCCESS, "cost init failed\n");
6416 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6417 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6418 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6419 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6423 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6424 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6425 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6426 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6430 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6431 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6432 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6433 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6437 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6438 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6439 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6440 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6444 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6445 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6446 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6447 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6451 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6452 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6453 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6454 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6458 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6459 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6460 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6461 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6465 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6466 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6467 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6468 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6472 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6473 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6474 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6475 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6479 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6480 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6481 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6482 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6486 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6487 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6488 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6489 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6493 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6494 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6495 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6496 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6500 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6501 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6502 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6503 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6507 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
6631 r = MsiDoAction( hpkg, "FileCost");
6632 ok( r == ERROR_SUCCESS, "file cost failed\n");
6636 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6637 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6638 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6639 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6643 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6644 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6645 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6646 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6650 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6652 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6653 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6657 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6659 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6660 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6664 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6665 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6666 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6667 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6671 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6673 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6674 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6678 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6679 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6680 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6681 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6685 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6687 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6688 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6692 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6693 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6694 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6695 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6699 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6700 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6701 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6702 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6706 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6707 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6708 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6709 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6713 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6714 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6715 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6716 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6720 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6721 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6722 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6723 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6727 r = MsiGetComponentState(hpkg, "theta", &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 = MsiGetComponentState(hpkg, "delta", &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 = MsiGetComponentState(hpkg, "epsilon", &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 = MsiGetComponentState(hpkg, "zeta", &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 = MsiGetComponentState(hpkg, "iota", &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 = MsiGetComponentState(hpkg, "eta", &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 = MsiGetComponentState(hpkg, "kappa", &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 = MsiGetComponentState(hpkg, "lambda", &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 = MsiGetComponentState(hpkg, "mu", &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 = MsiGetComponentState(hpkg, "nu", &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, "xi", &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, "omicron", &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, "pi", &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, "rho", &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, "sigma", &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, "tau", &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, "phi", &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, "chi", &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);
6851 r = MsiDoAction( hpkg, "CostFinalize");
6852 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6856 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6858 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6859 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6863 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6864 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6865 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6866 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6870 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6871 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6872 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6873 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6877 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6879 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6880 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6884 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6886 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6887 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6891 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6893 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6894 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6898 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6900 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6901 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6905 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6906 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6907 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6908 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6912 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6913 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6914 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6915 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6919 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6920 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6921 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6922 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6926 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6927 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6928 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6929 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6933 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6934 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6935 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6936 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6940 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6941 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6942 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6943 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6947 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6949 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6950 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6954 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6956 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6957 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6961 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6963 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6964 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6968 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6970 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6971 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6975 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6977 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6978 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6982 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6983 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6984 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6985 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6989 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6990 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6991 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6992 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6996 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6997 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6998 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6999 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7003 r = MsiGetComponentState(hpkg, "mu", &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( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7010 r = MsiGetComponentState(hpkg, "nu", &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( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7017 r = MsiGetComponentState(hpkg, "xi", &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( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7024 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7026 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7027 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7031 r = MsiGetComponentState(hpkg, "pi", &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, "rho", &state, &action);
7039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7040 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7041 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7045 r = MsiGetComponentState(hpkg, "sigma", &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( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7052 r = MsiGetComponentState(hpkg, "tau", &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( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7059 r = MsiGetComponentState(hpkg, "phi", &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( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7066 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7068 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7069 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7071 MsiCloseHandle(hpkg);
7073 /* uninstall the product */
7074 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7077 DeleteFileA(msifile);
7078 DeleteFileA(msifile2);
7079 DeleteFileA(msifile3);
7080 DeleteFileA(msifile4);
7083 static void test_getproperty(void)
7085 MSIHANDLE hPackage = 0;
7087 static CHAR empty[] = "";
7091 hPackage = package_from_db(create_package_db());
7092 ok( hPackage != 0, " Failed to create package\n");
7094 /* set the property */
7095 r = MsiSetProperty(hPackage, "Name", "Value");
7096 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7098 /* retrieve the size, NULL pointer */
7100 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7102 ok( size == 5, "Expected 5, got %d\n", size);
7104 /* retrieve the size, empty string */
7106 r = MsiGetProperty(hPackage, "Name", empty, &size);
7107 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7108 ok( size == 5, "Expected 5, got %d\n", size);
7110 /* don't change size */
7111 r = MsiGetProperty(hPackage, "Name", prop, &size);
7112 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7113 ok( size == 5, "Expected 5, got %d\n", size);
7114 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7116 /* increase the size by 1 */
7118 r = MsiGetProperty(hPackage, "Name", prop, &size);
7119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7120 ok( size == 5, "Expected 5, got %d\n", size);
7121 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7123 r = MsiCloseHandle( hPackage);
7124 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7125 DeleteFile(msifile);
7128 static void test_removefiles(void)
7134 hdb = create_package_db();
7135 ok ( hdb, "failed to create package database\n" );
7137 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7138 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7140 r = create_feature_table( hdb );
7141 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7143 r = create_component_table( hdb );
7144 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7146 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7147 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7149 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7150 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7152 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7153 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7155 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7156 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7158 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7159 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7161 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7162 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7164 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7165 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7167 r = create_feature_components_table( hdb );
7168 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7170 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7171 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7173 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7174 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7176 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7177 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7179 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7180 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7182 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7183 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7185 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7186 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7188 r = create_file_table( hdb );
7189 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7191 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7192 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7194 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7195 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7197 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7198 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7200 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7201 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7203 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7204 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7206 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7207 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7209 r = create_remove_file_table( hdb );
7210 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7212 hpkg = package_from_db( hdb );
7213 ok( hpkg, "failed to create package\n");
7215 MsiCloseHandle( hdb );
7217 create_test_file( "hydrogen.txt" );
7218 create_test_file( "helium.txt" );
7219 create_test_file( "lithium.txt" );
7220 create_test_file( "beryllium.txt" );
7221 create_test_file( "boron.txt" );
7222 create_test_file( "carbon.txt" );
7224 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7225 ok( r == ERROR_SUCCESS, "set property failed\n");
7227 r = MsiDoAction( hpkg, "CostInitialize");
7228 ok( r == ERROR_SUCCESS, "cost init failed\n");
7230 r = MsiDoAction( hpkg, "FileCost");
7231 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7233 r = MsiDoAction( hpkg, "CostFinalize");
7234 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7236 r = MsiDoAction( hpkg, "InstallValidate");
7237 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7239 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7240 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7242 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7243 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7245 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7246 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7248 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7249 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7251 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7252 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7254 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7255 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7257 r = MsiDoAction( hpkg, "RemoveFiles");
7258 ok( r == ERROR_SUCCESS, "remove files failed\n");
7260 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7261 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7262 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7263 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7264 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7265 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7267 MsiCloseHandle( hpkg );
7268 DeleteFileA(msifile);
7271 static void test_appsearch(void)
7276 CHAR prop[MAX_PATH];
7277 DWORD size = MAX_PATH;
7279 hdb = create_package_db();
7280 ok ( hdb, "failed to create package database\n" );
7282 r = create_appsearch_table( hdb );
7283 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7285 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7286 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7288 r = create_reglocator_table( hdb );
7289 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7291 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7292 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7294 r = create_signature_table( hdb );
7295 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7297 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7298 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7300 hpkg = package_from_db( hdb );
7301 ok( hpkg, "failed to create package\n");
7303 MsiCloseHandle( hdb );
7305 r = MsiDoAction( hpkg, "AppSearch" );
7306 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7308 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7309 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7312 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7315 MsiCloseHandle( hpkg );
7316 DeleteFileA(msifile);
7319 static void test_appsearch_complocator(void)
7321 MSIHANDLE hpkg, hdb;
7322 CHAR path[MAX_PATH];
7323 CHAR prop[MAX_PATH];
7328 get_user_sid(&usersid);
7331 skip("ConvertSidToStringSidA is not available\n");
7335 create_test_file("FileName1");
7336 create_test_file("FileName4");
7337 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7338 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7340 create_test_file("FileName2");
7341 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7342 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7344 create_test_file("FileName3");
7345 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7346 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7348 create_test_file("FileName5");
7349 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7350 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7352 create_test_file("FileName6");
7353 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7354 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7356 create_test_file("FileName7");
7357 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7358 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7360 /* dir is FALSE, but we're pretending it's a directory */
7361 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7362 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7364 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7365 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7366 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7368 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7369 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7370 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7372 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7373 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7374 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7376 hdb = create_package_db();
7377 ok(hdb, "Expected a valid database handle\n");
7379 r = create_appsearch_table(hdb);
7380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7382 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7385 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7388 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7391 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7394 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7397 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7400 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7403 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7406 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7409 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7410 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7412 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7415 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7418 r = create_complocator_table(hdb);
7419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7421 /* published component, machine, file, signature, misdbLocatorTypeFile */
7422 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7425 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7426 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7429 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7430 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7433 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7434 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7437 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7438 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7441 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7442 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7445 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7446 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7449 /* unpublished component, no signature, misdbLocatorTypeDir */
7450 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7453 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7454 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7455 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7457 /* published component, signature w/ ver, misdbLocatorTypeFile */
7458 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7461 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7462 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7465 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7466 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7469 r = create_signature_table(hdb);
7470 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7472 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7475 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7476 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7478 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7481 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7484 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7487 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7488 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7490 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7493 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7496 hpkg = package_from_db(hdb);
7497 ok(hpkg, "Expected a valid package handle\n");
7499 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
7500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7502 r = MsiDoAction(hpkg, "AppSearch");
7503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7506 sprintf(path, "%s\\FileName1", CURR_DIR);
7507 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7509 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7512 sprintf(path, "%s\\FileName2", CURR_DIR);
7513 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7515 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7518 sprintf(path, "%s\\FileName3", CURR_DIR);
7519 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7521 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7524 sprintf(path, "%s\\FileName4", CURR_DIR);
7525 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
7526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7527 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7530 sprintf(path, "%s\\FileName5", CURR_DIR);
7531 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7533 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7536 sprintf(path, "%s\\", CURR_DIR);
7537 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7539 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7542 sprintf(path, "%s\\", CURR_DIR);
7543 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7545 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7548 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7550 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
7553 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7554 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7555 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7558 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
7559 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7560 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7561 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7564 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
7565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7566 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7569 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
7570 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
7571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7572 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7574 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7575 MSIINSTALLCONTEXT_MACHINE, NULL);
7576 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7577 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
7578 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7579 MSIINSTALLCONTEXT_USERMANAGED, usersid);
7580 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7581 MSIINSTALLCONTEXT_MACHINE, NULL);
7582 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7583 MSIINSTALLCONTEXT_MACHINE, NULL);
7584 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7585 MSIINSTALLCONTEXT_MACHINE, NULL);
7586 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7587 MSIINSTALLCONTEXT_MACHINE, NULL);
7588 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7589 MSIINSTALLCONTEXT_MACHINE, NULL);
7590 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7591 MSIINSTALLCONTEXT_MACHINE, NULL);
7592 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7593 MSIINSTALLCONTEXT_MACHINE, NULL);
7595 DeleteFileA("FileName1");
7596 DeleteFileA("FileName2");
7597 DeleteFileA("FileName3");
7598 DeleteFileA("FileName4");
7599 DeleteFileA("FileName5");
7600 DeleteFileA("FileName6");
7601 DeleteFileA("FileName7");
7602 DeleteFileA("FileName8.dll");
7603 DeleteFileA("FileName9.dll");
7604 DeleteFileA("FileName10.dll");
7605 MsiCloseHandle(hpkg);
7606 DeleteFileA(msifile);
7609 static void test_appsearch_reglocator(void)
7611 MSIHANDLE hpkg, hdb;
7612 CHAR path[MAX_PATH];
7613 CHAR prop[MAX_PATH];
7616 BOOL space, version;
7627 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7630 DeleteFileA("test.dll");
7632 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
7633 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7635 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
7636 (const BYTE *)"regszdata", 10);
7637 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7639 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
7640 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7642 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
7643 (const BYTE *)"regszdata", 10);
7644 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7647 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
7648 ok(res == ERROR_SUCCESS ||
7649 broken(res == ERROR_INVALID_PARAMETER),
7650 "Expected ERROR_SUCCESS, got %d\n", res);
7652 if (res == ERROR_SUCCESS)
7654 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
7655 (const BYTE *)"regszdata", 10);
7656 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7659 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
7660 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7662 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
7663 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7665 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
7666 (const BYTE *)"regszdata", 10);
7667 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7670 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
7671 (const BYTE *)&val, sizeof(DWORD));
7672 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7675 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
7676 (const BYTE *)&val, sizeof(DWORD));
7677 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7679 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
7680 (const BYTE *)"%PATH%", 7);
7681 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7683 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
7684 (const BYTE *)"my%NOVAR%", 10);
7685 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7687 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
7688 (const BYTE *)"one\0two\0", 9);
7689 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7691 binary[0] = 0x1234abcd;
7692 binary[1] = 0x567890ef;
7693 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
7694 (const BYTE *)binary, sizeof(binary));
7695 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7697 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
7698 (const BYTE *)"#regszdata", 11);
7699 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7701 create_test_file("FileName1");
7702 sprintf(path, "%s\\FileName1", CURR_DIR);
7703 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
7704 (const BYTE *)path, lstrlenA(path) + 1);
7705 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7707 sprintf(path, "%s\\FileName2", CURR_DIR);
7708 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
7709 (const BYTE *)path, lstrlenA(path) + 1);
7710 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7712 lstrcpyA(path, CURR_DIR);
7713 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
7714 (const BYTE *)path, lstrlenA(path) + 1);
7715 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7717 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
7718 (const BYTE *)"", 1);
7719 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7721 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7722 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
7723 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
7724 (const BYTE *)path, lstrlenA(path) + 1);
7725 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7727 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7728 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
7729 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
7730 (const BYTE *)path, lstrlenA(path) + 1);
7731 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7733 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7734 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
7735 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
7736 (const BYTE *)path, lstrlenA(path) + 1);
7737 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7739 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
7740 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
7741 (const BYTE *)path, lstrlenA(path) + 1);
7743 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
7744 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
7745 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
7746 (const BYTE *)path, lstrlenA(path) + 1);
7748 hdb = create_package_db();
7749 ok(hdb, "Expected a valid database handle\n");
7751 r = create_appsearch_table(hdb);
7752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7754 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7755 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7757 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7758 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7760 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7763 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7764 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7766 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7769 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7772 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7775 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7776 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7778 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7781 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7784 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7787 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7790 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
7791 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7793 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
7794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7796 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
7797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7799 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
7800 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7802 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
7803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7805 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
7806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7808 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
7809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7811 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
7812 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7814 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
7815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7817 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
7818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7820 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
7821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7823 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
7824 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7826 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
7827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7829 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
7830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7832 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
7833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7835 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
7836 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7838 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
7839 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7841 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
7842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7844 r = create_reglocator_table(hdb);
7845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7847 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
7848 str = "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
7849 r = add_reglocator_entry(hdb, str);
7850 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7852 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
7853 str = "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
7854 r = add_reglocator_entry(hdb, str);
7855 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7857 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
7858 str = "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
7859 r = add_reglocator_entry(hdb, str);
7860 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7862 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7863 str = "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
7864 r = add_reglocator_entry(hdb, str);
7865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7867 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7868 str = "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
7869 r = add_reglocator_entry(hdb, str);
7870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7872 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
7873 str = "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
7874 r = add_reglocator_entry(hdb, str);
7875 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7877 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
7878 str = "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
7879 r = add_reglocator_entry(hdb, str);
7880 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7882 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
7883 str = "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
7884 r = add_reglocator_entry(hdb, str);
7885 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7887 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
7888 str = "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
7889 r = add_reglocator_entry(hdb, str);
7890 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7892 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
7893 str = "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
7894 r = add_reglocator_entry(hdb, str);
7895 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7897 /* HKLM, msidbLocatorTypeFileName, no signature */
7898 str = "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
7899 r = add_reglocator_entry(hdb, str);
7900 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7902 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
7903 str = "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
7904 r = add_reglocator_entry(hdb, str);
7905 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7907 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
7908 str = "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
7909 r = add_reglocator_entry(hdb, str);
7910 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7912 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
7913 str = "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
7914 r = add_reglocator_entry(hdb, str);
7915 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7917 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
7918 str = "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
7919 r = add_reglocator_entry(hdb, str);
7920 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7922 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
7923 str = "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
7924 r = add_reglocator_entry(hdb, str);
7925 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7927 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
7928 str = "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
7929 r = add_reglocator_entry(hdb, str);
7930 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7932 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
7933 str = "'NewSignature18', 2, 'Software\\Wine', '', 2";
7934 r = add_reglocator_entry(hdb, str);
7935 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7937 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
7938 str = "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
7939 r = add_reglocator_entry(hdb, str);
7940 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7942 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
7943 str = "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
7944 r = add_reglocator_entry(hdb, str);
7945 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7947 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
7948 str = "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
7949 r = add_reglocator_entry(hdb, str);
7950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7952 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
7953 str = "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
7954 r = add_reglocator_entry(hdb, str);
7955 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7957 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
7958 str = "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
7959 r = add_reglocator_entry(hdb, str);
7960 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7962 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
7963 str = "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
7964 r = add_reglocator_entry(hdb, str);
7965 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7967 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
7968 str = "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
7969 r = add_reglocator_entry(hdb, str);
7970 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7972 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
7973 str = "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
7974 r = add_reglocator_entry(hdb, str);
7975 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7977 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
7978 str = "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
7979 r = add_reglocator_entry(hdb, str);
7980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7982 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
7983 str = "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
7984 r = add_reglocator_entry(hdb, str);
7985 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7987 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
7988 str = "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
7989 r = add_reglocator_entry(hdb, str);
7990 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7992 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
7993 str = "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
7994 r = add_reglocator_entry(hdb, str);
7995 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7997 r = create_signature_table(hdb);
7998 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8000 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8001 r = add_signature_entry(hdb, str);
8002 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8004 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8005 r = add_signature_entry(hdb, str);
8006 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8008 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8009 r = add_signature_entry(hdb, str);
8010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8012 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8013 r = add_signature_entry(hdb, str);
8014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8016 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8017 r = add_signature_entry(hdb, str);
8018 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8020 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8021 r = add_signature_entry(hdb, str);
8022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8024 ptr = strrchr(CURR_DIR, '\\') + 1;
8025 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8026 r = add_signature_entry(hdb, path);
8027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8029 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8030 r = add_signature_entry(hdb, str);
8031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8033 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8034 r = add_signature_entry(hdb, str);
8035 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8037 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8038 r = add_signature_entry(hdb, str);
8039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8041 hpkg = package_from_db(hdb);
8042 ok(hpkg, "Expected a valid package handle\n");
8044 r = MsiDoAction(hpkg, "AppSearch");
8045 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8048 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8050 ok(!lstrcmpA(prop, "regszdata"),
8051 "Expected \"regszdata\", got \"%s\"\n", prop);
8054 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8056 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8059 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8061 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8063 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8064 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8066 /* Workaround for Win95 */
8068 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8070 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8071 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8074 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8077 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8078 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8079 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8080 ok(!lstrcmpA(pathdata, pathvar),
8081 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8083 HeapFree(GetProcessHeap(), 0, pathvar);
8084 HeapFree(GetProcessHeap(), 0, pathdata);
8087 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8088 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8090 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8093 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8094 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8097 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8098 "Expected \"\\0one\\0two\\0\\0\"\n");
8102 lstrcpyA(path, "#xCDAB3412EF907856");
8103 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8104 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8105 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8108 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8109 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8110 ok(!lstrcmpA(prop, "##regszdata"),
8111 "Expected \"##regszdata\", got \"%s\"\n", prop);
8114 sprintf(path, "%s\\FileName1", CURR_DIR);
8115 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8116 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8117 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8120 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8122 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8125 sprintf(path, "%s\\", CURR_DIR);
8126 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8127 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8128 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8131 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8132 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8133 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8136 sprintf(path, "%s\\", CURR_DIR);
8137 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8139 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8142 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8143 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8144 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8147 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8149 ok(!lstrcmpA(prop, "regszdata"),
8150 "Expected \"regszdata\", got \"%s\"\n", prop);
8153 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8154 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8155 ok(!lstrcmpA(prop, "regszdata"),
8156 "Expected \"regszdata\", got \"%s\"\n", prop);
8161 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8162 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8163 ok(!lstrcmpA(prop, "regszdata"),
8164 "Expected \"regszdata\", got \"%s\"\n", prop);
8168 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8169 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8170 ok(!lstrcmpA(prop, "defvalue"),
8171 "Expected \"defvalue\", got \"%s\"\n", prop);
8174 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8176 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8179 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8181 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8186 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8187 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8188 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8189 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8192 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8194 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8197 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8198 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8199 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8200 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8204 lstrcpyA(path, CURR_DIR);
8205 ptr = strrchr(path, '\\') + 1;
8207 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8209 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8212 sprintf(path, "%s\\", CURR_DIR);
8213 r = MsiGetPropertyA(hpkg, "SIGPROP25", 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, "SIGPROP26", prop, &size);
8219 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8220 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8223 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8224 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8225 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8228 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8229 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8230 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8233 sprintf(path, "%s\\FileName1", CURR_DIR);
8234 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8235 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8236 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8239 sprintf(path, "%s\\FileName1", CURR_DIR);
8240 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8241 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8243 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8245 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8247 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8248 RegDeleteValueA(hklm, "Value1");
8249 RegDeleteValueA(hklm, "Value2");
8250 RegDeleteValueA(hklm, "Value3");
8251 RegDeleteValueA(hklm, "Value4");
8252 RegDeleteValueA(hklm, "Value5");
8253 RegDeleteValueA(hklm, "Value6");
8254 RegDeleteValueA(hklm, "Value7");
8255 RegDeleteValueA(hklm, "Value8");
8256 RegDeleteValueA(hklm, "Value9");
8257 RegDeleteValueA(hklm, "Value10");
8258 RegDeleteValueA(hklm, "Value11");
8259 RegDeleteValueA(hklm, "Value12");
8260 RegDeleteValueA(hklm, "Value13");
8261 RegDeleteValueA(hklm, "Value14");
8262 RegDeleteValueA(hklm, "Value15");
8263 RegDeleteValueA(hklm, "Value16");
8264 RegDeleteValueA(hklm, "Value17");
8265 RegDeleteKeyA(hklm, "");
8268 RegDeleteValueA(classes, "Value1");
8269 RegDeleteKeyA(classes, "");
8270 RegCloseKey(classes);
8272 RegDeleteValueA(hkcu, "Value1");
8273 RegDeleteKeyA(hkcu, "");
8276 RegDeleteValueA(users, "Value1");
8277 RegDeleteKeyA(users, "");
8280 DeleteFileA("FileName1");
8281 DeleteFileA("FileName3.dll");
8282 DeleteFileA("FileName4.dll");
8283 DeleteFileA("FileName5.dll");
8284 MsiCloseHandle(hpkg);
8285 DeleteFileA(msifile);
8288 static void delete_win_ini(LPCSTR file)
8290 CHAR path[MAX_PATH];
8292 GetWindowsDirectoryA(path, MAX_PATH);
8293 lstrcatA(path, "\\");
8294 lstrcatA(path, file);
8299 static void test_appsearch_inilocator(void)
8301 MSIHANDLE hpkg, hdb;
8302 CHAR path[MAX_PATH];
8303 CHAR prop[MAX_PATH];
8311 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8314 DeleteFileA("test.dll");
8316 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8318 create_test_file("FileName1");
8319 sprintf(path, "%s\\FileName1", CURR_DIR);
8320 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8322 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8324 sprintf(path, "%s\\IDontExist", CURR_DIR);
8325 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8327 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8328 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8329 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8331 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8332 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8333 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8335 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8336 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8337 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8339 hdb = create_package_db();
8340 ok(hdb, "Expected a valid database handle\n");
8342 r = create_appsearch_table(hdb);
8343 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8345 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8348 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8349 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8351 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8352 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8354 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8355 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8357 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8358 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8360 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8363 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8366 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8369 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8370 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8372 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8373 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8375 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8378 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8381 r = create_inilocator_table(hdb);
8382 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8384 /* msidbLocatorTypeRawValue, field 1 */
8385 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8386 r = add_inilocator_entry(hdb, str);
8387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8389 /* msidbLocatorTypeRawValue, field 2 */
8390 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8391 r = add_inilocator_entry(hdb, str);
8392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8394 /* msidbLocatorTypeRawValue, entire field */
8395 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8396 r = add_inilocator_entry(hdb, str);
8397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8399 /* msidbLocatorTypeFile */
8400 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8401 r = add_inilocator_entry(hdb, str);
8402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8404 /* msidbLocatorTypeDirectory, file */
8405 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8406 r = add_inilocator_entry(hdb, str);
8407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8409 /* msidbLocatorTypeDirectory, directory */
8410 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8411 r = add_inilocator_entry(hdb, str);
8412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8414 /* msidbLocatorTypeFile, file, no signature */
8415 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8416 r = add_inilocator_entry(hdb, str);
8417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8419 /* msidbLocatorTypeFile, dir, no signature */
8420 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8421 r = add_inilocator_entry(hdb, str);
8422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8424 /* msidbLocatorTypeFile, file does not exist */
8425 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8426 r = add_inilocator_entry(hdb, str);
8427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8429 /* msidbLocatorTypeFile, signature with version */
8430 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8431 r = add_inilocator_entry(hdb, str);
8432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8434 /* msidbLocatorTypeFile, signature with version, ver > max */
8435 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8436 r = add_inilocator_entry(hdb, str);
8437 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8439 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8440 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8441 r = add_inilocator_entry(hdb, str);
8442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8444 r = create_signature_table(hdb);
8445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8447 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8450 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8453 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8456 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8459 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8462 hpkg = package_from_db(hdb);
8463 ok(hpkg, "Expected a valid package handle\n");
8465 r = MsiDoAction(hpkg, "AppSearch");
8466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8469 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8470 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8471 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
8474 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8476 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
8479 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8481 ok(!lstrcmpA(prop, "keydata,field2"),
8482 "Expected \"keydata,field2\", got \"%s\"\n", prop);
8485 sprintf(path, "%s\\FileName1", CURR_DIR);
8486 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8488 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8491 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8493 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8496 sprintf(path, "%s\\", CURR_DIR);
8497 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8499 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8502 sprintf(path, "%s\\", CURR_DIR);
8503 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8505 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8508 lstrcpyA(path, CURR_DIR);
8509 ptr = strrchr(path, '\\');
8511 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8512 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8513 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8516 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8518 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8523 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8524 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8526 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8529 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8531 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8534 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8535 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8536 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8537 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8540 delete_win_ini("IniFile.ini");
8541 DeleteFileA("FileName1");
8542 DeleteFileA("FileName2.dll");
8543 DeleteFileA("FileName3.dll");
8544 DeleteFileA("FileName4.dll");
8545 MsiCloseHandle(hpkg);
8546 DeleteFileA(msifile);
8549 static void test_appsearch_drlocator(void)
8551 MSIHANDLE hpkg, hdb;
8552 CHAR path[MAX_PATH];
8553 CHAR prop[MAX_PATH];
8560 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8563 DeleteFileA("test.dll");
8565 create_test_file("FileName1");
8566 CreateDirectoryA("one", NULL);
8567 CreateDirectoryA("one\\two", NULL);
8568 CreateDirectoryA("one\\two\\three", NULL);
8569 create_test_file("one\\two\\three\\FileName2");
8570 CreateDirectoryA("another", NULL);
8571 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8572 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8573 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8575 hdb = create_package_db();
8576 ok(hdb, "Expected a valid database handle\n");
8578 r = create_appsearch_table(hdb);
8579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8581 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8584 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8587 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8590 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8593 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8596 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8599 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8600 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8602 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8603 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8605 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8608 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8611 r = create_drlocator_table(hdb);
8612 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8614 /* no parent, full path, depth 0, signature */
8615 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
8616 r = add_drlocator_entry(hdb, path);
8617 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8619 /* no parent, full path, depth 0, no signature */
8620 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
8621 r = add_drlocator_entry(hdb, path);
8622 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8624 /* no parent, relative path, depth 0, no signature */
8625 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
8626 r = add_drlocator_entry(hdb, path);
8627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8629 /* no parent, full path, depth 2, signature */
8630 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
8631 r = add_drlocator_entry(hdb, path);
8632 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8634 /* no parent, full path, depth 3, signature */
8635 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
8636 r = add_drlocator_entry(hdb, path);
8637 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8639 /* no parent, full path, depth 1, signature is dir */
8640 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
8641 r = add_drlocator_entry(hdb, path);
8642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8644 /* parent is in DrLocator, relative path, depth 0, signature */
8645 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8646 r = add_drlocator_entry(hdb, path);
8647 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8649 /* no parent, full path, depth 0, signature w/ version */
8650 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
8651 r = add_drlocator_entry(hdb, path);
8652 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8654 /* no parent, full path, depth 0, signature w/ version, ver > max */
8655 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
8656 r = add_drlocator_entry(hdb, path);
8657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8659 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8660 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
8661 r = add_drlocator_entry(hdb, path);
8662 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8664 r = create_signature_table(hdb);
8665 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8667 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
8668 r = add_signature_entry(hdb, str);
8669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8671 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
8672 r = add_signature_entry(hdb, str);
8673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8675 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
8676 r = add_signature_entry(hdb, str);
8677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8679 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
8680 r = add_signature_entry(hdb, str);
8681 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8683 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
8684 r = add_signature_entry(hdb, str);
8685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8687 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8688 r = add_signature_entry(hdb, str);
8689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8691 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8692 r = add_signature_entry(hdb, str);
8693 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8695 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8696 r = add_signature_entry(hdb, str);
8697 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8699 hpkg = package_from_db(hdb);
8700 ok(hpkg, "Expected a valid package handle\n");
8702 r = MsiDoAction(hpkg, "AppSearch");
8703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8706 sprintf(path, "%s\\FileName1", CURR_DIR);
8707 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8709 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8712 sprintf(path, "%s\\", CURR_DIR);
8713 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8715 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8718 sprintf(path, "%s\\", CURR_DIR);
8719 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8721 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8724 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8725 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8726 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8729 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8730 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8731 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8732 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8735 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8736 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8737 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8740 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8741 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8742 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8743 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8748 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8749 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8750 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8751 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8754 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8755 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8756 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8759 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8761 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8764 DeleteFileA("FileName1");
8765 DeleteFileA("FileName3.dll");
8766 DeleteFileA("FileName4.dll");
8767 DeleteFileA("FileName5.dll");
8768 DeleteFileA("one\\two\\three\\FileName2");
8769 RemoveDirectoryA("one\\two\\three");
8770 RemoveDirectoryA("one\\two");
8771 RemoveDirectoryA("one");
8772 RemoveDirectoryA("another");
8773 MsiCloseHandle(hpkg);
8774 DeleteFileA(msifile);
8777 static void test_featureparents(void)
8782 INSTALLSTATE state, action;
8784 hdb = create_package_db();
8785 ok ( hdb, "failed to create package database\n" );
8787 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
8788 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
8790 r = create_feature_table( hdb );
8791 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
8793 r = create_component_table( hdb );
8794 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
8796 r = create_feature_components_table( hdb );
8797 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
8799 r = create_file_table( hdb );
8800 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
8802 /* msidbFeatureAttributesFavorLocal */
8803 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
8804 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8806 /* msidbFeatureAttributesFavorSource */
8807 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
8808 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8810 /* msidbFeatureAttributesFavorLocal */
8811 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
8812 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8814 /* disabled because of install level */
8815 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
8816 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8818 /* child feature of disabled feature */
8819 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
8820 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8822 /* component of disabled feature (install level) */
8823 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
8824 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8826 /* component of disabled child feature (install level) */
8827 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
8828 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8830 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8831 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
8832 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8834 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8835 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
8836 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8838 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8839 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
8840 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8842 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
8843 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
8844 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8846 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
8847 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
8848 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8850 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
8851 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
8852 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8854 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8855 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
8856 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8858 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8859 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
8860 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8862 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8863 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
8865 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
8866 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8868 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
8869 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8871 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
8872 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8874 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
8875 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8877 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
8878 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8880 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
8881 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8883 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
8884 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8886 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
8887 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8889 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
8890 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8892 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
8893 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8895 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
8896 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8898 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
8899 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8901 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
8902 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8904 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
8905 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8907 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
8908 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8910 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
8911 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8913 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
8914 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8916 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
8917 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8919 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
8920 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8922 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
8923 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8925 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
8926 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8928 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
8929 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8931 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
8932 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8934 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
8935 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8937 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
8938 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8940 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
8941 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8943 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
8944 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8946 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
8947 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8949 hpkg = package_from_db( hdb );
8950 ok( hpkg, "failed to create package\n");
8952 MsiCloseHandle( hdb );
8954 r = MsiDoAction( hpkg, "CostInitialize");
8955 ok( r == ERROR_SUCCESS, "cost init failed\n");
8957 r = MsiDoAction( hpkg, "FileCost");
8958 ok( r == ERROR_SUCCESS, "file cost failed\n");
8960 r = MsiDoAction( hpkg, "CostFinalize");
8961 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
8965 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
8966 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8967 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8968 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
8972 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
8973 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8974 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8975 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
8979 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
8980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8981 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8982 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
8986 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
8987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8988 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8989 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
8993 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
8994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8995 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8996 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9000 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9002 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9003 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9007 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9009 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9010 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9014 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9016 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9017 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9021 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9023 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9024 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9028 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9030 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9031 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9035 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9037 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9038 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9042 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9044 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9045 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9049 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9051 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9052 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9056 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9058 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9059 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9063 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9065 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9066 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9070 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9072 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9073 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9075 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9076 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9080 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9082 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9083 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9087 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9089 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9090 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9094 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9096 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9097 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9101 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9103 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9104 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9108 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9110 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9111 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9115 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9117 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9118 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9122 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9124 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9125 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9129 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9131 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9132 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9136 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9138 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9139 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9143 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9145 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9146 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9150 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9152 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9153 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9157 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9159 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9160 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9164 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9166 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9167 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9171 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9173 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9174 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9176 MsiCloseHandle(hpkg);
9177 DeleteFileA(msifile);
9180 static void test_installprops(void)
9182 MSIHANDLE hpkg, hdb;
9183 CHAR path[MAX_PATH];
9191 GetCurrentDirectory(MAX_PATH, path);
9192 lstrcat(path, "\\");
9193 lstrcat(path, msifile);
9195 hdb = create_package_db();
9196 ok( hdb, "failed to create database\n");
9198 hpkg = package_from_db(hdb);
9199 ok( hpkg, "failed to create package\n");
9201 MsiCloseHandle(hdb);
9204 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
9205 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9206 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9208 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
9210 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
9215 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9219 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
9222 /* win9x doesn't set this */
9226 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
9227 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9228 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9234 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9238 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
9244 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
9245 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9246 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9250 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
9251 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9252 trace("VersionDatabase = %s\n", buf);
9255 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
9256 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9257 trace("VersionMsi = %s\n", buf);
9260 r = MsiGetProperty(hpkg, "Date", buf, &size);
9261 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9262 trace("Date = %s\n", buf);
9265 r = MsiGetProperty(hpkg, "Time", buf, &size);
9266 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9267 trace("Time = %s\n", buf);
9270 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
9271 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9272 trace("PackageCode = %s\n", buf);
9274 langid = GetUserDefaultLangID();
9275 sprintf(path, "%d", langid);
9278 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
9279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9280 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
9282 res = GetSystemMetrics(SM_CXSCREEN);
9284 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
9285 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9287 res = GetSystemMetrics(SM_CYSCREEN);
9289 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
9290 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9294 MsiCloseHandle(hpkg);
9295 DeleteFile(msifile);
9298 static void test_launchconditions(void)
9304 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9306 hdb = create_package_db();
9307 ok( hdb, "failed to create package database\n" );
9309 r = create_launchcondition_table( hdb );
9310 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
9312 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
9313 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9315 /* invalid condition */
9316 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
9317 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9319 hpkg = package_from_db( hdb );
9320 ok( hpkg, "failed to create package\n");
9322 MsiCloseHandle( hdb );
9324 r = MsiSetProperty( hpkg, "X", "1" );
9325 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9327 /* invalid conditions are ignored */
9328 r = MsiDoAction( hpkg, "LaunchConditions" );
9329 ok( r == ERROR_SUCCESS, "cost init failed\n" );
9331 /* verify LaunchConditions still does some verification */
9332 r = MsiSetProperty( hpkg, "X", "2" );
9333 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9335 r = MsiDoAction( hpkg, "LaunchConditions" );
9336 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
9338 MsiCloseHandle( hpkg );
9339 DeleteFile( msifile );
9342 static void test_ccpsearch(void)
9344 MSIHANDLE hdb, hpkg;
9345 CHAR prop[MAX_PATH];
9346 DWORD size = MAX_PATH;
9349 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9351 hdb = create_package_db();
9352 ok(hdb, "failed to create package database\n");
9354 r = create_ccpsearch_table(hdb);
9355 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9357 r = add_ccpsearch_entry(hdb, "'CCP_random'");
9358 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9360 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
9361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9363 r = create_reglocator_table(hdb);
9364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9366 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9369 r = create_drlocator_table(hdb);
9370 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9372 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
9373 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9375 r = create_signature_table(hdb);
9376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9378 hpkg = package_from_db(hdb);
9379 ok(hpkg, "failed to create package\n");
9381 MsiCloseHandle(hdb);
9383 r = MsiDoAction(hpkg, "CCPSearch");
9384 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9386 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
9387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9388 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
9390 MsiCloseHandle(hpkg);
9391 DeleteFileA(msifile);
9394 static void test_complocator(void)
9396 MSIHANDLE hdb, hpkg;
9398 CHAR prop[MAX_PATH];
9399 CHAR expected[MAX_PATH];
9400 DWORD size = MAX_PATH;
9402 hdb = create_package_db();
9403 ok(hdb, "failed to create package database\n");
9405 r = create_appsearch_table(hdb);
9406 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9408 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
9409 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9411 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
9412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9414 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
9415 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9417 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
9418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9420 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
9421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9423 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
9424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9426 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
9427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9429 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
9430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9432 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
9433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9435 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
9436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9438 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
9439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9441 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
9442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9444 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
9445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9447 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
9448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9450 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
9451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9453 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
9454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9456 r = create_complocator_table(hdb);
9457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9459 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9462 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9465 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9468 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9471 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9474 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9477 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9480 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9483 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9486 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9489 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9492 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9495 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9498 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9501 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9502 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9504 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9507 r = create_signature_table(hdb);
9508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9510 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9513 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9516 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9519 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9522 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9525 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9528 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9531 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9534 hpkg = package_from_db(hdb);
9535 ok(hpkg, "failed to create package\n");
9537 MsiCloseHandle(hdb);
9539 create_test_file("abelisaurus");
9540 create_test_file("bactrosaurus");
9541 create_test_file("camelotia");
9542 create_test_file("diclonius");
9543 create_test_file("echinodon");
9544 create_test_file("falcarius");
9545 create_test_file("gallimimus");
9546 create_test_file("hagryphus");
9547 CreateDirectoryA("iguanodon", NULL);
9548 CreateDirectoryA("jobaria", NULL);
9549 CreateDirectoryA("kakuru", NULL);
9550 CreateDirectoryA("labocania", NULL);
9551 CreateDirectoryA("megaraptor", NULL);
9552 CreateDirectoryA("neosodon", NULL);
9553 CreateDirectoryA("olorotitan", NULL);
9554 CreateDirectoryA("pantydraco", NULL);
9556 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
9557 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
9558 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
9559 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
9560 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
9561 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
9562 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
9563 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
9564 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
9565 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
9566 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
9567 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
9568 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
9569 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
9570 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
9571 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
9573 r = MsiDoAction(hpkg, "AppSearch");
9574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9577 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
9578 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9580 lstrcpyA(expected, CURR_DIR);
9581 lstrcatA(expected, "\\abelisaurus");
9582 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9583 "Expected %s or empty string, got %s\n", expected, prop);
9586 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
9587 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9588 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9591 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
9592 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9593 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9596 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
9597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9598 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9601 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
9602 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9604 lstrcpyA(expected, CURR_DIR);
9605 lstrcatA(expected, "\\");
9606 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9607 "Expected %s or empty string, got %s\n", expected, prop);
9610 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
9611 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9612 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9615 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
9616 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9617 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9620 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
9621 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9622 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9625 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
9626 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9627 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9630 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
9631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9632 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9635 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
9636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9637 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9640 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
9641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9642 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9645 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
9646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9648 lstrcpyA(expected, CURR_DIR);
9649 lstrcatA(expected, "\\");
9650 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9651 "Expected %s or empty string, got %s\n", expected, prop);
9654 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
9655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9657 lstrcpyA(expected, CURR_DIR);
9658 lstrcatA(expected, "\\neosodon\\");
9659 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9660 "Expected %s or empty string, got %s\n", expected, prop);
9663 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
9664 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9665 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9668 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
9669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9670 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9672 MsiCloseHandle(hpkg);
9673 DeleteFileA("abelisaurus");
9674 DeleteFileA("bactrosaurus");
9675 DeleteFileA("camelotia");
9676 DeleteFileA("diclonius");
9677 DeleteFileA("echinodon");
9678 DeleteFileA("falcarius");
9679 DeleteFileA("gallimimus");
9680 DeleteFileA("hagryphus");
9681 RemoveDirectoryA("iguanodon");
9682 RemoveDirectoryA("jobaria");
9683 RemoveDirectoryA("kakuru");
9684 RemoveDirectoryA("labocania");
9685 RemoveDirectoryA("megaraptor");
9686 RemoveDirectoryA("neosodon");
9687 RemoveDirectoryA("olorotitan");
9688 RemoveDirectoryA("pantydraco");
9689 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
9690 MSIINSTALLCONTEXT_MACHINE, NULL);
9691 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
9692 MSIINSTALLCONTEXT_MACHINE, NULL);
9693 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
9694 MSIINSTALLCONTEXT_MACHINE, NULL);
9695 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
9696 MSIINSTALLCONTEXT_MACHINE, NULL);
9697 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
9698 MSIINSTALLCONTEXT_MACHINE, NULL);
9699 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
9700 MSIINSTALLCONTEXT_MACHINE, NULL);
9701 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
9702 MSIINSTALLCONTEXT_MACHINE, NULL);
9703 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
9704 MSIINSTALLCONTEXT_MACHINE, NULL);
9705 DeleteFileA(msifile);
9708 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
9713 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
9714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9716 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
9717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9719 r = MsiSummaryInfoPersist(summary);
9720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9722 MsiCloseHandle(summary);
9725 static void test_MsiGetSourcePath(void)
9727 MSIHANDLE hdb, hpkg;
9728 CHAR path[MAX_PATH];
9730 CHAR subsrc[MAX_PATH];
9731 CHAR sub2[MAX_PATH];
9735 lstrcpyA(cwd, CURR_DIR);
9736 lstrcatA(cwd, "\\");
9738 lstrcpyA(subsrc, cwd);
9739 lstrcatA(subsrc, "subsource");
9740 lstrcatA(subsrc, "\\");
9742 lstrcpyA(sub2, subsrc);
9743 lstrcatA(sub2, "sub2");
9744 lstrcatA(sub2, "\\");
9746 /* uncompressed source */
9748 hdb = create_package_db();
9749 ok( hdb, "failed to create database\n");
9751 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
9753 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
9754 ok(r == S_OK, "failed\n");
9756 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
9757 ok(r == S_OK, "failed\n");
9759 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
9760 ok(r == S_OK, "failed\n");
9762 r = MsiDatabaseCommit(hdb);
9763 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
9765 hpkg = package_from_db(hdb);
9766 ok(hpkg, "failed to create package\n");
9768 MsiCloseHandle(hdb);
9770 /* invalid database handle */
9772 lstrcpyA(path, "kiwi");
9773 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
9774 ok(r == ERROR_INVALID_HANDLE,
9775 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
9776 ok(!lstrcmpA(path, "kiwi"),
9777 "Expected path to be unchanged, got \"%s\"\n", path);
9778 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9782 lstrcpyA(path, "kiwi");
9783 r = MsiGetSourcePath(hpkg, NULL, path, &size);
9784 ok(r == ERROR_INVALID_PARAMETER,
9785 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
9786 ok(!lstrcmpA(path, "kiwi"),
9787 "Expected path to be unchanged, got \"%s\"\n", path);
9788 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9790 /* empty szFolder */
9792 lstrcpyA(path, "kiwi");
9793 r = MsiGetSourcePath(hpkg, "", path, &size);
9794 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9795 ok(!lstrcmpA(path, "kiwi"),
9796 "Expected path to be unchanged, got \"%s\"\n", path);
9797 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9801 lstrcpyA(path, "kiwi");
9802 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9803 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9804 ok(!lstrcmpA(path, "kiwi"),
9805 "Expected path to be unchanged, got \"%s\"\n", path);
9806 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9810 lstrcpyA(path, "kiwi");
9811 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9812 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9813 ok(!lstrcmpA(path, "kiwi"),
9814 "Expected path to be unchanged, got \"%s\"\n", path);
9815 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9819 lstrcpyA(path, "kiwi");
9820 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9821 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9822 ok(!lstrcmpA(path, "kiwi"),
9823 "Expected path to be unchanged, got \"%s\"\n", path);
9824 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9826 /* source path does not exist, but the property exists */
9828 lstrcpyA(path, "kiwi");
9829 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9831 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9832 ok(size == 0, "Expected 0, got %d\n", size);
9836 lstrcpyA(path, "kiwi");
9837 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9838 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9839 ok(!lstrcmpA(path, "kiwi"),
9840 "Expected path to be unchanged, got \"%s\"\n", path);
9841 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9845 lstrcpyA(path, "kiwi");
9846 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9847 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9848 ok(!lstrcmpA(path, "kiwi"),
9849 "Expected path to be unchanged, got \"%s\"\n", path);
9850 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9852 r = MsiDoAction(hpkg, "CostInitialize");
9853 ok(r == ERROR_SUCCESS, "cost init failed\n");
9855 /* try TARGETDIR after CostInitialize */
9857 lstrcpyA(path, "kiwi");
9858 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9859 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9860 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9861 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9863 /* try SourceDir after CostInitialize */
9865 lstrcpyA(path, "kiwi");
9866 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9868 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9869 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9871 /* try SOURCEDIR after CostInitialize */
9873 lstrcpyA(path, "kiwi");
9874 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9875 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9876 ok(!lstrcmpA(path, "kiwi"),
9877 "Expected path to be unchanged, got \"%s\"\n", path);
9878 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9880 /* source path does not exist, but the property exists */
9882 lstrcpyA(path, "kiwi");
9883 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9884 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9887 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9888 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9891 /* try SubDir after CostInitialize */
9893 lstrcpyA(path, "kiwi");
9894 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9895 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9896 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9897 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9899 /* try SubDir2 after CostInitialize */
9901 lstrcpyA(path, "kiwi");
9902 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9903 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9904 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
9905 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
9907 r = MsiDoAction(hpkg, "ResolveSource");
9908 ok(r == ERROR_SUCCESS, "file cost failed\n");
9910 /* try TARGETDIR after ResolveSource */
9912 lstrcpyA(path, "kiwi");
9913 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9915 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9916 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9918 /* try SourceDir after ResolveSource */
9920 lstrcpyA(path, "kiwi");
9921 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9922 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9923 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9924 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9926 /* try SOURCEDIR after ResolveSource */
9928 lstrcpyA(path, "kiwi");
9929 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9930 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9931 ok(!lstrcmpA(path, "kiwi"),
9932 "Expected path to be unchanged, got \"%s\"\n", path);
9933 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9935 /* source path does not exist, but the property exists */
9937 lstrcpyA(path, "kiwi");
9938 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9940 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9941 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9943 /* try SubDir after ResolveSource */
9945 lstrcpyA(path, "kiwi");
9946 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9948 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9949 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9951 /* try SubDir2 after ResolveSource */
9953 lstrcpyA(path, "kiwi");
9954 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9955 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9956 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
9957 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
9959 r = MsiDoAction(hpkg, "FileCost");
9960 ok(r == ERROR_SUCCESS, "file cost failed\n");
9962 /* try TARGETDIR after FileCost */
9964 lstrcpyA(path, "kiwi");
9965 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9966 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9967 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9968 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9970 /* try SourceDir after FileCost */
9972 lstrcpyA(path, "kiwi");
9973 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9974 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9975 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9976 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9978 /* try SOURCEDIR after FileCost */
9980 lstrcpyA(path, "kiwi");
9981 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9982 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9983 ok(!lstrcmpA(path, "kiwi"),
9984 "Expected path to be unchanged, got \"%s\"\n", path);
9985 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9987 /* try SubDir after FileCost */
9989 lstrcpyA(path, "kiwi");
9990 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9991 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9992 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9993 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9995 /* try SubDir2 after FileCost */
9997 lstrcpyA(path, "kiwi");
9998 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9999 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10000 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10001 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10003 r = MsiDoAction(hpkg, "CostFinalize");
10004 ok(r == ERROR_SUCCESS, "file cost failed\n");
10006 /* try TARGETDIR after CostFinalize */
10008 lstrcpyA(path, "kiwi");
10009 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10011 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10012 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10014 /* try SourceDir after CostFinalize */
10016 lstrcpyA(path, "kiwi");
10017 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10018 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10019 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10020 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10022 /* try SOURCEDIR after CostFinalize */
10024 lstrcpyA(path, "kiwi");
10025 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10026 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10027 ok(!lstrcmpA(path, "kiwi"),
10028 "Expected path to be unchanged, got \"%s\"\n", path);
10029 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10031 /* try SubDir after CostFinalize */
10033 lstrcpyA(path, "kiwi");
10034 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10035 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10036 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10037 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10039 /* try SubDir2 after CostFinalize */
10041 lstrcpyA(path, "kiwi");
10042 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10043 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10044 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10045 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10047 /* nonexistent directory */
10049 lstrcpyA(path, "kiwi");
10050 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
10051 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10052 ok(!lstrcmpA(path, "kiwi"),
10053 "Expected path to be unchanged, got \"%s\"\n", path);
10054 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10056 /* NULL szPathBuf */
10058 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
10059 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10060 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10062 /* NULL pcchPathBuf */
10063 lstrcpyA(path, "kiwi");
10064 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
10065 ok(r == ERROR_INVALID_PARAMETER,
10066 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10067 ok(!lstrcmpA(path, "kiwi"),
10068 "Expected path to be unchanged, got \"%s\"\n", path);
10070 /* pcchPathBuf is 0 */
10072 lstrcpyA(path, "kiwi");
10073 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10074 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10075 ok(!lstrcmpA(path, "kiwi"),
10076 "Expected path to be unchanged, got \"%s\"\n", path);
10077 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10079 /* pcchPathBuf does not have room for NULL terminator */
10080 size = lstrlenA(cwd);
10081 lstrcpyA(path, "kiwi");
10082 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10083 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10084 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
10085 "Expected path with no backslash, got \"%s\"\n", path);
10086 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10088 /* pcchPathBuf has room for NULL terminator */
10089 size = lstrlenA(cwd) + 1;
10090 lstrcpyA(path, "kiwi");
10091 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10093 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10094 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10096 MsiCloseHandle(hpkg);
10098 /* compressed source */
10100 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10103 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
10105 hpkg = package_from_db(hdb);
10106 ok(hpkg, "failed to create package\n");
10108 r = MsiDoAction(hpkg, "CostInitialize");
10109 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10110 r = MsiDoAction(hpkg, "FileCost");
10111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10112 r = MsiDoAction(hpkg, "CostFinalize");
10113 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10115 /* try TARGETDIR after CostFinalize */
10117 lstrcpyA(path, "kiwi");
10118 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10120 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10121 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10123 /* try SourceDir after CostFinalize */
10125 lstrcpyA(path, "kiwi");
10126 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10127 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10128 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10129 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10131 /* try SOURCEDIR after CostFinalize */
10133 lstrcpyA(path, "kiwi");
10134 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10137 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10138 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10139 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10142 /* try SubDir after CostFinalize */
10144 lstrcpyA(path, "kiwi");
10145 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10146 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10147 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10148 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10150 /* try SubDir2 after CostFinalize */
10152 lstrcpyA(path, "kiwi");
10153 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10154 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10155 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10156 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10158 MsiCloseHandle(hpkg);
10159 DeleteFile(msifile);
10162 static void test_shortlongsource(void)
10164 MSIHANDLE hdb, hpkg;
10165 CHAR path[MAX_PATH];
10166 CHAR cwd[MAX_PATH];
10167 CHAR subsrc[MAX_PATH];
10171 lstrcpyA(cwd, CURR_DIR);
10172 lstrcatA(cwd, "\\");
10174 lstrcpyA(subsrc, cwd);
10175 lstrcatA(subsrc, "long");
10176 lstrcatA(subsrc, "\\");
10178 /* long file names */
10180 hdb = create_package_db();
10181 ok( hdb, "failed to create database\n");
10183 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10185 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10186 ok(r == S_OK, "failed\n");
10188 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
10189 ok(r == S_OK, "failed\n");
10191 /* CostInitialize:short */
10192 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
10193 ok(r == S_OK, "failed\n");
10195 /* CostInitialize:long */
10196 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
10197 ok(r == S_OK, "failed\n");
10199 /* FileCost:short */
10200 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
10201 ok(r == S_OK, "failed\n");
10203 /* FileCost:long */
10204 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
10205 ok(r == S_OK, "failed\n");
10207 /* CostFinalize:short */
10208 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
10209 ok(r == S_OK, "failed\n");
10211 /* CostFinalize:long */
10212 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
10213 ok(r == S_OK, "failed\n");
10215 MsiDatabaseCommit(hdb);
10217 hpkg = package_from_db(hdb);
10218 ok(hpkg, "failed to create package\n");
10220 MsiCloseHandle(hdb);
10222 CreateDirectoryA("one", NULL);
10223 CreateDirectoryA("four", NULL);
10225 r = MsiDoAction(hpkg, "CostInitialize");
10226 ok(r == ERROR_SUCCESS, "file cost failed\n");
10228 CreateDirectory("five", NULL);
10229 CreateDirectory("eight", NULL);
10231 r = MsiDoAction(hpkg, "FileCost");
10232 ok(r == ERROR_SUCCESS, "file cost failed\n");
10234 CreateDirectory("nine", NULL);
10235 CreateDirectory("twelve", NULL);
10237 r = MsiDoAction(hpkg, "CostFinalize");
10238 ok(r == ERROR_SUCCESS, "file cost failed\n");
10240 /* neither short nor long source directories exist */
10242 lstrcpyA(path, "kiwi");
10243 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10245 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10246 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10248 CreateDirectoryA("short", NULL);
10250 /* short source directory exists */
10252 lstrcpyA(path, "kiwi");
10253 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10254 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10255 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10256 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10258 CreateDirectoryA("long", NULL);
10260 /* both short and long source directories exist */
10262 lstrcpyA(path, "kiwi");
10263 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10264 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10265 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10266 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10268 lstrcpyA(subsrc, cwd);
10269 lstrcatA(subsrc, "two");
10270 lstrcatA(subsrc, "\\");
10272 /* short dir exists before CostInitialize */
10274 lstrcpyA(path, "kiwi");
10275 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10276 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10277 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10278 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10280 lstrcpyA(subsrc, cwd);
10281 lstrcatA(subsrc, "four");
10282 lstrcatA(subsrc, "\\");
10284 /* long dir exists before CostInitialize */
10286 lstrcpyA(path, "kiwi");
10287 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10288 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10289 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10290 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10292 lstrcpyA(subsrc, cwd);
10293 lstrcatA(subsrc, "six");
10294 lstrcatA(subsrc, "\\");
10296 /* short dir exists before FileCost */
10298 lstrcpyA(path, "kiwi");
10299 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10300 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10301 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10302 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10304 lstrcpyA(subsrc, cwd);
10305 lstrcatA(subsrc, "eight");
10306 lstrcatA(subsrc, "\\");
10308 /* long dir exists before FileCost */
10310 lstrcpyA(path, "kiwi");
10311 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10312 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10313 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10314 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10316 lstrcpyA(subsrc, cwd);
10317 lstrcatA(subsrc, "ten");
10318 lstrcatA(subsrc, "\\");
10320 /* short dir exists before CostFinalize */
10322 lstrcpyA(path, "kiwi");
10323 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10325 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10326 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10328 lstrcpyA(subsrc, cwd);
10329 lstrcatA(subsrc, "twelve");
10330 lstrcatA(subsrc, "\\");
10332 /* long dir exists before CostFinalize */
10334 lstrcpyA(path, "kiwi");
10335 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10337 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10338 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10340 MsiCloseHandle(hpkg);
10341 RemoveDirectoryA("short");
10342 RemoveDirectoryA("long");
10343 RemoveDirectoryA("one");
10344 RemoveDirectoryA("four");
10345 RemoveDirectoryA("five");
10346 RemoveDirectoryA("eight");
10347 RemoveDirectoryA("nine");
10348 RemoveDirectoryA("twelve");
10350 /* short file names */
10352 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10353 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10355 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
10357 hpkg = package_from_db(hdb);
10358 ok(hpkg, "failed to create package\n");
10360 MsiCloseHandle(hdb);
10362 CreateDirectoryA("one", NULL);
10363 CreateDirectoryA("four", NULL);
10365 r = MsiDoAction(hpkg, "CostInitialize");
10366 ok(r == ERROR_SUCCESS, "file cost failed\n");
10368 CreateDirectory("five", NULL);
10369 CreateDirectory("eight", NULL);
10371 r = MsiDoAction(hpkg, "FileCost");
10372 ok(r == ERROR_SUCCESS, "file cost failed\n");
10374 CreateDirectory("nine", NULL);
10375 CreateDirectory("twelve", NULL);
10377 r = MsiDoAction(hpkg, "CostFinalize");
10378 ok(r == ERROR_SUCCESS, "file cost failed\n");
10380 lstrcpyA(subsrc, cwd);
10381 lstrcatA(subsrc, "short");
10382 lstrcatA(subsrc, "\\");
10384 /* neither short nor long source directories exist */
10386 lstrcpyA(path, "kiwi");
10387 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10389 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10390 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10392 CreateDirectoryA("short", NULL);
10394 /* short source directory exists */
10396 lstrcpyA(path, "kiwi");
10397 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10399 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10400 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10402 CreateDirectoryA("long", NULL);
10404 /* both short and long source directories exist */
10406 lstrcpyA(path, "kiwi");
10407 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10409 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10410 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10412 lstrcpyA(subsrc, cwd);
10413 lstrcatA(subsrc, "one");
10414 lstrcatA(subsrc, "\\");
10416 /* short dir exists before CostInitialize */
10418 lstrcpyA(path, "kiwi");
10419 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10420 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10421 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10422 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10424 lstrcpyA(subsrc, cwd);
10425 lstrcatA(subsrc, "three");
10426 lstrcatA(subsrc, "\\");
10428 /* long dir exists before CostInitialize */
10430 lstrcpyA(path, "kiwi");
10431 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10433 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10434 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10436 lstrcpyA(subsrc, cwd);
10437 lstrcatA(subsrc, "five");
10438 lstrcatA(subsrc, "\\");
10440 /* short dir exists before FileCost */
10442 lstrcpyA(path, "kiwi");
10443 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10445 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10446 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10448 lstrcpyA(subsrc, cwd);
10449 lstrcatA(subsrc, "seven");
10450 lstrcatA(subsrc, "\\");
10452 /* long dir exists before FileCost */
10454 lstrcpyA(path, "kiwi");
10455 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10457 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10458 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10460 lstrcpyA(subsrc, cwd);
10461 lstrcatA(subsrc, "nine");
10462 lstrcatA(subsrc, "\\");
10464 /* short dir exists before CostFinalize */
10466 lstrcpyA(path, "kiwi");
10467 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10469 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10470 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10472 lstrcpyA(subsrc, cwd);
10473 lstrcatA(subsrc, "eleven");
10474 lstrcatA(subsrc, "\\");
10476 /* long dir exists before CostFinalize */
10478 lstrcpyA(path, "kiwi");
10479 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10481 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10482 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10484 MsiCloseHandle(hpkg);
10485 RemoveDirectoryA("short");
10486 RemoveDirectoryA("long");
10487 RemoveDirectoryA("one");
10488 RemoveDirectoryA("four");
10489 RemoveDirectoryA("five");
10490 RemoveDirectoryA("eight");
10491 RemoveDirectoryA("nine");
10492 RemoveDirectoryA("twelve");
10493 DeleteFileA(msifile);
10496 static void test_sourcedir(void)
10498 MSIHANDLE hdb, hpkg;
10500 CHAR path[MAX_PATH];
10501 CHAR cwd[MAX_PATH];
10502 CHAR subsrc[MAX_PATH];
10506 lstrcpyA(cwd, CURR_DIR);
10507 lstrcatA(cwd, "\\");
10509 lstrcpyA(subsrc, cwd);
10510 lstrcatA(subsrc, "long");
10511 lstrcatA(subsrc, "\\");
10513 hdb = create_package_db();
10514 ok( hdb, "failed to create database\n");
10516 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10517 ok(r == S_OK, "failed\n");
10519 sprintf(package, "#%i", hdb);
10520 r = MsiOpenPackage(package, &hpkg);
10521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10523 /* properties only */
10525 /* SourceDir prop */
10527 lstrcpyA(path, "kiwi");
10528 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10530 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10531 ok(size == 0, "Expected 0, got %d\n", size);
10533 /* SOURCEDIR prop */
10535 lstrcpyA(path, "kiwi");
10536 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10538 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10539 ok(size == 0, "Expected 0, got %d\n", size);
10541 r = MsiDoAction(hpkg, "CostInitialize");
10542 ok(r == ERROR_SUCCESS, "file cost failed\n");
10544 /* SourceDir after CostInitialize */
10546 lstrcpyA(path, "kiwi");
10547 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10548 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10549 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10550 ok(size == 0, "Expected 0, got %d\n", size);
10552 /* SOURCEDIR after CostInitialize */
10554 lstrcpyA(path, "kiwi");
10555 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10556 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10557 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10558 ok(size == 0, "Expected 0, got %d\n", size);
10560 r = MsiDoAction(hpkg, "FileCost");
10561 ok(r == ERROR_SUCCESS, "file cost failed\n");
10563 /* SourceDir after FileCost */
10565 lstrcpyA(path, "kiwi");
10566 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10568 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10569 ok(size == 0, "Expected 0, got %d\n", size);
10571 /* SOURCEDIR after FileCost */
10573 lstrcpyA(path, "kiwi");
10574 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10576 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10577 ok(size == 0, "Expected 0, got %d\n", size);
10579 r = MsiDoAction(hpkg, "CostFinalize");
10580 ok(r == ERROR_SUCCESS, "file cost failed\n");
10582 /* SourceDir after CostFinalize */
10584 lstrcpyA(path, "kiwi");
10585 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10586 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10587 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10588 ok(size == 0, "Expected 0, got %d\n", size);
10590 /* SOURCEDIR after CostFinalize */
10592 lstrcpyA(path, "kiwi");
10593 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10595 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10596 ok(size == 0, "Expected 0, got %d\n", size);
10598 r = MsiDoAction(hpkg, "ResolveSource");
10599 ok(r == ERROR_SUCCESS, "file cost failed\n");
10601 /* SourceDir after ResolveSource */
10603 lstrcpyA(path, "kiwi");
10604 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10605 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10606 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10607 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10609 /* SOURCEDIR after ResolveSource */
10611 lstrcpyA(path, "kiwi");
10612 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10614 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10615 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10617 /* random casing */
10619 lstrcpyA(path, "kiwi");
10620 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
10621 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10622 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10623 ok(size == 0, "Expected 0, got %d\n", size);
10625 MsiCloseHandle(hpkg);
10627 /* reset the package state */
10628 sprintf(package, "#%i", hdb);
10629 r = MsiOpenPackage(package, &hpkg);
10630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10632 /* test how MsiGetSourcePath affects the properties */
10634 /* SourceDir prop */
10636 lstrcpyA(path, "kiwi");
10637 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10638 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10641 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10642 ok(size == 0, "Expected 0, got %d\n", size);
10646 lstrcpyA(path, "kiwi");
10647 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10648 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10649 ok(!lstrcmpA(path, "kiwi"),
10650 "Expected path to be unchanged, got \"%s\"\n", path);
10651 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10653 /* SourceDir after MsiGetSourcePath */
10655 lstrcpyA(path, "kiwi");
10656 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10660 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10661 ok(size == 0, "Expected 0, got %d\n", size);
10664 /* SOURCEDIR prop */
10666 lstrcpyA(path, "kiwi");
10667 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10668 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10671 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10672 ok(size == 0, "Expected 0, got %d\n", size);
10676 lstrcpyA(path, "kiwi");
10677 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10678 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10679 ok(!lstrcmpA(path, "kiwi"),
10680 "Expected path to be unchanged, got \"%s\"\n", path);
10681 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10683 /* SOURCEDIR prop after MsiGetSourcePath */
10685 lstrcpyA(path, "kiwi");
10686 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10687 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10690 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10691 ok(size == 0, "Expected 0, got %d\n", size);
10694 r = MsiDoAction(hpkg, "CostInitialize");
10695 ok(r == ERROR_SUCCESS, "file cost failed\n");
10697 /* SourceDir after CostInitialize */
10699 lstrcpyA(path, "kiwi");
10700 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10701 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10704 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10705 ok(size == 0, "Expected 0, got %d\n", size);
10709 lstrcpyA(path, "kiwi");
10710 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10712 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10713 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10715 /* SourceDir after MsiGetSourcePath */
10717 lstrcpyA(path, "kiwi");
10718 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10719 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10720 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10721 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10723 /* SOURCEDIR after CostInitialize */
10725 lstrcpyA(path, "kiwi");
10726 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10727 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10728 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10729 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10731 /* SOURCEDIR source path still does not exist */
10733 lstrcpyA(path, "kiwi");
10734 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10735 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10736 ok(!lstrcmpA(path, "kiwi"),
10737 "Expected path to be unchanged, got \"%s\"\n", path);
10738 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10740 r = MsiDoAction(hpkg, "FileCost");
10741 ok(r == ERROR_SUCCESS, "file cost failed\n");
10743 /* SourceDir after FileCost */
10745 lstrcpyA(path, "kiwi");
10746 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10747 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10748 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10749 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10751 /* SOURCEDIR after FileCost */
10753 lstrcpyA(path, "kiwi");
10754 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10755 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10756 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10757 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10759 /* SOURCEDIR source path still does not exist */
10761 lstrcpyA(path, "kiwi");
10762 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10763 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10764 ok(!lstrcmpA(path, "kiwi"),
10765 "Expected path to be unchanged, got \"%s\"\n", path);
10766 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10768 r = MsiDoAction(hpkg, "CostFinalize");
10769 ok(r == ERROR_SUCCESS, "file cost failed\n");
10771 /* SourceDir after CostFinalize */
10773 lstrcpyA(path, "kiwi");
10774 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10775 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10776 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10777 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10779 /* SOURCEDIR after CostFinalize */
10781 lstrcpyA(path, "kiwi");
10782 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10784 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10785 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10787 /* SOURCEDIR source path still does not exist */
10789 lstrcpyA(path, "kiwi");
10790 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10791 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10792 ok(!lstrcmpA(path, "kiwi"),
10793 "Expected path to be unchanged, got \"%s\"\n", path);
10794 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10796 r = MsiDoAction(hpkg, "ResolveSource");
10797 ok(r == ERROR_SUCCESS, "file cost failed\n");
10799 /* SourceDir after ResolveSource */
10801 lstrcpyA(path, "kiwi");
10802 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10804 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10805 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10807 /* SOURCEDIR after ResolveSource */
10809 lstrcpyA(path, "kiwi");
10810 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10811 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10812 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10813 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10815 /* SOURCEDIR source path still does not exist */
10817 lstrcpyA(path, "kiwi");
10818 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10819 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10820 ok(!lstrcmpA(path, "kiwi"),
10821 "Expected path to be unchanged, got \"%s\"\n", path);
10822 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10824 MsiCloseHandle(hdb);
10825 MsiCloseHandle(hpkg);
10826 DeleteFileA(msifile);
10836 static const struct access_res create[16] =
10838 { TRUE, ERROR_SUCCESS, TRUE },
10839 { TRUE, ERROR_SUCCESS, TRUE },
10840 { TRUE, ERROR_SUCCESS, FALSE },
10841 { TRUE, ERROR_SUCCESS, FALSE },
10842 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10843 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10844 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10845 { TRUE, ERROR_SUCCESS, FALSE },
10846 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10847 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10848 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10849 { TRUE, ERROR_SUCCESS, TRUE },
10850 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10851 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10852 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10853 { TRUE, ERROR_SUCCESS, TRUE }
10856 static const struct access_res create_commit[16] =
10858 { TRUE, ERROR_SUCCESS, TRUE },
10859 { TRUE, ERROR_SUCCESS, TRUE },
10860 { TRUE, ERROR_SUCCESS, FALSE },
10861 { TRUE, ERROR_SUCCESS, FALSE },
10862 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10863 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10864 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10865 { TRUE, ERROR_SUCCESS, FALSE },
10866 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10867 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10868 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10869 { TRUE, ERROR_SUCCESS, TRUE },
10870 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10871 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10872 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10873 { TRUE, ERROR_SUCCESS, TRUE }
10876 static const struct access_res create_close[16] =
10878 { TRUE, ERROR_SUCCESS, FALSE },
10879 { TRUE, ERROR_SUCCESS, FALSE },
10880 { TRUE, ERROR_SUCCESS, FALSE },
10881 { TRUE, ERROR_SUCCESS, FALSE },
10882 { TRUE, ERROR_SUCCESS, FALSE },
10883 { TRUE, ERROR_SUCCESS, FALSE },
10884 { TRUE, ERROR_SUCCESS, FALSE },
10885 { TRUE, ERROR_SUCCESS, FALSE },
10886 { TRUE, ERROR_SUCCESS, FALSE },
10887 { TRUE, ERROR_SUCCESS, FALSE },
10888 { TRUE, ERROR_SUCCESS, FALSE },
10889 { TRUE, ERROR_SUCCESS, FALSE },
10890 { TRUE, ERROR_SUCCESS, FALSE },
10891 { TRUE, ERROR_SUCCESS, FALSE },
10892 { TRUE, ERROR_SUCCESS, FALSE },
10893 { TRUE, ERROR_SUCCESS }
10896 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
10898 DWORD access = 0, share = 0;
10903 for (i = 0; i < 4; i++)
10905 if (i == 0) access = 0;
10906 if (i == 1) access = GENERIC_READ;
10907 if (i == 2) access = GENERIC_WRITE;
10908 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
10910 for (j = 0; j < 4; j++)
10912 if (ares[idx].ignore)
10915 if (j == 0) share = 0;
10916 if (j == 1) share = FILE_SHARE_READ;
10917 if (j == 2) share = FILE_SHARE_WRITE;
10918 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
10920 SetLastError(0xdeadbeef);
10921 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
10922 FILE_ATTRIBUTE_NORMAL, 0);
10923 lasterr = GetLastError();
10925 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
10926 "(%d, handle, %d): Expected %d, got %d\n",
10927 line, idx, ares[idx].gothandle,
10928 (hfile != INVALID_HANDLE_VALUE));
10930 ok(lasterr == ares[idx].lasterr ||
10931 lasterr == 0xdeadbeef, /* win9x */
10932 "(%d, lasterr, %d): Expected %d, got %d\n",
10933 line, idx, ares[idx].lasterr, lasterr);
10935 CloseHandle(hfile);
10941 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
10943 static void test_access(void)
10948 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
10949 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10951 test_file_access(msifile, create);
10953 r = MsiDatabaseCommit(hdb);
10954 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10956 test_file_access(msifile, create_commit);
10958 MsiCloseHandle(hdb);
10960 test_file_access(msifile, create_close);
10962 DeleteFileA(msifile);
10964 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
10965 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10967 test_file_access(msifile, create);
10969 r = MsiDatabaseCommit(hdb);
10970 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10972 test_file_access(msifile, create_commit);
10974 MsiCloseHandle(hdb);
10976 test_file_access(msifile, create_close);
10978 DeleteFileA(msifile);
10981 static void test_emptypackage(void)
10983 MSIHANDLE hpkg, hdb, hsuminfo;
10984 MSIHANDLE hview, hrec;
10985 MSICONDITION condition;
10986 CHAR buffer[MAX_PATH];
10990 r = MsiOpenPackageA("", &hpkg);
10993 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10996 hdb = MsiGetActiveDatabase(hpkg);
10999 ok(hdb != 0, "Expected a valid database handle\n");
11002 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
11005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11007 r = MsiViewExecute(hview, 0);
11010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11013 r = MsiViewFetch(hview, &hrec);
11016 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11020 r = MsiRecordGetString(hrec, 1, buffer, &size);
11023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11024 ok(!lstrcmpA(buffer, "_Property"),
11025 "Expected \"_Property\", got \"%s\"\n", buffer);
11028 MsiCloseHandle(hrec);
11030 r = MsiViewFetch(hview, &hrec);
11033 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11037 r = MsiRecordGetString(hrec, 1, buffer, &size);
11040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11041 ok(!lstrcmpA(buffer, "#_FolderCache"),
11042 "Expected \"_Property\", got \"%s\"\n", buffer);
11045 MsiCloseHandle(hrec);
11046 MsiViewClose(hview);
11047 MsiCloseHandle(hview);
11049 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
11052 ok(condition == MSICONDITION_FALSE,
11053 "Expected MSICONDITION_FALSE, got %d\n", condition);
11056 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
11059 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11061 r = MsiViewExecute(hview, 0);
11064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11067 /* _Property table is not empty */
11068 r = MsiViewFetch(hview, &hrec);
11071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11074 MsiCloseHandle(hrec);
11075 MsiViewClose(hview);
11076 MsiCloseHandle(hview);
11078 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
11081 ok(condition == MSICONDITION_FALSE,
11082 "Expected MSICONDITION_FALSE, got %d\n", condition);
11085 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
11088 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11090 r = MsiViewExecute(hview, 0);
11093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11096 /* #_FolderCache is not empty */
11097 r = MsiViewFetch(hview, &hrec);
11100 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11103 MsiCloseHandle(hrec);
11104 MsiViewClose(hview);
11105 MsiCloseHandle(hview);
11107 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
11110 ok(r == ERROR_BAD_QUERY_SYNTAX,
11111 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11114 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
11117 ok(r == ERROR_BAD_QUERY_SYNTAX,
11118 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11121 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
11124 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
11125 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
11128 MsiCloseHandle(hsuminfo);
11130 r = MsiDatabaseCommit(hdb);
11133 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11136 MsiCloseHandle(hdb);
11137 MsiCloseHandle(hpkg);
11140 static void test_MsiGetProductProperty(void)
11142 MSIHANDLE hprod, hdb;
11143 CHAR val[MAX_PATH];
11144 CHAR path[MAX_PATH];
11145 CHAR query[MAX_PATH];
11146 CHAR keypath[MAX_PATH*2];
11147 CHAR prodcode[MAX_PATH];
11148 CHAR prod_squashed[MAX_PATH];
11149 HKEY prodkey, userkey, props;
11156 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
11157 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
11159 win_skip("Different registry keys on Win9x and WinMe\n");
11162 CloseServiceHandle(scm);
11164 GetCurrentDirectoryA(MAX_PATH, path);
11165 lstrcatA(path, "\\");
11167 create_test_guid(prodcode, prod_squashed);
11168 get_user_sid(&usersid);
11170 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
11171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11173 r = MsiDatabaseCommit(hdb);
11174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11176 r = set_summary_info(hdb);
11177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11180 "CREATE TABLE `Directory` ( "
11181 "`Directory` CHAR(255) NOT NULL, "
11182 "`Directory_Parent` CHAR(255), "
11183 "`DefaultDir` CHAR(255) NOT NULL "
11184 "PRIMARY KEY `Directory`)");
11185 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11188 "CREATE TABLE `Property` ( "
11189 "`Property` CHAR(72) NOT NULL, "
11190 "`Value` CHAR(255) "
11191 "PRIMARY KEY `Property`)");
11192 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11194 sprintf(query, "INSERT INTO `Property` "
11195 "(`Property`, `Value`) "
11196 "VALUES( 'ProductCode', '%s' )", prodcode);
11197 r = run_query(hdb, query);
11198 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11200 r = MsiDatabaseCommit(hdb);
11201 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11203 MsiCloseHandle(hdb);
11205 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
11206 lstrcatA(keypath, prod_squashed);
11208 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &prodkey);
11209 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11211 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
11212 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
11213 lstrcatA(keypath, prod_squashed);
11215 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &userkey);
11216 if (res == ERROR_ACCESS_DENIED)
11218 skip("Not enough rights to perform tests\n");
11219 RegDeleteKeyA(prodkey, "");
11220 RegCloseKey(prodkey);
11223 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11225 res = RegCreateKeyA(userkey, "InstallProperties", &props);
11226 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11228 lstrcpyA(val, path);
11229 lstrcatA(val, "\\winetest.msi");
11230 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
11231 (const BYTE *)val, lstrlenA(val) + 1);
11232 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11234 hprod = 0xdeadbeef;
11235 r = MsiOpenProductA(prodcode, &hprod);
11236 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11237 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
11239 /* hProduct is invalid */
11241 lstrcpyA(val, "apple");
11242 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
11243 ok(r == ERROR_INVALID_HANDLE,
11244 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11245 ok(!lstrcmpA(val, "apple"),
11246 "Expected val to be unchanged, got \"%s\"\n", val);
11247 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11249 /* szProperty is NULL */
11251 lstrcpyA(val, "apple");
11252 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
11253 ok(r == ERROR_INVALID_PARAMETER,
11254 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11255 ok(!lstrcmpA(val, "apple"),
11256 "Expected val to be unchanged, got \"%s\"\n", val);
11257 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11259 /* szProperty is empty */
11261 lstrcpyA(val, "apple");
11262 r = MsiGetProductPropertyA(hprod, "", val, &size);
11263 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11264 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11265 ok(size == 0, "Expected 0, got %d\n", size);
11267 /* get the property */
11269 lstrcpyA(val, "apple");
11270 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11271 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11272 ok(!lstrcmpA(val, prodcode),
11273 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11274 ok(size == lstrlenA(prodcode),
11275 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11277 /* lpValueBuf is NULL */
11279 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
11280 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11281 ok(size == lstrlenA(prodcode),
11282 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11284 /* pcchValueBuf is NULL */
11285 lstrcpyA(val, "apple");
11286 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
11287 ok(r == ERROR_INVALID_PARAMETER,
11288 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11289 ok(!lstrcmpA(val, "apple"),
11290 "Expected val to be unchanged, got \"%s\"\n", val);
11291 ok(size == lstrlenA(prodcode),
11292 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11294 /* pcchValueBuf is too small */
11296 lstrcpyA(val, "apple");
11297 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11298 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11299 ok(!strncmp(val, prodcode, 3),
11300 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
11301 ok(size == lstrlenA(prodcode),
11302 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11304 /* pcchValueBuf does not leave room for NULL terminator */
11305 size = lstrlenA(prodcode);
11306 lstrcpyA(val, "apple");
11307 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11308 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11309 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
11310 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
11311 ok(size == lstrlenA(prodcode),
11312 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11314 /* pcchValueBuf has enough room for NULL terminator */
11315 size = lstrlenA(prodcode) + 1;
11316 lstrcpyA(val, "apple");
11317 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11318 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11319 ok(!lstrcmpA(val, prodcode),
11320 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11321 ok(size == lstrlenA(prodcode),
11322 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11324 /* nonexistent property */
11326 lstrcpyA(val, "apple");
11327 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
11328 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11329 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11330 ok(size == 0, "Expected 0, got %d\n", size);
11332 r = MsiSetPropertyA(hprod, "NewProperty", "value");
11333 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11335 /* non-product property set */
11337 lstrcpyA(val, "apple");
11338 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
11339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11340 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11341 ok(size == 0, "Expected 0, got %d\n", size);
11343 r = MsiSetPropertyA(hprod, "ProductCode", "value");
11344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11346 /* non-product property that is also a product property set */
11348 lstrcpyA(val, "apple");
11349 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11350 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11351 ok(!lstrcmpA(val, prodcode),
11352 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11353 ok(size == lstrlenA(prodcode),
11354 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11356 MsiCloseHandle(hprod);
11358 RegDeleteValueA(props, "LocalPackage");
11359 RegDeleteKeyA(props, "");
11360 RegCloseKey(props);
11361 RegDeleteKeyA(userkey, "");
11362 RegCloseKey(userkey);
11363 RegDeleteKeyA(prodkey, "");
11364 RegCloseKey(prodkey);
11365 DeleteFileA(msifile);
11368 START_TEST(package)
11370 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
11372 test_createpackage();
11374 test_gettargetpath_bad();
11375 test_settargetpath();
11377 test_property_table();
11380 test_formatrecord2();
11382 test_getproperty();
11383 test_removefiles();
11385 test_appsearch_complocator();
11386 test_appsearch_reglocator();
11387 test_appsearch_inilocator();
11388 test_appsearch_drlocator();
11389 test_featureparents();
11390 test_installprops();
11391 test_launchconditions();
11393 test_complocator();
11394 test_MsiGetSourcePath();
11395 test_shortlongsource();
11398 test_emptypackage();
11399 test_MsiGetProductProperty();